├── Config-mt7615.in ├── Makefile ├── patches ├── 0001-fix.1.patch ├── 0002-fix.2.patch ├── 0003-fix.3.patch ├── 0004-fix.4.patch ├── 0005-fix.5.patch ├── 0006-fix.6.patch └── 0007-fix.7.patch └── src ├── mt_wifi ├── ate │ ├── LoopBack.c │ ├── ate_agent.c │ ├── include │ │ ├── LoopBack.h │ │ ├── ate.h │ │ ├── ate_agent.h │ │ ├── meta_agent.h │ │ ├── mt_testmode.h │ │ ├── qa_agent.h │ │ ├── testmode_common.h │ │ └── testmode_ioctl.h │ ├── meta_agent.c │ ├── mt_mac │ │ ├── mt_ate.c │ │ └── mt_testmode.c │ ├── qa_agent.c │ └── testmode_ioctl.c ├── chips │ ├── mt7615.c │ ├── rtmp_chip.c │ └── rtxx_dft.c ├── eeprom │ ├── MT7615E1_EEPROM.bin │ ├── MT7615E1_EEPROM2.bin │ └── MT7615E1_EEPROM3.bin ├── embedded │ ├── Kconfig │ ├── Makefile │ ├── Pack_Release_sta.sh │ ├── Prebuild_Release.sh │ ├── Release_Notes.txt │ ├── Release_sta.sh │ ├── ap │ │ ├── ap.c │ │ ├── ap_apcli.c │ │ ├── ap_apcli_inf.c │ │ ├── ap_assoc.c │ │ ├── ap_auth.c │ │ ├── ap_autoChSel.c │ │ ├── ap_band_steering.c │ │ ├── ap_cfg.c │ │ ├── ap_connect.c │ │ ├── ap_data.c │ │ ├── ap_ftkd.c │ │ ├── ap_ids.c │ │ ├── ap_mbss.c │ │ ├── ap_mbss_inf.c │ │ ├── ap_mlme.c │ │ ├── ap_mumimo.c │ │ ├── ap_mura.c │ │ ├── ap_nps.c │ │ ├── ap_qload.c │ │ ├── ap_repeater.c │ │ ├── ap_rls.c │ │ ├── ap_sanity.c │ │ ├── ap_sec.c │ │ ├── ap_sync.c │ │ ├── ap_vow.c │ │ ├── ap_wds.c │ │ ├── ap_wds_inf.c │ │ ├── ap_wpa.c │ │ ├── apcli_assoc.c │ │ ├── apcli_auth.c │ │ ├── apcli_ctrl.c │ │ ├── apcli_link_cover.c │ │ └── apcli_sync.c │ ├── common │ │ ├── action.c │ │ ├── ba_action.c │ │ ├── bcn.c │ │ ├── bgnd_scan.c │ │ ├── client_wds.c │ │ ├── cmm_cfg.c │ │ ├── cmm_cmd.c │ │ ├── cmm_cs.c │ │ ├── cmm_data.c │ │ ├── cmm_data_pci.c │ │ ├── cmm_dfs.c │ │ ├── cmm_info.c │ │ ├── cmm_loft_cal.c │ │ ├── cmm_mac_pci.c │ │ ├── cmm_mat.c │ │ ├── cmm_mat_iparp.c │ │ ├── cmm_mat_ipv6.c │ │ ├── cmm_mat_pppoe.c │ │ ├── cmm_mumimo.c │ │ ├── cmm_profile.c │ │ ├── cmm_radar.c │ │ ├── cmm_rdm_mt.c │ │ ├── cmm_rf_cal.c │ │ ├── cmm_sanity.c │ │ ├── cmm_sync.c │ │ ├── cmm_tcprack.c │ │ ├── cmm_txbf.c │ │ ├── cmm_txbf_cal.c │ │ ├── cmm_video.c │ │ ├── cut_through.c │ │ ├── ee_efuse.c │ │ ├── ee_flash.c │ │ ├── ee_prom.c │ │ ├── eeprom.c │ │ ├── event_notifier.c │ │ ├── frq_cal.c │ │ ├── ft.c │ │ ├── ft_iocl.c │ │ ├── ft_rc.c │ │ ├── ft_tlv.c │ │ ├── gas.c │ │ ├── hotspot.c │ │ ├── igmp_snoop.c │ │ ├── mlme.c │ │ ├── mt_io.c │ │ ├── mt_ps.c │ │ ├── multi_channel.c │ │ ├── multi_profile.c │ │ ├── mwds.c │ │ ├── netif_block.c │ │ ├── nfc.c │ │ ├── op_class.c │ │ ├── ps.c │ │ ├── ral_ps.c │ │ ├── routing_tab.c │ │ ├── rrm.c │ │ ├── rrm_sanity.c │ │ ├── rrm_tlv.c │ │ ├── rt_channel.c │ │ ├── rt_led.c │ │ ├── rt_os_util.c │ │ ├── rtmp_init.c │ │ ├── rtmp_init_inf.c │ │ ├── rtmp_timer.c │ │ ├── scan.c │ │ ├── spectrum.c │ │ ├── sys_log.c │ │ ├── txpower.c │ │ ├── uapsd.c │ │ ├── vendor.c │ │ ├── vht.c │ │ ├── wfd.c │ │ ├── wifi_sys_info.c │ │ ├── wnm.c │ │ ├── wnm_tlv.c │ │ ├── wsc.c │ │ ├── wsc_tlv.c │ │ ├── wsc_ufd.c │ │ └── wsc_v2.c │ ├── conf │ │ ├── RT2860AP.dat │ │ ├── RT2860AP.dat_ac │ │ ├── RT2860AP.dat_dbdc │ │ ├── RT2860STA.dat │ │ └── RT2860STA.dat_dbdc │ ├── doc │ │ ├── Doxyfile │ │ ├── ate_iwpriv_usage.txt │ │ ├── brftph_usage.txt │ │ ├── header_translation.txt │ │ ├── iwpriv_usage.txt │ │ ├── mainpage.dox │ │ ├── mbss_phy.readme │ │ ├── sta_ate_iwpriv_usage.txt │ │ └── wps_iwpriv_usage.txt │ ├── easy_setup │ │ ├── ez_cmm.o │ │ ├── ez_hooks.c │ │ ├── mt7615_chip_ops.c │ │ └── mt7615_chip_ops_api.c │ ├── hif │ │ └── hif_pci.c │ ├── hw_ctrl │ │ ├── hdev │ │ │ ├── hdev_basic.c │ │ │ ├── omac_ctrl.c │ │ │ ├── radio_ctrl.c │ │ │ ├── wmm_ctrl.c │ │ │ └── wtbl_ctrl.c │ │ ├── hdev_ctrl.c │ │ ├── hw_ctrl.c │ │ ├── hw_ctrl_basic.c │ │ └── hw_ctrl_cmd.c │ ├── include │ │ ├── action.h │ │ ├── ags.h │ │ ├── ap.h │ │ ├── ap_apcli.h │ │ ├── ap_autoChSel.h │ │ ├── ap_autoChSel_cmm.h │ │ ├── ap_cfg.h │ │ ├── ap_diversity.h │ │ ├── ap_ids.h │ │ ├── ap_mbss.h │ │ ├── ap_mumimo.h │ │ ├── ap_mura.h │ │ ├── ap_repeater.h │ │ ├── ap_vow.h │ │ ├── ap_wds.h │ │ ├── band_steering.h │ │ ├── band_steering_def.h │ │ ├── bcn.h │ │ ├── bgnd_scan.h │ │ ├── bgnd_scan_cmm.h │ │ ├── br_ftph.h │ │ ├── cfg80211.h │ │ ├── cfg80211_cmm.h │ │ ├── cfg80211extr.h │ │ ├── chlist.h │ │ ├── client_wds.h │ │ ├── client_wds_cmm.h │ │ ├── cmm_cmd.h │ │ ├── cmm_tcprack.h │ │ ├── cs.h │ │ ├── cut_through.h │ │ ├── dfs.h │ │ ├── dot11_base.h │ │ ├── dot11ac_vht.h │ │ ├── dot11k_rrm.h │ │ ├── dot11n_ht.h │ │ ├── dot11r_ft.h │ │ ├── dot11u_interworking.h │ │ ├── dot11v_wnm.h │ │ ├── easy_setup │ │ │ ├── ez_cmm.h │ │ │ ├── ez_hooks.h │ │ │ ├── ez_hooks_proto.h │ │ │ └── ez_mod_hooks.h │ │ ├── eeprom.h │ │ ├── eeprom │ │ │ ├── mt7615_e2p_ePAeLNA.h │ │ │ ├── mt7615_e2p_ePAiLNA.h │ │ │ ├── mt7615_e2p_iPAeLNA.h │ │ │ ├── mt7615_e2p_iPAiLNA.h │ │ │ ├── mt_dmac_e2p_def.h │ │ │ └── mt_e2p_def.h │ │ ├── efuse.h │ │ ├── event_notifier.h │ │ ├── firmware.h │ │ ├── frame_hdr.h │ │ ├── frq_cal.h │ │ ├── ft.h │ │ ├── ft_cmm.h │ │ ├── gas.h │ │ ├── hdev │ │ │ ├── hdev.h │ │ │ └── hdev_basic.h │ │ ├── hdev_ctrl.h │ │ ├── hotspot.h │ │ ├── hw_ctrl.h │ │ ├── hw_ctrl_basic.h │ │ ├── iface │ │ │ ├── iface.h │ │ │ ├── iface_util.h │ │ │ ├── rtmp_inf_pcirbs.h │ │ │ └── rtmp_pci.h │ │ ├── igmp_snoop.h │ │ ├── ipv6.h │ │ ├── mat.h │ │ ├── mcu │ │ │ ├── andes_core.h │ │ │ ├── andes_mt.h │ │ │ ├── andes_rlt.h │ │ │ ├── btcoex.h │ │ │ ├── mcu.h │ │ │ ├── mt7615_cr4_firmware.h │ │ │ ├── mt7615_firmware.h │ │ │ └── mt7615_rom_patch.h │ │ ├── meminfo_list.h │ │ ├── mgmt │ │ │ ├── be_export.h │ │ │ └── be_internal.h │ │ ├── mlme.h │ │ ├── mlme_sys.h │ │ ├── mt_io.h │ │ ├── mt_rdm.h │ │ ├── mwds.h │ │ ├── netif_block.h │ │ ├── nfc.h │ │ ├── oid.h │ │ ├── radar.h │ │ ├── rls.h │ │ ├── rls_def.h │ │ ├── routing_tab.h │ │ ├── rrm.h │ │ ├── rrm_cmm.h │ │ ├── rt_cal.h │ │ ├── rt_config.h │ │ ├── rt_led.h │ │ ├── rt_os_net.h │ │ ├── rt_os_util.h │ │ ├── rt_txbf.h │ │ ├── rt_udma.h │ │ ├── rtmp.h │ │ ├── rtmp_chip.h │ │ ├── rtmp_cmd.h │ │ ├── rtmp_comm.h │ │ ├── rtmp_def.h │ │ ├── rtmp_dmacb.h │ │ ├── rtmp_dot11.h │ │ ├── rtmp_iface.h │ │ ├── rtmp_os.h │ │ ├── rtmp_osabl.h │ │ ├── rtmp_timer.h │ │ ├── rtmp_type.h │ │ ├── scs.h │ │ ├── security │ │ │ ├── crypt_aes.h │ │ │ ├── crypt_arc4.h │ │ │ ├── crypt_biginteger.h │ │ │ ├── crypt_dh.h │ │ │ ├── crypt_hmac.h │ │ │ ├── crypt_md5.h │ │ │ ├── crypt_sha2.h │ │ │ ├── dh_key.h │ │ │ ├── dot11i_wpa.h │ │ │ ├── dot11w_pmf.h │ │ │ ├── pmf.h │ │ │ ├── pmf_cmm.h │ │ │ ├── sec.h │ │ │ ├── sec_cmm.h │ │ │ ├── wapi.h │ │ │ ├── wapi_cmm.h │ │ │ ├── wapi_def.h │ │ │ ├── wapi_sms4.h │ │ │ ├── wpa.h │ │ │ └── wpa_cmm.h │ │ ├── spectrum.h │ │ ├── spectrum_def.h │ │ ├── sta.h │ │ ├── sta_cfg.h │ │ ├── tx_power.h │ │ ├── uapsd.h │ │ ├── vendor.h │ │ ├── vht.h │ │ ├── video.h │ │ ├── vr_ikans.h │ │ ├── vrut_ubm.h │ │ ├── wfa_p2p.h │ │ ├── wfd.h │ │ ├── wfd_cmm.h │ │ ├── wlan_config │ │ │ ├── config_export.h │ │ │ └── config_internal.h │ │ ├── wnm.h │ │ ├── wnm_cmm.h │ │ ├── wsc.h │ │ └── wsc_tlv.h │ ├── mcu │ │ ├── andes_core.c │ │ ├── andes_mt.c │ │ ├── andes_rlt.c │ │ └── mcu.c │ ├── mgmt │ │ ├── be_basic.c │ │ ├── be_ht.c │ │ ├── be_phy.c │ │ ├── be_vht.c │ │ ├── mgmt_dev.c │ │ ├── mgmt_entrytb.c │ │ ├── mgmt_ht.c │ │ ├── mgmt_hw.c │ │ └── mgmt_vht.c │ ├── naf │ │ ├── cso.c │ │ ├── net_acc.c │ │ └── tso.c │ ├── security │ │ ├── cmm_aes.c │ │ ├── cmm_sec.c │ │ ├── cmm_tkip.c │ │ ├── cmm_wep.c │ │ ├── cmm_wpa.c │ │ ├── cmm_wpa_adhoc.c │ │ ├── crypt_aes.c │ │ ├── crypt_arc4.c │ │ ├── crypt_biginteger.c │ │ ├── crypt_dh.c │ │ ├── crypt_hmac.c │ │ ├── crypt_md5.c │ │ ├── crypt_sha2.c │ │ ├── dh_key.c │ │ ├── pmf.c │ │ └── wapi.c │ ├── tools │ │ ├── Makefile │ │ ├── bin2h │ │ ├── bin2h.c │ │ ├── check_build_script.sh │ │ ├── plug_in │ │ │ └── Makefile │ │ └── r.sh │ ├── tx_rx │ │ ├── hdr_trans.c │ │ ├── txs.c │ │ ├── wdev.c │ │ ├── wdev_rx.c │ │ └── wdev_tx.c │ └── wlan_config │ │ ├── config_basic.c │ │ ├── config_ht.c │ │ ├── config_phy.c │ │ └── config_vht.c ├── hw_ctrl │ ├── cmm_asic.c │ ├── cmm_asic_mt.c │ ├── cmm_asic_mt_dmac.c │ ├── cmm_asic_mt_fw.c │ ├── cmm_asic_rt.c │ ├── cmm_chip_mt.c │ ├── cmm_chip_rt.c │ ├── coex.c │ ├── greenap.c │ ├── hw_init.c │ └── mt_gpio.c ├── include │ ├── chip │ │ ├── chip_id.h │ │ └── mt7615.h │ ├── common │ │ ├── debug.h │ │ ├── link_list.h │ │ ├── module.h │ │ ├── mt_os_util.h │ │ └── wifi_sys_info.h │ ├── eeprom │ │ └── mt_tx_pwr.h │ ├── hif │ │ ├── hif.h │ │ ├── mt_hif_pci.h │ │ └── rtmp_reg_pcirbs.h │ ├── hw_ctrl │ │ ├── cmm_asic.h │ │ ├── cmm_asic_mt.h │ │ ├── cmm_asic_mt_fw.h │ │ ├── cmm_chip.h │ │ └── hw_init.h │ ├── mac │ │ ├── mac.h │ │ └── mac_mt │ │ │ ├── dmac │ │ │ ├── client.h │ │ │ ├── gpio.h │ │ │ ├── mt_dmac.h │ │ │ ├── pse.h │ │ │ ├── wf_agg.h │ │ │ ├── wf_aon.h │ │ │ ├── wf_arb.h │ │ │ ├── wf_cfg.h │ │ │ ├── wf_cfgoff.h │ │ │ ├── wf_dma.h │ │ │ ├── wf_int_wakeup_top.h │ │ │ ├── wf_lpon_top.h │ │ │ ├── wf_mib.h │ │ │ ├── wf_mu.h │ │ │ ├── wf_pf.h │ │ │ ├── wf_phy.h │ │ │ ├── wf_ple.h │ │ │ ├── wf_pp.h │ │ │ ├── wf_rmac.h │ │ │ ├── wf_sec.h │ │ │ ├── wf_tmac.h │ │ │ ├── wf_trb.h │ │ │ ├── wf_wtbl.h │ │ │ ├── wf_wtbloff.h │ │ │ └── wf_wtblon.h │ │ │ ├── mt_mac.h │ │ │ ├── mt_mac_ctrl.h │ │ │ ├── mt_mac_pci.h │ │ │ ├── smac │ │ │ ├── client.h │ │ │ ├── dma_sch.h │ │ │ ├── gpio.h │ │ │ ├── mt_mac.h │ │ │ ├── mt_smac.h │ │ │ ├── pse.h │ │ │ ├── wf_agg.h │ │ │ ├── wf_aon.h │ │ │ ├── wf_arb.h │ │ │ ├── wf_cfgoff.h │ │ │ ├── wf_dma.h │ │ │ ├── wf_int_wakeup_top.h │ │ │ ├── wf_lpon_top.h │ │ │ ├── wf_mib.h │ │ │ ├── wf_pf.h │ │ │ ├── wf_phy.h │ │ │ ├── wf_rmac.h │ │ │ ├── wf_sec.h │ │ │ ├── wf_tmac.h │ │ │ ├── wf_trb.h │ │ │ ├── wf_wtbl.h │ │ │ ├── wf_wtbloff.h │ │ │ └── wf_wtblon.h │ │ │ └── top.h │ ├── mcu │ │ ├── fwdl.h │ │ ├── mt_cmd.h │ │ └── mt_fdb.h │ ├── os │ │ ├── bb_soc.h │ │ ├── pkt_meta.h │ │ ├── rt_drv.h │ │ ├── rt_ecos.h │ │ ├── rt_ecos_type.h │ │ ├── rt_linux.h │ │ ├── rt_linux_cmm.h │ │ ├── rt_linux_txrx_hook.h │ │ ├── rt_os.h │ │ ├── rt_threadx.h │ │ ├── rt_ucos.h │ │ ├── rt_vxworks.h │ │ ├── rt_win.h │ │ ├── rt_wince.h │ │ └── trace.h │ ├── phy │ │ ├── mt_bbp.h │ │ ├── mt_phy.h │ │ ├── mt_rf.h │ │ ├── phy.h │ │ ├── rlm_cal_cache.h │ │ ├── rlt_bbp.h │ │ ├── rlt_rf.h │ │ ├── rtmp_bbp.h │ │ └── wf_phy_back.h │ ├── protocol │ │ ├── protection.h │ │ └── tmr.h │ ├── rate_ctrl │ │ └── ra_ctrl.h │ ├── txbf │ │ ├── mt_txbf.h │ │ └── mt_txbf_cal.h │ └── txpwr │ │ ├── BFBackoffTable_1.h │ │ ├── BFBackoffTable_10.h │ │ ├── BFBackoffTable_11.h │ │ ├── BFBackoffTable_12.h │ │ ├── BFBackoffTable_13.h │ │ ├── BFBackoffTable_14.h │ │ ├── BFBackoffTable_15.h │ │ ├── BFBackoffTable_16.h │ │ ├── BFBackoffTable_17.h │ │ ├── BFBackoffTable_18.h │ │ ├── BFBackoffTable_19.h │ │ ├── BFBackoffTable_2.h │ │ ├── BFBackoffTable_20.h │ │ ├── BFBackoffTable_3.h │ │ ├── BFBackoffTable_4.h │ │ ├── BFBackoffTable_5.h │ │ ├── BFBackoffTable_6.h │ │ ├── BFBackoffTable_7.h │ │ ├── BFBackoffTable_8.h │ │ ├── BFBackoffTable_9.h │ │ ├── SKUTable_1.h │ │ ├── SKUTable_10.h │ │ ├── SKUTable_11.h │ │ ├── SKUTable_12.h │ │ ├── SKUTable_13.h │ │ ├── SKUTable_14.h │ │ ├── SKUTable_15.h │ │ ├── SKUTable_16.h │ │ ├── SKUTable_17.h │ │ ├── SKUTable_18.h │ │ ├── SKUTable_19.h │ │ ├── SKUTable_2.h │ │ ├── SKUTable_20.h │ │ ├── SKUTable_3.h │ │ ├── SKUTable_4.h │ │ ├── SKUTable_5.h │ │ ├── SKUTable_6.h │ │ ├── SKUTable_7.h │ │ ├── SKUTable_8.h │ │ ├── SKUTable_9.h │ │ └── single_sku.h ├── mac │ ├── mt_dmac.c │ ├── mt_mac.c │ ├── ral_nmac.c │ ├── ral_omac.c │ └── rtmp_mac.c ├── mcu │ ├── bin │ │ ├── MT7615_cr4.bin │ │ ├── MT7615_cr4_noReOrdering.bin │ │ ├── WIFI_RAM_CODE_MT7615.bin │ │ └── mt7615_patch_e3_hdr.bin │ ├── fw_cmd.c │ ├── fwdl.c │ ├── fwdl_mt.c │ ├── mt_cmd.c │ └── mt_fdb.c ├── os │ └── linux │ │ ├── Kconfig.mt_wifi │ │ ├── Kconfig.mt_wifi_3_18 │ │ ├── Kconfig.mt_wifi_ap │ │ ├── Kconfig.mt_wifi_sta │ │ ├── Makefile.4 │ │ ├── Makefile.4.netif │ │ ├── Makefile.4.util │ │ ├── Makefile.6 │ │ ├── Makefile.6.netif │ │ ├── Makefile.6.util │ │ ├── Makefile.clean │ │ ├── Makefile.libautoprovision.6 │ │ ├── Makefile.libwapi.4 │ │ ├── Makefile.libwapi.6 │ │ ├── Makefile.mt_wifi_ap │ │ ├── Makefile.mt_wifi_sta │ │ ├── android_priv_cmd.c │ │ ├── ap_ioctl.c │ │ ├── bb_soc.c │ │ ├── br_ftph.c │ │ ├── cfg80211 │ │ ├── cfg80211.c │ │ ├── cfg80211_ap.c │ │ ├── cfg80211_inf.c │ │ ├── cfg80211_p2p.c │ │ ├── cfg80211_rx.c │ │ ├── cfg80211_scan.c │ │ ├── cfg80211_tdls.c │ │ ├── cfg80211_tx.c │ │ ├── cfg80211_util.c │ │ └── cfg80211drv.c │ │ ├── config.mk │ │ ├── config.mk.cfg80211 │ │ ├── inf_ppa.c │ │ ├── load │ │ ├── monitor_mode.c │ │ ├── mt_fwdump.c │ │ ├── multi_main_dev.c │ │ ├── pci_main_dev.c │ │ ├── rt_linux.c │ │ ├── rt_linux_symb.c │ │ ├── rt_main_dev.c │ │ ├── rt_pci_rbus.c │ │ ├── rt_proc.c │ │ ├── rt_profile.c │ │ ├── rt_rbus_pci_drv.c │ │ ├── rt_rbus_pci_util.c │ │ ├── rt_symb.c │ │ ├── rt_txrx_hook.c │ │ ├── rt_udma.c │ │ ├── trace.c │ │ ├── unload │ │ ├── vr_bdlt.c │ │ └── vr_ikans.c ├── phy │ ├── mt_phy.c │ ├── mt_rf.c │ ├── phy.c │ ├── rf.c │ └── rlm_cal_cache.c ├── protocol │ ├── protection.c │ └── tmr.c ├── rate_ctrl │ ├── alg_legacy.c │ ├── ra_cfg.c │ ├── ra_ctrl.c │ ├── ra_ctrl_mt.c │ ├── ra_ctrl_mt_drv.c │ └── ra_wrapper_embedded.c ├── txbf │ ├── cmm_txbf_cal_mt.c │ ├── cmm_txbf_mt.c │ └── txbf_wrapper_embedded.c └── txpwr │ ├── Makefile │ ├── dat2h │ ├── dat2h.c │ ├── single_sku.c │ └── sku_tables │ ├── 7615_SingleSKU_1.dat │ ├── 7615_SingleSKU_BF_1.dat │ ├── 7615_SingleSKU_BF_default.dat │ └── 7615_SingleSKU_default.dat └── mt_wifi_ap ├── Kconfig └── Makefile /patches/0003-fix.3.patch: -------------------------------------------------------------------------------- 1 | From f113b764123924324f6bcb8c02ade5a675761c32 Mon Sep 17 00:00:00 2001 2 | From: hanwckf 3 | Date: Mon, 7 Jan 2019 03:39:06 +0800 4 | Subject: [PATCH] fix.3 5 | 6 | --- 7 | mt_wifi/include/os/rt_linux.h | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/mt_wifi/include/os/rt_linux.h b/mt_wifi/include/os/rt_linux.h 11 | index e0bfc2c..e8c7308 100644 12 | --- a/mt_wifi/include/os/rt_linux.h 13 | +++ b/mt_wifi/include/os/rt_linux.h 14 | @@ -860,7 +860,7 @@ void linux_pci_unmap_single(void *handle, ra_dma_addr_t dma_addr, size_t size, i 15 | 16 | #define SKB_BUF_HEADTAIL_RSV (SKB_BUF_HEADROOM_RSV + SKB_BUF_TAILROOM_RSV) 17 | /* Need to do below miniume size protect for build_skb method, to avoid DATAABORT issue. */ 18 | -#define SKB_BUF_MINIMUN_SIZE (1984) 19 | +#define SKB_BUF_MINIMUN_SIZE (2048) 20 | 21 | 22 | #ifdef CONFIG_WIFI_BUILD_SKB 23 | -- 24 | 2.20.1 25 | 26 | -------------------------------------------------------------------------------- /patches/0004-fix.4.patch: -------------------------------------------------------------------------------- 1 | From 8401478caf3542a4a3160300df863a8a192ad582 Mon Sep 17 00:00:00 2001 2 | From: hanwckf 3 | Date: Mon, 7 Jan 2019 14:40:38 +0800 4 | Subject: [PATCH] fix.4 5 | 6 | --- 7 | mt_wifi/os/linux/rt_linux.c | 8 ++++---- 8 | 1 file changed, 4 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/mt_wifi/os/linux/rt_linux.c b/mt_wifi/os/linux/rt_linux.c 11 | index 5d19a5e..d76a4d3 100644 12 | --- a/mt_wifi/os/linux/rt_linux.c 13 | +++ b/mt_wifi/os/linux/rt_linux.c 14 | @@ -362,8 +362,8 @@ void RtmpFlashRead( 15 | #else 16 | //wilsonl, fix compile for temp 17 | #ifndef MT7622 18 | - /* ra_mtd_read_nm("Factory", a&0xFFFF, (size_t) b, p); */ 19 | - ra_mtd_read_nm("Factory", a, (size_t) b, p); /* triple card needs to access beyond 0xFFFF , don't mask */ 20 | + ra_mtd_read_nm("factory", a&0xFFFF, (size_t) b, p); 21 | + //ra_mtd_read_nm("Factory", a, (size_t) b, p); /* triple card needs to access beyond 0xFFFF , don't mask */ 22 | #endif 23 | #endif 24 | #endif /* CONFIG_RALINK_FLASH_API */ 25 | @@ -382,8 +382,8 @@ void RtmpFlashWrite( 26 | #else 27 | //wilsonl, fix compile for temp 28 | #ifndef MT7622 29 | - /* ra_mtd_write_nm("Factory", a&0xFFFF, (size_t) b, p); */ 30 | - ra_mtd_write_nm("Factory", a, (size_t) b, p); /* triple card needs to access beyond 0xFFFF , don't mask */ 31 | + ra_mtd_write_nm("factory", a&0xFFFF, (size_t) b, p); 32 | + //ra_mtd_write_nm("Factory", a, (size_t) b, p); /* triple card needs to access beyond 0xFFFF , don't mask */ 33 | #endif 34 | #endif 35 | #endif /* CONFIG_RALINK_FLASH_API */ 36 | -- 37 | 2.20.1 38 | 39 | -------------------------------------------------------------------------------- /patches/0006-fix.6.patch: -------------------------------------------------------------------------------- 1 | From 3174acef27c6028dc430721b608f88deaf3bca48 Mon Sep 17 00:00:00 2001 2 | From: hanwckf 3 | Date: Tue, 8 Jan 2019 22:58:49 +0800 4 | Subject: [PATCH] fix.6 5 | 6 | --- 7 | mt_wifi/embedded/common/ba_action.c | 4 ++-- 8 | mt_wifi/embedded/common/ft_rc.c | 2 +- 9 | 2 files changed, 3 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/mt_wifi/embedded/common/ba_action.c b/mt_wifi/embedded/common/ba_action.c 12 | index d0dd29e..17aa767 100644 13 | --- a/mt_wifi/embedded/common/ba_action.c 14 | +++ b/mt_wifi/embedded/common/ba_action.c 15 | @@ -766,7 +766,7 @@ BOOLEAN BARecSessionAdd( 16 | pBAEntry->max_reord_pkt_timeout = MAX_REORDERING_PACKET_TIMEOUT; 17 | pBAEntry->reord_pkt_timeout = REORDERING_PACKET_TIMEOUT; 18 | 19 | - MTWF_LOG(DBG_CAT_PROTO, CATPROTO_BA, DBG_LVL_OFF, ("Start Seq = %08x\n", pFrame->BaStartSeq.field.StartSeq)); 20 | + MTWF_LOG(DBG_CAT_PROTO, CATPROTO_BA, DBG_LVL_TRACE, ("Start Seq = %08x\n", pFrame->BaStartSeq.field.StartSeq)); 21 | NdisReleaseSpinLock(&pAd->BATabLock); 22 | 23 | if (pEntry->RXBAbitmap & (1<CommonCfg.bBADecline == FALSE) && IS_HT_STA(pMacEntry)) 27 | { 28 | - MTWF_LOG(DBG_CAT_PROTO, CATPROTO_BA, DBG_LVL_OFF, ("Rcv Wcid(%d) AddBAReq\n", Elem->Wcid)); 29 | + MTWF_LOG(DBG_CAT_PROTO, CATPROTO_BA, DBG_LVL_TRACE, ("Rcv Wcid(%d) AddBAReq\n", Elem->Wcid)); 30 | if (BARecSessionAdd(pAd, &pAd->MacTab.Content[Elem->Wcid], pAddreqFrame)) 31 | { 32 | #ifdef PEER_DELBA_TX_ADAPT 33 | diff --git a/mt_wifi/embedded/common/ft_rc.c b/mt_wifi/embedded/common/ft_rc.c 34 | index c220095..3baf94a 100644 35 | --- a/mt_wifi/embedded/common/ft_rc.c 36 | +++ b/mt_wifi/embedded/common/ft_rc.c 37 | @@ -330,7 +330,7 @@ extern BOOLEAN BARecSessionAdd( 38 | AddreqFrame.TimeOutValue = le2cpu16(pRicBaInfo->TimeOutValue); 39 | AddreqFrame.BaStartSeq.word = le2cpu16(pRicBaInfo->BaStartSeq); 40 | 41 | - MTWF_LOG(DBG_CAT_PROTO, CATPROTO_FT, DBG_LVL_OFF, ("Rcv Wcid(%d) AddBAReq\n", pMacEntry->Aid)); 42 | + MTWF_LOG(DBG_CAT_PROTO, CATPROTO_FT, DBG_LVL_TRACE, ("Rcv Wcid(%d) AddBAReq\n", pMacEntry->Aid)); 43 | if (BARecSessionAdd(pAd, pMacEntry, &AddreqFrame)) 44 | Status = 0; 45 | else 46 | -- 47 | 2.20.1 48 | 49 | -------------------------------------------------------------------------------- /patches/0007-fix.7.patch: -------------------------------------------------------------------------------- 1 | From 2c35c12d16d38645ee767ccd57db1805e73afd8f Mon Sep 17 00:00:00 2001 2 | From: hanwckf 3 | Date: Tue, 29 Jan 2019 23:09:21 +0800 4 | Subject: [PATCH] fix.7 5 | 6 | --- 7 | mt_wifi_ap/Makefile | 2 ++ 8 | 1 file changed, 2 insertions(+) 9 | 10 | diff --git a/mt_wifi_ap/Makefile b/mt_wifi_ap/Makefile 11 | index a57b59d..fd26961 100644 12 | --- a/mt_wifi_ap/Makefile 13 | +++ b/mt_wifi_ap/Makefile 14 | @@ -13,6 +13,8 @@ EXTRA_CFLAGS += \ 15 | -Wno-maybe-uninitialized \ 16 | -Wno-date-time 17 | 18 | +EXTRA_CFLAGS += -DVENDOR_FEATURE6_SUPPORT 19 | + 20 | ifeq ($(CONFIG_FIRST_IF_EEPROM_PROM),y) 21 | EXTRA_CFLAGS += -DCONFIG_RT_FIRST_CARD_EEPROM="\"prom\"" 22 | endif 23 | -- 24 | 2.20.1 25 | 26 | -------------------------------------------------------------------------------- /src/mt_wifi/ate/include/qa_agent.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | qa_agent.h 15 | */ 16 | 17 | #ifndef __QA_AGENT_H__ 18 | #define __QA_AGENT_H__ 19 | 20 | #define HQA_CMD_MAGIC_NO 0x18142880 21 | 22 | /* RX STAT */ 23 | #define HQA_RX_STAT_MACFCSERRCNT 0x1 24 | #define HQA_RX_STAT_MAC_MDRDYCNT 0x2 25 | #define HQA_RX_STAT_PHY_MDRDYCNT 0x3 26 | #define HQA_RX_STAT_PHY_FCSERRCNT 0x4 27 | #define HQA_RX_STAT_PD 0x5 28 | #define HQA_RX_STAT_CCK_SIG_SFD 0x6 29 | #define HQA_RX_STAT_OFDM_SIG_TAG 0x7 30 | #define HQA_RX_STAT_RSSI 0x8 31 | #define HQA_RX_RESET_PHY_COUNT 0x9 32 | #define HQA_RX_RESET_MAC_COUNT 0xa 33 | 34 | /* FW Event Callback */ 35 | VOID HQA_GetThermalValue_CB(struct cmd_msg *msg, char *Data, UINT16 Len); 36 | 37 | 38 | typedef struct _HQA_CMD_FRAME { 39 | UINT32 MagicNo; 40 | UINT16 Type; 41 | UINT16 Id; 42 | UINT16 Length; 43 | UINT16 Sequence; 44 | UCHAR Data[2048]; 45 | } __attribute__((packed))HQA_CMD_FRAME; 46 | 47 | typedef INT32 (*HQA_CMD_HANDLER)( 48 | struct _RTMP_ADAPTER *pAd, 49 | RTMP_IOCTL_INPUT_STRUCT *wrq, 50 | HQA_CMD_FRAME *HqaCmdFrame); 51 | 52 | typedef struct _HQA_CMD_TABLE{ 53 | HQA_CMD_HANDLER *CmdSet; 54 | UINT32 CmdSetSize; 55 | UINT32 CmdOffset; 56 | } HQA_CMD_TABLE; 57 | 58 | typedef struct _HQA_RX_STAT{ 59 | UINT32 MacFCSErr; 60 | UINT32 MacMdrdy; 61 | UINT32 FCSErr_CCK; 62 | UINT32 FCSErr_OFDM; 63 | UINT32 CCK_PD; 64 | UINT32 OFDM_PD; 65 | UINT32 CCK_SIG_Err; 66 | UINT32 CCK_SFD_Err; 67 | UINT32 OFDM_SIG_Err; 68 | UINT32 OFDM_TAG_Err; 69 | UINT32 WB_RSSSI0; 70 | UINT32 IB_RSSSI0; 71 | UINT32 WB_RSSSI1; 72 | UINT32 IB_RSSSI1; 73 | UINT32 PhyMdrdyCCK; 74 | UINT32 PhyMdrdyOFDM; 75 | UINT32 DriverRxCount; 76 | UINT32 RCPI0; 77 | UINT32 RCPI1; 78 | UINT32 FreqOffsetFromRX; 79 | UINT32 RSSI0; 80 | UINT32 RSSI1; 81 | } __attribute__((packed))HQA_RX_STAT; 82 | 83 | #endif /* __QA_AGENT_H__ */ 84 | -------------------------------------------------------------------------------- /src/mt_wifi/ate/include/testmode_common.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TESTMODE_COMMON_H 3 | #define _TESTMODE_COMMON_H 4 | 5 | #ifndef COMPOS_TESTMODE_WIN 6 | typedef enum{ 7 | EP4QID = 0, 8 | EP5QID, 9 | EP6QID, 10 | EP7QID, 11 | EP8QID = 8, 12 | EP9QID, 13 | EPALLQID 14 | }EPQID; 15 | #endif 16 | /*test mode common*/ 17 | // 18 | // Scheduler Register 4 (offset: 0x0594, default: 0x0000_0000) 19 | // Note: 20 | // 1. DW : double word 21 | // 22 | typedef union _SCHEDULER_REGISTER4 23 | { 24 | struct { 25 | // DW0 26 | ULONG ForceQid:4; // [3 : 0] When force_mode = 1, queue id will adopt this index. 27 | ULONG ForceMode:1; // [4] Force enable dma_scheduler work in force queue without calculate TXOP time. 28 | ULONG BypassMode:1; // [5] Bypass_mode:1, for PSE loopback only. 29 | ULONG HybridMode:1; // [6] Hybrid_mode:1, when assert this reg, DMA scheduler would ignore the tx op time information from LMAC, and also use FFA and RSV for enqueue cal. 30 | ULONG RgPredictNoMask:1; // [7] When disable high and queue mask, force in predict mode. 31 | ULONG RgResetScheduler:1; // [8] DMA Scheduler soft reset. When assert this reset, dma scheduler state machine will be in INIT state and reset all queue counter. 32 | ULONG RgDoneClearHeader:1; // [9] Switch header counter clear flag. 0 : Clear by tx_eof 1 : Clear by sch_txdone 33 | ULONG SwMode:1; // [10] When SwMode is 1 : DMA scheduler will ignore rate mapping & txop time threshold from LMAC, and use RgRateMap & txtime_thd_* value. 34 | ULONG Reserves0:5; // [15 : 11] Reserved bits. 35 | ULONG RgRateMap:14; // [29 : 16] When SwMode 1 : DMA scheduler will load rate mapping information from this register, else rate mapping information from LMAC. Rate Mapping table : {mode X [2 : 0], rate [5 : 0], frmode [1 : 0], nss [1: 0], sg_flag} 36 | ULONG Reserves1:2; // [31 : 30] Reserved bits. 37 | } Default; 38 | ULONG word; 39 | } SCHEDULER_REGISTER4, *PSCHEDULER_REGISTER4; 40 | 41 | // MT7637 for Band display 42 | #define MT7367_RO_AGC_DEBUG_2 WF_PHY_BASE + 0x0584 43 | #define CR_ACI_HIT WF_PHY_BASE + 0x0594 44 | // MT7637 for Band display end 45 | 46 | 47 | /*~test mode common*/ 48 | 49 | #endif //_TESTMODE_COMMON_H 50 | -------------------------------------------------------------------------------- /src/mt_wifi/eeprom/MT7615E1_EEPROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/eeprom/MT7615E1_EEPROM.bin -------------------------------------------------------------------------------- /src/mt_wifi/eeprom/MT7615E1_EEPROM2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/eeprom/MT7615E1_EEPROM2.bin -------------------------------------------------------------------------------- /src/mt_wifi/eeprom/MT7615E1_EEPROM3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/eeprom/MT7615E1_EEPROM3.bin -------------------------------------------------------------------------------- /src/mt_wifi/embedded/Prebuild_Release.sh: -------------------------------------------------------------------------------- 1 | DriverVersion="V4.4.2.0" 2 | ModulePrefix="MT7615_LinuxAP" 3 | ChipName="mt7615" 4 | WiFiMode=AP 5 | package_name=$ModulePrefix\_$DriverVersion 6 | 7 | if [ -d wifi_driver ]; then 8 | 9 | if [ -d release ]; then 10 | rm release -Rf 11 | fi 12 | 13 | if [ -d mt_wifi ]; then 14 | rm mt_wifi -Rf 15 | fi 16 | 17 | if [ -d mt_wifi_ap ]; then 18 | rm mt_wifi_ap -Rf 19 | fi 20 | 21 | ## clean the garbage files 22 | cd wifi_driver/embedded 23 | ####### Remove unwanted files that do not processed by strip tool ####### // TODO 24 | rm os/linux/Makefile.libautoprovision.6 common/rt2860.bin common/rt2870_sw_ch_offload.bin common/RT85592.bin 25 | rm tools/mt7662e_ap.sh tools/mt7662e_sta.sh tools/i.sh tools/trace.sh 26 | rm ../eeprom/MT7601*.bin ../eeprom/MT7603*.bin ../eeprom/MT7628*.bin ../eeprom/MT7637*.bin ../eeprom/MT7662*.bin 27 | rm ../eeprom/MT7636*.bin 28 | rm ../mcu/bin/*_FPGA*.bin ../mcu/bin/*_plain*.bin ../mcu/bin/*_test*.bin 29 | rm ../mcu/bin/*7601* ../mcu/bin/*7603* ../mcu/bin/*7612* ../mcu/bin/*7636* ../mcu/bin/*7637* 30 | rm ../mcu/bin/*7610* ../mcu/bin/*7650* ../mcu/bin/*7662* ../mcu/bin/*7628* 31 | rm ../os/linux/Kconfig.ap* ../os/linux/Kconfig.sta* ../os/linux/Kconfig.rlt* ../os/linux/Kconfig.wifi 32 | rm ../os/linux/Makefile.ap* ../os/linux/Makefile.sta* ../os/linux/Makefile.2880* ../os/linux/Makefile.rlt* 33 | ######################################################################### 34 | 35 | make build_tools CHIPSET=$ChipName 36 | ## Regenerate SKU tables ## 37 | make build_sku_tables CHIPSET=$ChipName 38 | make release WIFI_MODE=$WiFiMode CHIPSET=$ChipName 39 | 40 | mv DPA ../../mt_wifi 41 | 42 | cd ../../ 43 | mkdir -p mt_wifi_ap 44 | #mkdir -p mt_wifi_sta 45 | 46 | cp -a wifi_driver/os/linux/Kconfig.mt_wifi_ap ./mt_wifi_ap/Kconfig 47 | cp -a wifi_driver/os/linux/Makefile.mt_wifi_ap ./mt_wifi_ap/Makefile 48 | #cp -a wifi_driver/os/linux/Kconfig.mt_wifi_sta ./mt_wifi_sta/Kconfig 49 | #cp -a wifi_driver/os/linux/Makefile.mt_wifi_sta ./mt_wifi_sta/Makefile 50 | cp -a wifi_driver/os/linux/Kconfig.mt_wifi wifi_driver/embedded/Kconfig 51 | 52 | rm mt_wifi/embedded/*auto_build* 53 | 54 | mkdir -p release/ 55 | tar -jcvf release/$package_name\.tar.bz2 mt_wifi mt_wifi_ap 56 | 57 | else 58 | exit 1 59 | fi 60 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/ap/ap_ftkd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/ap/ap_ftkd.c -------------------------------------------------------------------------------- /src/mt_wifi/embedded/ap/ap_sanity.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | ap_sanity.c 18 | 19 | Abstract: 20 | Handle association related requests either from WSTA or from local MLME 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | John Chang 08-14-2003 created for 11g soft-AP 26 | John Chang 12-30-2004 merge with STA driver for RT2600 27 | */ 28 | 29 | #include "rt_config.h" 30 | 31 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/common/cmm_loft_cal.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2009, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | cmm_loft_cal.c 20 | 21 | Abstract: 22 | Tx LOFT calibration and profile related functions 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | 28 | */ 29 | 30 | #include "rt_config.h" 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/common/frq_cal.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | frq_cal.c 20 | 21 | Abstract: 22 | 23 | Revision History: 24 | Who When What 25 | -------- ---------- ---------------------------------------------- 26 | */ 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/common/netif_block.c: -------------------------------------------------------------------------------- 1 | #ifdef BLOCK_NET_IF 2 | 3 | #include "rt_config.h" 4 | #include "netif_block.h" 5 | 6 | static NETIF_ENTRY freeNetIfEntryPool[FREE_NETIF_POOL_SIZE]; 7 | static LIST_HEADER freeNetIfEntryList; 8 | 9 | 10 | void initblockQueueTab(RTMP_ADAPTER *pAd) 11 | { 12 | int i; 13 | 14 | initList(&freeNetIfEntryList); 15 | for (i = 0; i < FREE_NETIF_POOL_SIZE; i++) 16 | insertTailList(&freeNetIfEntryList, (RT_LIST_ENTRY *)&freeNetIfEntryPool[i]); 17 | 18 | for (i=0; i < NUM_OF_TX_RING; i++) 19 | initList(&pAd->blockQueueTab[i].NetIfList); 20 | 21 | return; 22 | } 23 | 24 | 25 | BOOLEAN blockNetIf(BLOCK_QUEUE_ENTRY *pBlockQueueEntry, PNET_DEV pNetDev) 26 | { 27 | NETIF_ENTRY *pNetIfEntry = NULL; 28 | 29 | if ((pNetIfEntry = (NETIF_ENTRY *)removeHeadList(&freeNetIfEntryList)) != NULL) 30 | { 31 | RTMP_OS_NETDEV_STOP_QUEUE(pNetDev); 32 | pNetIfEntry->pNetDev = pNetDev; 33 | insertTailList(&pBlockQueueEntry->NetIfList, (RT_LIST_ENTRY *)pNetIfEntry); 34 | 35 | pBlockQueueEntry->SwTxQueueBlockFlag = TRUE; 36 | MTWF_LOG(DBG_CAT_TX, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("RTMP_OS_NETDEV_STOP_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); 37 | } 38 | else 39 | return FALSE; 40 | 41 | return TRUE; 42 | } 43 | 44 | 45 | VOID releaseNetIf(BLOCK_QUEUE_ENTRY *pBlockQueueEntry) 46 | { 47 | NETIF_ENTRY *pNetIfEntry = NULL; 48 | LIST_HEADER *pNetIfList = &pBlockQueueEntry->NetIfList; 49 | 50 | while((pNetIfEntry = (NETIF_ENTRY *)removeHeadList(pNetIfList)) != NULL) 51 | { 52 | PNET_DEV pNetDev = pNetIfEntry->pNetDev; 53 | 54 | if (pNetDev) { 55 | RTMP_OS_NETDEV_WAKE_QUEUE(pNetDev); 56 | MTWF_LOG(DBG_CAT_TX, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("RTMP_OS_NETDEV_WAKE_QUEUE(%s)\n", 57 | RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); 58 | } 59 | insertTailList(&freeNetIfEntryList, (RT_LIST_ENTRY *)pNetIfEntry); 60 | } 61 | pBlockQueueEntry->SwTxQueueBlockFlag = FALSE; 62 | 63 | return; 64 | } 65 | 66 | 67 | VOID StopNetIfQueue(RTMP_ADAPTER *pAd, UCHAR QueIdx, PNDIS_PACKET pPacket) 68 | { 69 | UCHAR wdev_idx; 70 | struct wifi_dev *wdev; 71 | 72 | wdev_idx = RTMP_GET_PACKET_WDEV(pPacket); 73 | if ((wdev_idx < WDEV_NUM_MAX) && (pAd->wdev_list[wdev_idx] != NULL)) 74 | { 75 | wdev = pAd->wdev_list[wdev_idx]; 76 | 77 | /* WMM support 4 software queues.*/ 78 | /* One software queue full doesn't mean device have no capbility to transmit packet.*/ 79 | /* So disable block Net-If queue function while WMM enable.*/ 80 | if ((wdev->bWmmCapable == FALSE) && (wdev->if_dev)) 81 | blockNetIf(&pAd->blockQueueTab[QueIdx], wdev->if_dev); 82 | } 83 | return; 84 | } 85 | 86 | #endif /* BLOCK_NET_IF */ 87 | 88 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/common/nfc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/common/nfc.c -------------------------------------------------------------------------------- /src/mt_wifi/embedded/common/op_class.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/common/op_class.c -------------------------------------------------------------------------------- /src/mt_wifi/embedded/common/wfd.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | 16 | #include "rt_config.h" 17 | #include "wfd_cmm.h" 18 | 19 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/common/wnm_tlv.c: -------------------------------------------------------------------------------- 1 | #include "rt_config.h" 2 | 3 | 4 | VOID InsertDMSReqElement( 5 | IN PRTMP_ADAPTER pAd, 6 | OUT PUCHAR pFrameBuf, 7 | OUT PULONG pFrameLen, 8 | IN WNM_DMS_REQUEST_ELEMENT DMSReqElement) 9 | { 10 | ULONG TempLen; 11 | 12 | MakeOutgoingFrame( pFrameBuf, &TempLen, 13 | 3, &DMSReqElement, 14 | END_OF_ARGS); 15 | 16 | /* *pFrameLen = *pFrameLen + TempLen; */ 17 | 18 | return; 19 | } 20 | 21 | 22 | 23 | VOID WNM_InsertDMS( 24 | IN PRTMP_ADAPTER pAd, 25 | OUT PUCHAR pFrameBuf, 26 | OUT PULONG pFrameLen, 27 | IN UINT8 Len, 28 | IN UCHAR DMSID, 29 | IN WNM_TCLAS wmn_tclas, 30 | IN ULONG IpAddr) 31 | { 32 | ULONG TempLen; 33 | UINT8 DMSIDId = DMSID; 34 | WNM_TCLAS tclas; 35 | UCHAR TCLASElementID = WNM_CATEGORY; 36 | UCHAR TCLASLength = WNM_TCLAS_TYPE_IP_V4_LEN; 37 | 38 | tclas.UserPriority = 0; 39 | tclas.ClassifierType = 1; 40 | tclas.ClassifierMask = 255; 41 | tclas.Clasifier.IPv4.Version = 0; 42 | tclas.Clasifier.IPv4.IpSource = 0; 43 | tclas.Clasifier.IPv4.PortSource = 0; 44 | tclas.Clasifier.IPv4.PortDest = 0; 45 | tclas.Clasifier.IPv4.DSCP = 0; 46 | tclas.Clasifier.IPv4.Protocol = 4; 47 | 48 | tclas.Clasifier.IPv4.IpDest = IpAddr; 49 | 50 | MakeOutgoingFrame( pFrameBuf, &TempLen, 51 | 1, &DMSIDId, 52 | 1, &Len, 53 | 1, &TCLASElementID, 54 | 1, &TCLASLength, 55 | WNM_TCLAS_TYPE_IP_V4_LEN, &tclas, 56 | END_OF_ARGS); 57 | 58 | *pFrameLen = *pFrameLen + TempLen; 59 | 60 | return; 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/conf/RT2860AP.dat: -------------------------------------------------------------------------------- 1 | #The word of "Default" must not be removed 2 | Default 3 | CountryRegion=5 4 | CountryRegionABand=7 5 | CountryCode=TW 6 | BssidNum=1 7 | SSID1=RT2860AP1 8 | SSID2= 9 | SSID3= 10 | SSID4= 11 | WirelessMode=9 12 | TxRate=0 13 | Channel=11 14 | BasicRate=15 15 | BeaconPeriod=100 16 | DtimPeriod=1 17 | TxPower=100 18 | DisableOLBC=0 19 | BGProtection=0 20 | MaxStaNum=0 21 | TxPreamble=0 22 | RTSThreshold=2347 23 | FragThreshold=2346 24 | TxBurst=1 25 | PktAggregate=0 26 | TurboRate=0 27 | WmmCapable=0 28 | APSDCapable=0 29 | DLSCapable=0 30 | APAifsn=3;7;1;1 31 | APCwmin=4;4;3;2 32 | APCwmax=6;10;4;3 33 | APTxop=0;0;94;47 34 | APACM=0;0;0;0 35 | BSSAifsn=3;7;2;2 36 | BSSCwmin=4;4;3;2 37 | BSSCwmax=10;10;4;3 38 | BSSTxop=0;0;94;47 39 | BSSACM=0;0;0;0 40 | AckPolicy=0;0;0;0 41 | NoForwarding=0 42 | NoForwardingBTNBSSID=0 43 | HideSSID=0 44 | StationKeepAlive=0 45 | ShortSlot=1 46 | AutoChannelSelect=0 47 | IEEE8021X=0 48 | IEEE80211H=0 49 | CSPeriod=10 50 | WirelessEvent=0 51 | IdsEnable=0 52 | AuthFloodThreshold=32 53 | AssocReqFloodThreshold=32 54 | ReassocReqFloodThreshold=32 55 | ProbeReqFloodThreshold=32 56 | DisassocFloodThreshold=32 57 | DeauthFloodThreshold=32 58 | EapReqFooldThreshold=32 59 | PreAuth=0 60 | AuthMode=OPEN 61 | EncrypType=NONE 62 | RekeyInterval=0 63 | RekeyMethod=DISABLE 64 | PMKCachePeriod=10 65 | WPAPSK1= 66 | WPAPSK2= 67 | WPAPSK3= 68 | WPAPSK4= 69 | DefaultKeyID=1 70 | Key1Type=0 71 | Key1Str1= 72 | Key1Str2= 73 | Key1Str3= 74 | Key1Str4= 75 | Key2Type=0 76 | Key2Str1= 77 | Key2Str2= 78 | Key2Str3= 79 | Key2Str4= 80 | Key3Type=0 81 | Key3Str1= 82 | Key3Str2= 83 | Key3Str3= 84 | Key3Str4= 85 | Key4Type=0 86 | Key4Str1= 87 | Key4Str2= 88 | Key4Str3= 89 | Key4Str4= 90 | HSCounter=0 91 | AccessPolicy0=0 92 | AccessControlList0= 93 | AccessPolicy1=0 94 | AccessControlList1= 95 | AccessPolicy2=0 96 | AccessControlList2= 97 | AccessPolicy3=0 98 | AccessControlList3= 99 | WdsEnable=0 100 | WdsEncrypType=NONE 101 | WdsList= 102 | WdsKey= 103 | RADIUS_Server=192.168.2.3 104 | RADIUS_Port=1812 105 | RADIUS_Key=ralink 106 | own_ip_addr=192.168.5.234 107 | EAPifname=br0 108 | PreAuthifname=br0 109 | HT_HTC=0 110 | HT_RDG=0 111 | HT_EXTCHA=0 112 | HT_LinkAdapt=0 113 | HT_OpMode=0 114 | HT_MpduDensity=0 115 | HT_BW=1 116 | HT_AutoBA=1 117 | HT_AMSDU=1 118 | HT_BAWinSize=64 119 | HT_GI=1 120 | HT_LDPC=0 121 | HT_MCS=33 122 | VHT_BW=1 123 | VHT_SGI=1 124 | VHT_STBC=0 125 | VHT_BW_SIGNAL=0 126 | VHT_DisallowNonVHT=0 127 | VHT_LDPC=0 128 | MeshId=MESH 129 | MeshAutoLink=1 130 | MeshAuthMode=OPEN 131 | MeshEncrypType=NONE 132 | MeshWPAKEY= 133 | MeshDefaultkey=1 134 | MeshWEPKEY= 135 | WscManufacturer= 136 | WscModelName= 137 | WscDeviceName= 138 | WscModelNumber= 139 | WscSerialNumber= 140 | RadioOn=1 141 | PMFMFPC=0 142 | PMFMFPR=0 143 | PMFSHA256=0 144 | LoadCodeMethod=0 145 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/conf/RT2860AP.dat_ac: -------------------------------------------------------------------------------- 1 | #The word of "Default" must not be removed 2 | Default 3 | CountryRegion=5 4 | CountryRegionABand=7 5 | CountryCode=TW 6 | BssidNum=1 7 | SSID1=RT85592AP 8 | SSID2= 9 | SSID3= 10 | SSID4= 11 | WirelessMode=14 12 | TxRate=0 13 | Channel=56 14 | BasicRate=15 15 | BeaconPeriod=100 16 | DtimPeriod=3 17 | TxPower=100 18 | DisableOLBC=0 19 | BGProtection=0 20 | MaxStaNum=0 21 | TxPreamble=0 22 | RTSThreshold=2347 23 | FragThreshold=2346 24 | TxBurst=1 25 | PktAggregate=0 26 | TurboRate=0 27 | WmmCapable=0 28 | APSDCapable=0 29 | DLSCapable=0 30 | APAifsn=3;7;1;1 31 | APCwmin=4;4;3;2 32 | APCwmax=6;10;4;3 33 | APTxop=0;0;94;47 34 | APACM=0;0;0;0 35 | BSSAifsn=3;7;2;2 36 | BSSCwmin=4;4;3;2 37 | BSSCwmax=10;10;4;3 38 | BSSTxop=0;0;94;47 39 | BSSACM=0;0;0;0 40 | AckPolicy=0;0;0;0 41 | NoForwarding=0 42 | NoForwardingBTNBSSID=0 43 | HideSSID=0 44 | StationKeepAlive=0 45 | ShortSlot=1 46 | AutoChannelSelect=0 47 | IEEE8021X=0 48 | IEEE80211H=0 49 | CSPeriod=10 50 | WirelessEvent=0 51 | IdsEnable=0 52 | AuthFloodThreshold=32 53 | AssocReqFloodThreshold=32 54 | ReassocReqFloodThreshold=32 55 | ProbeReqFloodThreshold=32 56 | DisassocFloodThreshold=32 57 | DeauthFloodThreshold=32 58 | EapReqFooldThreshold=32 59 | PreAuth=0 60 | AuthMode=OPEN 61 | EncrypType=NONE 62 | RekeyInterval=0 63 | RekeyMethod=DISABLE 64 | PMKCachePeriod=10 65 | WPAPSK1= 66 | WPAPSK2= 67 | WPAPSK3= 68 | WPAPSK4= 69 | DefaultKeyID=1 70 | Key1Type=0 71 | Key1Str1= 72 | Key1Str2= 73 | Key1Str3= 74 | Key1Str4= 75 | Key2Type=0 76 | Key2Str1= 77 | Key2Str2= 78 | Key2Str3= 79 | Key2Str4= 80 | Key3Type=0 81 | Key3Str1= 82 | Key3Str2= 83 | Key3Str3= 84 | Key3Str4= 85 | Key4Type=0 86 | Key4Str1= 87 | Key4Str2= 88 | Key4Str3= 89 | Key4Str4= 90 | HSCounter=0 91 | AccessPolicy0=0 92 | AccessControlList0= 93 | AccessPolicy1=0 94 | AccessControlList1= 95 | AccessPolicy2=0 96 | AccessControlList2= 97 | AccessPolicy3=0 98 | AccessControlList3= 99 | WdsEnable=0 100 | WdsEncrypType=NONE 101 | WdsList= 102 | WdsKey= 103 | RADIUS_Server=192.168.2.3 104 | RADIUS_Port=1812 105 | RADIUS_Key=ralink 106 | own_ip_addr=192.168.5.234 107 | EAPifname=br0 108 | PreAuthifname=br0 109 | HT_HTC=0 110 | HT_RDG=0 111 | HT_EXTCHA=0 112 | HT_LinkAdapt=0 113 | HT_OpMode=0 114 | HT_MpduDensity=5 115 | HT_BW=1 116 | HT_AutoBA=1 117 | HT_AMSDU=0 118 | HT_BAWinSize=64 119 | HT_GI=1 120 | HT_MCS=33 121 | MeshId=MESH 122 | MeshAutoLink=1 123 | MeshAuthMode=OPEN 124 | MeshEncrypType=NONE 125 | MeshWPAKEY= 126 | MeshDefaultkey=1 127 | MeshWEPKEY= 128 | WscManufacturer= 129 | WscModelName= 130 | WscDeviceName= 131 | WscModelNumber= 132 | WscSerialNumber= 133 | RadioOn=1 134 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/conf/RT2860AP.dat_dbdc: -------------------------------------------------------------------------------- 1 | #The word of "Default" must not be removed 2 | Default 3 | CountryRegion=5 4 | CountryRegionABand=7 5 | CountryCode=TW 6 | DBDC_MODE=1 7 | BssidNum=2 8 | SSID1=RT2860AP1;0 9 | SSID2=RT2860AP2;0 10 | SSID3= 11 | SSID4= 12 | WirelessMode=9;14 13 | TxRate=0 14 | Channel=11;100 15 | BasicRate=15 16 | BeaconPeriod=100 17 | DtimPeriod=1 18 | TxPower=100 19 | DisableOLBC=0 20 | BGProtection=0 21 | MaxStaNum=0 22 | TxPreamble=0 23 | RTSThreshold=2347 24 | FragThreshold=2346 25 | TxBurst=1 26 | PktAggregate=0 27 | TurboRate=0 28 | WmmCapable=0 29 | APSDCapable=0 30 | DLSCapable=0 31 | APEdca0=1;3,7,1,1;4,4,3,2;6,10,4,3;0,0,94,47;0,0,0,0 32 | APAifsn=3;7;1;1 33 | APCwmin=4;4;3;2 34 | APCwmax=6;10;4;3 35 | APTxop=0;0;94;47 36 | APACM=0;0;0;0 37 | BSSAifsn=3;7;2;2 38 | BSSCwmin=4;4;3;2 39 | BSSCwmax=10;10;4;3 40 | BSSTxop=0;0;94;47 41 | BSSACM=0;0;0;0 42 | AckPolicy=0;0;0;0 43 | NoForwarding=0 44 | NoForwardingBTNBSSID=0 45 | HideSSID=0 46 | StationKeepAlive=0 47 | ShortSlot=1 48 | AutoChannelSelect=0 49 | IEEE8021X=0 50 | IEEE80211H=0 51 | CSPeriod=10 52 | WirelessEvent=0 53 | IdsEnable=0 54 | AuthFloodThreshold=32 55 | AssocReqFloodThreshold=32 56 | ReassocReqFloodThreshold=32 57 | ProbeReqFloodThreshold=32 58 | DisassocFloodThreshold=32 59 | DeauthFloodThreshold=32 60 | EapReqFooldThreshold=32 61 | PreAuth=0 62 | AuthMode=OPEN 63 | EncrypType=NONE 64 | RekeyInterval=0 65 | RekeyMethod=DISABLE 66 | PMKCachePeriod=10 67 | WPAPSK1= 68 | WPAPSK2= 69 | WPAPSK3= 70 | WPAPSK4= 71 | DefaultKeyID=1 72 | Key1Type=0 73 | Key1Str1= 74 | Key1Str2= 75 | Key1Str3= 76 | Key1Str4= 77 | Key2Type=0 78 | Key2Str1= 79 | Key2Str2= 80 | Key2Str3= 81 | Key2Str4= 82 | Key3Type=0 83 | Key3Str1= 84 | Key3Str2= 85 | Key3Str3= 86 | Key3Str4= 87 | Key4Type=0 88 | Key4Str1= 89 | Key4Str2= 90 | Key4Str3= 91 | Key4Str4= 92 | HSCounter=0 93 | AccessPolicy0=0 94 | AccessControlList0= 95 | AccessPolicy1=0 96 | AccessControlList1= 97 | AccessPolicy2=0 98 | AccessControlList2= 99 | AccessPolicy3=0 100 | AccessControlList3= 101 | WdsEnable=0 102 | WdsEncrypType=NONE 103 | WdsList= 104 | WdsKey= 105 | RADIUS_Server=192.168.2.3 106 | RADIUS_Port=1812 107 | RADIUS_Key=ralink 108 | own_ip_addr=192.168.5.234 109 | EAPifname=br0 110 | PreAuthifname=br0 111 | HT_HTC=0 112 | HT_RDG=0 113 | HT_EXTCHA=0 114 | HT_LinkAdapt=0 115 | HT_OpMode=0 116 | HT_MpduDensity=0 117 | HT_BW=1 118 | HT_AutoBA=1 119 | HT_AMSDU=1 120 | HT_BAWinSize=64 121 | HT_GI=1 122 | HT_LDPC=0 123 | HT_MCS=33 124 | VHT_BW=1 125 | VHT_SGI=1 126 | VHT_STBC=0 127 | VHT_BW_SIGNAL=0 128 | VHT_DisallowNonVHT=0 129 | VHT_LDPC=0 130 | MeshId=MESH 131 | MeshAutoLink=1 132 | MeshAuthMode=OPEN 133 | MeshEncrypType=NONE 134 | MeshWPAKEY= 135 | MeshDefaultkey=1 136 | MeshWEPKEY= 137 | WscManufacturer= 138 | WscModelName= 139 | WscDeviceName= 140 | WscModelNumber= 141 | WscSerialNumber= 142 | RadioOn=1 143 | PMFMFPC=0 144 | PMFMFPR=0 145 | PMFSHA256=0 146 | LoadCodeMethod=0 147 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/conf/RT2860STA.dat: -------------------------------------------------------------------------------- 1 | #The word of "Default" must not be removed 2 | Default 3 | CountryRegion=5 4 | CountryRegionABand=7 5 | CountryCode= 6 | ChannelGeography=1 7 | SSID=Dennis2860AP 8 | NetworkType=Infra 9 | WirelessMode=9 10 | Channel=0 11 | BeaconPeriod=100 12 | TxPower=100 13 | BGProtection=0 14 | TxPreamble=0 15 | RTSThreshold=2347 16 | FragThreshold=2346 17 | TxBurst=1 18 | PktAggregate=0 19 | WmmCapable=1 20 | AckPolicy=0;0;0;0 21 | AuthMode=OPEN 22 | EncrypType=NONE 23 | WPAPSK= 24 | DefaultKeyID=1 25 | Key1Type=0 26 | Key1Str= 27 | Key2Type=0 28 | Key2Str= 29 | Key3Type=0 30 | Key3Str= 31 | Key4Type=0 32 | Key4Str= 33 | PSMode=CAM 34 | AutoRoaming=0 35 | RoamThreshold=70 36 | APSDCapable=0 37 | APSDAC=0;0;0;0 38 | HT_RDG=1 39 | HT_EXTCHA=0 40 | HT_OpMode=0 41 | HT_MpduDensity=0 42 | HT_BW=1 43 | HT_AutoBA=1 44 | HT_BADecline=0 45 | HT_AMSDU=1 46 | HT_BAWinSize=64 47 | HT_GI=1 48 | HT_MCS=33 49 | HT_MIMOPSMode=3 50 | HT_DisallowTKIP=1 51 | HT_LDPC=0 52 | HT_STBC=0 53 | VHT_BW=1 54 | VHT_SGI=1 55 | VHT_STBC=0 56 | VHT_BW_SIGNAL=0 57 | VHT_DisallowNonVHT=0 58 | VHT_LDPC=0 59 | EthConvertMode= 60 | EthCloneMac= 61 | IEEE80211H=0 62 | TGnWifiTest=0 63 | WirelessEvent=0 64 | MeshId=MESH 65 | MeshAutoLink=1 66 | MeshAuthMode=OPEN 67 | MeshEncrypType=NONE 68 | MeshWPAKEY= 69 | MeshDefaultkey=1 70 | MeshWEPKEY= 71 | CarrierDetect=0 72 | AntDiversity=0 73 | BeaconLostTime=4 74 | FtSupport=0 75 | Wapiifname=ra0 76 | WapiPsk= 77 | WapiPskType= 78 | WapiUserCertPath= 79 | WapiAsCertPath= 80 | PSP_XLINK_MODE=0 81 | WscManufacturer= 82 | WscModelName= 83 | WscDeviceName= 84 | WscModelNumber= 85 | WscSerialNumber= 86 | RadioOn=1 87 | WIDIEnable=1 88 | P2P_L2SD_SCAN_TOGGLE=3 89 | Wsc4digitPinCode=0 90 | P2P_WIDIEnable=0 91 | PMFMFPC=0 92 | PMFMFPR=0 93 | PMFSHA256=0 94 | SnifferType=0 95 | LoadCodeMethod=0 96 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/conf/RT2860STA.dat_dbdc: -------------------------------------------------------------------------------- 1 | #The word of "Default" must not be removed 2 | Default 3 | CountryRegion=5 4 | CountryRegionABand=7 5 | CountryCode= 6 | DBDC_MODE=1 7 | MStaNum=2 8 | ChannelGeography=1 9 | SSID=Dennis2860AP;5GAP 10 | NetworkType=Infra 11 | WirelessMode=9;14 12 | Channel=1;36 13 | BeaconPeriod=100 14 | TxPower=100 15 | BGProtection=0 16 | TxPreamble=0 17 | RTSThreshold=2347 18 | FragThreshold=2346 19 | TxBurst=0 20 | PktAggregate=0 21 | WmmCapable=1 22 | AckPolicy=0;0;0;0 23 | AuthMode=OPEN;OPEN 24 | EncrypType=NONE;NONE 25 | #AuthMode=WPA2PSK 26 | #EncrypType=AES 27 | WPAPSK=12345678 28 | DefaultKeyID=1 29 | Key1Type=0 30 | Key1Str= 31 | Key2Type=0 32 | Key2Str= 33 | Key3Type=0 34 | Key3Str= 35 | Key4Type=0 36 | Key4Str= 37 | PSMode=CAM 38 | AutoRoaming=0 39 | RoamThreshold=70 40 | APSDCapable=0 41 | APSDAC=0;0;0;0 42 | HT_RDG=0 43 | HT_EXTCHA=0 44 | HT_OpMode=0 45 | HT_MpduDensity=4 46 | HT_BW=0 47 | HT_AutoBA=0 48 | HT_BADecline=0 49 | HT_AMSDU=0 50 | HT_BAWinSize=64 51 | HT_GI=1 52 | HT_MCS=33 53 | HT_MIMOPSMode=3 54 | HT_DisallowTKIP=1 55 | HT_LDPC=0 56 | HT_STBC=0 57 | VHT_BW=0 58 | VHT_SGI=1 59 | VHT_STBC=0 60 | VHT_BW_SIGNAL=0 61 | VHT_DisallowNonVHT=0 62 | VHT_LDPC=0 63 | EthConvertMode= 64 | EthCloneMac= 65 | IEEE80211H=0 66 | TGnWifiTest=0 67 | WirelessEvent=0 68 | MeshId=MESH 69 | MeshAutoLink=1 70 | MeshAuthMode=OPEN 71 | MeshEncrypType=NONE 72 | MeshWPAKEY= 73 | MeshDefaultkey=1 74 | MeshWEPKEY= 75 | CarrierDetect=0 76 | AntDiversity=0 77 | BeaconLostTime=4 78 | FtSupport=0 79 | Wapiifname=ra0 80 | WapiPsk= 81 | WapiPskType= 82 | WapiUserCertPath= 83 | WapiAsCertPath= 84 | PSP_XLINK_MODE=0 85 | WscManufacturer= 86 | WscModelName= 87 | WscDeviceName= 88 | WscModelNumber= 89 | WscSerialNumber= 90 | RadioOn=1 91 | WIDIEnable=1 92 | P2P_L2SD_SCAN_TOGGLE=3 93 | Wsc4digitPinCode=0 94 | P2P_WIDIEnable=0 95 | PMFMFPC=0 96 | PMFMFPR=0 97 | PMFSHA256=0 98 | SnifferType=0 99 | LoadCodeMethod=0 100 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/doc/ate_iwpriv_usage.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/doc/ate_iwpriv_usage.txt -------------------------------------------------------------------------------- /src/mt_wifi/embedded/doc/brftph_usage.txt: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | ****************************************************************************/ 15 | 16 | The steps for bridge fast path function in wireless driver: 17 | 18 | 1. Change HAS_BGFP_SUPPORT=y and HAS_BGFP_OPEN_SUPPORT=y 19 | Note1: When you just only want to enable fast path in WLAN module, you can 20 | only enable HAS_BGFP_SUPPORT. 21 | Note2: When you want to enable fast path in WLAN and Ethernet module, you 22 | need to enable HAS_BGFP_SUPPORT and HAS_BGFP_OPEN_SUPPORT. 23 | 24 | 25 | The steps for bridge fast path function in ethernet driver: 26 | 27 | 1. Find the function you pass received packets to upper layer. 28 | 2. Path code to the function. 29 | 30 | Note: If the ethernet driver is a library type, i.e. ***.ko, you must insert 31 | the ethernet driver to the Linux kernel before RALINK WLAN driver. 32 | 33 | For examples: 34 | 35 | 1. Declare a symbol and a function prototype. 36 | UINT32 (*RALINK_FP_Handle)(PNDIS_PACKET pPacket); 37 | EXPORT_SYMBOL(RALINK_FP_Handle); 38 | 39 | 2. Support your received handler, called packet_forward() 40 | 41 | In Linux, find the keyword, netif_rx(), such as 42 | packet_forward() 43 | { 44 | ...... 45 | 46 | // pass the packet to upper layer 47 | skb->protocol = eth_type_trans(skb, skb->dev); 48 | netif_rx(skb); 49 | } 50 | 51 | 3. Change the code segment to 52 | packet_forward() 53 | { 54 | UINT32 HandRst = 1; 55 | 56 | ...... 57 | 58 | if (RALINK_FP_Handle != NULL) 59 | HandRst = RALINK_FP_Handle(skb); 60 | 61 | if (HandRst != 0) 62 | { 63 | // pass the packet to upper layer 64 | // printk("pass to upper layer!\n"); 65 | skb->protocol = eth_type_trans(skb, skb->dev); 66 | netif_rx(skb); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/doc/header_translation.txt: -------------------------------------------------------------------------------- 1 | Tx Feature: 2 | -AMPDU 3 | -QoS Data 4 | -Non Qos Data 5 | -WDS Data(Not Mesh) 6 | -IBSS Data 7 | -Packet Sequence Number Maintain 8 | -HTC insertion(RDG) 9 | -HTC insertion 10 | -(TXBF Sounding Frame) 11 | -IPX(8137) 12 | -AppleTalk(80F3) 13 | -LLC Tunnel(AAAA03000000/ AAAA030000F8) 14 | -VLAN Remove (per pkt control) 15 | 16 | TXD 17 | -HF (00: non-802.11 data frame) (pTxBlk->NeedTrans) 18 | -ETYPE (1: indicate that this frame is an Ehternet-II frame which type/len >= 1536(0x600)) (RTMP_GET_PACKET_PROTOCOL(pkt) need check if already 802.3 packet in ) 19 | -VLAN (0: no VLAN field, 1: exist VLAN field) (RTMP_GET_PACKET_VLAN(pkt)) 20 | -RMVL (0: keep VLAN field, 1: remove VLAN field) (dat setting, current setting use 1 that remove vlan) 21 | -MRD (More Data: TX_BLK_TEST_FLAG(pTxBlk, fTX_bMoreData)) 22 | -EOSP (End of service period: TX_BLK_TEST_FLAG(pTxBlk, fTX_bWMM_UAPSD_EOSP)) 23 | -PF (pTxBlk->CipherAlg) 24 | -HE (must be 0) 25 | -DAS 26 | -OM[5:0] 27 | -NA 28 | -Header Padding (padding the dummy bytes in the head of header) 29 | 30 | WTBL 31 | -PA 32 | -QoS (will be set when peer side has HT capability) 33 | -TD (According to mac_entry->EntryType and ) 34 | -FD (According to entry type) 35 | 36 | Tx Translation rule 37 | 38 | Frame Control Field[15:0] 39 | -Protocol version (fixed value: 0x00) 40 | -Type[1:0] =2'b10 (Data SW guarantee) 41 | -SubType[3:0]=4'b0000 (non-QoS) or 4'b1000(QoS) = WTBL.QoS bit 42 | -ToDS = WTBL.TD 43 | -FromDS = WTBL.FD 44 | -MoreFrag = 1'b0 (fragment packet should be 802.11 format) 45 | -Retry - HW generate 46 | -PwrMgt 47 | -MoreData = TxD.MRD 48 | -ProtectFrame = TxD.PF 49 | -Order = TxD.HE (must be 0) 50 | 51 | Duration/ID[15:0] = 16'h0 (TMAC will replace this) 52 | 53 | A1-A4 54 | DA = (TxD.DAS = 0, DA in MSDU) or (TxD.DAS = 1, PA in WTBL) (use TMI_DAS_FROM_MPDU for TxD.DAS) 55 | SA = SA in MSDU (DMA read it from header buffer) 56 | BSSID = select by TxD.OM[5:0] for multiple BSSID 57 | RA = PA in WTBL 58 | TA = select by TxD.OM[5:0] 59 | 60 | Sequence Control field[15:0] = HW prepare 61 | 62 | QoS Control [15:0] 63 | TID[3:0] = TxD.TID (pTxBlk->UserPriority) 64 | EOSP(bit 4) = TxD.EOSP 65 | Ack Policy[1:0] 66 | = 2'b01 if TxD.NA == 1 67 | = 2'b00 if TxD.NA == 0 and not PSMP queue (AC6) 68 | = 2'b10 if PSMA queue (AC6), TxD.NA must be 0 69 | A-MSDU = 1'b0 70 | QoS Control [15:8] = 8'h0 (Not support Mesh-TX header translation) 71 | 72 | Driver Tx path: 73 | 1.not need to touch skb->data packet 74 | 2.Only build txd header and fill related information for ethernet-ii or 802.3 packet 75 | 76 | Rx Feature: 77 | -Translation Enable/Disable (DCR.RX_HDR_TRANS_EN / DCR.RX_HDR_TRANS_CHK_BSSID) 78 | -Translation Enable/Disable per Peer (WTBL.DIS_RHTR) 79 | -QoS Data 80 | -Non-QoS Data 81 | -MPDU carry a MSDU 82 | -MPDU carry a AMSDU 83 | -No Error packet convert 84 | -Fragment data convert 85 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/doc/mainpage.dox: -------------------------------------------------------------------------------- 1 | /** 2 | * @mainpage 3 | * 4 | * 5 | * ## WiFi Driver Branch 6 | * //Jedi/TRUNK/JEDI_WIFI (wifi driver main branch) 7 | */ 8 | 9 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/doc/mbss_phy.readme: -------------------------------------------------------------------------------- 1 | Readme for different phy mode of different BSS as below: 2 | 3 | 1. Extend WirelessMode usage in DAT file 4 | 5 | EX: WirelessMode=0;9;1;9 i.e. bg, bgn, b-only, bgn, pAd->CommonCfg.PhyMode will be 9 6 | 7 | EX: WirelessMode=0;0;1;0 i.e. bg, bg, b-only, bg, pAd->CommonCfg.PhyMode will be 0 8 | 9 | 10 | 11 | 12 | 2. Add a new parameter, PhyMode, in MULTISSID_STRUCT structure 13 | 14 | 15 | 16 | 3. Use pAd->ApCfg.MBSSID[apidx].PhyMode, not pAd->CommonCfg.PhyMode in APUpdateBeaconFrame() 17 | 18 | Use pAd->ApCfg.MBSSID[apidx].PhyMode, not pAd->CommonCfg.PhyMode in APPeerProbeReqAction() 19 | 20 | 21 | 22 | 4. Use maximum capability for all BSS in RT_CfgSetWirelessMode(). 23 | 24 | EX: In MBSS mode, BSS0 is 11g-only, BSS1 is 11b-only, pAd->CommonCfg.PhyMode will be 11bg-mixed. 25 | 26 | EX: In MBSS mode, BSS0 is 11n-2.4G-only, BSS1 is also 11n-2.4G-only, pAd->CommonCfg.PhyMode will be 11n-2.4G-only, not 11bgn-mixed. 27 | 28 | EX: In MBSS mode, BSS0 is 11b-only, BSS1 is also 11b-only, pAd->CommonCfg.PhyMode will be 11b-only. 29 | 30 | EX: In MBSS mode, BSS0 is 11b-only, BSS1 is also 11bgn-mixed, pAd->CommonCfg.PhyMode will be 11bgn-mixed. 31 | 32 | 33 | 34 | So no impact for GreenAP mode. Check with K.H. 35 | 36 | 37 | 38 | 5. Add two new command 39 | 40 | (1) iwpriv ra0 set MBSSWirelessMode=[0 ~ 11] 41 | 42 | Set different phy mode for different BSS. 43 | 44 | (2) iwpriv ra0 show mbss 45 | 46 | Show current phy mode for different BSS. EX: 47 | 48 | 49 | 50 | BSS Idx Phy Mode 51 | MAX BGN Mixed 52 | 0 BG Mixed 53 | 1 BG Mixed 54 | 2 BG Mixed 55 | 3 BGN Mixed 56 | 57 | 58 | 59 | 6. When ra0 use 2.4G, users set ra1 to 5G, ra0 will be same as ra1. 60 | When ra0 use 5G, users set ra1 to 2.4G, ra0 will be same as ra1. 61 | EX: BSS0 is 11bg-mixed, then users set BSS1 to 11a-only, ra0 will be 11a-only, not 11an-mixed. 62 | EX: BSS0 is 11bg-mixed, then users set BSS1 to 11an-mixed, ra0 will be 11an-mixed. 63 | 64 | 65 | 7. Use CONFIG_AP_SUPPORT and MBSS_SUPPORT to include these codes. 66 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/doc/sta_ate_iwpriv_usage.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/doc/sta_ate_iwpriv_usage.txt -------------------------------------------------------------------------------- /src/mt_wifi/embedded/easy_setup/ez_cmm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/easy_setup/ez_cmm.o -------------------------------------------------------------------------------- /src/mt_wifi/embedded/easy_setup/mt7615_chip_ops.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | cmm_ez.c 20 | 21 | Abstract: 22 | Easy Setup APIs 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #ifdef WH_EZ_SETUP 30 | #include "rt_config.h" 31 | #endif 32 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/hif/hif_pci.c: -------------------------------------------------------------------------------- 1 | 2 | #include "rt_config.h" 3 | 4 | 5 | #ifdef RTMP_MAC_PCI 6 | INT NICInitPwrPinCfg(RTMP_ADAPTER *pAd) 7 | { 8 | #if defined(RTMP_MAC) || defined(RLT_MAC) 9 | UINT32 mac_val = 0; 10 | #endif 11 | 12 | // TODO: shiang-7603 13 | if (pAd->chipCap.hif_type == HIF_MT) { 14 | MTWF_LOG(DBG_CAT_HIF, CATHIF_PCI, DBG_LVL_OFF, ("%s(%d): Not support for HIF_MT yet!\n", 15 | __FUNCTION__, __LINE__)); 16 | 17 | return FALSE; 18 | } 19 | 20 | #if defined(RTMP_MAC) || defined(RLT_MAC) 21 | /*@!Release 22 | For MT76x0 series, 23 | PWR_PIN_CFG[2:0]: obsolete, no function 24 | Don't need to change PWR_PIN_CFG here. 25 | */ 26 | mac_val = 0x3; /* To fix driver disable/enable hang issue when radio off*/ 27 | RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, mac_val); 28 | #endif /* defined(RTMP_MAC) || defined(RLT_MAC) */ 29 | 30 | return TRUE; 31 | } 32 | 33 | 34 | 35 | #endif /* RTMP_MAC_PCI */ 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/action.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | aironet.h 20 | 21 | Abstract: 22 | 23 | Revision History: 24 | Who When What 25 | -------- ---------- ---------------------------------------------- 26 | Name Date Modification logs 27 | */ 28 | 29 | #ifndef __ACTION_H__ 30 | #define __ACTION_H__ 31 | 32 | 33 | struct _RTMP_ADAPTER; 34 | 35 | 36 | 37 | VOID MlmeQOSAction( 38 | IN PRTMP_ADAPTER pAd, 39 | IN MLME_QUEUE_ELEM *Elem); 40 | 41 | VOID MlmeDLSAction( 42 | IN PRTMP_ADAPTER pAd, 43 | IN MLME_QUEUE_ELEM *Elem); 44 | 45 | VOID MlmeInvalidAction( 46 | IN PRTMP_ADAPTER pAd, 47 | IN MLME_QUEUE_ELEM *Elem); 48 | 49 | VOID PeerRMAction( 50 | IN PRTMP_ADAPTER pAd, 51 | IN MLME_QUEUE_ELEM *Elem); 52 | 53 | VOID PeerQOSAction( 54 | IN PRTMP_ADAPTER pAd, 55 | IN MLME_QUEUE_ELEM *Elem); 56 | 57 | #ifdef DOT11_N_SUPPORT 58 | VOID PeerAddBAReqAction( 59 | IN PRTMP_ADAPTER pAd, 60 | IN MLME_QUEUE_ELEM *Elem); 61 | 62 | VOID PeerAddBARspAction( 63 | IN PRTMP_ADAPTER pAd, 64 | IN MLME_QUEUE_ELEM *Elem); 65 | 66 | VOID PeerDelBAAction( 67 | IN PRTMP_ADAPTER pAd, 68 | IN MLME_QUEUE_ELEM *Elem); 69 | 70 | VOID PeerBAAction( 71 | IN PRTMP_ADAPTER pAd, 72 | IN MLME_QUEUE_ELEM *Elem); 73 | 74 | VOID PeerHTAction( 75 | IN PRTMP_ADAPTER pAd, 76 | IN MLME_QUEUE_ELEM *Elem); 77 | 78 | #ifdef DOT11_VHT_AC 79 | VOID PeerVHTAction( 80 | IN PRTMP_ADAPTER pAd, 81 | IN MLME_QUEUE_ELEM *Elem) ; 82 | #endif /* DOT11_VHT_AC */ 83 | #endif /* DOT11_N_SUPPORT */ 84 | 85 | VOID PeerPublicAction( 86 | IN PRTMP_ADAPTER pAd, 87 | IN MLME_QUEUE_ELEM *Elem); 88 | 89 | 90 | #ifdef CONFIG_AP_SUPPORT 91 | VOID ApPublicAction( 92 | IN PRTMP_ADAPTER pAd, 93 | IN MLME_QUEUE_ELEM *Elem); 94 | #endif /* CONFIG_AP_SUPPORT */ 95 | 96 | #endif /* __ACTION_H__ */ 97 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/ap_ids.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | ap_ids.c 18 | 19 | Abstract: 20 | IDS definition 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | VOID RTMPIdsPeriodicExec( 28 | IN PVOID SystemSpecific1, 29 | IN PVOID FunctionContext, 30 | IN PVOID SystemSpecific2, 31 | IN PVOID SystemSpecific3); 32 | 33 | BOOLEAN RTMPSpoofedMgmtDetection( 34 | IN RTMP_ADAPTER *pAd, 35 | IN RX_BLK *rxblk); 36 | 37 | VOID RTMPConflictSsidDetection( 38 | IN PRTMP_ADAPTER pAd, 39 | IN PUCHAR pSsid, 40 | IN UCHAR SsidLen, 41 | IN CHAR Rssi0, 42 | IN CHAR Rssi1, 43 | IN CHAR Rssi2); 44 | 45 | BOOLEAN RTMPReplayAttackDetection( 46 | IN RTMP_ADAPTER *pAd, 47 | IN UCHAR *pAddr2, 48 | IN RX_BLK *rxblk); 49 | 50 | VOID RTMPUpdateStaMgmtCounter( 51 | IN PRTMP_ADAPTER pAd, 52 | IN USHORT type); 53 | 54 | VOID RTMPClearAllIdsCounter( 55 | IN PRTMP_ADAPTER pAd); 56 | 57 | VOID RTMPIdsStart( 58 | IN PRTMP_ADAPTER pAd); 59 | 60 | VOID RTMPIdsStop( 61 | IN PRTMP_ADAPTER pAd); 62 | 63 | VOID rtmp_read_ids_from_file( 64 | IN PRTMP_ADAPTER pAd, 65 | char *tmpbuf, 66 | char *buffer); 67 | 68 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/ap_vow.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/include/ap_vow.h -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/br_ftph.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | 17 | Abstract: 18 | 19 | All Bridge Fast Path Related Structure & Definition. 20 | 21 | ***************************************************************************/ 22 | 23 | #ifndef __BR_FTPH_H__ 24 | #define __BR_FTPH_H__ 25 | 26 | /* Public function prototype */ 27 | /* 28 | ======================================================================== 29 | Routine Description: 30 | Init bridge fast path module. 31 | 32 | Arguments: 33 | None 34 | 35 | Return Value: 36 | None 37 | 38 | Note: 39 | Used in module init. 40 | ======================================================================== 41 | */ 42 | VOID BG_FTPH_Init(VOID); 43 | 44 | /* 45 | ======================================================================== 46 | Routine Description: 47 | Remove bridge fast path module. 48 | 49 | Arguments: 50 | None 51 | 52 | Return Value: 53 | None 54 | 55 | Note: 56 | Used in module remove. 57 | ======================================================================== 58 | */ 59 | VOID BG_FTPH_Remove(VOID); 60 | 61 | /* 62 | ======================================================================== 63 | Routine Description: 64 | Forward the received packet. 65 | 66 | Arguments: 67 | pPacket - the received packet 68 | 69 | Return Value: 70 | None 71 | 72 | Note: 73 | ======================================================================== 74 | */ 75 | UINT32 BG_FTPH_PacketFromApHandle( 76 | IN PNDIS_PACKET pPacket); 77 | 78 | #endif /* __BR_FTPH_H__ */ 79 | 80 | /* End of br_ftph.h */ 81 | 82 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/cfg80211.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | 17 | Abstract: 18 | 19 | All MAC80211/CFG80211 Related Structure & Definition. 20 | 21 | ***************************************************************************/ 22 | #ifndef __CFG80211_H__ 23 | #define __CFG80211_H__ 24 | 25 | #ifdef RT_CFG80211_SUPPORT 26 | 27 | #include 28 | 29 | typedef enum _NDIS_HOSTAPD_STATUS { 30 | Hostapd_Diable = 0, 31 | Hostapd_EXT, 32 | Hostapd_CFG 33 | } NDIS_HOSTAPD_STATUS, *PNDIS_HOSTAPD_STATUS; 34 | 35 | 36 | typedef struct __CFG80211_CB { 37 | 38 | /* we can change channel/rate information on the fly so we backup them */ 39 | struct ieee80211_supported_band Cfg80211_bands[IEEE80211_NUM_BANDS]; 40 | struct ieee80211_channel *pCfg80211_Channels; 41 | struct ieee80211_rate *pCfg80211_Rates; 42 | 43 | /* used in wiphy_unregister */ 44 | struct wireless_dev *pCfg80211_Wdev; 45 | 46 | /* used in scan end */ 47 | struct cfg80211_scan_request *pCfg80211_ScanReq; 48 | 49 | /* monitor filter */ 50 | UINT32 MonFilterFlag; 51 | 52 | /* channel information */ 53 | struct ieee80211_channel ChanInfo[MAX_NUM_OF_CHANNELS]; 54 | 55 | /* to protect scan status */ 56 | spinlock_t scan_notify_lock; 57 | 58 | } CFG80211_CB; 59 | 60 | #define WDEV_NOT_FOUND -1 61 | 62 | /* 63 | ======================================================================== 64 | Routine Description: 65 | Register MAC80211 Module. 66 | 67 | Arguments: 68 | pAd - WLAN control block pointer 69 | pDev - Generic device interface 70 | pNetDev - Network device 71 | 72 | Return Value: 73 | NONE 74 | 75 | Note: 76 | pDev != pNetDev 77 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) 78 | 79 | Can not use pNetDev to replace pDev; Or kernel panic. 80 | ======================================================================== 81 | */ 82 | BOOLEAN CFG80211_Register( 83 | VOID *pAd, 84 | struct device *pDev, 85 | struct net_device *pNetDev); 86 | 87 | #endif /* RT_CFG80211_SUPPORT */ 88 | 89 | #endif /* __CFG80211_H__ */ 90 | 91 | /* End of cfg80211.h */ 92 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/client_wds.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | client_wds.h 20 | 21 | Abstract: 22 | */ 23 | 24 | #ifndef __CLIENT_WDS_H__ 25 | #define __CLIENT_WDS_H__ 26 | 27 | #include "client_wds_cmm.h" 28 | 29 | VOID CliWds_ProxyTabInit( 30 | IN PRTMP_ADAPTER pAd); 31 | 32 | VOID CliWds_ProxyTabDestory( 33 | IN PRTMP_ADAPTER pAd); 34 | 35 | PCLIWDS_PROXY_ENTRY CliWdsEntyAlloc( 36 | IN PRTMP_ADAPTER pAd); 37 | 38 | 39 | VOID CliWdsEntyFree( 40 | IN PRTMP_ADAPTER pAd, 41 | IN PCLIWDS_PROXY_ENTRY pCliWdsEntry); 42 | 43 | 44 | UCHAR *CliWds_ProxyLookup(RTMP_ADAPTER *pAd, UCHAR *pMac); 45 | 46 | 47 | VOID CliWds_ProxyTabUpdate( 48 | IN PRTMP_ADAPTER pAd, 49 | IN SHORT Aid, 50 | IN PUCHAR pMac); 51 | 52 | 53 | VOID CliWds_ProxyTabMaintain( 54 | IN PRTMP_ADAPTER pAd); 55 | 56 | #endif /* __CLIENT_WDS_H__ */ 57 | 58 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/client_wds_cmm.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | client_wds_cmm.h 20 | 21 | Abstract: 22 | */ 23 | 24 | #ifndef __CLIENT_WDS_CMM_H__ 25 | #define __CLIENT_WDS_CMM_H__ 26 | 27 | #include "rtmp_def.h" 28 | 29 | #ifdef CLIENT_WDS 30 | 31 | 32 | #define CLI_WDS_ENTRY_AGEOUT 5000 /* seconds */ 33 | 34 | #define CLIWDS_POOL_SIZE 128 35 | #define CLIWDS_HASH_TAB_SIZE 64 /* the legth of hash table must be power of 2. */ 36 | typedef struct _CLIWDS_PROXY_ENTRY { 37 | struct _CLIWDS_PROXY_ENTRY * pNext; 38 | ULONG LastRefTime; 39 | SHORT Aid; 40 | UCHAR Addr[MAC_ADDR_LEN]; 41 | } CLIWDS_PROXY_ENTRY, *PCLIWDS_PROXY_ENTRY; 42 | 43 | #endif /* CLIENT_WDS */ 44 | 45 | #endif /* __CLIENT_WDS_CMM_H__ */ 46 | 47 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/dot11r_ft.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/include/dot11r_ft.h -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/dot11v_wnm.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 5F., No.36 Taiyuan St., Jhubei City, 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * 7 | * (c) Copyright 2011, Ralink Technology, Inc. 8 | * 9 | * All rights reserved. Ralink's source code is an unpublished work and the 10 | * use of a copyright notice does not imply otherwise. This source code 11 | * contains confidential trade secret material of Ralink Tech. Any attemp 12 | * or participation in deciphering, decoding, reverse engineering or in any 13 | * way altering the source code is stricitly prohibited, unless the prior 14 | * written consent of Ralink Technology, Inc. is obtained. 15 | *************************************************************************** 16 | 17 | Module Name: 18 | dot11v_wnm.h 19 | 20 | Revision History: 21 | Who When What 22 | -------- ---------- ---------------------------------------------- 23 | 24 | */ 25 | 26 | #ifndef __DOT11V_WNM_H__ 27 | #define __DOT11V_WNM_H__ 28 | 29 | enum WNM_ACTION_FIELD { 30 | EVENT_REQUEST, 31 | EVENT_REPORT, 32 | DIAGNOSTIC_REQ, 33 | DIAGNOSTIC_REPORT, 34 | LOCATION_CONF_REQ, 35 | LOCATION_CONF_RSP, 36 | BSS_TRANSITION_QUERY, 37 | BSS_TRANSITION_REQ, 38 | BSS_TRANSITION_RSP, 39 | FMS_REQ, 40 | FMS_RSP, 41 | COLLOCATED_INTERFERENCE_REQ, 42 | COLLOCATED_INTERFERENCE_REPORT, 43 | TFS_REQ, 44 | TFS_RSP, 45 | TFS_NOTIFY, 46 | WNM_SLEEP_MODE_REQ, 47 | WNM_SLEEP_MODE_RSP, 48 | TIM_BROADCAST_REQ, 49 | TIM_BROADCAST_RSP, 50 | QOS_TRAFFIC_CAPABILITY_UPDATE, 51 | CHANNEL_USAGE_REQ, 52 | CHANNEL_USAGE_RSP, 53 | DMS_REQ, 54 | DMS_RSP, 55 | TIMING_MEASUREMENT_REQ, 56 | WNM_NOTIFICATION_REQ, 57 | WNM_NOTIFICATION_RSP, 58 | }; 59 | 60 | typedef struct GNU_PACKED _WNM_FRAME 61 | { 62 | HEADER_802_11 Hdr; 63 | UCHAR Category; 64 | union { 65 | struct { 66 | UCHAR Action; 67 | UCHAR DialogToken; 68 | UCHAR Variable[0]; 69 | } GNU_PACKED BTM_QUERY; 70 | 71 | struct { 72 | UCHAR Action; 73 | UCHAR DialogToken; 74 | UCHAR Variable[0]; 75 | } GNU_PACKED BTM_REQ; 76 | 77 | struct { 78 | UCHAR Action; 79 | UCHAR DialogToken; 80 | UCHAR Variable[0]; 81 | } GNU_PACKED BTM_RSP; 82 | 83 | struct { 84 | UCHAR Action; 85 | UCHAR DialogToken; 86 | UCHAR Type; 87 | UCHAR Variable[0]; 88 | } GNU_PACKED WNM_NOTIFY_REQ; 89 | 90 | struct { 91 | UCHAR Action; 92 | UCHAR DialogToken; 93 | UCHAR RespStatus; 94 | UCHAR Variable[0]; 95 | } GNU_PACKED WNM_NOTIFY_RSP; 96 | }u; 97 | } WNM_FRAME, *PWNM_FRAME; 98 | 99 | void PeerWNMAction(IN struct _RTMP_ADAPTER *pAd, 100 | IN MLME_QUEUE_ELEM *Elem); 101 | 102 | #endif /* __DOT11V_WNM_H__ */ 103 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/eeprom/mt_dmac_e2p_def.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | mt_dmac_e2p_def.h 15 | */ 16 | 17 | #ifndef __MT_DMAC_E2P_DEF_H__ 18 | #define __MT_DMAC_E2P_DEF_H__ 19 | 20 | #define DMAC_TX0_G_BAND_TARGET_PWR 0x58 21 | #define DMAC_TX1_G_BAND_TARGET_PWR 0x5E 22 | #define DMAC_TX2_G_BAND_TARGET_PWR 0x64 23 | #define DMAC_TX3_G_BAND_TARGET_PWR 0x6A 24 | 25 | #define DMAC_GRP0_TX0_A_BAND_TARGET_PWR 0x70 26 | #define DMAC_GRP1_TX0_A_BAND_TARGET_PWR 0x75 27 | #define DMAC_GRP2_TX0_A_BAND_TARGET_PWR 0x7A 28 | #define DMAC_GRP3_TX0_A_BAND_TARGET_PWR 0x7F 29 | #define DMAC_GRP4_TX0_A_BAND_TARGET_PWR 0x84 30 | #define DMAC_GRP5_TX0_A_BAND_TARGET_PWR 0x89 31 | #define DMAC_GRP6_TX0_A_BAND_TARGET_PWR 0x8E 32 | #define DMAC_GRP7_TX0_A_BAND_TARGET_PWR 0x93 33 | 34 | #define DMAC_GRP0_TX1_A_BAND_TARGET_PWR 0x98 35 | #define DMAC_GRP1_TX1_A_BAND_TARGET_PWR 0x9D 36 | #define DMAC_GRP2_TX1_A_BAND_TARGET_PWR 0xA2 37 | #define DMAC_GRP3_TX1_A_BAND_TARGET_PWR 0xA7 38 | #define DMAC_GRP4_TX1_A_BAND_TARGET_PWR 0xAC 39 | #define DMAC_GRP5_TX1_A_BAND_TARGET_PWR 0xB1 40 | #define DMAC_GRP6_TX1_A_BAND_TARGET_PWR 0xB6 41 | #define DMAC_GRP7_TX1_A_BAND_TARGET_PWR 0xBB 42 | 43 | #define DMAC_GRP0_TX2_A_BAND_TARGET_PWR 0x142 44 | #define DMAC_GRP1_TX2_A_BAND_TARGET_PWR 0x147 45 | #define DMAC_GRP2_TX2_A_BAND_TARGET_PWR 0x14C 46 | #define DMAC_GRP3_TX2_A_BAND_TARGET_PWR 0x151 47 | #define DMAC_GRP4_TX2_A_BAND_TARGET_PWR 0x156 48 | #define DMAC_GRP5_TX2_A_BAND_TARGET_PWR 0x15B 49 | #define DMAC_GRP6_TX2_A_BAND_TARGET_PWR 0x160 50 | #define DMAC_GRP7_TX2_A_BAND_TARGET_PWR 0x165 51 | 52 | #define DMAC_GRP0_TX3_A_BAND_TARGET_PWR 0x16A 53 | #define DMAC_GRP1_TX3_A_BAND_TARGET_PWR 0x16F 54 | #define DMAC_GRP2_TX3_A_BAND_TARGET_PWR 0x174 55 | #define DMAC_GRP3_TX3_A_BAND_TARGET_PWR 0x179 56 | #define DMAC_GRP4_TX3_A_BAND_TARGET_PWR 0x17E 57 | #define DMAC_GRP5_TX3_A_BAND_TARGET_PWR 0x183 58 | #define DMAC_GRP6_TX3_A_BAND_TARGET_PWR 0x188 59 | #define DMAC_GRP7_TX3_A_BAND_TARGET_PWR 0x18D 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/efuse.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | efuse.h 15 | */ 16 | #ifndef __EFUSE_H__ 17 | #define __EFUSE_H__ 18 | 19 | /* eFuse registers */ 20 | #define EFUSE_CTRL 0x0580 21 | #define EFUSE_DATA0 0x0590 22 | #define EFUSE_DATA1 0x0594 23 | #define EFUSE_DATA2 0x0598 24 | #define EFUSE_DATA3 0x059c 25 | 26 | #define EFUSE_CTRL_3290 0x24 27 | #define EFUSE_DATA0_3290 0x28 28 | #define EFUSE_DATA1_3290 0x2c 29 | #define EFUSE_DATA2_3290 0x30 30 | #define EFUSE_DATA3_3290 0x34 31 | 32 | #define EFUSE_TAG 0x2fe 33 | 34 | 35 | #define MT_EEF_BASE 0x81070000 36 | #define MT_EE_CTRL (MT_EEF_BASE) 37 | #define MT_EFUSE_CTRL (MT_EEF_BASE + 0x8) 38 | #define MT_EFUSE_WDATA0 (MT_EEF_BASE + 0x10) 39 | #define MT_EFUSE_WDATA1 (MT_EEF_BASE + 0x14) 40 | #define MT_EFUSE_WDATA2 (MT_EEF_BASE + 0x18) 41 | #define MT_EFUSE_WDATA3 (MT_EEF_BASE + 0x1C) 42 | #define MT_EFUSE_RDATA0 (MT_EEF_BASE + 0x30) 43 | #define MT_EFUSE_RDATA1 (MT_EEF_BASE + 0x34) 44 | #define MT_EFUSE_RDATA2 (MT_EEF_BASE + 0x38) 45 | #define MT_EFUSE_RDATA3 (MT_EEF_BASE + 0x3C) 46 | 47 | #ifdef RT_BIG_ENDIAN 48 | typedef union _EFUSE_CTRL_STRUC { 49 | struct { 50 | UINT32 SEL_EFUSE:1; 51 | UINT32 EFSROM_KICK:1; 52 | UINT32 EFSROM_DOUT_VLD:1; 53 | UINT32 RESERVED:3; 54 | UINT32 EFSROM_AIN:10; 55 | UINT32 EFSROM_LDO_ON_TIME:2; 56 | UINT32 EFSROM_LDO_OFF_TIME:6; 57 | UINT32 EFSROM_MODE:2; 58 | UINT32 EFSROM_AOUT:6; 59 | } field; 60 | UINT32 word; 61 | } EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC; 62 | #else 63 | typedef union _EFUSE_CTRL_STRUC { 64 | struct { 65 | UINT32 EFSROM_AOUT:6; 66 | UINT32 EFSROM_MODE:2; 67 | UINT32 EFSROM_LDO_OFF_TIME:6; 68 | UINT32 EFSROM_LDO_ON_TIME:2; 69 | UINT32 EFSROM_AIN:10; 70 | UINT32 RESERVED:3; 71 | UINT32 EFSROM_DOUT_VLD:1; 72 | UINT32 EFSROM_KICK:1; 73 | UINT32 SEL_EFUSE:1; 74 | } field; 75 | UINT32 word; 76 | } EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC; 77 | #endif /* RT_BIG_ENDIAN */ 78 | 79 | VOID eFuseReadPhysical( 80 | IN PRTMP_ADAPTER pAd, 81 | IN PUSHORT lpInBuffer, 82 | IN ULONG nInBufferSize, 83 | OUT PUSHORT lpOutBuffer, 84 | IN ULONG nOutBufferSize); 85 | 86 | #endif /* __EFUSE_H__ */ 87 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/frame_hdr.h: -------------------------------------------------------------------------------- 1 | #ifndef __FRAME_HDR_H__ 2 | #define __FRAME_HDR_H__ 3 | 4 | #define HDR_TRANS_LEN 50 5 | 6 | #ifdef RT_BIG_ENDIAN 7 | typedef struct GNU_PACKED _WIFI_INFO_STRUCT{ 8 | UINT32 more_data:1; 9 | UINT32 wep:1; 10 | UINT32 ps:1; 11 | UINT32 rdg:1; 12 | UINT32 qos:1; 13 | UINT32 eosp:1; 14 | UINT32 tid:4; 15 | UINT32 mode:2; 16 | UINT32 vlan:1; 17 | UINT32 rev:3; 18 | UINT32 bssidx:4; 19 | UINT32 seq_num:12; 20 | }WIFI_INFO_STRUCT; 21 | #else 22 | typedef struct GNU_PACKED _WIFI_INFO_STRUCT{ 23 | UINT32 seq_num:12; 24 | UINT32 bssidx:4; 25 | UINT32 rev:3; 26 | UINT32 vlan:1; 27 | UINT32 mode:2; 28 | UINT32 tid:4; 29 | UINT32 eosp:1; 30 | UINT32 qos:1; 31 | UINT32 rdg:1; 32 | UINT32 ps:1; 33 | UINT32 wep:1; 34 | UINT32 more_data:1; 35 | }WIFI_INFO_STRUCT; 36 | #endif /* RT_BIG_ENDIAN */ 37 | 38 | WIFI_INFO_STRUCT wifi_info[] = { 39 | /* mode 1 -> AP, mode 2 --> STA */ 40 | /* seq_num, bssidx, rsv, vlan, mode, tid, eosp, qos, rdg, ps, wep, more_data*/ 41 | {0xff, 5, 0, 1, 1, 3, 0, 1, 0, 0, 0, 0}, 42 | }; 43 | 44 | 45 | UINT8 Input_Frame_Hdr[][HDR_TRANS_LEN] = { 46 | /*type, len, vlan, wcid */ 47 | /************************************ AP LLC/SNAP *********************************/ 48 | /************************************ WDS LLC/SNAP ******************************/ 49 | {0, 34, 0, 1, 0x08, 0x03, 0x00, 0x00, 0x33, 0x33, 0x00, 0x00, 0x00, 0x02, 0x00, 0x11, 0x22, 0x33, 50 | 0x44, 0x50, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x50, 0x02, 0x00, 0xee, 0xee, 0xee, 51 | 0xee, 0xee, 0x00, 0x00, 0x08, 0x00}, /* AP w/o LLC - Ether II*/ 52 | 53 | }; 54 | 55 | UINT8 Hdr_Bssid[] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55}; 56 | 57 | UINT8 Hdr_Wcid[][6] = { 58 | {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, //0 59 | {0x00, 0x77, 0x77, 0x77, 0x77, 0x77}, //1 60 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x01}, //2 61 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x02}, //3 62 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x03}, //4 63 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x04}, //5 64 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x05}, //6 65 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x06}, //7 66 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x07}, //8 67 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x08}, //9 68 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x09}, //a 69 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x0a}, //b 70 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x0b}, //c 71 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x0c}, //d 72 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x0d}, //e 73 | {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x0e}, //f 74 | }; 75 | UINT8 MAC_WCID[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; 76 | 77 | //UINT32 RX_Black_List[] = {0x0d898e88}; /* EAPOL 888E, TDLS 890D */ 78 | //UINT32 RX_Black_List[] = {0x888e0800}; /* EAPOL 888E, TDLS 890D */ 79 | UINT32 RX_Black_List[] = {}; /* EAPOL 888E, TDLS 890D */ 80 | UINT32 TCI[] = {0x10021001, 0x10041003, 0x10061005, 0x10081007}; 81 | UINT32 RX_WCID_En[] = {0xFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF}; 82 | #endif 83 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/hw_ctrl_basic.h: -------------------------------------------------------------------------------- 1 | 2 | /*==============================================*/ 3 | /* Define HW Ctrl Handler and Mapping Table */ 4 | /*==============================================*/ 5 | 6 | typedef NTSTATUS (*HwCmdHdlr)(RTMP_ADAPTER *pAd, HwCmdQElmt *CMDQelmt); 7 | typedef NTSTATUS (*HwFlagHdlr)(RTMP_ADAPTER *pAd); 8 | 9 | typedef struct { 10 | UINT32 CmdID; 11 | HwCmdHdlr CmdHdlr; 12 | UINT32 RfCnt; 13 | }HW_CMD_TABLE_T; 14 | 15 | 16 | typedef struct { 17 | UINT32 FlagId; 18 | HwFlagHdlr FlagHdlr; 19 | UINT32 RfCnt; 20 | }HW_FLAG_TABLE_T; 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/iface/iface.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __IFACE_H__ 3 | #define __IFACE_H__ 4 | 5 | #ifdef MT_MAC 6 | #if defined(RTMP_MAC_PCI) || defined(RTMP_MAC_USB) 7 | #include "mt_hif_pci_usb.h" 8 | #endif 9 | 10 | #endif 11 | 12 | #endif /* __IFACE_H__ */ 13 | 14 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/iface/iface_util.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | rtmp_util.h 18 | 19 | Abstract: 20 | Common for PCI/USB/RBUS. 21 | 22 | Revision History: 23 | Who When What 24 | --------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | #ifndef __RTMP_UTIL_H__ 28 | #define __RTMP_UTIL_H__ 29 | 30 | /* maximum of PCI, USB, or RBUS, int PCI, it is 0 but in USB, it is 11 */ 31 | #define RTMP_PKT_TAIL_PADDING 11 /* 3(max 4 byte padding) + 4 (last packet padding) + 4 (MaxBulkOutsize align padding) */ 32 | 33 | #ifdef PCI_MSI_SUPPORT 34 | #define RTMP_MSI_ENABLE(_pAd) \ 35 | { POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ 36 | (_pAd)->HaveMsi = pci_enable_msi(_pObj->pci_dev) == 0 ? TRUE : FALSE; \ 37 | } 38 | 39 | #define RTMP_MSI_DISABLE(_pci_dev, _pHaveMsi) \ 40 | { \ 41 | if (*(_pHaveMsi) == TRUE) \ 42 | pci_disable_msi(_pci_dev); \ 43 | *(_pHaveMsi) = FALSE; \ 44 | } 45 | 46 | #else 47 | #define RTMP_MSI_ENABLE(_pAd) do{}while(0) 48 | #define RTMP_MSI_DISABLE(_pci_dev, _pHaveMsi) do{}while(0) 49 | #endif /* PCI_MSI_SUPPORT */ 50 | 51 | #define RTMP_PCI_DMA_TODEVICE 0xFF00 52 | #define RTMP_PCI_DMA_FROMDEVICE 0xFF01 53 | 54 | 55 | 56 | 57 | #define UNLINK_TIMEOUT_MS 3 58 | 59 | #define USBD_TRANSFER_DIRECTION_OUT 0 60 | #define USBD_TRANSFER_DIRECTION_IN 0 61 | #define USBD_SHORT_TRANSFER_OK 0 62 | #define PURB purbb_t 63 | 64 | #define OS_RTMP_MlmeUp RtmpOsMlmeUp 65 | 66 | #endif /* __RTMP_UTIL_H__ */ 67 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/mcu/mcu.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | mcu.h 20 | 21 | Abstract: 22 | MCU related information 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #ifndef __MCU_H__ 30 | #define __MCU_H__ 31 | 32 | #define CONFG_BASE_ADDR 0x2000 33 | #define CONFG_COM_REG3 (CONFG_BASE_ADDR + 0x0000020C) 34 | #define CONFG_COM_REG3_FWOPMODE BIT(4) 35 | 36 | #define ENABLE_RXD_LOG 0 37 | 38 | enum MCU_TYPE { 39 | SWMCU = (1<<0), 40 | M8051 = (1<<1), 41 | ANDES = (1<<2), 42 | CR4 = (1<<3), 43 | }; 44 | 45 | /* 46 | * Power opration 47 | */ 48 | enum PWR_OP { 49 | RADIO_OFF = 0x30, 50 | RADIO_ON, 51 | RADIO_OFF_AUTO_WAKEUP, 52 | RADIO_OFF_ADVANCE, 53 | RADIO_ON_ADVANCE, 54 | }; 55 | 56 | struct _RTMP_ADAPTER; 57 | 58 | VOID ChipOpsMCUHook(struct _RTMP_ADAPTER *pAd, enum MCU_TYPE MCUType); 59 | VOID MCUCtrlInit(struct _RTMP_ADAPTER *pAd); 60 | VOID MCUCtrlExit(struct _RTMP_ADAPTER *pAd); 61 | 62 | INT32 MCULoadRomPatch(struct _RTMP_ADAPTER *pAd); 63 | INT32 MCUSysPrepare(struct _RTMP_ADAPTER *pAd); 64 | 65 | 66 | INT32 MCUSysInit(struct _RTMP_ADAPTER *pAd); 67 | INT32 MCUSysExit(struct _RTMP_ADAPTER *pAd); 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/mlme_sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | 6 | #include "rtmp_type.h" 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/mt_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | mt_io.h 15 | */ 16 | 17 | #ifndef __MT_WIFI_IO_H__ 18 | #define __MT_WIFI_IO_H__ 19 | 20 | struct _RTMP_ADAPTER; 21 | 22 | UINT32 mt_physical_addr_map(struct _RTMP_ADAPTER *pAd, UINT32 addr); 23 | BOOLEAN mt_mac_cr_range_mapping(struct _RTMP_ADAPTER *pAd, UINT32 *mac_addr); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/netif_block.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __NET_IF_BLOCK_H__ 3 | #define __NET_IF_BLOCK_H__ 4 | 5 | #include "common/link_list.h" 6 | #include "rtmp.h" 7 | 8 | #define FREE_NETIF_POOL_SIZE 32 9 | 10 | typedef struct _NETIF_ENTRY 11 | { 12 | struct _NETIF_ENTRY *pNext; 13 | PNET_DEV pNetDev; 14 | } NETIF_ENTRY, *PNETIF_ENTRY; 15 | 16 | void initblockQueueTab( 17 | IN PRTMP_ADAPTER pAd); 18 | 19 | BOOLEAN blockNetIf( 20 | IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry, 21 | IN PNET_DEV pNetDev); 22 | 23 | VOID releaseNetIf( 24 | IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry); 25 | 26 | VOID StopNetIfQueue( 27 | IN PRTMP_ADAPTER pAd, 28 | IN UCHAR QueIdx, 29 | IN PNDIS_PACKET pPacket); 30 | #endif /* __NET_IF_BLOCK_H__ */ 31 | 32 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/nfc.h: -------------------------------------------------------------------------------- 1 | #ifndef __WSC_NFC_H__ 2 | #define __WSC_NFC_H__ 3 | 4 | VOID NfcParseRspCommand( 5 | IN PRTMP_ADAPTER pAd, 6 | IN PUCHAR pData, 7 | IN USHORT DataLen); 8 | 9 | VOID NfcCommand( 10 | IN PRTMP_ADAPTER pAd, 11 | IN UCHAR Action, 12 | IN UCHAR Type, 13 | IN SHORT DataLen, 14 | IN PUCHAR pData); 15 | 16 | VOID NfcGenRandomPasswd( 17 | IN PRTMP_ADAPTER pAd, 18 | IN PWSC_CTRL pWscCtrl); 19 | 20 | INT NfcBuildWscProfileTLV( 21 | IN PRTMP_ADAPTER pAd, 22 | IN PWSC_CTRL pWscCtrl, 23 | OUT UCHAR *pbuf, 24 | OUT USHORT *pBufLen); 25 | 26 | INT NfcBuildOOBDevPasswdTLV( 27 | IN PRTMP_ADAPTER pAd, 28 | IN PWSC_CTRL pWscCtrl, 29 | IN UCHAR HandoverType, 30 | OUT UCHAR *pbuf, 31 | OUT USHORT *pBufLen); 32 | 33 | INT Set_NfcStatus_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 34 | 35 | INT Set_NfcPasswdToken_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 36 | 37 | INT Set_NfcConfigurationToken_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 38 | 39 | INT Get_NfcStatus_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 40 | 41 | INT Set_DoWpsByNFC_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 42 | 43 | INT Set_NfcRegenPK_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 44 | 45 | 46 | #endif /* __WSC_NFC_H__ */ 47 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/rls.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | rls.h 15 | */ 16 | 17 | #ifndef __RLS_H__ 18 | #define __RLS_H__ 19 | 20 | #ifdef RADIO_LINK_SELECTION 21 | 22 | /* ioctl */ 23 | INT Show_Rls_Info(PRTMP_ADAPTER pAd, RTMP_STRING *arg); 24 | INT Set_Rls_Period(PRTMP_ADAPTER pAd, RTMP_STRING *arg); 25 | 26 | 27 | INT Rls_Init(PRTMP_ADAPTER pAd); 28 | INT Rls_TableInit(PRTMP_ADAPTER pAd, PRLS_CLI_TABLE table); 29 | INT Rls_Release(PRTMP_ADAPTER pAd); 30 | INT Rls_TableRelease(PRTMP_ADAPTER pAd, PRLS_CLI_TABLE table); 31 | INT Rls_InfCliLinkDown(PRTMP_ADAPTER pAd, struct wifi_dev *wdev); 32 | INT Rls_InfCliLinkUp(PRTMP_ADAPTER pAd, struct wifi_dev *wdev); 33 | INT Set_Rls_Enable(PRTMP_ADAPTER pAd,RTMP_STRING * arg); 34 | 35 | INT Rls_SetInfInfo(PRTMP_ADAPTER pAd, BOOLEAN bInfReady, struct wifi_dev *wdev); 36 | void Rls_UpdateTableChannel(PRTMP_ADAPTER pAd, INT old_channel, INT new_channel); 37 | void Rls_UpdateDevOpMode(PRTMP_ADAPTER pAd, BOOLEAN enable, struct wifi_dev *wdev); 38 | 39 | INT Rls_MsgHandlePro(PRTMP_ADAPTER pAd, RTMP_IOCTL_INPUT_STRUCT *wrq); 40 | 41 | #define RLS_MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, _Level, _Fmt) MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, _Level, _Fmt) 42 | 43 | #endif /* RADIO_LINK_SELECTION */ 44 | #endif /* __RLS_H__ */ 45 | 46 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/rt_cal.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2009, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | cmm_rf_cal.c 20 | 21 | Abstract: 22 | RF calibration and profile related functions 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | Arvin Tai 2012/05/02 28 | */ 29 | 30 | #define DPD_CAL_PASS_THRES 5 31 | #define DPD_CAL_MAX_RETRY 5 32 | 33 | INT32 CalcRCalibrationCode( 34 | IN PRTMP_ADAPTER pAd, 35 | IN INT32 D1, 36 | IN INT32 D2); 37 | 38 | INT Set_TestRxIQCalibration_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 39 | 40 | VOID R_Calibration( 41 | IN PRTMP_ADAPTER pAd); 42 | 43 | VOID RtmpKickOutHwNullFrame( 44 | IN PRTMP_ADAPTER pAd, 45 | IN BOOLEAN bPrepareContent, 46 | IN BOOLEAN bTransmit); 47 | 48 | VOID DPD_IQ_Swap_AM_PM_Inversion( 49 | IN PRTMP_ADAPTER pAd, 50 | IN UCHAR AntIdx); 51 | 52 | VOID DPD_AM_AM_LUT_Scaling( 53 | IN PRTMP_ADAPTER pAd, 54 | IN UCHAR AntIdx); 55 | 56 | UCHAR DPD_Calibration( 57 | IN PRTMP_ADAPTER pAd, 58 | IN UCHAR AntIdx); 59 | 60 | VOID DoDPDCalibration( 61 | IN PRTMP_ADAPTER pAd); 62 | 63 | INT Set_DPDCalPassThres_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 64 | 65 | INT Set_TestDPDCalibration_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 66 | 67 | INT Set_TestDPDCalibrationTX0_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 68 | 69 | INT Set_TestDPDCalibrationTX1_Proc(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 70 | 71 | VOID LOFT_IQ_Calibration( 72 | IN RTMP_ADAPTER *pAd); 73 | 74 | BOOLEAN BW_Filter_Calibration( 75 | IN PRTMP_ADAPTER pAd, 76 | IN BOOLEAN bTxCal); 77 | 78 | VOID RxDCOC_Calibration( 79 | IN PRTMP_ADAPTER pAd); 80 | 81 | VOID RXIQ_Calibration( 82 | IN PRTMP_ADAPTER pAd); 83 | 84 | VOID RF_SELF_TXDC_CAL( 85 | IN PRTMP_ADAPTER pAd); 86 | 87 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/rt_udma.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Module Name: 4 | rt_udma.h 5 | 6 | Abstract: 7 | For Puma6 UDMA implementation. 8 | 9 | Revision History: 10 | Who When What 11 | --------- ---------- ---------------------------------------------- 12 | Anjan Chanda 05-05-2015 Initial creation 13 | 14 | ***************************************************************************/ 15 | 16 | #ifndef __RT_UDMA_H__ 17 | #define __RT_UDMA_H__ 18 | 19 | int mt_udma_pkt_send(VOID *ctx, PNDIS_PACKET pRxPkt); 20 | 21 | int mt_udma_register(VOID *pAd, PNET_DEV main_dev_p); 22 | int mt_udma_unregister(VOID *pAd); 23 | 24 | 25 | #endif /* __RT_UDMA_H__ */ 26 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/rtmp_dmacb.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTMP_DMACB_H__ 2 | #define __RTMP_DMACB_H__ 3 | 4 | /* 5 | Data buffer for DMA operation, the buffer must be contiguous physical memory 6 | Both DMA to / from CPU use the same structure. 7 | */ 8 | typedef struct _RTMP_DMABUF { 9 | ULONG AllocSize; 10 | PVOID AllocVa; /* TxBuf virtual address */ 11 | NDIS_PHYSICAL_ADDRESS AllocPa; /* TxBuf physical address */ 12 | } RTMP_DMABUF, *PRTMP_DMABUF; 13 | 14 | /* 15 | Control block (Descriptor) for all ring descriptor DMA operation, buffer must be 16 | contiguous physical memory. NDIS_PACKET stored the binding Rx packet descriptor 17 | which won't be released, driver has to wait until upper layer return the packet 18 | before giveing up this rx ring descriptor to ASIC. NDIS_BUFFER is assocaited pair 19 | to describe the packet buffer. For Tx, NDIS_PACKET stored the tx packet descriptor 20 | which driver should ACK upper layer when the tx is physically done or failed. 21 | */ 22 | typedef struct _RTMP_DMACB { 23 | ULONG AllocSize; /* Control block size */ 24 | PVOID AllocVa; /* Control block virtual address */ 25 | NDIS_PHYSICAL_ADDRESS AllocPa; /* Control block physical address */ 26 | PNDIS_PACKET pNdisPacket; 27 | PNDIS_PACKET pNextNdisPacket; 28 | NDIS_PHYSICAL_ADDRESS PacketPa; 29 | 30 | RTMP_DMABUF DmaBuf; /* Associated DMA buffer structure */ 31 | #ifdef CACHE_LINE_32B 32 | RXD_STRUC LastBDInfo; 33 | #endif /* CACHE_LINE_32B */ 34 | 35 | #ifdef CUT_THROUGH 36 | UINT16 token_id; 37 | #endif /* CUT_THROUGH */ 38 | } RTMP_DMACB, *PRTMP_DMACB; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/rtmp_iface.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | rt_iface.h 18 | 19 | Abstract: 20 | 21 | Revision History: 22 | Who When What 23 | --------- ---------- ---------------------------------------------- 24 | */ 25 | 26 | #ifndef __RTMP_IFACE_H__ 27 | #define __RTMP_IFACE_H__ 28 | 29 | #ifdef RTMP_PCI_SUPPORT 30 | #include "iface/rtmp_pci.h" 31 | #endif /* RTMP_PCI_SUPPORT */ 32 | 33 | 34 | 35 | 36 | 37 | typedef struct _INF_PCI_CONFIG_ { 38 | unsigned long CSRBaseAddress; /* PCI MMIO Base Address, all access will use */ 39 | unsigned int irq_num; 40 | } INF_PCI_CONFIG; 41 | 42 | typedef struct _INF_USB_CONFIG_ { 43 | unsigned char BulkInEpAddr; /* bulk-in endpoint address */ 44 | unsigned char BulkOutEpAddr[6]; /* bulk-out endpoint address */ 45 | } INF_USB_CONFIG; 46 | 47 | typedef struct _INF_RBUS_CONFIG_ { 48 | unsigned long csr_addr; 49 | unsigned int irq; 50 | } INF_RBUS_CONFIG; 51 | 52 | 53 | typedef union _RTMP_INF_CONFIG_ { 54 | struct _INF_PCI_CONFIG_ pciConfig; 55 | struct _INF_USB_CONFIG_ usbConfig; 56 | struct _INF_RBUS_CONFIG_ rbusConfig; 57 | } RTMP_INF_CONFIG; 58 | 59 | #endif /* __RTMP_IFACE_H__ */ 60 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/rtmp_osabl.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Module Name: 4 | OS/rtmp_osabl.h 5 | 6 | Abstract: 7 | Some structure/definitions for OS ABL function. 8 | 9 | Revision History: 10 | Who When What 11 | --------- ---------- ---------------------------------------------- 12 | 13 | ***************************************************************************/ 14 | 15 | #ifndef __RTMP_OS_ABL_H__ 16 | #define __RTMP_OS_ABL_H__ 17 | 18 | #ifdef OS_ABL_FUNC_SUPPORT 19 | 20 | #ifdef OS_ABL_OS_PCI_SUPPORT 21 | #ifndef RTMP_MAC_PCI 22 | #define RTMP_MAC_PCI 23 | #endif /* RTMP_MAC_PCI */ 24 | #ifndef RTMP_PCI_SUPPORT 25 | #define RTMP_PCI_SUPPORT 26 | #endif /* RTMP_PCI_SUPPORT */ 27 | #endif /* OS_ABL_OS_PCI_SUPPORT */ 28 | 29 | #ifdef OS_ABL_OS_USB_SUPPORT 30 | #include 31 | 32 | #define RTMP_MAC_USB 33 | #define RTMP_USB_SUPPORT 34 | #endif /* OS_ABL_OS_USB_SUPPORT */ 35 | 36 | #ifdef OS_ABL_OS_RBUS_SUPPORT 37 | #define RTMP_RBUS_SUPPORT 38 | #endif /* OS_ABL_OS_RBUS_SUPPORT */ 39 | 40 | #ifdef OS_ABL_OS_AP_SUPPORT 41 | #ifndef CONFIG_AP_SUPPORT 42 | #define CONFIG_AP_SUPPORT 43 | #endif /* CONFIG_AP_SUPPORT */ 44 | #endif /* OS_ABL_OS_AP_SUPPORT */ 45 | 46 | #ifdef OS_ABL_OS_STA_SUPPORT 47 | #define CONFIG_STA_SUPPORT 48 | #endif /* OS_ABL_OS_STA_SUPPORT */ 49 | 50 | /* AP & STA con-current */ 51 | #undef RT_CONFIG_IF_OPMODE_ON_AP 52 | #undef RT_CONFIG_IF_OPMODE_ON_STA 53 | 54 | #if defined(CONFIG_AP_SUPPORT) && defined(CONFIG_STA_SUPPORT) 55 | #define RT_CONFIG_IF_OPMODE_ON_AP(__OpMode) if (__OpMode == OPMODE_AP) 56 | #define RT_CONFIG_IF_OPMODE_ON_STA(__OpMode) if (__OpMode == OPMODE_STA) 57 | #else 58 | #define RT_CONFIG_IF_OPMODE_ON_AP(__OpMode) 59 | #define RT_CONFIG_IF_OPMODE_ON_STA(__OpMode) 60 | #endif 61 | 62 | #endif /* OS_ABL_FUNC_SUPPORT */ 63 | 64 | #endif /* __RTMP_OS_ABL_H__ */ 65 | 66 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/security/crypt_arc4.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | Module Name: 17 | RC4 18 | 19 | Abstract: 20 | 21 | Revision History: 22 | Who When What 23 | -------- ---------- ------------------------------------------ 24 | Eddy 2009/05/13 ARC4 25 | ***************************************************************************/ 26 | 27 | #ifndef __CRYPT_ARC4_H__ 28 | #define __CRYPT_ARC4_H__ 29 | 30 | #include "rt_config.h" 31 | 32 | /* ARC4 definition & structure */ 33 | #define ARC4_KEY_BLOCK_SIZE 256 34 | 35 | typedef struct { 36 | UINT BlockIndex1; 37 | UINT BlockIndex2; 38 | UINT8 KeyBlock[256]; 39 | } ARC4_CTX_STRUC, *PARC4_CTX_STRUC; 40 | 41 | /* ARC4 operations */ 42 | VOID ARC4_INIT( 43 | IN ARC4_CTX_STRUC * pARC4_CTX, 44 | IN PUCHAR pKey, 45 | IN UINT KeyLength); 46 | 47 | VOID ARC4_Compute( 48 | IN ARC4_CTX_STRUC * pARC4_CTX, 49 | IN UINT8 InputBlock[], 50 | IN UINT InputBlockSize, 51 | OUT UINT8 OutputBlock[]); 52 | 53 | VOID ARC4_Discard_KeyLength( 54 | IN ARC4_CTX_STRUC * pARC4_CTX, 55 | IN UINT Length); 56 | 57 | #endif /* __CRYPT_ARC4_H__ */ 58 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/security/crypt_dh.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | Module Name: 17 | DH 18 | 19 | Abstract: 20 | RFC 2631: Diffie-Hellman Key Agreement Method 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ------------------------------------------ 25 | Eddy 2009/01/21 Create Diffie-Hellman, Montgomery Algorithm 26 | ***************************************************************************/ 27 | 28 | #ifndef __CRYPT_DH_H__ 29 | #define __CRYPT_DH_H__ 30 | 31 | #include "rt_config.h" 32 | 33 | 34 | /* DH operations */ 35 | void DH_PublicKey_Generate ( 36 | IN UINT8 GValue[], 37 | IN UINT GValueLength, 38 | IN UINT8 PValue[], 39 | IN UINT PValueLength, 40 | IN UINT8 PrivateKey[], 41 | IN UINT PrivateKeyLength, 42 | OUT UINT8 PublicKey[], 43 | INOUT UINT *PublicKeyLength); 44 | 45 | void DH_SecretKey_Generate ( 46 | IN UINT8 PublicKey[], 47 | IN UINT PublicKeyLength, 48 | IN UINT8 PValue[], 49 | IN UINT PValueLength, 50 | IN UINT8 PrivateKey[], 51 | IN UINT PrivateKeyLength, 52 | OUT UINT8 SecretKey[], 53 | INOUT UINT *SecretKeyLength); 54 | 55 | #define RT_DH_PublicKey_Generate(GK, GKL, PV, PVL, PriK, PriKL, PubK, PubKL) \ 56 | DH_PublicKey_Generate((GK), (GKL), (PV), (PVL), (PriK), (PriKL), (UINT8 *) (PubK), (UINT *) (PubKL)) 57 | 58 | #define RT_DH_SecretKey_Generate(PubK, PubKL, PV, PVL, PriK, PriKL, SecK, SecKL) \ 59 | DH_SecretKey_Generate((PubK), (PubKL), (PV), (PVL), (PriK), (PriKL), (UINT8 *) (SecK), (UINT *) (SecKL)) 60 | 61 | #define RT_DH_FREE_ALL() 62 | 63 | 64 | #endif /* __CRYPT_DH_H__ */ 65 | 66 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/security/crypt_hmac.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | Module Name: 17 | HMAC 18 | 19 | Abstract: 20 | FIPS 198: The Keyed-Hash Message Authentication Code (HMAC) 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ------------------------------------------ 25 | Eddy 2008/11/24 Create HMAC-SHA1, HMAC-SHA256 26 | ***************************************************************************/ 27 | 28 | #ifndef __CRYPT_HMAC_H__ 29 | #define __CRYPT_HMAC_H__ 30 | 31 | #include "rt_config.h" 32 | 33 | 34 | #ifdef SHA1_SUPPORT 35 | #define HMAC_SHA1_SUPPORT 36 | VOID RT_HMAC_SHA1( 37 | IN const UINT8 Key[], 38 | IN UINT KeyLen, 39 | IN const UINT8 Message[], 40 | IN UINT MessageLen, 41 | OUT UINT8 MAC[], 42 | IN UINT MACLen); 43 | #endif /* SHA1_SUPPORT */ 44 | 45 | #ifdef SHA256_SUPPORT 46 | #define HMAC_SHA256_SUPPORT 47 | VOID RT_HMAC_SHA256( 48 | IN const UINT8 Key[], 49 | IN UINT KeyLen, 50 | IN const UINT8 Message[], 51 | IN UINT MessageLen, 52 | OUT UINT8 MAC[], 53 | IN UINT MACLen); 54 | #endif /* SHA256_SUPPORT */ 55 | 56 | #ifdef MD5_SUPPORT 57 | #define HMAC_MD5_SUPPORT 58 | VOID RT_HMAC_MD5( 59 | IN const UINT8 Key[], 60 | IN UINT KeyLen, 61 | IN const UINT8 Message[], 62 | IN UINT MessageLen, 63 | OUT UINT8 MAC[], 64 | IN UINT MACLen); 65 | #endif /* MD5_SUPPORT */ 66 | 67 | 68 | #endif /* __CRYPT_HMAC_H__ */ 69 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/security/crypt_md5.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | Module Name: 17 | MD5 18 | 19 | Abstract: 20 | RFC1321: The MD5 Message-Digest Algorithm 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ------------------------------------------ 25 | Eddy 2008/11/24 Create md5 26 | ***************************************************************************/ 27 | 28 | #ifndef __CRYPT_MD5_H__ 29 | #define __CRYPT_MD5_H__ 30 | 31 | 32 | /* Algorithm options */ 33 | #define MD5_SUPPORT 34 | 35 | #ifdef MD5_SUPPORT 36 | #define MD5_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ 37 | #define MD5_DIGEST_SIZE 16 /* 128 bits = 16 bytes */ 38 | typedef struct { 39 | UINT32 HashValue[4]; 40 | UINT64 MessageLen; 41 | UINT8 Block[MD5_BLOCK_SIZE]; 42 | UINT BlockLen; 43 | } MD5_CTX_STRUC, *PMD5_CTX_STRUC; 44 | 45 | VOID RT_MD5_Init( 46 | IN MD5_CTX_STRUC * pMD5_CTX); 47 | VOID RT_MD5_Hash( 48 | IN MD5_CTX_STRUC * pMD5_CTX); 49 | VOID RT_MD5_Append( 50 | IN MD5_CTX_STRUC * pMD5_CTX, 51 | IN const UINT8 Message[], 52 | IN UINT MessageLen); 53 | VOID RT_MD5_End( 54 | IN MD5_CTX_STRUC * pMD5_CTX, 55 | OUT UINT8 DigestMessage[]); 56 | VOID RT_MD5( 57 | IN const UINT8 Message[], 58 | IN UINT MessageLen, 59 | OUT UINT8 DigestMessage[]); 60 | #endif /* MD5_SUPPORT */ 61 | 62 | 63 | #endif /* __CRYPT_MD5_H__ */ 64 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/security/dh_key.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef HEADER_DH_KEY_H 3 | #define HEADER_DH_KEY_H 4 | 5 | #define NN_DIGIT_BITS 32 6 | #define DH_KEY_LEN 192 7 | #define NN_DIGIT_LEN 4 8 | #define MAX_NN_DIGITS 49 9 | 10 | extern void GenerateDHPublicKey(unsigned char *memPtr, unsigned char *ran_buf, int ran_len, 11 | unsigned char *dhkey, int *dhkey_len); 12 | 13 | extern void GenerateDHSecreteKey(unsigned char *memPtr, unsigned char *ran_buf, int ran_len, 14 | unsigned char *peer_dhkey, int peer_dhkey_len, 15 | unsigned char *secrete_dhkey, int *secrete_dhkey_len); 16 | 17 | extern void DH_freeall(void); 18 | 19 | #endif /*HEADER_DH_KEY_H */ 20 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/security/wapi_sms4.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* SMS4 encryption/decryption definition */ 4 | /* Parameter : */ 5 | /* Input - the incoming message packet */ 6 | /* Ouput - the result ouput */ 7 | /* rk - key */ 8 | void SMS4Crypt(unsigned char *Input, unsigned char *Output, unsigned int *rk); 9 | 10 | /* SMS4 key extend algorithm */ 11 | void SMS4KeyExt(unsigned char *Key, unsigned int *rk, unsigned int CryptFlag); 12 | 13 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/sta_cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2009, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | sta_cfg.h 20 | 21 | Abstract: 22 | 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | 28 | */ 29 | 30 | #ifndef __STA_CFG_H__ 31 | #define __STA_CFG_H__ 32 | 33 | INT RTMPSTAPrivIoctlSet( 34 | IN RTMP_ADAPTER *pAd, 35 | IN RTMP_STRING *SetProcName, 36 | IN RTMP_STRING *ProcArg); 37 | 38 | #if (defined(WOW_SUPPORT) && defined(RTMP_MAC_USB)) || defined(NEW_WOW_SUPPORT) || defined(MT_WOW_SUPPORT) 39 | /* set WOW enable */ 40 | INT Set_WOW_Enable(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 41 | /* set GPIO pin for wake-up signal */ 42 | INT Set_WOW_GPIO(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 43 | /* set delay time for WOW really enable */ 44 | INT Set_WOW_Delay(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 45 | /* set wake up hold time */ 46 | INT Set_WOW_Hold(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 47 | /* set wakeup signal type */ 48 | INT Set_WOW_InBand(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 49 | /* set wakeup interface */ 50 | INT Set_WOW_Interface(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 51 | /* set wow if down support */ 52 | INT Set_WOW_IfDown_Support(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 53 | /* set IPAdress for ARP response */ 54 | INT Set_WOW_IPAddress(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 55 | /* set wakeup GPIO High Low */ 56 | INT Set_WOW_GPIOHighLow(RTMP_ADAPTER *pAd, RTMP_STRING *arg); 57 | #endif /* (defined(WOW_SUPPORT) && defined(RTMP_MAC_USB)) || defined(NEW_WOW_SUPPORT) || defined(MT_WOW_SUPPORT) */ 58 | 59 | 60 | #endif /* __STA_CFG_H__ */ 61 | 62 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/tx_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | 20 | Abstract: 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | */ 26 | #ifndef __TX_PWR_H__ 27 | #define __TX_PWR_H__ 28 | 29 | #ifdef MT_MAC 30 | #include "eeprom/mt_tx_pwr.h" 31 | #endif 32 | 33 | #define DEFAULT_BO 4 34 | #define LIN2DB_ERROR_CODE (-10000) 35 | 36 | #define G_BAND_LOW 0 37 | #define G_BAND_MID 1 38 | #define G_BAND_HI 2 39 | 40 | #define A_BAND_LOW 0 41 | #define A_BAND_HI 1 42 | 43 | #ifdef SINGLE_SKU_V2 44 | #define SKU_PHYMODE_CCK_1M_2M 0 45 | #define SKU_PHYMODE_CCK_5M_11M 1 46 | #define SKU_PHYMODE_OFDM_6M_9M 2 47 | #define SKU_PHYMODE_OFDM_12M_18M 3 48 | #define SKU_PHYMODE_OFDM_24M_36M 4 49 | #define SKU_PHYMODE_OFDM_48M_54M 5 50 | #define SKU_PHYMODE_HT_MCS0_MCS1 6 51 | #define SKU_PHYMODE_HT_MCS2_MCS3 7 52 | #define SKU_PHYMODE_HT_MCS4_MCS5 8 53 | #define SKU_PHYMODE_HT_MCS6_MCS7 9 54 | #define SKU_PHYMODE_HT_MCS8_MCS9 10 55 | #define SKU_PHYMODE_HT_MCS10_MCS11 11 56 | #define SKU_PHYMODE_HT_MCS12_MCS13 12 57 | #define SKU_PHYMODE_HT_MCS14_MCS15 13 58 | #define SKU_PHYMODE_STBC_MCS0_MCS1 14 59 | #define SKU_PHYMODE_STBC_MCS2_MCS3 15 60 | #define SKU_PHYMODE_STBC_MCS4_MCS5 16 61 | #define SKU_PHYMODE_STBC_MCS6_MCS7 17 62 | #endif /* SINGLE_SKU_V2 */ 63 | 64 | VOID LoadTssiInfoFromEEPROM(struct _RTMP_ADAPTER *pAd); 65 | INT32 get_low_mid_hi_index(UINT8 Channel); 66 | #ifdef RTMP_INTERNAL_TX_ALC 67 | INT16 MT76xx_lin2dBd( 68 | IN UINT16 linearValue); 69 | #endif /* RTMP_INTERNAL_TX_ALC */ 70 | #endif /* __TX_PWR_H__ */ 71 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/vendor.h: -------------------------------------------------------------------------------- 1 | 2 | struct _RTMP_ADAPTER; 3 | 4 | #define RALINK_IE_LEN 0x9 5 | #define MEDIATEK_IE_LEN 0x9 6 | 7 | #define RALINK_AGG_CAP (1 << 0) 8 | #define RALINK_PIGGY_CAP (1 << 1) 9 | #define RALINK_RDG_CAP (1 << 2) 10 | #define RALINK_256QAM_CAP (1 << 3) 11 | 12 | #define MEDIATEK_256QAM_CAP (1 << 3) 13 | #ifdef WH_EZ_SETUP 14 | #define MEDIATEK_EASY_SETUP (1 << 6) 15 | #endif 16 | #ifdef MWDS 17 | #define MEDIATEK_MWDS_CAP (1 << 7) 18 | #endif 19 | #define BROADCOM_256QAM_CAP (1 << 0) 20 | 21 | #ifdef STA_FORCE_ROAM_SUPPORT 22 | #define MEDIATEK_CLI_ENTRY (1 << 4) 23 | #endif 24 | 25 | typedef struct GNU_PACKED _ie_hdr { 26 | UCHAR eid; 27 | UINT8 len; 28 | } IE_HEADER; 29 | 30 | 31 | struct GNU_PACKED _ralink_ie { 32 | IE_HEADER ie_hdr; 33 | UCHAR oui[3]; 34 | UCHAR cap0; 35 | UCHAR cap1; 36 | UCHAR cap2; 37 | UCHAR cap3; 38 | }; 39 | 40 | 41 | typedef struct GNU_PACKED _vht_cap_ie { 42 | IE_HEADER ie_hdr; 43 | UCHAR vht_cap_info[4]; 44 | UCHAR support_vht_mcs_nss[8]; 45 | } VHT_CAP; 46 | 47 | 48 | typedef struct GNU_PACKED _vht_op_ie { 49 | IE_HEADER ie_hdr; 50 | UCHAR vht_op_info[3]; 51 | UCHAR basic_vht_mcs_nss[2]; 52 | } VHT_OP; 53 | 54 | 55 | typedef struct GNU_PACKED _vht_tx_pwr_env_ie { 56 | IE_HEADER ie_hdr; 57 | UCHAR tx_pwr_info; 58 | UCHAR local_max_txpwr_20Mhz; 59 | UCHAR local_max_txpwr_40Mhz; 60 | } VHT_TX_PWR_ENV; 61 | 62 | 63 | struct GNU_PACKED _mediatek_ie { 64 | IE_HEADER ie_hdr; 65 | UCHAR oui[3]; 66 | UCHAR cap0; 67 | UCHAR cap1; 68 | UCHAR cap2; 69 | UCHAR cap3; 70 | }; 71 | 72 | 73 | struct GNU_PACKED _mediatek_vht_ie { 74 | VHT_CAP vht_cap; 75 | VHT_OP vht_op; 76 | VHT_TX_PWR_ENV vht_txpwr_env; 77 | }; 78 | 79 | 80 | struct GNU_PACKED _broadcom_ie { 81 | IE_HEADER ie_hdr; 82 | UCHAR oui[3]; 83 | UCHAR fixed_pattern[2]; 84 | VHT_CAP vht_cap; 85 | VHT_OP vht_op; 86 | VHT_TX_PWR_ENV vht_txpwr_env; 87 | }; 88 | 89 | 90 | ULONG build_vendor_ie(struct _RTMP_ADAPTER *pAd, 91 | struct wifi_dev *wdev, UCHAR *frame_buffer 92 | #ifdef WH_EZ_SETUP 93 | , UCHAR SubType 94 | #endif 95 | ); 96 | 97 | VOID check_vendor_ie(struct _RTMP_ADAPTER *pAd, 98 | UCHAR *ie_buffer, struct _vendor_ie_cap *vendor_ie); 99 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/video.h: -------------------------------------------------------------------------------- 1 | #ifdef VIDEO_TURBINE_SUPPORT 2 | extern AP_VIDEO_STRUCT GLOBAL_AP_VIDEO_CONFIG; 3 | 4 | VOID VideoModeUpdate(IN PRTMP_ADAPTER pAd); 5 | VOID VideoModeDynamicTune(IN PRTMP_ADAPTER pAd); 6 | UINT32 GetAsicDefaultRetry(IN PRTMP_ADAPTER pAd); 7 | UCHAR GetAsicDefaultTxBA(IN PRTMP_ADAPTER pAd); 8 | UINT32 GetAsicVideoRetry(IN PRTMP_ADAPTER pAd); 9 | UCHAR GetAsicVideoTxBA(IN PRTMP_ADAPTER pAd); 10 | VOID VideoConfigInit(IN PRTMP_ADAPTER pAd); 11 | #endif /* VIDEO_TURBINE_SUPPORT */ 12 | 13 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/vr_ikans.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | vr_ikans.h 18 | 19 | Abstract: 20 | Only for IKANOS Vx160 or Vx180 platform. 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | Sample Lin 01-28-2008 Created 26 | 27 | */ 28 | 29 | #ifndef __VR_IKANS_H__ 30 | #define __VR_IKANS_H__ 31 | 32 | #ifndef MODULE_IKANOS 33 | #define IKANOS_EXTERN extern 34 | #else 35 | #define IKANOS_EXTERN 36 | #endif /* MODULE_IKANOS */ 37 | 38 | #ifdef IKANOS_VX_1X0 39 | typedef void (*IkanosWlanTxCbFuncP)(void *, void *); 40 | 41 | struct IKANOS_TX_INFO 42 | { 43 | struct net_device *netdev; 44 | IkanosWlanTxCbFuncP *fp; 45 | }; 46 | #endif /* IKANOS_VX_1X0 */ 47 | 48 | 49 | IKANOS_EXTERN void VR_IKANOS_FP_Init(UINT8 BssNum, UINT8 *pApMac); 50 | 51 | IKANOS_EXTERN INT32 IKANOS_DataFramesTx(struct sk_buff *pSkb, 52 | struct net_device *pNetDev); 53 | 54 | IKANOS_EXTERN void IKANOS_DataFrameRx(PRTMP_ADAPTER pAd, 55 | struct sk_buff *pSkb); 56 | 57 | #endif /* __VR_IKANS_H__ */ 58 | 59 | /* End of vr_ikans.h */ 60 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/vrut_ubm.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2010, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | 17 | Abstract: 18 | 19 | All Related Structure & Definition for UBICOM platform. 20 | 21 | Only used in UTIL module. 22 | 23 | ***************************************************************************/ 24 | 25 | #ifndef __VR_UBICOM_H__ 26 | #define __VR_UBICOM_H__ 27 | 28 | #ifdef PLATFORM_UBM_IPX8 29 | 30 | #include 31 | 32 | #undef RTMP_UTIL_DCACHE_FLUSH 33 | #define RTMP_UTIL_DCACHE_FLUSH(__AddrStart, __Size) \ 34 | flush_dcache_range((ULONG)(__AddrStart), \ 35 | (ULONG)(((UCHAR *)(__AddrStart)) + __Size - 1)) 36 | 37 | #endif /* PLATFORM_UBM_IPX8 */ 38 | 39 | #endif /* __VR_UBICOM_H__ */ 40 | 41 | /* End of vrut_ubm.h */ 42 | 43 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/wlan_config/config_internal.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * MediaTek Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * 7 | * (c) Copyright 1997-2012, MediaTek, Inc. 8 | * 9 | * All rights reserved. MediaTek source code is an unpublished work and the 10 | * use of a copyright notice does not imply otherwise. This source code 11 | * contains confidential trade secret material of MediaTek. Any attemp 12 | * or participation in deciphering, decoding, reverse engineering or in any 13 | * way altering the source code is stricitly prohibited, unless the prior 14 | * written consent of MediaTek Technology, Inc. is obtained. 15 | *************************************************************************** 16 | 17 | */ 18 | 19 | #ifndef __CONFIG_INTERNAL_H__ 20 | #define __CONFIG_INTERNAL_H__ 21 | 22 | #include "mgmt/be_internal.h" 23 | 24 | /* 25 | * define struct constructor & deconstructor 26 | */ 27 | 28 | VOID phy_cfg_init(struct phy_cfg *obj); 29 | VOID phy_cfg_exit(struct phy_cfg *obj); 30 | 31 | /* 32 | *ht phy info related 33 | */ 34 | VOID ht_cfg_init(struct ht_cfg * obj); 35 | VOID ht_cfg_exit(struct ht_cfg * obj); 36 | 37 | /* 38 | *vht info related 39 | */ 40 | VOID vht_cfg_init(struct vht_cfg *obj); 41 | VOID vht_cfg_exit(struct vht_cfg *obj); 42 | 43 | /* 44 | * internal export configure loader 45 | */ 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/wnm_cmm.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2006, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | ***************************************************************************/ 17 | 18 | /**************************************************************************** 19 | Abstract: 20 | 21 | ***************************************************************************/ 22 | 23 | #ifndef __WNM_CONFIG_H__ 24 | #define __WNM_CONFIG_H__ 25 | 26 | #ifdef DOT11V_WNM_SUPPORT 27 | #include "rtmp_type.h" 28 | #include "dot11v_wnm.h" 29 | 30 | 31 | #define WNM_DEFAULT_QUIET_PERIOD 200 32 | 33 | 34 | typedef struct _WNM_CONFIG 35 | { 36 | BOOLEAN bDot11vWNM_BSSEnable; 37 | BOOLEAN bDot11vWNM_DMSEnable; 38 | BOOLEAN bDot11vWNM_FMSEnable; 39 | BOOLEAN bDot11vWNM_SleepModeEnable; 40 | BOOLEAN bDot11vWNM_TFSEnable; 41 | #ifdef CONFIG_AP_SUPPORT 42 | VOID *DMSEntry[10]; 43 | #endif /* CONFIG_AP_SUPPORT */ 44 | 45 | } WNM_CONFIG; 46 | 47 | 48 | 49 | #endif /* DOT11V_WNM_SUPPORT */ 50 | 51 | #endif /* __WNM_CONFIG_H__ */ 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/include/wsc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/include/wsc.h -------------------------------------------------------------------------------- /src/mt_wifi/embedded/mgmt/be_vht.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * MediaTek Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * 7 | * (c) Copyright 1997-2012, MediaTek, Inc. 8 | * 9 | * All rights reserved. MediaTek source code is an unpublished work and the 10 | * use of a copyright notice does not imply otherwise. This source code 11 | * contains confidential trade secret material of MediaTek. Any attemp 12 | * or participation in deciphering, decoding, reverse engineering or in any 13 | * way altering the source code is stricitly prohibited, unless the prior 14 | * written consent of MediaTek Technology, Inc. is obtained. 15 | *************************************************************************** 16 | 17 | */ 18 | 19 | #include "rt_config.h" 20 | #include "mgmt/be_internal.h" 21 | 22 | 23 | /* 24 | *vht phy related 25 | */ 26 | VOID vht_oper_init(struct vht_op *obj) 27 | { 28 | obj->vht_bw = VHT_BW_80; 29 | } 30 | 31 | VOID vht_oper_exit(struct vht_op *obj) 32 | { 33 | os_zero_mem(obj,sizeof(*obj)); 34 | } 35 | 36 | /* 37 | * internal used configure loader 38 | */ 39 | VOID config_loader_vht_bw(struct wifi_dev *wdev,struct wlan_config *cfg) 40 | { 41 | #ifdef WH_EZ_SETUP // Fix made to use VHT BW itself for configuration 42 | if(IS_EZ_SETUP_ENABLED(wdev)){ 43 | wlan_operate_set_vht_bw(wdev,cfg->vht_conf.vht_bw); 44 | } 45 | else{ 46 | #endif 47 | wlan_operate_set_vht_bw(wdev,cfg->ht_conf.ht_bw); 48 | #ifdef WH_EZ_SETUP 49 | } 50 | #endif 51 | 52 | } 53 | 54 | VOID operate_loader_vht_bw(struct wlan_operate *op) 55 | { 56 | operate_loader_bw(op); 57 | } 58 | 59 | /* 60 | * exported operation function. 61 | */ 62 | 63 | /* 64 | * Set 65 | */ 66 | INT32 wlan_operate_set_vht_bw(struct wifi_dev *wdev,UCHAR vht_bw) 67 | { 68 | struct wlan_operate *op = (struct wlan_operate*) wdev->wpf_op; 69 | UCHAR cap_vht_bw = wlan_config_get_vht_bw(wdev); 70 | INT32 ret = WLAN_OPER_OK; 71 | 72 | if(vht_bw > cap_vht_bw){ 73 | MTWF_LOG(DBG_CAT_CFG, DBG_SUBCAT_ALL, DBG_LVL_ERROR, 74 | ("%s(): new vht_bw:%d > cap_vht_bw: %d, correct to cap_vht_bw\n", 75 | __FUNCTION__, 76 | vht_bw, 77 | cap_vht_bw 78 | )); 79 | vht_bw = cap_vht_bw; 80 | ret = WLAN_OPER_FAIL; 81 | } 82 | 83 | op->vht_oper.vht_bw = vht_bw; 84 | /*configure loader*/ 85 | operate_loader_vht_bw(op); 86 | return ret; 87 | } 88 | 89 | /* 90 | * Get 91 | */ 92 | UCHAR wlan_operate_get_vht_bw(struct wifi_dev *wdev) 93 | { 94 | struct wlan_operate *op = (struct wlan_operate*)wdev->wpf_op; 95 | return op->vht_oper.vht_bw; 96 | } 97 | 98 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/mgmt/mgmt_hw.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | 20 | Abstract: 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | #include 28 | 29 | 30 | INT dev_adjust_radio(RTMP_ADAPTER *pAd) 31 | { 32 | struct hw_setting new_cfg, *hw_cfg = &pAd->hw_cfg; 33 | 34 | 35 | NdisZeroMemory(&new_cfg, sizeof(struct hw_setting)); 36 | 37 | 38 | /* For all wdev, find the maximum inter-set */ 39 | 40 | 41 | if (hw_cfg->bbp_bw != new_cfg.bbp_bw) 42 | { 43 | HcBbpSetBwByChannel(pAd,new_cfg.bbp_bw,new_cfg.cent_ch); 44 | hw_cfg->bbp_bw = new_cfg.bbp_bw; 45 | } 46 | 47 | if (hw_cfg->cent_ch != new_cfg.cent_ch) 48 | { 49 | UINT8 ext_ch = EXTCHA_NONE; 50 | 51 | bbp_set_ctrlch(pAd, ext_ch); 52 | AsicSetCtrlCh(pAd, ext_ch); 53 | } 54 | 55 | return TRUE; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/naf/cso.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | 20 | Abstract: 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/naf/net_acc.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | 20 | Abstract: 21 | Network Acceleration related function 22 | 23 | Revision History: 24 | Who When What 25 | -------- ---------- ---------------------------------------------- 26 | */ 27 | 28 | #include "rt_config.h" 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/naf/tso.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | 20 | Abstract: 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/security/cmm_aes.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/security/cmm_aes.c -------------------------------------------------------------------------------- /src/mt_wifi/embedded/security/cmm_wpa_adhoc.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | cmm_wpa_adhoc.c 20 | 21 | Abstract: 22 | 23 | Revision History: 24 | Who When What 25 | -------- ---------- ---------------------------------------------- 26 | */ 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/security/crypt_hmac.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/security/crypt_hmac.c -------------------------------------------------------------------------------- /src/mt_wifi/embedded/tools/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gcc -g bin2h.c -o bin2h 3 | clean: 4 | rm -f *.o bin2h 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/tools/bin2h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/embedded/tools/bin2h -------------------------------------------------------------------------------- /src/mt_wifi/embedded/tools/check_build_script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function showUsage(){ 4 | echo "##########################################################" 5 | echo "./check_build_script [ argument1 argument2 ]" 6 | echo "argument 1:" 7 | echo " shall be chip model, such as mt7615, mt7603e...." 8 | echo "" 9 | echo "argument 2:" 10 | echo " could be empty, it will auto build AP & STA mode." 11 | echo "otherwise, you could assign the mode you would like to build." 12 | echo "##########################################################" 13 | } 14 | 15 | function build(){ 16 | for modes in AP STA 17 | do 18 | if [ "$1" != "" ]; then 19 | if [ $1 = ${modes} ]; then 20 | echo "###### BUILD assign chip: ${chips}.... " 21 | echo "###### BUILD assign mode: ${modes} " 22 | sleep 2 23 | make WIFI_MODE=${modes} CHIPSET=${chips} clean 24 | make WIFI_MODE=${modes} CHIPSET=${chips} || { echo "######### WIFI_MODE=${modes}, CHIPSET=${chips} fail!!"; exit 1; } 25 | make WIFI_MODE=${modes} CHIPSET=${chips} clean 26 | else 27 | continue; 28 | fi 29 | else 30 | echo "###### BUILD chip: ${chips}.... " 31 | echo "###### Auto Build AP/STA mode to check.... " 32 | echo "###### BUILD mode now: ${modes} " 33 | sleep 2 34 | make WIFI_MODE=${modes} CHIPSET=${chips} clean 35 | make WIFI_MODE=${modes} CHIPSET=${chips} || { echo "######### WIFI_MODE=${modes}, CHIPSET=${chips} fail!!"; exit 1; } 36 | make WIFI_MODE=${modes} CHIPSET=${chips} clean 37 | echo "" 38 | fi 39 | done 40 | } 41 | 42 | for chips in mt7636s mt7636u mt7603e mt7603u mt7615 mt7637e mt7637u 43 | do 44 | if [ "$1" != "" ]; then 45 | if [ $1 = ${chips} ]; then 46 | build $2; 47 | else 48 | continue; 49 | fi 50 | else 51 | build; 52 | fi 53 | done 54 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/tools/plug_in/Makefile: -------------------------------------------------------------------------------- 1 | export MODULE_FLAGS 2 | 3 | KBUILD_EXTRA_SYMBOLS+= $(RT28xx_DIR)/os/linux/Module.symvers 4 | #CONFIG_PLUGIN_SOFTQ_STAT=m 5 | 6 | ifdef CONFIG_PLUGIN_SOFTQ_STAT 7 | obj-$(CONFIG_PLUGIN_SOFTQ_STAT) += softq_statistic/ 8 | MODULE_LIST+=softq_statistic 9 | endif 10 | 11 | #CONFIG_PLUGIN_CALIB_ROBUST_TEST=m 12 | 13 | ifdef CONFIG_PLUGIN_CALIB_ROBUST_TEST 14 | obj-$(CONFIG_PLUGIN_CALIB_ROBUST_TEST) += calib_robust_test/ 15 | MODULE_LIST+=calib_robust_test 16 | endif 17 | 18 | 19 | 20 | clean: 21 | find . -name "*.o" | xargs rm -rf 22 | find . -name "*.ko" | xargs rm -rf 23 | find . -name "modules.order" | xargs rm -rf 24 | find . -name "Module.symvers" | xargs rm -rf 25 | install: 26 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/tools/r.sh: -------------------------------------------------------------------------------- 1 | ifconfig ra0 down 2 | rmmod mt7603e_ap 3 | -------------------------------------------------------------------------------- /src/mt_wifi/embedded/tx_rx/hdr_trans.c: -------------------------------------------------------------------------------- 1 | #include "rt_config.h" 2 | 3 | 4 | #ifdef HDR_TRANS_SUPPORT 5 | 6 | 7 | #endif /* HDR_TRANS_SUPPORT */ 8 | 9 | -------------------------------------------------------------------------------- /src/mt_wifi/hw_ctrl/cmm_chip_rt.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | cmm_chip_rt.c 20 | 21 | Abstract: 22 | Functions used to communicate with ASIC 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #include "rt_config.h" 31 | 32 | 33 | 34 | 35 | INT rt_hif_sys_init(RTMP_ADAPTER *pAd) 36 | { 37 | #ifdef RTMP_MAC_PCI 38 | { 39 | /* pbf hardware reset, asic simulation sequence put this ahead before loading firmware */ 40 | if (pAd->chipCap.hif_type == HIF_RTMP || pAd->chipCap.hif_type == HIF_RLT) 41 | { 42 | RTMP_IO_WRITE32(pAd, WPDMA_RST_IDX, 0xffffffff /*0x1003f*/); 43 | 44 | { 45 | RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0xe1f); 46 | RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0xe00); 47 | } 48 | } 49 | AsicInitTxRxRing(pAd); 50 | } 51 | #endif /* RTMP_MAC_PCI */ 52 | return TRUE; 53 | } 54 | -------------------------------------------------------------------------------- /src/mt_wifi/hw_ctrl/coex.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | 20 | Abstract: 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | -------------------------------------------------------------------------------- /src/mt_wifi/include/common/module.h: -------------------------------------------------------------------------------- 1 | #ifndef __GROUP_H__ 2 | #define __GROUP_H__ 3 | 4 | /** 5 | * @defgroup wifi_dev_system Wi-Fi Core Device System 6 | * @authors shiang.tu jay.hung 7 | */ 8 | 9 | /** 10 | * @defgroup tx_rx_path Wi-Fi TX/RX 11 | * @authors shiang.tu jay.hung hugo.lee leonardo.wu 12 | */ 13 | 14 | /** 15 | * @defgroup lp Low Power/AP Power Saving 16 | * @authors eddy.tsai patrick.hsiao hanmin.hsu 17 | */ 18 | 19 | /** 20 | * @defgroup security Security 21 | * @authors eddy.tsai 22 | */ 23 | 24 | /** 25 | * @defgroup mcc MCC 26 | * @authors hanmin.hsu 27 | */ 28 | 29 | /** 30 | * @defgroup qa_ate QA/ATE 31 | * @authors yuchi.wang 32 | */ 33 | 34 | /** 35 | * @defgroup tmr TMR 36 | * @authors carter.chen 37 | */ 38 | 39 | /** 40 | * @defgroup ap AP feature 41 | * @authors carter.chen 42 | */ 43 | 44 | /** 45 | * @defgroup led LED 46 | * @authors woody.hung 47 | */ 48 | 49 | /** 50 | * @defgroup thermal_protect Thermal Protect 51 | * @authors star.chang 52 | */ 53 | 54 | /** 55 | * @defgroup efuse 56 | * @authors star.chang 57 | */ 58 | 59 | /** 60 | * @defgroup buffer_mode Buffer Mode 61 | * @authors star.chang 62 | */ 63 | 64 | /** 65 | * @defgroup wmm WMM 66 | * @authors eddy.tsai star.chang 67 | */ 68 | 69 | /** 70 | * @defgroup radio_mgt Radio Management 71 | * @authors star.chang 72 | */ 73 | 74 | /** 75 | * @defgroup sku SKU 76 | * @authors star.chang 77 | */ 78 | 79 | /** 80 | * @defgroup cr_io CR_IO 81 | * @authors star.chang 82 | */ 83 | 84 | /** 85 | * @defgroup auto_rate Auto Rate 86 | * @authors chungting.wu 87 | */ 88 | 89 | /** 90 | * @defgroup wtbl WTBL 91 | * @authors hanmin.hsu 92 | */ 93 | 94 | /** 95 | * @defgroup bss_dev_sta_info BSS Info/Device Info/STA Record 96 | * @authors jay.hung hanmin.hsu 97 | */ 98 | 99 | /** 100 | * @defgroup mcu_control MCU Control 101 | * @authors jay.hung hugo.lee leonardo.wu 102 | */ 103 | 104 | /** 105 | * @defgroup hif HIF 106 | * @authors jay.hung hugo.lee leonardo.wu 107 | */ 108 | 109 | /** 110 | * @defgroup dma_sch DMA scheduler 111 | * @authors eddy.tsai 112 | */ 113 | 114 | /** 115 | * @defgroup phy Phy operation 116 | * @authors 117 | */ 118 | 119 | /** 120 | * @defgroup pse PSE operation 121 | * @authors 122 | */ 123 | 124 | /** 125 | * @defgroup others Others 126 | * @authors 127 | */ 128 | 129 | /** 130 | * @defgroup embedded_ioctl Embedded IO Command 131 | * @authors 132 | * 133 | */ 134 | 135 | /** 136 | * @defgroup others Others 137 | * @authors 138 | */ 139 | 140 | #endif 141 | -------------------------------------------------------------------------------- /src/mt_wifi/include/hif/hif.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __HIF_H__ 3 | #define __HIF_H__ 4 | 5 | #if defined(RTMP_MAC) || defined(RTL_MAC) 6 | #ifdef RTMP_MAC_PCI 7 | #include "hif/rtmp_reg_pcirbs.h" 8 | #endif /* RTMP_MAC_PCI */ 9 | #endif /* defined(RTMP_MAC) || defined(RTL_MAC) */ 10 | 11 | #ifdef MT_MAC 12 | #ifdef RTMP_MAC_PCI 13 | #include "hif/mt_hif_pci.h" 14 | #include "mac/mac_mt/mt_mac_pci.h" 15 | #endif /* RTMP_MAC_PCI */ 16 | 17 | 18 | #endif /* MT_MAC */ 19 | 20 | 21 | typedef enum _RTMP_INF_TYPE_ 22 | { 23 | RTMP_DEV_INF_UNKNOWN = 0, 24 | RTMP_DEV_INF_PCI = 1, 25 | RTMP_DEV_INF_USB = 2, 26 | RTMP_DEV_INF_RBUS = 4, 27 | RTMP_DEV_INF_PCIE = 5, 28 | RTMP_DEV_INF_SDIO= 6, 29 | }RTMP_INF_TYPE; 30 | 31 | #define IS_SDIO_INF(_pAd) ((_pAd)->infType == RTMP_DEV_INF_SDIO) 32 | #define IS_USB_INF(_pAd) ((_pAd)->infType == RTMP_DEV_INF_USB) 33 | #define IS_USB3_INF(_pAd) ((IS_USB_INF(_pAd)) && ((_pAd)->BulkOutMaxPacketSize == 1024)) 34 | #define IS_PCIE_INF(_pAd) ((_pAd)->infType == RTMP_DEV_INF_PCIE) 35 | #define IS_PCI_INF(_pAd) (((_pAd)->infType == RTMP_DEV_INF_PCI) || IS_PCIE_INF(_pAd)) 36 | #define IS_PCI_ONLY_INF(_pAd) ((_pAd)->infType == RTMP_DEV_INF_PCI) 37 | #define IS_RBUS_INF(_pAd) ((_pAd)->infType == RTMP_DEV_INF_RBUS) 38 | 39 | 40 | 41 | #endif /* __HIF_H__ */ 42 | 43 | -------------------------------------------------------------------------------- /src/mt_wifi/include/hw_ctrl/hw_init.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2009, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | hw_init.h 20 | 21 | Abstract: 22 | 23 | Revision History: 24 | Who When What 25 | -------- ---------- ---------------------------------------------- 26 | Name Date Modification logs 27 | */ 28 | 29 | #ifndef __HW_INIT_H__ 30 | #define __HW_INIT_H__ 31 | 32 | struct _RTMP_ADAPTER ; 33 | 34 | typedef struct { 35 | USHORT Dummy;//empty struct will cause build error in testmode win 36 | }HIF_INFO_T; 37 | 38 | 39 | /*HW related init*/ 40 | 41 | INT32 WfTopInit(struct _RTMP_ADAPTER *pAd); 42 | 43 | 44 | INT32 WfHifInit(struct _RTMP_ADAPTER *pAd); 45 | 46 | 47 | INT32 WfMcuInit(struct _RTMP_ADAPTER *pAd); 48 | 49 | 50 | INT32 WfMacInit(struct _RTMP_ADAPTER *pAd); 51 | 52 | 53 | INT32 WfEPROMInit(struct _RTMP_ADAPTER *pAd); 54 | 55 | 56 | INT32 WfPhyInit(struct _RTMP_ADAPTER *pAd); 57 | 58 | 59 | /*SW related init*/ 60 | 61 | INT32 WfSysPreInit(struct _RTMP_ADAPTER *pAd); 62 | 63 | 64 | INT32 WfSysPosExit(struct _RTMP_ADAPTER *pAd); 65 | 66 | 67 | INT32 WfSysCfgInit(struct _RTMP_ADAPTER *pAd); 68 | 69 | 70 | 71 | INT32 WfSysCfgExit(struct _RTMP_ADAPTER *pAd); 72 | 73 | /*OS dependence function*/ 74 | INT32 WfHifSysInit(struct _RTMP_ADAPTER *pAd,HIF_INFO_T *pHifInfo); 75 | INT32 WfHifSysExit(struct _RTMP_ADAPTER *pAd); 76 | INT32 WfMcuSysInit(struct _RTMP_ADAPTER *pAd); 77 | INT32 WfMcuSysExit(struct _RTMP_ADAPTER *pAd); 78 | INT32 WfEPROMSysInit(struct _RTMP_ADAPTER *pAd); 79 | INT32 WfEPROMSysExit(struct _RTMP_ADAPTER *pAd); 80 | 81 | /*Global*/ 82 | INT32 WfInit(struct _RTMP_ADAPTER *pAd); 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/client.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | client.h 15 | */ 16 | 17 | #ifndef __CLIENT_H__ 18 | #define __CLIENT_H__ 19 | 20 | #define CLIENT_BASE 0xe000 21 | #define RXINF (CLIENT_BASE + 0x0030) 22 | #define RXSH_GROUP1_EN (1 << 0) 23 | #define RXSH_GROUP2_EN (1 << 1) 24 | #define RXSH_GROUP3_EN (1 << 2) 25 | 26 | #define RST (CLIENT_BASE + 0x0070) 27 | #define TX_R_E_1 (1 << 16) 28 | #define TX_R_E_2 (1 << 17) 29 | #define TX_R_E_1_S (1 << 20) 30 | #define TX_R_E_2_S (1 << 21) 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/wf_aon.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_aon.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_AON_H__ 31 | #define __WF_AON_H__ 32 | 33 | #define WF_AON_BASE 0x20000 34 | 35 | 36 | #endif /* __WF_AON_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/wf_cfgoff.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_cfgoff.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_CFG_OFF_H__ 31 | #define __WF_CFG_OFF_H__ 32 | 33 | #define WF_CFG_OFF_BASE 0x20600 34 | 35 | /* 820F0800 WOSWRST_EN SW Reset 00000000 */ 36 | #define CFG_OFF_WOSWRST_EN (WF_CFG_OFF_BASE) 37 | #define BB_LOGRST_MASK 0x01 38 | #define BB_LOGRST_EN BIT0 39 | #define MACOFF_REGRST_MASK 0x02 40 | #define MACOFF_REGRST_EN BIT1 41 | #define MACOFF_LOGRST_MASK 0x04 42 | #define MACOFF_LOGRST_EN BIT2 43 | 44 | 45 | 46 | #endif /* __WF_CFG_OFF_H__ */ 47 | 48 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/wf_pf.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_pf.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_PF_H__ 31 | #define __WF_PF_H__ 32 | 33 | #define WF_PF_BASE 0x22000 34 | 35 | 36 | #endif /* __WF_PF_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/wf_pp.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_pp.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #ifndef __WF_PP_H__ 30 | #define __WF_PP_H__ 31 | 32 | #define PP_BASE 0xe000 33 | 34 | 35 | /* CT path control register */ 36 | #define PP_RXCUTDISP (PP_BASE + 0x54) 37 | #define PP_RXCUTDISP_CT_EN_MASK (1<<0) 38 | #define PP_RXCUTDISP_CR4_EN_MASK (1<<1) 39 | 40 | /* */ 41 | #define PP_PAGECTL_0 (PP_BASE + 0x58) 42 | #define PAGECTL_0_PSE_PG_CNT_MASK (0xfff) 43 | 44 | /* */ 45 | #define PP_PAGECTL_1 (PP_BASE + 0x5c) 46 | #define PAGECTL_1_PLE_PG_CNT_MASK (0xfff) 47 | 48 | /* */ 49 | #define PP_PAGECTL_2 (PP_BASE + 0x60) 50 | #define PAGECTL_2_CUT_PG_CNT_MASK (0xfff) 51 | 52 | /* PP spare dummy CR */ 53 | #define PP_SPARE_DUMMY_CR5 (PP_BASE + 0x64) 54 | #define PP_SPARE_DUMMY_CR6 (PP_BASE + 0x68) 55 | #define PP_SPARE_DUMMY_CR7 (PP_BASE + 0x6c) 56 | #define PP_SPARE_DUMMY_CR8 (PP_BASE + 0x70) 57 | 58 | #endif /* __WF_PP_H__ */ 59 | 60 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/wf_sec.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_sec.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_SEC_H__ 31 | #define __WF_SEC_H__ 32 | 33 | #define WF_SEC_BASE 0x21600 34 | #define SEC_SCR (WF_SEC_BASE + 0x004) 35 | 36 | #endif /* __WF_SEC_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/wf_trb.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_trb.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_TRB_H__ 31 | #define __WF_TRB_H__ 32 | 33 | #define WF_TRB_BASE 0x20800 34 | #define TRB_GCR (WF_TRB_BASE + 0x000) 35 | 36 | #define TRB_TRBTHR (WF_TRB_BASE + 0x014) 37 | #define TRB_RXBTHR (WF_TRB_BASE + 0x01C) 38 | 39 | #ifdef DBG 40 | #define TRB_TXBSR (WF_TRB_BASE + 0x020) 41 | #define TRB_TXPSR (WF_TRB_BASE + 0x024) 42 | 43 | #define TRB_RXBSR (WF_TRB_BASE + 0x040) 44 | #define TRB_RXPSR0 (WF_TRB_BASE + 0x044) 45 | #define TRB_RXPSR1 (WF_TRB_BASE + 0x048) 46 | #define TRB_RXPSR2 (WF_TRB_BASE + 0x04c) 47 | #endif /* DBG */ 48 | #endif /* __WF_TRB_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/wf_wtbloff.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_wtbloff.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_WTBL_OFF_H__ 31 | #define __WF_WTBL_OFF_H__ 32 | 33 | 34 | #define WF_WTBL_OFF_BASE 0x23400 35 | 36 | 37 | #define WTBL_OFF_WIUCR (WF_WTBL_OFF_BASE + 0x30) /* 0x23430 */ 38 | #define WLAN_IDX_MASK (0xff) 39 | #define WLAN_IDX(p) (((p) & 0xff)) 40 | #define WTBL_RXINFO_UPDATE (1 << 11) 41 | #define WTBL_ADM_CNT_CLEAR (1 << 12) 42 | #define WTBL_RATE_UPDATE (1 << 13) 43 | #define WTBL_TX_CNT_CLEAR (1 << 14) 44 | #define WTBL_RX_CNT_CLEAR (1 << 15) 45 | #define WTBL_IU_BUSY (1 << 31) 46 | 47 | #define WTBL_OFF_BCR (WF_WTBL_OFF_BASE + 0x4) /* 0x23404 */ 48 | #define BIP_EN (1 << 0) 49 | 50 | #define WTBL_OFF_RMVTCR (WF_WTBL_OFF_BASE + 0x8) /* 0x23408 */ 51 | #define RX_MV_MODE (1 << 23) 52 | #define RCPI_AVG_PARAM_MASK (0x3 << 20) 53 | #define RCPI_AVG_PARAM(p) (((p) & 0x3) << 20) 54 | 55 | #define WTBL_OFF_RCR (WF_WTBL_OFF_BASE + 0x0) /* 0x23400 */ 56 | #define CHECK_CTRL(p) ((p & 0x1)) 57 | #define CHECK_CTRL_MASK (0x1) 58 | 59 | #define WTBL_OFF_ACR (WF_WTBL_OFF_BASE + 0xC) /* 0x2340C */ 60 | #define WTBL_ADM_RX_EN (1 << 31) 61 | 62 | #endif /* __WF_WTBL_OFF_H__ */ 63 | 64 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/dmac/wf_wtblon.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_wtblon.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #ifndef __WF_WTBL_ON_H__ 30 | #define __WF_WTBL_ON_H__ 31 | 32 | #define WF_WTBL_ON_BASE 0x23000 33 | 34 | #define WTBL_ON_WTBLOR (WF_WTBL_ON_BASE + 0x0) 35 | #define WTBL_OR_PSM_W_FLAG (1<<31) 36 | 37 | #define WTBL_ON_RICR0 (WF_WTBL_ON_BASE + 0x10) // DW0 38 | #define WTBL_ON_RICR1 (WF_WTBL_ON_BASE + 0x14) // DW1 39 | #define WTBL_ON_RIUCR0 (WF_WTBL_ON_BASE + 0x20) // DW5 40 | #define WTBL_ON_RIUCR1 (WF_WTBL_ON_BASE + 0x24) // DW6 41 | #define WTBL_ON_RIUCR2 (WF_WTBL_ON_BASE + 0x28) // DW7 42 | #define WTBL_ON_RIUCR3 (WF_WTBL_ON_BASE + 0x2C) // DW8 43 | 44 | #define WTBL_ON_TCGSBR (WF_WTBL_ON_BASE + 0x40) 45 | #define WTBL_ON_ACGSBR (WF_WTBL_ON_BASE + 0x44) 46 | #define WTBL_ON_RVCDARx (WF_WTBL_ON_BASE + 0x80) // RV bit for wtbl 47 | 48 | 49 | #define WTBL_BTCRn (WF_WTBL_ON_BASE + 0x100) 50 | #define WTBL_BTBCRn (WF_WTBL_ON_BASE + 0x110) 51 | #define WTBL_BRCRn (WF_WTBL_ON_BASE + 0x120) 52 | #define WTBL_BRBCRn (WF_WTBL_ON_BASE + 0x130) 53 | #define WTBL_BTDCRn (WF_WTBL_ON_BASE + 0x150) 54 | 55 | #define WTBL_MBTCRn (WF_WTBL_ON_BASE + 0x2010) 56 | #define WTBL_MBRCRn (WF_WTBL_ON_BASE + 0x2110) 57 | 58 | #define WTBL_MBTBCRn (WF_WTBL_ON_BASE + 0x2040) 59 | 60 | #define WTBL_MBRBCRn (WF_WTBL_ON_BASE + 0x2140) 61 | 62 | 63 | #define PSM_W_FLAG (1 << 31) 64 | #endif /* __WF_WTBL_ON_H__ */ 65 | 66 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/smac/client.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | client.h 15 | */ 16 | 17 | #ifndef __CLIENT_H__ 18 | #define __CLIENT_H__ 19 | 20 | #define CLIENT_BASE 0x800C0000 21 | #define RXINF (CLIENT_BASE + 0x0068) 22 | #define RXSH_GROUP1_EN (1 << 0) 23 | #define RXSH_GROUP2_EN (1 << 1) 24 | #define RXSH_GROUP3_EN (1 << 2) 25 | 26 | #define RST (CLIENT_BASE + 0x0070) 27 | #define TX_R_E_1 (1 << 16) 28 | #define TX_R_E_2 (1 << 17) 29 | #define TX_R_E_1_S (1 << 20) 30 | #define TX_R_E_2_S (1 << 21) 31 | 32 | #endif 33 | 34 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/smac/wf_aon.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_aon.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_AON_H__ 31 | #define __WF_AON_H__ 32 | 33 | #define WF_AON_BASE 0x2D000 34 | 35 | 36 | #endif /* __WF_AON_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/smac/wf_cfgoff.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_cfgoff.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_CFG_OFF_H__ 31 | #define __WF_CFG_OFF_H__ 32 | 33 | #define WF_CFG_OFF_BASE 0x21E00 34 | 35 | 36 | #endif /* __WF_CFG_OFF_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/smac/wf_mib.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_mib.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_MIB_H__ 31 | #define __WF_MIB_H__ 32 | 33 | #define WF_MIB_BASE 0x2C000 34 | 35 | #define MIB_MSCR (WF_MIB_BASE + 0x00) 36 | #define MIB_MPBSCR (WF_MIB_BASE + 0x04) 37 | #define MIB_MSDR0 (WF_MIB_BASE + 0x08) 38 | #define MIB_MSDR4 (WF_MIB_BASE + 0x18) 39 | #define MIB_MSDR5 (WF_MIB_BASE + 0x1c) 40 | #define MIB_MSDR6 (WF_MIB_BASE + 0x20) 41 | #define MIB_MSDR7 (WF_MIB_BASE + 0x24) 42 | #define MIB_MSDR8 (WF_MIB_BASE + 0x28) 43 | #define MIB_MSDR9 (WF_MIB_BASE + 0x2c) 44 | #define MIB_MSDR10 (WF_MIB_BASE + 0x30) 45 | #define MIB_MSDR11 (WF_MIB_BASE + 0x34) 46 | #define MIB_MSDR12 (WF_MIB_BASE + 0x38) 47 | #define MIB_MSDR14 (WF_MIB_BASE + 0x40) 48 | #define MIB_MSDR15 (WF_MIB_BASE + 0x44) 49 | #define MIB_MSDR16 (WF_MIB_BASE + 0x48) 50 | #define MIB_MSDR17 (WF_MIB_BASE + 0x4c) 51 | #define MIB_MSDR18 (WF_MIB_BASE + 0x50) 52 | #define MIB_MSDR22 (WF_MIB_BASE + 0x60) 53 | #define MIB_MSDR23 (WF_MIB_BASE + 0x64) 54 | #define MIB_MDR0 (WF_MIB_BASE + 0xa0) 55 | #define MIB_MDR1 (WF_MIB_BASE + 0xa4) 56 | #define MIB_MDR2 (WF_MIB_BASE + 0xa8) 57 | #define MIB_MDR3 (WF_MIB_BASE + 0xac) 58 | #define MIB_MB0SDR0 (WF_MIB_BASE + 0x100) 59 | #define MIB_MB1SDR0 (WF_MIB_BASE + 0x110) 60 | #define MIB_MB2SDR0 (WF_MIB_BASE + 0x120) 61 | #define MIB_MB3SDR0 (WF_MIB_BASE + 0x130) 62 | #define MIB_MB0SDR1 (WF_MIB_BASE + 0x104) 63 | #define MIB_MB1SDR1 (WF_MIB_BASE + 0x114) 64 | #define MIB_MB2SDR1 (WF_MIB_BASE + 0x124) 65 | #define MIB_MB3SDR1 (WF_MIB_BASE + 0x134) 66 | #define MIB_MB0SDR2 (WF_MIB_BASE + 0x108) 67 | #define MIB_MB1SDR2 (WF_MIB_BASE + 0x118) 68 | #define MIB_MB2SDR2 (WF_MIB_BASE + 0x128) 69 | #define MIB_MB3SDR2 (WF_MIB_BASE + 0x138) 70 | 71 | #endif /* __WF_SEC_H__ */ 72 | 73 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/smac/wf_pf.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_pf.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_PF_H__ 31 | #define __WF_PF_H__ 32 | 33 | #define WF_PF_BASE 0x22000 34 | 35 | 36 | #endif /* __WF_PF_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/smac/wf_sec.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_sec.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_SEC_H__ 31 | #define __WF_SEC_H__ 32 | 33 | #define WF_SEC_BASE 0x21A00 34 | #define SEC_SCR (WF_SEC_BASE + 0x004) 35 | 36 | #endif /* __WF_SEC_H__ */ 37 | 38 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/smac/wf_trb.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_trb.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_TRB_H__ 31 | #define __WF_TRB_H__ 32 | 33 | #define WF_TRB_BASE 0x21000 34 | #define TRB_GCR (WF_TRB_BASE + 0x000) 35 | #define TRB_TXBSR (WF_TRB_BASE + 0x020) 36 | #define TRB_RXBSR (WF_TRB_BASE + 0x040) 37 | 38 | #endif /* __WF_TRB_H__ */ 39 | 40 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/smac/wf_wtbloff.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wf_wtbloff.h 20 | 21 | Abstract: 22 | Ralink Wireless Chip MAC related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | 30 | #ifndef __WF_WTBL_OFF_H__ 31 | #define __WF_WTBL_OFF_H__ 32 | 33 | #define WF_WTBL_OFF_BASE 0x23000 34 | #define WTBL_OFF_WIUCR (WF_WTBL_OFF_BASE + 0x0) /* 0x23000 */ 35 | #define WLAN_IDX_MASK (0xff) 36 | #define WLAN_IDX(p) (((p) & 0xff)) 37 | #define WTBL2_UPDATE_FLAG (1 << 11) 38 | #define ADM_CNT_CLEAR (1 << 12) 39 | #define RATE_UPDATE (1 << 13) 40 | #define TX_CNT_CLEAR (1 << 14) 41 | #define RX_CNT_CLEAR (1 << 15) 42 | #define IU_BUSY (1 << 16) 43 | 44 | #define WTBL_OFF_BCR (WF_WTBL_OFF_BASE + 0x4) /* 0x23204 */ 45 | #define BIP_EN (1 << 0) 46 | 47 | #define WTBL_OFF_RMVTCR (WF_WTBL_OFF_BASE + 0x8) /* 0x23008 */ 48 | #define RX_MV_MODE (BIT23) 49 | #define RCPI_AVG_PARAM_MASK (0x3 << 20) 50 | #define RCPI_AVG_PARAM(p) (((p) & 0x3) << 20) 51 | 52 | #endif /* __WF_WTBL_OFF_H__ */ 53 | 54 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mac/mac_mt/top.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | top.h 15 | */ 16 | 17 | #ifndef __TOP_H__ 18 | #define __TOP_H__ 19 | 20 | #define TOP_CFG_BASE 0x0000 21 | 22 | 23 | #define TOP_HVR (TOP_CFG_BASE + 0x1000) 24 | #define HW_VER_MASK (0xffff) 25 | #define GET_HW_VER(p) (((p) & HW_VER_MASK)) 26 | #define RESC_CID_MASK (0xf << 28) 27 | #define GET_RESC_CID(p) (((p) & RESC_CID_MASK) >> 28) 28 | 29 | #define TOP_FVR (TOP_CFG_BASE + 0x1004) 30 | #define FW_VER_MASK (0xffff) 31 | #define GET_FW_VER(p) (((p) & FW_VER_MASK)) 32 | 33 | #define TOP_HCR (TOP_CFG_BASE + 0x1008) 34 | #define HW_CODE_MASK (0xffff) 35 | #define GET_HW_CODE(p) (((p) & HW_CODE_MASK)) 36 | 37 | #define STRAP_STA (TOP_CFG_BASE + 0x1010) 38 | #define XTAL_SEL_MASK (0x3) 39 | #define GET_XTAL_SEL(p) (((p) & XTAL_SEL_MASK)) 40 | #define EEPROM_SEL (1 << 2) 41 | #define GET_EEPROM_SEL(p) (((p) & EEPROM_SEL) >> 2) 42 | #define CO_CLOCK_SEL (1 << 8) 43 | #define GET_CO_CLOCK_SEL(p) (((p) & CO_CLOCK_SEL) >> 8) 44 | #define THREE_ANT (1 << 24) 45 | #define GET_THREE_ANT(p) (((p) & THREE_ANT) >> 24) 46 | #define N_ONLY (1 << 25) 47 | #define GET_11N_ONLY(p) (((p) & N_ONLY) >> 25) 48 | 49 | #define TOP_CKGEN0 (TOP_CFG_BASE + 0x1100) 50 | #define TOP_CKGEN1 (TOP_CFG_BASE + 0x1104) 51 | 52 | 53 | #define TOP_OFF_RSV (TOP_CFG_BASE + 0x1128) 54 | #define SW_SYNC_MASK (0x70000) 55 | #define GET_SW_SYNC(p) (((p) & SW_SYNC_MASK) >> 16) 56 | 57 | #define TOP_MISC (TOP_CFG_BASE + 0x1130) 58 | #define TOP_MISC2 (TOP_CFG_BASE + 0x1134) 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /src/mt_wifi/include/mcu/fwdl.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _FWDL_H 3 | #define _FWDL_H 4 | 5 | 6 | #ifdef MT_MAC 7 | #define FW_NO_INIT 0 8 | #define FW_DOWNLOAD 1 9 | #define FW_RUN_TIME 2 10 | #define ROM_PATCH_DOWNLOAD 3 11 | #define FW_DOWNLOAD_SCATTER 4 12 | #define ROM_PATCH_DOWNLOAD_SCATTER 5 13 | 14 | INT AndesMtFwdlHookInit(struct _RTMP_ADAPTER *pAd); 15 | #endif 16 | 17 | #define PATCH_INFO_SIZE 30 18 | 19 | /* 20 | * Command response RX Ring selection 21 | */ 22 | enum RX_RING_ID { 23 | RX_RING0, 24 | RX_RING1, 25 | }; 26 | 27 | /* 28 | * Load code method 29 | */ 30 | enum LOAD_CODE_METHOD { 31 | HEADER_METHOD, 32 | BIN_FILE_METHOD, 33 | }; 34 | 35 | 36 | INT NICLoadFirmware(struct _RTMP_ADAPTER *pAd); 37 | 38 | VOID NICEraseFirmware(struct _RTMP_ADAPTER *pAd); 39 | 40 | INT FwdlHookInit(struct _RTMP_ADAPTER *pAd); 41 | VOID NICRestartFirmware(struct _RTMP_ADAPTER *pAd); 42 | INT NICLoadRomPatch(struct _RTMP_ADAPTER *ad); 43 | VOID NICEraseRomPatch(struct _RTMP_ADAPTER *pAd); 44 | #ifdef Mt7615 45 | #if defined(RTMP_PCI_SUPPORT) 46 | VOID NICResetFirmware(struct _RTMP_ADAPTER *pAd); 47 | #endif 48 | #endif 49 | #endif 50 | -------------------------------------------------------------------------------- /src/mt_wifi/include/os/bb_soc.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __BBU_SOC_H__ 3 | #define __BBU_SOC_H__ 4 | 5 | 6 | //#include "rt_config.h" 7 | 8 | 9 | #define POLLING_MODE_DETECT_INTV 300 10 | extern void os_TCIfQuery (unsigned short query_id, void* result, void* result2); 11 | 12 | 13 | typedef struct _BBUPollingMode{ 14 | RALINK_TIMER_STRUCT PollingModeDetect; 15 | BOOLEAN PollingModeDetectRunning; 16 | struct work_struct PollingDataBH; 17 | UINT32 pAd_va; 18 | NDIS_SPIN_LOCK PollingModeLock; 19 | }BBUPollingMode,*PBBUPollingMode; 20 | 21 | extern void tc3162_enable_irq(unsigned int irq); 22 | extern void tc3162_disable_irq(unsigned int irq); 23 | extern VOID PeriodicPollingModeDetect( 24 | IN PVOID SystemSpecific1, 25 | IN PVOID FunctionContext, 26 | IN PVOID SystemSpecific2, 27 | IN PVOID SystemSpecific3); 28 | DECLARE_TIMER_FUNCTION(PeriodicPollingModeDetect); 29 | 30 | extern VOID PollingModeIsr(struct work_struct *work); 31 | /* 32 | ======================================================================== 33 | 34 | Routine Description: 35 | Trendchip DMT Trainning status detect 36 | 37 | Arguments: 38 | data Point to RTMP_ADAPTER 39 | 40 | Return Value: 41 | NONE 42 | 43 | Note: 44 | 45 | ======================================================================== 46 | */ 47 | extern void pcieReset(void); 48 | extern int pcieRegInitConfig(void); 49 | extern void BBU_PCIE_Init(void); 50 | extern VOID BBUPollingModeClose(IN RTMP_ADAPTER *pAd); 51 | extern VOID BBUPollingModeInit(IN RTMP_ADAPTER *pAd); 52 | extern VOID BBUPollingModeStart(IN RTMP_ADAPTER *pAd); 53 | extern VOID BBUPrepareMAC(IN RTMP_ADAPTER *pAd, PUCHAR macaddr ); 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /src/mt_wifi/include/os/rt_ecos_type.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | 17 | Abstract: 18 | 19 | 20 | ***************************************************************************/ 21 | 22 | #ifndef __RTMP_ECOS_TYPE_H_ 23 | #define __RTMP_ECOS_TYPE_H_ 24 | 25 | /* Put platform dependent declaration here */ 26 | /* For example, linux type definition */ 27 | typedef unsigned char UINT8; 28 | typedef unsigned short UINT16; 29 | typedef unsigned int UINT32; 30 | typedef unsigned long long UINT64; 31 | typedef int INT32; 32 | typedef short INT16; 33 | typedef long long INT64; 34 | typedef unsigned int u32; 35 | 36 | typedef unsigned char UCHAR; 37 | typedef unsigned short USHORT; 38 | typedef unsigned int UINT; 39 | typedef unsigned long ULONG; 40 | 41 | typedef unsigned char * PUINT8; 42 | typedef unsigned short * PUINT16; 43 | typedef unsigned int * PUINT32; 44 | typedef unsigned long long * PUINT64; 45 | typedef int * PINT32; 46 | typedef long long * PINT64; 47 | 48 | /* modified for fixing compile warning on Sigma 8634 platform */ 49 | //typedef char STRING; 50 | typedef char RTMP_STRING; 51 | typedef signed char CHAR; 52 | 53 | typedef signed short SHORT; 54 | typedef signed int INT; 55 | typedef signed long LONG; 56 | typedef signed long long LONGLONG; 57 | 58 | typedef unsigned long long ULONGLONG; 59 | 60 | typedef unsigned char BOOLEAN; 61 | typedef void VOID; 62 | 63 | typedef VOID * PVOID; 64 | typedef CHAR * PCHAR; 65 | typedef UCHAR * PUCHAR; 66 | typedef USHORT * PUSHORT; 67 | typedef LONG * PLONG; 68 | typedef ULONG * PULONG; 69 | typedef UINT * PUINT; 70 | 71 | #endif /* __RTMP_ECOS_TYPE_H_ */ 72 | 73 | -------------------------------------------------------------------------------- /src/mt_wifi/include/os/rt_linux_txrx_hook.h: -------------------------------------------------------------------------------- 1 | #ifndef _RT_LINUX_TXRX_HOOK_H_ 2 | #define _RT_LINUX_TXRX_HOOK_H_ 3 | 4 | #include 5 | #include 6 | #define MT_WLAN_TXRXHOOK_NAME_MAX 128 7 | 8 | /*define hook point, if you want to add a new point, please define it in here*/ 9 | typedef enum { 10 | 11 | WLAN_TX_IN=0, 12 | WLAN_TX_ENQUEUE, 13 | WLAN_TX_DROP, 14 | WLAN_TX_DEQUEUE, 15 | WLAN_TX_DMA_DONE, 16 | WLAN_TX_PRETBTT_INTR, 17 | WLAN_TX_DEQUEUE_PROGRESS, 18 | WLAN_TX_ENQUEUE_PROGRESS, 19 | WLAN_TX_MLME_PERIOD, 20 | WLAN_CALIB_TEST_RSP, 21 | 22 | } WLAN_HOOK_PT_T ; 23 | 24 | 25 | /*hook link list will handle the order depend on below priority in the same hook point. 26 | 0: priority low ~ 100: priority high 27 | */ 28 | typedef enum { 29 | WLAN_HOOK_PRI_LOWEST=0, 30 | WLAN_HOOK_PRI_SOFTQ_STAT=WLAN_HOOK_PRI_LOWEST, 31 | WLAN_HOOK_PRI_HIGHEST=100, 32 | } WLAN_HOOK_PRI_T; 33 | 34 | 35 | struct mt_wlanTxRxHookOps { 36 | 37 | struct list_head list; 38 | const char name[MT_WLAN_TXRXHOOK_NAME_MAX]; 39 | unsigned int (*hookfun)(unsigned short hook, struct sk_buff *skb,unsigned char queIdx,void *priv); 40 | struct module *me; 41 | unsigned short priority; 42 | unsigned short hooks; 43 | }; 44 | 45 | 46 | void RtmpOsTxRxHookInit(void); 47 | int RtmpOsTxRxHookCall(unsigned short hook,struct sk_buff *skb, unsigned char queldx,void *priv); 48 | int RtmpOsTxRxHookRegister(struct mt_wlanTxRxHookOps *ops); 49 | int RtmpOsTxRxHookUnRegister(struct mt_wlanTxRxHookOps *ops); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/mt_wifi/include/os/rt_wince.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2005, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | wince.h 20 | 21 | Abstract: 22 | WinCE generic portion header file 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | Rory Chen 04-14-2005 created 28 | 29 | */ 30 | #ifndef __WINCE_H__ 31 | #define __WINCE_H__ 32 | 33 | #ifdef UNDER_CE 34 | 35 | #include "giisr.h" 36 | #include 37 | #include 38 | 39 | 40 | #if DBG 41 | 42 | #define ZONE_ERROR_BIT 0 43 | #define ZONE_WARN_BIT 1 44 | #define ZONE_FUNCTION_BIT 2 45 | #define ZONE_INIT_BIT 3 46 | #define ZONE_INTR_BIT 4 47 | #define ZONE_RCV_BIT 5 48 | #define ZONE_XMIT_BIT 6 49 | #define ZONE_LINK_BIT 7 50 | 51 | #define ZONE_ERROR_MASK (1 << ZONE_ERROR_BIT) 52 | #define ZONE_WARN_MASK (1 << ZONE_WARN_BIT) 53 | #define ZONE_FUNCTION_MASK (1 << ZONE_FUNCTION_BIT) 54 | #define ZONE_INIT_MASK (1 << ZONE_INIT_BIT) 55 | #define ZONE_INTR_MASK (1 << ZONE_INTR_BIT) 56 | #define ZONE_RCV_MASK (1 << ZONE_RCV_BIT) 57 | #define ZONE_XMIT_MASK (1 << ZONE_XMIT_BIT) 58 | #define ZONE_LINK_MASK (1 << ZONE_LINK_BIT) 59 | 60 | #define ZONE_ERROR DEBUGZONE(ZONE_ERROR_BIT) 61 | #define ZONE_WARN DEBUGZONE(ZONE_WARN_BIT) 62 | #define ZONE_FUNCTION DEBUGZONE(ZONE_FUNCTION_BIT) 63 | #define ZONE_INIT DEBUGZONE(ZONE_INIT_BIT) 64 | #define ZONE_INTR DEBUGZONE(ZONE_INTR_BIT) 65 | #define ZONE_RCV DEBUGZONE(ZONE_RCV_BIT) 66 | #define ZONE_XMIT DEBUGZONE(ZONE_XMIT_BIT) 67 | #define ZONE_LINK DEBUGZONE(ZONE_LINK_BIT) 68 | 69 | #endif /* DBG */ 70 | 71 | 72 | NDIS_STATUS LoadISR( 73 | IN PRTMP_ADAPTER pAd, 74 | IN NDIS_HANDLE WrapperConfigurationContext); 75 | 76 | NDIS_STATUS UnloadISR( 77 | IN PRTMP_ADAPTER pAd); 78 | 79 | VOID RTMPCopyUnicodeString( 80 | IN OUT PUNICODE_STRING DestinationString, 81 | IN PUNICODE_STRING SourceString); 82 | 83 | #endif /*UNDER_CE */ 84 | 85 | #endif /*__WINCE_H__ */ 86 | -------------------------------------------------------------------------------- /src/mt_wifi/include/phy/mt_bbp.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | mt_bbp.h 15 | */ 16 | 17 | #ifndef __MT_BBP_H__ 18 | #define __MT_BBP_H__ 19 | 20 | INT32 MTShowAllBBP(struct _RTMP_ADAPTER *pAd); 21 | INT32 MTShowPartialBBP(struct _RTMP_ADAPTER *pAd, UINT32 Start, UINT32 End); 22 | INT mt_phy_probe(struct _RTMP_ADAPTER *pAd); 23 | 24 | #endif /* __MT_BBP_H__ */ 25 | 26 | -------------------------------------------------------------------------------- /src/mt_wifi/include/phy/mt_phy.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/mt_wifi/include/phy/mt_rf.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | mt_rf.h 15 | */ 16 | 17 | 18 | 19 | #ifndef __MT_RF_H__ 20 | #define __MT_RF_H__ 21 | 22 | INT32 MTShowAllRF(struct _RTMP_ADAPTER *pAd); 23 | INT32 MTShowPartialRF(struct _RTMP_ADAPTER *pAd, UINT32 Start, UINT32 End); 24 | 25 | #endif /* __MT_RF_H__ */ 26 | 27 | -------------------------------------------------------------------------------- /src/mt_wifi/include/phy/rlt_rf.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | rlt_rf.h 15 | */ 16 | 17 | #ifndef __RLT_RF_H__ 18 | #define __RLT_RF_H__ 19 | 20 | /* 21 | RF sections 22 | */ 23 | #define RF_R00 0 24 | #define RF_R01 1 25 | #define RF_R02 2 26 | #define RF_R03 3 27 | #define RF_R04 4 28 | #define RF_R05 5 29 | #define RF_R06 6 30 | #define RF_R07 7 31 | #define RF_R08 8 32 | #define RF_R09 9 33 | #define RF_R10 10 34 | #define RF_R11 11 35 | #define RF_R12 12 36 | #define RF_R13 13 37 | #define RF_R14 14 38 | #define RF_R15 15 39 | #define RF_R16 16 40 | #define RF_R17 17 41 | #define RF_R18 18 42 | #define RF_R19 19 43 | #define RF_R20 20 44 | #define RF_R21 21 45 | #define RF_R22 22 46 | #define RF_R23 23 47 | #define RF_R24 24 48 | #define RF_R25 25 49 | #define RF_R26 26 50 | #define RF_R27 27 51 | #define RF_R28 28 52 | #define RF_R29 29 53 | #define RF_R30 30 54 | #define RF_R31 31 55 | #define RF_R32 32 56 | #define RF_R33 33 57 | #define RF_R34 34 58 | #define RF_R35 35 59 | #define RF_R36 36 60 | #define RF_R37 37 61 | #define RF_R38 38 62 | #define RF_R39 39 63 | #define RF_R40 40 64 | #define RF_R41 41 65 | #define RF_R42 42 66 | #define RF_R43 43 67 | #define RF_R44 44 68 | #define RF_R45 45 69 | #define RF_R46 46 70 | #define RF_R47 47 71 | #define RF_R48 48 72 | #define RF_R49 49 73 | #define RF_R50 50 74 | #define RF_R51 51 75 | #define RF_R52 52 76 | #define RF_R53 53 77 | #define RF_R54 54 78 | #define RF_R55 55 79 | #define RF_R56 56 80 | #define RF_R57 57 81 | #define RF_R58 58 82 | #define RF_R59 59 83 | #define RF_R60 60 84 | #define RF_R61 61 85 | #define RF_R62 62 86 | #define RF_R63 63 87 | 88 | #define RF_R64 64 89 | #define RF_R65 65 90 | #define RF_R66 66 91 | #define RF_R67 67 92 | #define RF_R68 68 93 | #define RF_R69 69 94 | #define RF_R70 70 95 | #define RF_R71 71 96 | #define RF_R72 72 97 | #define RF_R73 73 98 | #define RF_R74 74 99 | #define RF_R75 75 100 | #define RF_R76 76 101 | #define RF_R77 77 102 | #define RF_R78 78 103 | #define RF_R79 79 104 | #define RF_R126 126 105 | #define RF_R127 127 106 | 107 | #endif 108 | -------------------------------------------------------------------------------- /src/mt_wifi/include/protocol/protection.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * MediaTek Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * 7 | * (c) Copyright 1997-2016, MediaTek, Inc. 8 | * 9 | * All rights reserved. MediaTek source code is an unpublished work and the 10 | * use of a copyright notice does not imply otherwise. This source code 11 | * contains confidential trade secret material of MediaTek. Any attemp 12 | * or participation in deciphering, decoding, reverse engineering or in any 13 | * way altering the source code is stricitly prohibited, unless the prior 14 | * written consent of MediaTek Technology, Inc. is obtained. 15 | *************************************************************************** 16 | 17 | 18 | Module Name: 19 | protection.h 20 | 21 | Abstract: 22 | Generic 802.11 Legacy/HT/nonHT Protection Mechanism 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | Hugo 2016-0505 create 28 | 29 | */ 30 | 31 | #ifndef __PROTECTION_H__ 32 | #define __PROTECTION_H__ 33 | 34 | struct _MAC_TABLE_ENTRY; 35 | struct _RTMP_ADAPTER; 36 | 37 | struct erp_protect { 38 | UCHAR use_protection; 39 | }; 40 | 41 | struct gf_protect { 42 | UCHAR nongf_exist; 43 | }; 44 | 45 | struct ht_protect { 46 | UCHAR op_mode; 47 | }; 48 | 49 | enum ht_protection { 50 | NON_PROTECT=0, 51 | NONMEMBER_PROTECT=1, 52 | BW20_PROTECT=2, 53 | NONHT_MM_PROTECT=3 54 | }; 55 | 56 | struct protection_cfg { 57 | struct erp_protect erp; 58 | struct gf_protect gf; 59 | struct ht_protect ht; 60 | }; 61 | 62 | enum peer_state { 63 | PEER_JOIN = 0, 64 | PEER_LEAVE 65 | }; 66 | 67 | UINT16 nonerp_sta_num(struct _MAC_TABLE_ENTRY *peer, UCHAR peer_state); 68 | UCHAR nonerp_protection(struct wifi_dev *wdev); 69 | VOID wdev_protect_init(struct wifi_dev *wdev); 70 | VOID protect_update(struct _RTMP_ADAPTER *pAd, struct _MAC_TABLE_ENTRY *peer, UCHAR peer_state); 71 | VOID protect_perodic_detect(struct _RTMP_ADAPTER *pAd); 72 | 73 | #endif /* __PROTECTION_H__ */ 74 | -------------------------------------------------------------------------------- /src/mt_wifi/include/protocol/tmr.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | tmr.h 20 | 21 | Abstract: 22 | 802.11v-Timing Measurement, 23 | 802.11mc-Fine Timing Measurement related function and state machine 24 | 25 | Revision History: 26 | Who When What 27 | -------- ---------- ---------------------------------------------- 28 | Carter 2014-1120 create 29 | 30 | */ 31 | 32 | #ifndef _TMR_H_ 33 | #define _TMR_H_ 34 | 35 | #ifdef MT_MAC 36 | #include "rtmp.h" 37 | 38 | typedef enum _TMR_TYPE { 39 | TMR_DISABLE = 0, 40 | TMR_INITIATOR, 41 | TMR_RESPONDER 42 | } TMR_TYPE, *P_TMR_TYPE; 43 | 44 | typedef enum _TMR_IDENRIRY { 45 | TMR_IR0_TX = 0, 46 | TMR_IR1_RX = 1 47 | } TMR_IDENRIRY, *P_TMR_IDENRIRY; 48 | 49 | typedef enum _TMR_INITIATOR_SEND_PKT_STATE { 50 | SEND_IDLE = 0, 51 | SEND_OUT 52 | } TMR_INITIATOR_SEND_PKT_STATE, *P_TMR_INITIATOR_SEND_PKT_STATE; 53 | 54 | VOID TmrReportParser(RTMP_ADAPTER *pAd,TMR_FRM_STRUC *tmr, BOOLEAN fgFinalResult, UINT32 TOAECalibrationResult); 55 | 56 | VOID MtSetTmrEnable(RTMP_ADAPTER *pAd, UCHAR enable); 57 | INT TmrCtrlInit(RTMP_ADAPTER *pAd, UCHAR TmrType, UCHAR Ver); 58 | 59 | VOID TmrCtrl(RTMP_ADAPTER *pAd, UCHAR enable, UCHAR Ver); 60 | 61 | #endif /* MT_MAC */ 62 | #endif /* _TMR_H_ */ 63 | -------------------------------------------------------------------------------- /src/mt_wifi/mcu/bin/MT7615_cr4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/mcu/bin/MT7615_cr4.bin -------------------------------------------------------------------------------- /src/mt_wifi/mcu/bin/MT7615_cr4_noReOrdering.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/mcu/bin/MT7615_cr4_noReOrdering.bin -------------------------------------------------------------------------------- /src/mt_wifi/mcu/bin/WIFI_RAM_CODE_MT7615.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/mcu/bin/WIFI_RAM_CODE_MT7615.bin -------------------------------------------------------------------------------- /src/mt_wifi/mcu/bin/mt7615_patch_e3_hdr.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/mcu/bin/mt7615_patch_e3_hdr.bin -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/Kconfig.mt_wifi_sta: -------------------------------------------------------------------------------- 1 | config MT_STA_SUPPORT 2 | tristate "Ralink RT2860 802.11n/ac STA support" 3 | # depends on NET_RADIO 4 | select WIRELESS_EXT 5 | select WEXT_SPY 6 | select WEXT_PRIV 7 | 8 | config ETH_CONVERT_SUPPORT 9 | bool "Ethernet Convert Mode Support" 10 | depends on MT_STA_SUPPORT 11 | default y 12 | 13 | #config MUMIMO_SUPPORT 14 | # bool "MU-MIMO Support" 15 | # depends on WIFI_DRIVER 16 | # default y 17 | 18 | #config DOT11R_FT_SUPPORT 19 | # bool "802.11r Fast BSS Transition" 20 | # depends on MT_STA_SUPPORT 21 | 22 | #config DOT11K_RRM_SUPPORT 23 | # bool "802.11k Radio Resource Management" 24 | # depends on MT_STA_SUPPORT 25 | 26 | #config SNIFFER_SUPPORT 27 | # bool "SNIFFER" 28 | # depends on MT_STA_SUPPORT 29 | # default n 30 | 31 | config CFG80211_SUPPORT 32 | bool "CFG80211" 33 | depends on MT_STA_SUPPORT 34 | depends on CFG80211 35 | default n 36 | 37 | #config CON_WPS_SUPPORT 38 | # bool "Concurrent WPS Support" 39 | # depends on MT_STA_SUPPORT 40 | # depends on APCLI_SUPPORT 41 | # depends on WSC_INCLUDED 42 | # depends on WSC_V2_SUPPORT 43 | # default n 44 | 45 | #config COC_SUPPORT 46 | # bool "CoC Support" 47 | # depends on MT_STA_SUPPORT 48 | # default n 49 | 50 | #config RT2860V2_SNMP 51 | # bool "Net-SNMP Support" 52 | # depends on MT_STA_SUPPORT 53 | 54 | #config MCAST_RATE_SPECIFIC 55 | # bool "User specific tx rate of mcast pkt" 56 | # depends on MT_STA_SUPPORT 57 | 58 | #config EXT_BUILD_CHANNEL_LIST 59 | # bool "Extension Channel List" 60 | # depends on MT_STA_SUPPORT 61 | 62 | #config AUTO_CH_SELECT_ENHANCE 63 | # bool "Auto Channel Selection Enhancement" 64 | # depends on MT_STA_SUPPORT 65 | 66 | #config AIRPLAY_SUPPORT 67 | # bool "AIRPLAY Support" 68 | # depends on MT_STA_SUPPORT 69 | # default n 70 | 71 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/Makefile.4.netif: -------------------------------------------------------------------------------- 1 | include $(RT28xx_DIR)/os/linux/config.mk 2 | 3 | #ifdef CONFIG_AP_SUPPORT 4 | ifeq ($(RT28xx_MODE),AP) 5 | MOD_NAME = rtnet$(MODULE)ap 6 | endif 7 | #endif // CONFIG_AP_SUPPORT // 8 | 9 | 10 | 11 | OBJ := $(MOD_NAME).o 12 | 13 | #ifdef CONFIG_AP_SUPPORT 14 | 15 | RT28XX_AP_OBJ := \ 16 | ../../ap/ap_mbss_inf.o\ 17 | ../../os/linux/ap_ioctl.o\ 18 | ../../os/linux/rt_main_dev.o 19 | 20 | ifeq ($(HAS_WDS),y) 21 | RT28XX_AP_OBJ += \ 22 | ../../ap/ap_wds_inf.o 23 | endif 24 | 25 | ifeq ($(HAS_APCLI),y) 26 | RT28XX_AP_OBJ += \ 27 | ../../ap/ap_apcli_inf.o 28 | endif 29 | 30 | ifeq ($(HAS_MESH_SUPPORT),y) 31 | RT28XX_AP_OBJ += \ 32 | ../../common/mesh_inf.o 33 | endif 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | #endif // CONFIG_AP_SUPPORT // 51 | 52 | 53 | 54 | PHONY := all clean 55 | 56 | all:$(OBJ) 57 | 58 | rtnet$(MODULE)sta.o: $(RT28XX_STA_OBJ) 59 | $(LD) -r $^ -o $@ 60 | 61 | rtnet$(MODULE)ap.o: $(RT28XX_AP_OBJ) 62 | $(LD) -r $^ -o $@ 63 | 64 | rtnet$(MODULE)apsta.o: $(RT28XX_APSTA_OBJ) 65 | $(LD) -r $^ -o $@ 66 | 67 | clean: 68 | rm -f $(RT28xx_DIR)/common/*.o 69 | rm -f $(RT28xx_DIR)/common/.*.{cmd,flags,d} 70 | rm -f $(RT28xx_DIR)/os/linux/*.{o,ko,mod.{o,c}} 71 | rm -f $(RT28xx_DIR)/os/linux/.*.{cmd,flags,d} 72 | rm -fr $(RT28xx_DIR)/os/linux/.tmp_versions 73 | rm -f $(RT28xx_DIR)/chips/*.o 74 | rm -f $(RT28xx_DIR)/chips/.*.{cmd,flags,d} 75 | ifeq ($(RT28xx_MODE),AP) 76 | rm -f $(RT28xx_DIR)/ap/*.o 77 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 78 | else 79 | ifeq ($(RT28xx_MODE),STA) 80 | rm -f $(RT28xx_DIR)/sta/*.o 81 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 82 | else 83 | ifeq ($(RT28xx_MODE),APSTA) 84 | rm -f $(RT28xx_DIR)/ap/*.o 85 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 86 | rm -f $(RT28xx_DIR)/sta/*.o 87 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 88 | endif 89 | endif 90 | endif 91 | 92 | install: 93 | install -d $(LINUX_SRC_MODULE) 94 | install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE) 95 | /sbin/depmod -a ${shell uname -r} 96 | 97 | uninstall: 98 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME))) 99 | /sbin/depmod -a ${shell uname -r} 100 | 101 | # Declare the contents of the .PHONY variable as phony. We keep that 102 | # # information in a variable so we can use it in if_changed and friends. 103 | .PHONY: $(PHONY) 104 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/Makefile.4.util: -------------------------------------------------------------------------------- 1 | include $(RT28xx_DIR)/os/linux/config.mk 2 | 3 | #ifdef CONFIG_AP_SUPPORT 4 | ifeq ($(RT28xx_MODE),AP) 5 | MOD_NAME = rtutil$(MODULE)ap 6 | endif 7 | #endif // CONFIG_AP_SUPPORT // 8 | 9 | 10 | 11 | OBJ := $(MOD_NAME).o 12 | 13 | #ifdef CONFIG_AP_SUPPORT 14 | 15 | RT28XX_AP_OBJ := \ 16 | ../../common/rt_os_util.o\ 17 | ../../os/linux/rt_linux_symb.o\ 18 | ../../os/linux/rt_rbus_pci_util.o\ 19 | ../../os/linux/rt_usb_util.o\ 20 | ../../os/linux/rt_linux.o 21 | 22 | ifeq ($(HAS_BGFP_SUPPORT),y) 23 | RT28XX_AP_OBJ += \ 24 | $(RT28xx_DIR)/os/linux/br_ftph.o 25 | endif 26 | 27 | #endif // CONFIG_AP_SUPPORT // 28 | 29 | 30 | 31 | 32 | 33 | PHONY := all clean 34 | 35 | all:$(OBJ) 36 | 37 | rtutil$(MODULE)sta.o: $(RT28XX_STA_OBJ) 38 | $(LD) -r $^ -o $@ 39 | 40 | rtutil$(MODULE)ap.o: $(RT28XX_AP_OBJ) 41 | $(LD) -r $^ -o $@ 42 | 43 | rtutil$(MODULE)apsta.o: $(RT28XX_APSTA_OBJ) 44 | $(LD) -r $^ -o $@ 45 | 46 | clean: 47 | rm -f $(RT28xx_DIR)/common/*.o 48 | rm -f $(RT28xx_DIR)/common/.*.{cmd,flags,d} 49 | rm -f $(RT28xx_DIR)/os/linux/*.{o,ko,mod.{o,c}} 50 | rm -f $(RT28xx_DIR)/os/linux/.*.{cmd,flags,d} 51 | rm -fr $(RT28xx_DIR)/os/linux/.tmp_versions 52 | rm -f $(RT28xx_DIR)/chips/*.o 53 | rm -f $(RT28xx_DIR)/chips/.*.{cmd,flags,d} 54 | ifeq ($(RT28xx_MODE),AP) 55 | rm -f $(RT28xx_DIR)/ap/*.o 56 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 57 | else 58 | ifeq ($(RT28xx_MODE),STA) 59 | rm -f $(RT28xx_DIR)/sta/*.o 60 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 61 | else 62 | ifeq ($(RT28xx_MODE),APSTA) 63 | rm -f $(RT28xx_DIR)/ap/*.o 64 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 65 | rm -f $(RT28xx_DIR)/sta/*.o 66 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 67 | endif 68 | endif 69 | endif 70 | 71 | install: 72 | install -d $(LINUX_SRC_MODULE) 73 | install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE) 74 | /sbin/depmod -a ${shell uname -r} 75 | 76 | uninstall: 77 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME))) 78 | /sbin/depmod -a ${shell uname -r} 79 | 80 | # Declare the contents of the .PHONY variable as phony. We keep that 81 | # # information in a variable so we can use it in if_changed and friends. 82 | .PHONY: $(PHONY) 83 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/Makefile.6.netif: -------------------------------------------------------------------------------- 1 | include $(RT28xx_DIR)/os/linux/config.mk 2 | 3 | #ifdef CONFIG_AP_SUPPORT 4 | ifeq ($(RT28xx_MODE),AP) 5 | MOD_NAME = $(MODULE)_ap_net 6 | endif 7 | #endif // CONFIG_AP_SUPPORT // 8 | 9 | 10 | 11 | obj-m := $(MOD_NAME).o 12 | 13 | #ifdef CONFIG_AP_SUPPORT 14 | ifeq ($(RT28xx_MODE),AP) 15 | $(MOD_NAME)-objs := \ 16 | ../../ap/ap_mbss_inf.o\ 17 | ../../os/linux/ap_ioctl.o\ 18 | ../../os/linux/rt_main_dev.o 19 | 20 | ifeq ($(HAS_CFG80211_SUPPORT),y) 21 | $(MOD_NAME)-objs += \ 22 | ../../os/linux/cfg80211.o 23 | endif 24 | 25 | ifeq ($(HAS_WDS),y) 26 | $(MOD_NAME)-objs += \ 27 | ../../ap/ap_wds_inf.o 28 | endif 29 | 30 | ifeq ($(HAS_APCLI),y) 31 | $(MOD_NAME)-objs += \ 32 | ../../ap/ap_apcli_inf.o 33 | endif 34 | 35 | ifeq ($(HAS_MESH_SUPPORT),y) 36 | $(MOD_NAME)-objs += \ 37 | ../../common/mesh_inf.o 38 | endif 39 | 40 | endif 41 | #endif // CONFIG_AP_SUPPORT // 42 | 43 | 44 | 45 | #chip related 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | #ifdef RTMP_MAC_PCI 59 | #endif // RTMP_MAC_PCI // 60 | 61 | 62 | 63 | #ifdef RTMP_MAC_PCI 64 | #endif // RTMP_MAC_PCI // 65 | 66 | 67 | 68 | clean: 69 | rm -f ../../common/*.o 70 | rm -f ../../common/.*.{cmd,flags,d} 71 | rm -f ../../os/linux/*.{o,ko,mod.{o,c}} 72 | rm -f ../../os/linux/.*.{cmd,flags,d} 73 | rm -fr ../../os/linux/.tmp_versions 74 | rm -f ../../os/linux/Module.symvers 75 | rm -f ../../os/linux/Modules.symvers 76 | rm -f ../../os/linux/Module.markers 77 | rm -f ../../os/linux/modules.order 78 | rm -f ../../chips/*.o 79 | rm -f ../../chips/.*.{cmd,flags,d} 80 | ifeq ($(RT28xx_MODE),AP) 81 | rm -f ../../ap/*.o 82 | rm -f ../../ap/.*.{cmd,flags,d} 83 | else 84 | ifeq ($(RT28xx_MODE),STA) 85 | rm -f ../../sta/*.o 86 | rm -f ../../sta/.*.{cmd,flags,d} 87 | endif 88 | endif 89 | 90 | install: 91 | install -d $(LINUX_SRC_MODULE) 92 | install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE) 93 | /sbin/depmod -a ${shell uname -r} 94 | 95 | uninstall: 96 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME))) 97 | /sbin/depmod -a ${shell uname -r} 98 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/Makefile.6.util: -------------------------------------------------------------------------------- 1 | include $(RT28xx_DIR)/os/linux/config.mk 2 | 3 | #ifdef CONFIG_AP_SUPPORT 4 | ifeq ($(RT28xx_MODE),AP) 5 | MOD_NAME = $(MODULE)_ap_util 6 | endif 7 | #endif // CONFIG_AP_SUPPORT // 8 | 9 | 10 | 11 | obj-m := $(MOD_NAME).o 12 | 13 | #ifdef CONFIG_AP_SUPPORT 14 | ifeq ($(RT28xx_MODE),AP) 15 | $(MOD_NAME)-objs := \ 16 | ../../common/rt_os_util.o\ 17 | ../../os/linux/rt_linux_symb.o\ 18 | ../../os/linux/rt_rbus_pci_util.o\ 19 | ../../os/linux/rt_usb_util.o\ 20 | ../../os/linux/rt_linux.o 21 | 22 | ifeq ($(PLATFORM),BL2348) 23 | $(MOD_NAME)-objs += \ 24 | ../../os/linux/vr_bdlt.o 25 | endif 26 | 27 | ifeq ($(PLATFORM),BLUBB) 28 | $(MOD_NAME)-objs += \ 29 | ../../os/linux/vr_bdlt.o 30 | endif 31 | 32 | ifeq ($(HAS_BGFP_SUPPORT),y) 33 | $(MOD_NAME)-objs += \ 34 | ../../os/linux/br_ftph.o 35 | endif 36 | endif 37 | #endif // CONFIG_AP_SUPPORT // 38 | 39 | 40 | 41 | 42 | 43 | clean: 44 | rm -f ../../common/*.o 45 | rm -f ../../common/.*.{cmd,flags,d} 46 | rm -f ../../os/linux/*.{o,ko,mod.{o,c}} 47 | rm -f ../../os/linux/.*.{cmd,flags,d} 48 | rm -fr ../../os/linux/.tmp_versions 49 | rm -f ../../os/linux/Module.symvers 50 | rm -f ../../os/linux/Modules.symvers 51 | rm -f ../../os/linux/Module.markers 52 | rm -f ../../os/linux/modules.order 53 | rm -f ../../chips/*.o 54 | rm -f ../../chips/.*.{cmd,flags,d} 55 | ifeq ($(RT28xx_MODE),AP) 56 | rm -f ../../ap/*.o 57 | rm -f ../../ap/.*.{cmd,flags,d} 58 | else 59 | ifeq ($(RT28xx_MODE),STA) 60 | rm -f ../../sta/*.o 61 | rm -f ../../sta/.*.{cmd,flags,d} 62 | endif 63 | endif 64 | 65 | install: 66 | install -d $(LINUX_SRC_MODULE) 67 | install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE) 68 | /sbin/depmod -a ${shell uname -r} 69 | 70 | uninstall: 71 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME))) 72 | /sbin/depmod -a ${shell uname -r} 73 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/Makefile.libautoprovision.6: -------------------------------------------------------------------------------- 1 | include $(RT28xx_DIR)/os/linux/config.mk 2 | 3 | #ifdef CONFIG_AP_SUPPORT 4 | 5 | ifeq ($(HAS_SAMSUNG_EASY_CONFIG_SUPPORT),y) 6 | lib-y := ../../common/auto_provision.o 7 | endif 8 | 9 | #endif // CONFIG_AP_SUPPORT // 10 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/Makefile.libwapi.4: -------------------------------------------------------------------------------- 1 | # 2 | # Release file for AP Mode 3 | # 4 | include $(RT28xx_DIR)/os/linux/config.mk 5 | 6 | MOD_NAME = wapi_module 7 | 8 | OBJ := $(MOD_NAME).o 9 | 10 | WAPI_M_OBJ := \ 11 | $(RT28xx_DIR)/common/wapi_sms4.o\ 12 | $(RT28xx_DIR)/common/wapi_crypt.o 13 | 14 | PHONY := all 15 | 16 | all:$(OBJ) 17 | 18 | $(MOD_NAME).o: $(WAPI_M_OBJ) 19 | $(LD) -r $^ -o $@ 20 | 21 | # Declare the contents of the .PHONY variable as phony. We keep that 22 | # information in a variable so we can use it in if_changed and friends. 23 | .PHONY: $(PHONY) -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/Makefile.libwapi.6: -------------------------------------------------------------------------------- 1 | # 2 | # Release file for AP Mode 3 | # 4 | include $(RT28xx_DIR)/os/linux/config.mk 5 | 6 | obj-m := wapi_module.o 7 | 8 | wapi_module-objs := \ 9 | ../../common/wapi_sms4.o\ 10 | ../../common/wapi_crypt.o 11 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/inf_ppa.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | inf_ppa.c 18 | 19 | Abstract: 20 | Only for Infineon PPA Direct path feature. 21 | 22 | 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | carella 06-01-2010 Created 28 | 29 | */ 30 | 31 | #ifdef INF_PPA_SUPPORT 32 | 33 | #include "rt_config.h" 34 | #include 35 | #include 36 | 37 | extern INT rt28xx_send_packets(struct sk_buff *skb_p, struct net_device *net_dev); 38 | 39 | int ifx_ra_start_xmit(struct net_device *rx_dev, struct net_device *tx_dev, struct sk_buff *skb, int len) 40 | { 41 | if(tx_dev != NULL) 42 | { 43 | SET_OS_PKT_NETDEV(skb, tx_dev); 44 | rt28xx_send_packets(skb, tx_dev); 45 | } 46 | else if(rx_dev != NULL) 47 | { 48 | skb->protocol = eth_type_trans(skb, skb->dev); 49 | netif_rx(skb); 50 | } 51 | else 52 | { 53 | dev_kfree_skb_any(skb); 54 | } 55 | return 0; 56 | } 57 | #endif /* INF_PPA_SUPPORT */ 58 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/load: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ifconfig ra0 down 3 | rmmod rt2860ap 4 | insmod rt2860ap.o 5 | ifconfig ra0 up 192.168.100.77 6 | 7 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/monitor_mode.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | #include "rt_os_util.h" 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/multi_main_dev.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2004, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | 20 | Abstract: 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | 28 | #ifdef MULTI_INF_SUPPORT 29 | 30 | #include "rtmp_comm.h" 31 | #include "rt_os_util.h" 32 | #include "rt_os_net.h" 33 | #include 34 | 35 | /* Index 0 for Card_1, Index 1 for Card_2 */ 36 | VOID* adapt_list[MAX_NUM_OF_INF] = {NULL}; 37 | 38 | int multi_inf_adapt_reg(VOID *pAd) 39 | { 40 | int status = 0; 41 | 42 | if (adapt_list[0] == NULL) 43 | adapt_list[0] = pAd; 44 | else if (adapt_list[1] == NULL) 45 | adapt_list[1] = pAd; 46 | else if (adapt_list[2] == NULL) 47 | adapt_list[2] = pAd; 48 | else { 49 | MTWF_LOG(DBG_CAT_INIT, DBG_SUBCAT_ALL, DBG_LVL_ERROR, 50 | ("%s(): adapt_list assign error !\n", __FUNCTION__)); 51 | status = NDIS_STATUS_FAILURE; 52 | } 53 | 54 | return status; 55 | } 56 | 57 | int multi_inf_get_idx(VOID *pAd) 58 | { 59 | int idx = 0; /* use index 0 as default */ 60 | 61 | for (idx = 0; idx < MAX_NUM_OF_INF; idx++) { 62 | if (pAd == adapt_list[idx]) 63 | return idx; 64 | } 65 | 66 | MTWF_LOG(DBG_CAT_INIT, DBG_SUBCAT_ALL, DBG_LVL_ERROR, 67 | ("%s(): failed to find the index in adapt_list!\n", __FUNCTION__)); 68 | 69 | return idx; 70 | } 71 | 72 | /* 73 | Driver module load/unload function 74 | */ 75 | static int __init wifi_drv_init_module(void) 76 | { 77 | int status = 0; 78 | 79 | #ifdef RTMP_PCI_SUPPORT 80 | status = rt_pci_init_module(); 81 | if (status) 82 | printk("Register PCI device driver failed(%d)!\n", status); 83 | #endif /* RTMP_PCI_SUPPORT */ 84 | 85 | 86 | 87 | return status; 88 | } 89 | 90 | 91 | static void __exit wifi_drv_cleanup_module(void) 92 | { 93 | #ifdef RTMP_PCI_SUPPORT 94 | rt_pci_cleanup_module(); 95 | printk("Unregister PCI device driver\n"); 96 | #endif /* RTMP_PCI_SUPPORT */ 97 | 98 | 99 | } 100 | 101 | 102 | module_init(wifi_drv_init_module); 103 | module_exit(wifi_drv_cleanup_module); 104 | 105 | #endif /* MULTI_INF_SUPPORT */ 106 | 107 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/rt_pci_rbus.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | rt_pci_rbus.c 20 | 21 | Abstract: 22 | Create and register network interface. 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #define RTMP_MODULE_OS 30 | 31 | /*#include */ 32 | #include "rtmp_comm.h" 33 | #include "rt_os_util.h" 34 | #include "rt_os_net.h" 35 | #include 36 | 37 | 38 | IRQ_HANDLE_TYPE 39 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) 40 | rt2860_interrupt(int irq, void *dev_instance); 41 | #else 42 | rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs); 43 | #endif 44 | 45 | 46 | /*************************************************************************** 47 | * 48 | * Interface-depended memory allocation/Free related procedures. 49 | * Mainly for Hardware TxDesc/RxDesc/MgmtDesc, DMA Memory for TxData/RxData, etc., 50 | * 51 | **************************************************************************/ 52 | 53 | 54 | /*************************************************************************** 55 | * 56 | * interrupt handler related procedures. 57 | * 58 | **************************************************************************/ 59 | /*int print_int_count; */ 60 | 61 | IRQ_HANDLE_TYPE 62 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)) 63 | rt2860_interrupt(int irq, void *dev_instance) 64 | #else 65 | rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs) 66 | #endif 67 | { 68 | struct net_device *net_dev = (struct net_device *) dev_instance; 69 | VOID *pAd = NULL; 70 | #ifdef MULTI_CORE_SUPPORT 71 | unsigned long flags=0; 72 | #endif /* MULTI_CORE_SUPPORT */ 73 | 74 | GET_PAD_FROM_NET_DEV(pAd, net_dev); 75 | 76 | RTMPHandleInterrupt(pAd); 77 | 78 | #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) 79 | return IRQ_HANDLED; 80 | #endif 81 | 82 | } 83 | 84 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/rt_symb.c: -------------------------------------------------------------------------------- 1 | #ifdef OS_ABL_SUPPORT 2 | 3 | #include 4 | #include "rt_config.h" 5 | 6 | EXPORT_SYMBOL(RTMP_DRV_OPS_FUNCTION); 7 | 8 | #endif /* OS_ABL_SUPPORT */ 9 | 10 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/rt_txrx_hook.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "rt_config.h" 3 | 4 | 5 | /* Registration hooks for tx/rx path. */ 6 | struct list_head hookHead; 7 | 8 | void RtmpOsTxRxHookInit(void) 9 | { 10 | INIT_LIST_HEAD(&hookHead); 11 | } 12 | 13 | 14 | int RtmpOsTxRxHookCall(unsigned short hook,struct sk_buff *skb,unsigned char queIdx, void *priv) 15 | { 16 | struct mt_wlanTxRxHookOps *entry; 17 | struct list_head *next,*cur; 18 | 19 | list_for_each_safe(cur,next,&hookHead) 20 | { 21 | entry = list_entry(cur,struct mt_wlanTxRxHookOps,list); 22 | if(entry->hooks & 1 << hook) 23 | { 24 | entry->hookfun(hook,skb,queIdx,priv); 25 | } 26 | } 27 | return 0; 28 | } 29 | 30 | 31 | int RtmpOsTxRxHookRegister(struct mt_wlanTxRxHookOps *ops) 32 | { 33 | struct mt_wlanTxRxHookOps *entry; 34 | struct list_head *next = NULL; 35 | struct list_head *cur = NULL; 36 | 37 | if(!ops) 38 | { 39 | return -1; 40 | } 41 | 42 | if(!cur) 43 | { 44 | return -1; 45 | } 46 | 47 | list_for_each_safe(cur,next,&hookHead) 48 | { 49 | entry = list_entry(cur,struct mt_wlanTxRxHookOps,list); 50 | if(entry && ops->priority > entry->priority) 51 | { 52 | (ops->list).next = next; 53 | cur->next =& ops->list; 54 | return 0; 55 | } 56 | } 57 | 58 | /*add first entry*/ 59 | list_add(&ops->list,&hookHead); 60 | 61 | return 0; 62 | } 63 | 64 | 65 | int RtmpOsTxRxHookUnRegister(struct mt_wlanTxRxHookOps *ops) 66 | { 67 | struct mt_wlanTxRxHookOps *entry; 68 | struct list_head *next,*cur; 69 | 70 | if(!ops) 71 | { 72 | return -1; 73 | } 74 | 75 | list_for_each_safe(cur,next,&hookHead) 76 | { 77 | entry = list_entry(cur,struct mt_wlanTxRxHookOps,list); 78 | if(ops==entry) 79 | { 80 | list_del(&entry->list); 81 | return 0; 82 | } 83 | } 84 | return -1; 85 | } 86 | 87 | 88 | #ifdef MT_MAC 89 | /*Export for modules*/ 90 | INT32 RtmpOsRfRead(RTMP_ADAPTER *pAd, UINT32 RFIdx, UINT32 Offset, UINT32 *Value) 91 | { 92 | INT32 ret; 93 | 94 | ret = MtCmdRFRegAccessRead(pAd, RFIdx, Offset, Value); 95 | return ret; 96 | } 97 | 98 | EXPORT_SYMBOL(RtmpOsRfRead); 99 | 100 | 101 | INT32 RtmpOsMemIORead(RTMP_ADAPTER *pAd,UINT32 addr,UINT32 *value) 102 | { 103 | INT32 ret=0; 104 | RTMP_IO_READ32(pAd,addr,value); 105 | return ret; 106 | } 107 | 108 | EXPORT_SYMBOL(RtmpOsMemIORead); 109 | 110 | 111 | INT32 RtmpOsRfTest(RTMP_ADAPTER *pAd, UINT8 Action, UINT8 Mode, UINT8 CalItem) 112 | { 113 | INT32 ret = 0; 114 | //Cmd Changed 115 | //ret = CmdRfTest(pAd, Action, Mode, CalItem); 116 | return ret; 117 | 118 | } 119 | EXPORT_SYMBOL(RtmpOsRfTest); 120 | EXPORT_SYMBOL(RtmpOsGetNetDevPriv); 121 | EXPORT_SYMBOL(AsicSwitchChannel); 122 | #endif /*MT_MAC*/ 123 | 124 | 125 | EXPORT_SYMBOL(RtmpOsTxRxHookRegister); 126 | EXPORT_SYMBOL(RtmpOsTxRxHookUnRegister); 127 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/trace.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | trace.c 15 | */ 16 | 17 | #include "rt_config.h" 18 | 19 | #ifdef CONFIG_TRACE_SUPPORT 20 | #define CREATE_TRACE_POINTS 21 | #include "os/trace.h" 22 | #endif 23 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/unload: -------------------------------------------------------------------------------- 1 | ifconfig ra0 down 2 | rmmod rt2860ap 3 | -------------------------------------------------------------------------------- /src/mt_wifi/os/linux/vr_bdlt.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Module Name: 4 | vr_brlt.c 5 | 6 | Abstract: 7 | Only for BroadLight 2348 platform. 8 | 9 | Revision History: 10 | Who When What 11 | --------- ---------- ---------------------------------------------- 12 | Sample Lin 01-12-2010 Created 13 | 14 | ***************************************************************************/ 15 | 16 | #define RTMP_MODULE_OS 17 | #define RTMP_MODULE_OS_UTIL 18 | 19 | #define MODULE_BDLT 20 | 21 | /*#include "rt_config.h" */ 22 | #include "rtmp_comm.h" 23 | #include "rt_os_util.h" 24 | #include "rtmp_osabl.h" 25 | 26 | 27 | #if defined(PLATFORM_BL2348) || defined(PLATFORM_BL23570) 28 | 29 | /* global variables */ 30 | int (*pToUpperLayerPktSent)(struct sk_buff *pSkb) = netif_rx ; 31 | 32 | 33 | 34 | 35 | /* 36 | ======================================================================== 37 | Routine Description: 38 | Assign the briding function. 39 | 40 | Arguments: 41 | xi_destination_ptr - bridging function 42 | 43 | Return Value: 44 | None 45 | 46 | Note: 47 | The function name must be replace_upper_layer_packet_destination. 48 | ======================================================================== 49 | */ 50 | VOID replace_upper_layer_packet_destination(VOID *pXiDestination) 51 | { 52 | MTWF_LOG(DBG_CAT_INIT, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("ralink broad light> replace_upper_layer_packet_destination\n")); 53 | pToUpperLayerPktSent = pXiDestination ; 54 | } /* End of replace_upper_layer_packet_destination */ 55 | 56 | 57 | EXPORT_SYMBOL(pToUpperLayerPktSent); 58 | EXPORT_SYMBOL(replace_upper_layer_packet_destination); 59 | 60 | #endif /* PLATFORM_BL2348 */ 61 | 62 | 63 | /* End of vr_bdlt.c */ 64 | -------------------------------------------------------------------------------- /src/mt_wifi/phy/mt_rf.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | mt_rf.c 15 | */ 16 | #ifdef COMPOS_WIN 17 | #include "MtConfig.h" 18 | #if defined(EVENT_TRACING) 19 | #include "mt_rf.tmh" 20 | #endif 21 | #else 22 | #include "rt_config.h" 23 | #endif 24 | 25 | INT32 MTShowPartialRF(RTMP_ADAPTER *pAd, UINT32 Start, UINT32 End) 26 | { 27 | #ifdef COMPOS_WIN 28 | #else 29 | UINT32 RFIdx, Offset, Value; 30 | 31 | #ifdef MT_MAC 32 | for (RFIdx = 0; RFIdx < pAd->Antenna.field.TxPath; RFIdx++) 33 | { 34 | for (Offset = Start; Offset <= End; Offset = Offset + 4) 35 | { 36 | MtCmdRFRegAccessRead(pAd, RFIdx, Offset, &Value); 37 | MTWF_LOG(DBG_CAT_HW, DBG_SUBCAT_ALL, DBG_LVL_OFF, ("%s():%d 0x%04x 0x%08x\n", __FUNCTION__, RFIdx, Offset, Value)); 38 | } 39 | } 40 | #endif /* MT_MAC */ 41 | #endif 42 | return TRUE; 43 | } 44 | 45 | 46 | INT32 MTShowAllRF(RTMP_ADAPTER *pAd) 47 | { 48 | #ifdef COMPOS_WIN 49 | #else 50 | UINT32 RFIdx, Offset, Value; 51 | 52 | #ifdef MT_MAC 53 | for (RFIdx = 0; RFIdx < pAd->Antenna.field.TxPath; RFIdx++) 54 | { 55 | for (Offset = 0; Offset <= (pAd->chipCap.MaxNumOfRfId * 4); Offset = Offset + 4) 56 | { 57 | MtCmdRFRegAccessRead(pAd, RFIdx, Offset, &Value); 58 | MTWF_LOG(DBG_CAT_HW, DBG_SUBCAT_ALL, DBG_LVL_OFF, ("%s():%d 0x%04x 0x%08x\n", __FUNCTION__, RFIdx, Offset, Value)); 59 | } 60 | } 61 | #endif /* MT_MAC */ 62 | #endif 63 | return TRUE; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/mt_wifi/phy/rf.c: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * MediaTek Inc. 4 | * 5 | * All rights reserved. source code is an unpublished work and the 6 | * use of a copyright notice does not imply otherwise. This source code 7 | * contains confidential trade secret material of MediaTek. Any attemp 8 | * or participation in deciphering, decoding, reverse engineering or in any 9 | * way altering the source code is stricitly prohibited, unless the prior 10 | * written consent of MediaTek, Inc. is obtained. 11 | *************************************************************************** 12 | 13 | Module Name: 14 | rf.c 15 | */ 16 | 17 | #include "rt_config.h" 18 | 19 | VOID InitRFRegisters(RTMP_ADAPTER *pAd) 20 | { 21 | MTWF_LOG(DBG_CAT_HW, DBG_SUBCAT_ALL, DBG_LVL_TRACE, ("%s(): Init RF Registers\n", __FUNCTION__)); 22 | if (pAd->chipOps.AsicRfInit) 23 | pAd->chipOps.AsicRfInit(pAd); 24 | } 25 | 26 | -------------------------------------------------------------------------------- /src/mt_wifi/protocol/protection.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * MediaTek Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * 7 | * (c) Copyright 1997-2016, MediaTek, Inc. 8 | * 9 | * All rights reserved. MediaTek source code is an unpublished work and the 10 | * use of a copyright notice does not imply otherwise. This source code 11 | * contains confidential trade secret material of MediaTek. Any attemp 12 | * or participation in deciphering, decoding, reverse engineering or in any 13 | * way altering the source code is stricitly prohibited, unless the prior 14 | * written consent of MediaTek Technology, Inc. is obtained. 15 | *************************************************************************** 16 | 17 | Module Name: 18 | protection.c 19 | 20 | Abstract: 21 | For general 802.11 Legacy/HT/nonHT protection mechanism 22 | 23 | Who When What 24 | -------------- ---------- ---------------------------------------------- 25 | Hugo 2016-0505 created 26 | */ 27 | 28 | #include "rt_config.h" 29 | 30 | UINT16 nonerp_sta_num(struct _MAC_TABLE_ENTRY *peer, UCHAR peer_state) 31 | { 32 | if ((peer->MaxHTPhyMode.field.MODE == MODE_CCK) && (peer->Sst == SST_ASSOC)) { 33 | if ((peer_state == PEER_JOIN) && (!peer->nonerp_sta)) { 34 | peer->wdev->conn_sta.nonerp_sta_cnt++; 35 | peer->nonerp_sta = 1; 36 | } 37 | if ((peer_state == PEER_LEAVE) && (peer->nonerp_sta)) { 38 | peer->wdev->conn_sta.nonerp_sta_cnt--; 39 | peer->nonerp_sta = 0; 40 | } 41 | } 42 | 43 | return peer->wdev->conn_sta.nonerp_sta_cnt; 44 | } 45 | 46 | UCHAR nonerp_protection(struct wifi_dev *wdev) 47 | { 48 | UCHAR use_prot = 0; 49 | 50 | if (wdev && (wdev->conn_sta.nonerp_sta_cnt > 0)) { 51 | use_prot = 1; 52 | } 53 | 54 | return use_prot; 55 | } 56 | 57 | VOID wdev_protect_init(struct wifi_dev *wdev) 58 | { 59 | if (wdev) { 60 | os_zero_mem(&wdev->prot_cfg, sizeof(wdev->prot_cfg)); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/mt_wifi/txpwr/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gcc -g dat2h.c -o dat2h 3 | clean: 4 | rm -f *.o dat2h 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/mt_wifi/txpwr/dat2h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanwckf/openwrt-mt7615/1d71bfa33dd16756ac27aa9eb2cce1b940cb7456/src/mt_wifi/txpwr/dat2h --------------------------------------------------------------------------------