├── .gitignore ├── History.txt ├── Kconfig ├── MT7601USTA.dat ├── Makefile ├── Makefile.PC ├── Makefile.android ├── README_STA_usb ├── RT2870AP.dat ├── RT2870APCard.dat ├── RT2870STA.dat ├── RT2870STACard.dat ├── RT2870STA_7601.dat ├── ap ├── ap.c ├── ap_assoc.c ├── ap_auth.c ├── ap_autoChSel.c ├── ap_connect.c ├── ap_data.c ├── ap_dls.c ├── ap_ftkd.c ├── ap_ids.c ├── ap_mbss.c ├── ap_mbss_inf.c ├── ap_mlme.c ├── ap_qload.c ├── ap_sanity.c ├── ap_sync.c ├── ap_wds_inf.c └── ap_wpa.c ├── ate ├── chips │ ├── mrgtmp0 │ ├── mt7601_ate.c │ ├── rt28xx_ate.c │ ├── rt30xx_ate.c │ ├── rt33xx_ate.c │ └── rt5390_ate.c ├── common │ ├── ate_usb.c │ ├── mrgtmp0 │ ├── rt_ate.c │ └── rt_qa.c └── include │ ├── rt_ate.h │ └── rt_qa.h ├── chips ├── mt7601.c ├── rt28xx.c ├── rt3290.c ├── rt6590.c ├── rt65xx.c ├── rt85592.c └── rtmp_chip.c ├── common ├── action.c ├── ba_action.c ├── client_wds.c ├── cmm_aes.c ├── cmm_asic.c ├── cmm_cfg.c ├── cmm_cmd.c ├── cmm_cs.c ├── cmm_data.c ├── cmm_data_usb.c ├── cmm_dfs.c ├── cmm_info.c ├── cmm_mac_usb.c ├── cmm_mat.c ├── cmm_mat_iparp.c ├── cmm_mat_ipv6.c ├── cmm_mat_pppoe.c ├── cmm_profile.c ├── cmm_radar.c ├── cmm_sanity.c ├── cmm_sync.c ├── cmm_tkip.c ├── cmm_video.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 ├── ee_efuse.c ├── ee_prom.c ├── eeprom.c ├── frq_cal.c ├── igmp_snoop.c ├── image.bin ├── misc.c ├── mlme.c ├── multi_channel.c ├── netif_block.c ├── p2p.c ├── p2p_action.c ├── p2p_cfg.c ├── p2p_ctrl.c ├── p2p_dbg.c ├── p2p_disc_mng.c ├── p2p_inf.c ├── p2p_nego_mng.c ├── p2p_packet.c ├── p2p_table.c ├── ps.c ├── rt2860.bin.dfs ├── rt2860.bin.old ├── rt2870_wow.bin ├── rt_channel.c ├── rt_led.c ├── rt_os_util.c ├── rt_rf.c ├── rtmp_init.c ├── rtmp_init_inf.c ├── rtmp_timer.c ├── rtusb_bulk.c ├── rtusb_data.c ├── rtusb_dev_id.c ├── rtusb_io.c ├── scan.c ├── spectrum.c ├── txpower.c ├── uapsd.c ├── vht.c ├── wapi.c ├── wsc.c ├── wsc_tlv.c ├── wsc_ufd.c └── wsc_v2.c ├── elian ├── lib │ ├── plat.h │ ├── plat_mt7601.c │ ├── sccb.c │ └── sccb.h ├── msc │ ├── core.h │ ├── core.o │ ├── msc.c │ └── msc.h └── os │ └── linux │ ├── glue.c │ ├── glue.h │ ├── osal.c │ └── osal.h ├── hw_atomic ├── 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 ├── br_ftph.h ├── cfg80211.h ├── cfg80211extr.h ├── chip │ ├── chip_id.h │ ├── mt7601.h │ ├── rt28xx.h │ ├── rt3290.h │ ├── rt6590.h │ └── rtmp_phy.h ├── chlist.h ├── client_wds.h ├── client_wds_cmm.h ├── crypt_aes.h ├── crypt_arc4.h ├── crypt_biginteger.h ├── crypt_dh.h ├── crypt_hmac.h ├── crypt_md5.h ├── crypt_sha2.h ├── cs.h ├── dfs.h ├── dot11ac_vht.h ├── dot11i_wpa.h ├── dot11r_ft.h ├── dot11z_tdls.h ├── drs_extr.h ├── eeprom.h ├── firmware.h ├── frq_cal.h ├── iface │ ├── iface_util.h │ ├── rtmp_reg_pcirbs.h │ └── rtmp_usb.h ├── igmp_snoop.h ├── ipv6.h ├── link_list.h ├── mac_ral │ ├── fce.h │ ├── mac_pci.h │ ├── mac_usb.h │ ├── nmac │ │ ├── ral_nmac.h │ │ ├── ral_nmac_pbf.h │ │ ├── ral_nmac_pci.h │ │ ├── ral_nmac_rxwi.h │ │ ├── ral_nmac_txwi.h │ │ └── ral_nmac_usb.h │ ├── omac │ │ ├── ral_omac.h │ │ ├── ral_omac_pbf.h │ │ ├── ral_omac_pci.h │ │ ├── ral_omac_rf_ctrl.h │ │ ├── ral_omac_rxwi.h │ │ ├── ral_omac_txwi.h │ │ └── ral_omac_usb.h │ ├── pbf.h │ ├── rf_ctrl.h │ └── rtmp_mac.h ├── mat.h ├── mcu │ └── .empty ├── misc.h ├── misc_cmm.h ├── mlme.h ├── mlme_sys.h ├── netif_block.h ├── oid.h ├── os │ ├── rt_drv.h │ ├── rt_linux.h │ ├── rt_linux_cmm.h │ └── rt_os.h ├── p2p.h ├── p2p_cmm.h ├── p2p_inf.h ├── p2pcli.h ├── phy │ └── rlt_phy.h ├── radar.h ├── rt_config.h ├── rt_led.h ├── rt_os_net.h ├── rt_os_util.h ├── rt_txbf.h ├── rtmp.h ├── rtmp_M51.h ├── rtmp_and.h ├── rtmp_chip.h ├── rtmp_cmd.h ├── rtmp_comm.h ├── rtmp_def.h ├── rtmp_dot11.h ├── rtmp_iface.h ├── rtmp_mcu.h ├── rtmp_os.h ├── rtmp_osabl.h ├── rtmp_timer.h ├── rtmp_type.h ├── rtusb_io.h ├── spectrum.h ├── spectrum_def.h ├── sta_cfg.h ├── tdls.h ├── tdls_cmm.h ├── uapsd.h ├── vht.h ├── video.h ├── vr_ikans.h ├── vrut_ubm.h ├── wapi.h ├── wapi_def.h ├── wapi_sms4.h ├── wfa_p2p.h ├── wpa.h ├── wpa_cmm.h ├── wsc.h └── wsc_tlv.h ├── iwpriv_usage.txt ├── mac ├── ral_nmac.c ├── ral_omac.c └── rtmp_mac.c ├── mcu ├── bin │ ├── MT7601.bin │ ├── MT7601.bin_PRE │ ├── MT7601_formal_1.3_Debug.bin │ ├── MT7650.bin │ ├── RT85592.bin │ ├── rt2860.bin │ ├── rt2870.bin │ └── rt2870_wow.bin ├── rtmp_M51.c ├── rtmp_and.c └── rtmp_mcu.c ├── mgmt ├── mgmt_dev.c ├── mgmt_entrytb.c ├── mgmt_ht.c ├── mgmt_hw.c └── mgmt_vht.c ├── os └── linux │ ├── EEPROMDump.txt │ ├── Kconfig.ap.soc │ ├── Kconfig.ap.usb │ ├── Kconfig.sta.soc │ ├── MacDump.txt │ ├── Makefile.4 │ ├── Makefile.4.netif │ ├── Makefile.4.util │ ├── Makefile.6 │ ├── Makefile.6.netif │ ├── Makefile.6.prealloc │ ├── Makefile.6.util │ ├── Makefile.ap.soc │ ├── Makefile.ap.usb │ ├── Makefile.clean │ ├── Makefile.libautoprovision.6 │ ├── Makefile.libwapi.4 │ ├── Makefile.libwapi.6 │ ├── Makefile.sta.soc │ ├── android_priv_cmd.c │ ├── ap_ioctl.c │ ├── br_ftph.c │ ├── cfg80211.c │ ├── cfg80211_inf.c │ ├── cfg80211drv.c │ ├── config.mk │ ├── inf_ppa.c │ ├── prealloc.c │ ├── rt_linux.c │ ├── rt_linux_symb.c │ ├── rt_main_dev.c │ ├── rt_proc.c │ ├── rt_profile.c │ ├── rt_rbus_pci_drv.c │ ├── rt_symb.c │ ├── rt_usb.c │ ├── rt_usb_util.c │ ├── sta_ioctl.c │ ├── usb_main_dev.c │ ├── vr_bdlt.c │ └── vr_ikans.c ├── phy ├── rlt_phy.c ├── rlt_rf.c └── rtmp_phy.c ├── rate_ctrl ├── alg_ags.c ├── alg_grp.c ├── alg_legacy.c └── ra_ctrl.c ├── sta ├── assoc.c ├── auth.c ├── auth_rsp.c ├── connect.c ├── dls.c ├── p2pcli.c ├── p2pcli_assoc.c ├── p2pcli_auth.c ├── p2pcli_ctrl.c ├── p2pcli_sync.c ├── rtmp_ckipmic.c ├── rtmp_data.c ├── sanity.c ├── sta_cfg.c ├── sta_iwsc.c ├── sync.c ├── tdls.c ├── tdls_chswitch_mng.c ├── tdls_link_mng.c ├── tdls_tlv.c ├── tdls_uapsd.c └── wpa.c ├── sta_ate_iwpriv_usage.txt ├── tools ├── Makefile └── bin2h.c └── wps_iwpriv_usage.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE! Don't add files that are generated in specific 3 | # subdirectories here. Add them in the ".gitignore" file 4 | # in that subdirectory instead. 5 | # 6 | # NOTE! Please use 'git ls-files -i --exclude-standard' 7 | # command after changing this file, to see if there are 8 | # any tracked files which get ignored after the change. 9 | # 10 | # Normal rules 11 | # 12 | .* 13 | *.o 14 | *.o.* 15 | *.a 16 | *.s 17 | *.ko 18 | *.so 19 | *.so.dbg 20 | *.mod.c 21 | *.i 22 | *.lst 23 | *.symtypes 24 | *.order 25 | *.elf 26 | modules.builtin 27 | Module.symvers 28 | *.dwo 29 | *.su 30 | *.c.[012]*.* 31 | 32 | # 33 | # Top-level generic files 34 | # 35 | /tags 36 | /TAGS 37 | 38 | # 39 | # git files that we don't want to ignore even if they are dot-files 40 | # 41 | !.gitignore 42 | !.mailmap 43 | !.cocciconfig 44 | 45 | # 46 | # Generated include files 47 | # 48 | include/config 49 | include/generated 50 | os/linux/Makefile 51 | include/mcu/MT7601_firmware.h 52 | tools/bin2h 53 | 54 | # stgit generated dirs 55 | patches-* 56 | 57 | # quilt's files 58 | patches 59 | series 60 | 61 | # cscope files 62 | cscope.* 63 | ncscope.* 64 | 65 | # gnu global files 66 | GPATH 67 | GRTAGS 68 | GSYMS 69 | GTAGS 70 | 71 | # id-utils files 72 | ID 73 | 74 | *.orig 75 | *~ 76 | \#*# 77 | 78 | -------------------------------------------------------------------------------- /Kconfig: -------------------------------------------------------------------------------- 1 | config MT7601_STA 2 | tristate "MT7601 STA support" 3 | default m 4 | # depends on NET_RADIO 5 | -------------------------------------------------------------------------------- /MT7601USTA.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=11n-AP 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=4 42 | HT_BW=1 43 | HT_BADecline=0 44 | HT_AutoBA=1 45 | HT_AMSDU=0 46 | HT_BAWinSize=64 47 | HT_GI=1 48 | HT_MCS=33 49 | HT_MIMOPSMode=3 50 | HT_DisallowTKIP=1 51 | HT_STBC=1 52 | EthConvertMode= 53 | EthCloneMac= 54 | IEEE80211H=0 55 | TGnWifiTest=0 56 | WirelessEvent=0 57 | MeshId=MESH 58 | MeshAutoLink=1 59 | MeshAuthMode=OPEN 60 | MeshEncrypType=NONE 61 | MeshWPAKEY= 62 | MeshDefaultkey=1 63 | MeshWEPKEY= 64 | CarrierDetect=0 65 | AntDiversity=0 66 | BeaconLostTime=4 67 | FtSupport=0 68 | Wapiifname=ra0 69 | WapiPsk= 70 | WapiPskType= 71 | WapiUserCertPath= 72 | WapiAsCertPath= 73 | PSP_XLINK_MODE=0 74 | WscManufacturer= 75 | WscModelName= 76 | WscDeviceName= 77 | WscModelNumber= 78 | WscSerialNumber= 79 | RadioOn=1 80 | WIDIEnable=1 81 | P2P_L2SD_SCAN_TOGGLE=3 82 | Wsc4digitPinCode=0 83 | P2P_WIDIEnable=0 84 | PMFMFPC=0 85 | PMFMFPR=0 86 | PMFSHA256=0 87 | BW20_RSSI_THR0=-36 88 | BW20_RSSI_THR1=-50 89 | BW20_RSSI_THR2=-75 90 | BW20_RSSI_THR3=-80 91 | BW40_RSSI_THR0=-35 92 | BW40_RSSI_THR1=-49 93 | BW40_RSSI_THR2=-76 94 | BW40_RSSI_THR3=-80 95 | NOISE_RSSI_THR1=-62 96 | NOISE_RSSI_THR2=-70 97 | NOISE_RSSI_THR3=-75 98 | FCCA_THR1=1800 99 | FCCA_THR2=200 100 | DYPD_ENABLE=1 101 | -------------------------------------------------------------------------------- /README_STA_usb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/README_STA_usb -------------------------------------------------------------------------------- /RT2870AP.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 | SSID=RT2860AP 8 | WirelessMode=9 9 | TxRate=0 10 | Channel=11 11 | BasicRate=15 12 | BeaconPeriod=100 13 | DtimPeriod=1 14 | TxPower=100 15 | DisableOLBC=0 16 | BGProtection=0 17 | TxAntenna= 18 | RxAntenna= 19 | TxPreamble=0 20 | RTSThreshold=2347 21 | FragThreshold=2346 22 | TxBurst=1 23 | PktAggregate=0 24 | TurboRate=0 25 | WmmCapable=0 26 | APSDCapable=0 27 | DLSCapable=0 28 | APAifsn=3;7;1;1 29 | APCwmin=4;4;3;2 30 | APCwmax=6;10;4;3 31 | APTxop=0;0;94;47 32 | APACM=0;0;0;0 33 | BSSAifsn=3;7;2;2 34 | BSSCwmin=4;4;3;2 35 | BSSCwmax=10;10;4;3 36 | BSSTxop=0;0;94;47 37 | BSSACM=0;0;0;0 38 | AckPolicy=0;0;0;0 39 | NoForwarding=0 40 | NoForwardingBTNBSSID=0 41 | HideSSID=0 42 | StationKeepAlive=0 43 | ShortSlot=1 44 | AutoChannelSelect=0 45 | IEEE8021X=0 46 | IEEE80211H=0 47 | CSPeriod=10 48 | WirelessEvent=0 49 | IdsEnable=0 50 | AuthFloodThreshold=32 51 | AssocReqFloodThreshold=32 52 | ReassocReqFloodThreshold=32 53 | ProbeReqFloodThreshold=32 54 | DisassocFloodThreshold=32 55 | DeauthFloodThreshold=32 56 | EapReqFooldThreshold=32 57 | PreAuth=0 58 | AuthMode=OPEN 59 | EncrypType=NONE 60 | RekeyInterval=0 61 | RekeyMethod=DISABLE 62 | PMKCachePeriod=10 63 | WPAPSK= 64 | DefaultKeyID=1 65 | Key1Type=0 66 | Key1Str= 67 | Key2Type=0 68 | Key2Str= 69 | Key3Type=0 70 | Key3Str= 71 | Key4Type=0 72 | Key4Str= 73 | HSCounter=0 74 | AccessPolicy0=0 75 | AccessControlList0= 76 | AccessPolicy1=0 77 | AccessControlList1= 78 | AccessPolicy2=0 79 | AccessControlList2= 80 | AccessPolicy3=0 81 | AccessControlList3= 82 | WdsEnable=0 83 | WdsEncrypType=NONE 84 | WdsList= 85 | WdsKey= 86 | RADIUS_Server=192.168.2.3 87 | RADIUS_Port=1812 88 | RADIUS_Key=ralink 89 | own_ip_addr=192.168.5.234 90 | EAPifname=br0 91 | PreAuthifname=br0 92 | HT_HTC=0 93 | HT_RDG=0 94 | HT_EXTCHA=0 95 | HT_LinkAdapt=0 96 | HT_OpMode=0 97 | HT_MpduDensity=5 98 | HT_BW=1 99 | HT_AutoBA=1 100 | HT_AMSDU=0 101 | HT_BAWinSize=64 102 | HT_GI=1 103 | HT_MCS=33 104 | MeshId=MESH 105 | MeshAutoLink=1 106 | MeshAuthMode=OPEN 107 | MeshEncrypType=NONE 108 | MeshWPAKEY= 109 | MeshDefaultkey=1 110 | MeshWEPKEY= 111 | WscManufacturer= 112 | WscModelName= 113 | WscDeviceName= 114 | WscModelNumber= 115 | WscSerialNumber= 116 | RadioOn=1 117 | PMFMFPC=0 118 | PMFMFPR=0 119 | PMFSHA256=0 -------------------------------------------------------------------------------- /RT2870APCard.dat: -------------------------------------------------------------------------------- 1 | #The word of "Default" must not be removed, maximum 32 cards, 00 ~ 31 2 | Default 3 | 4 | #CARDID, MAC, CARDTYPE 5 | SELECT=CARDTYPE 6 | 7 | 00CARDID=/etc/Wireless/RT2870AP/RT2870AP1.dat 8 | 01CARDID=/etc/Wireless/RT2870AP/RT2870AP2.dat 9 | 02CARDID=/etc/Wireless/RT2870AP/RT2870AP3.dat 10 | 11 | 00MAC00:0E:2E:C3:D0:48=/etc/Wireless/RT2870AP/RT2870AP1.dat 12 | 01MAC00:40:F4:FF:AA:40=/etc/Wireless/RT2870AP/RT2870AP2.dat 13 | 02MAC00:0C:43:10:11:5C=/etc/Wireless/RT2870AP/RT2870AP3.dat 14 | 15 | 00CARDTYPEbgn=/etc/Wireless/RT2870AP/RT2870AP1.dat 16 | 01CARDTYPEbgn=/etc/Wireless/RT2870AP/RT2870AP2.dat 17 | 02CARDTYPEabgn=/etc/Wireless/RT2870AP/RT2870AP3.dat 18 | 19 | 20 | -------------------------------------------------------------------------------- /RT2870STA.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=11n-AP 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=4 42 | HT_BW=1 43 | HT_BADecline=0 44 | HT_AutoBA=1 45 | HT_AMSDU=0 46 | HT_BAWinSize=64 47 | HT_GI=1 48 | HT_MCS=33 49 | HT_MIMOPSMode=3 50 | HT_DisallowTKIP=1 51 | HT_STBC=0 52 | EthConvertMode= 53 | EthCloneMac= 54 | IEEE80211H=0 55 | TGnWifiTest=0 56 | WirelessEvent=0 57 | MeshId=MESH 58 | MeshAutoLink=1 59 | MeshAuthMode=OPEN 60 | MeshEncrypType=NONE 61 | MeshWPAKEY= 62 | MeshDefaultkey=1 63 | MeshWEPKEY= 64 | CarrierDetect=0 65 | AntDiversity=0 66 | BeaconLostTime=4 67 | FtSupport=0 68 | Wapiifname=ra0 69 | WapiPsk= 70 | WapiPskType= 71 | WapiUserCertPath= 72 | WapiAsCertPath= 73 | PSP_XLINK_MODE=0 74 | WscManufacturer= 75 | WscModelName= 76 | WscDeviceName= 77 | WscModelNumber= 78 | WscSerialNumber= 79 | RadioOn=1 80 | WIDIEnable=1 81 | P2P_L2SD_SCAN_TOGGLE=3 82 | Wsc4digitPinCode=0 83 | P2P_WIDIEnable=0 84 | PMFMFPC=0 85 | PMFMFPR=0 86 | PMFSHA256=0 87 | RSSI_THR1=-45 88 | RSSI_THR2=-60 89 | RSSI_THR3=-75 90 | NOISE_RSSI_THR1=-62 91 | NOISE_RSSI_THR2=-70 92 | NOISE_RSSI_THR3=-75 93 | FCCA_THR1=800 94 | FCCA_THR2=10 95 | DYPD_ENABLE=1 96 | -------------------------------------------------------------------------------- /RT2870STACard.dat: -------------------------------------------------------------------------------- 1 | #The word of "Default" must not be removed, maximum 32 cards, 00 ~ 31 2 | Default 3 | 4 | #CARDID, MAC, CARDTYPE 5 | SELECT=CARDTYPE 6 | 7 | 00CARDID=/etc/Wireless/RT2870STA/RT2870STA1.dat 8 | 01CARDID=/etc/Wireless/RT2870STA/RT2870STA2.dat 9 | 02CARDID=/etc/Wireless/RT2870STA/RT2870STA3.dat 10 | 11 | 00MAC00:0E:2E:C3:D0:48=/etc/Wireless/RT2870STA/RT2870STA1.dat 12 | 01MAC00:40:F4:FF:AA:40=/etc/Wireless/RT2870STA/RT2870STA2.dat 13 | 02MAC00:0C:43:10:11:5C=/etc/Wireless/RT2870STA/RT2870STA3.dat 14 | 15 | 00CARDTYPEbgn=/etc/Wireless/RT2870STA/RT2870STA1.dat 16 | 01CARDTYPEbgn=/etc/Wireless/RT2870STA/RT2870STA2.dat 17 | 02CARDTYPEabgn=/etc/Wireless/RT2870STA/RT2870STA3.dat 18 | 19 | 20 | -------------------------------------------------------------------------------- /RT2870STA_7601.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=11n-AP 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=4 42 | HT_BW=1 43 | HT_BADecline=0 44 | HT_AutoBA=1 45 | HT_AMSDU=0 46 | HT_BAWinSize=64 47 | HT_GI=1 48 | HT_MCS=33 49 | HT_MIMOPSMode=3 50 | HT_DisallowTKIP=1 51 | HT_STBC=1 52 | EthConvertMode= 53 | EthCloneMac= 54 | IEEE80211H=0 55 | TGnWifiTest=0 56 | WirelessEvent=0 57 | MeshId=MESH 58 | MeshAutoLink=1 59 | MeshAuthMode=OPEN 60 | MeshEncrypType=NONE 61 | MeshWPAKEY= 62 | MeshDefaultkey=1 63 | MeshWEPKEY= 64 | CarrierDetect=0 65 | AntDiversity=0 66 | BeaconLostTime=4 67 | FtSupport=0 68 | Wapiifname=ra0 69 | WapiPsk= 70 | WapiPskType= 71 | WapiUserCertPath= 72 | WapiAsCertPath= 73 | PSP_XLINK_MODE=0 74 | WscManufacturer= 75 | WscModelName= 76 | WscDeviceName= 77 | WscModelNumber= 78 | WscSerialNumber= 79 | RadioOn=1 80 | WIDIEnable=1 81 | P2P_L2SD_SCAN_TOGGLE=3 82 | Wsc4digitPinCode=0 83 | P2P_WIDIEnable=0 84 | PMFMFPC=0 85 | PMFMFPR=0 86 | PMFSHA256=0 87 | BW20_RSSI_THR0=-36 88 | BW20_RSSI_THR1=-50 89 | BW20_RSSI_THR2=-75 90 | BW20_RSSI_THR3=-80 91 | BW40_RSSI_THR0=-35 92 | BW40_RSSI_THR1=-49 93 | BW40_RSSI_THR2=-76 94 | BW40_RSSI_THR3=-80 95 | NOISE_RSSI_THR1=-62 96 | NOISE_RSSI_THR2=-70 97 | NOISE_RSSI_THR3=-75 98 | FCCA_THR1=1800 99 | FCCA_THR2=200 100 | DYPD_ENABLE=1 101 | -------------------------------------------------------------------------------- /ap/ap_ftkd.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 | 17 | Abstract: 18 | 19 | All related IEEE802.11r Key Distribution Protocol (FT KDP) body. 20 | 21 | Overview: 22 | 23 | 1. A station associates to us, send out a broadcast ADD-Notify packet. 24 | 25 | ASSOC --> 26 | FT_KDP_EVENT_INFORM(FT_KDP_SIG_FT_ASSOCIATION) --> 27 | FT_KDP_EventInform(FT_KDP_SIG_FT_ASSOCIATION) --> 28 | Notify IAPP daemon, IAPP_RcvHandlerRawDrv(), IAPP_SIG_Process() --> 29 | Send ADD-Notify packet, IAPP_UDP_PacketSend(), IAPP_L2UpdateFrameSend() 30 | 31 | 2. When receiving a ADD-Notify packet, send a unicast SSB packet to 32 | request PMK-R1 key for the station with our R0KH. 33 | 34 | IAPP daemon, IAPP_RcvHandlerUdp() --> 35 | Notify driver, IAPP_MsgProcess() --> 36 | IOCTL, RTMPAPSetInformation() --> 37 | FT_KDP_StationInform() --> 38 | Notify IAPP daemon, FT_KDP_EventInform(FT_KDP_SIG_KEY_REQ_AUTO) --> 39 | Notify IAPP daemon, IAPP_RcvHandlerRawDrv(), IAPP_SIG_Process() --> 40 | Send SSB packet with R0KHID = 0, by using TCP or UDP based on peerIP 41 | 42 | 3. A station reassociates to us, send out a MOVE-Request packet. 43 | 44 | REASSOC --> 45 | FT_KDP_EVENT_INFORM(FT_KDP_SIG_FT_REASSOCIATION) --> 46 | FT_KDP_EventInform(FT_KDP_SIG_FT_REASSOCIATION) --> 47 | Notify IAPP daemon, IAPP_RcvHandlerRawDrv(), IAPP_SIG_Process() --> 48 | Send MOVE-Request packet by using TCP or UDP, IAPP_L2UpdateFrameSend() 49 | 50 | 4. When receiving a MOVE-Request packet, delete the STA MAC entry. 51 | 52 | IAPP daemon, IAPP_RcvHandlerUdp()/ IAPP_RcvHandlerTcp() --> 53 | Notify driver, IAPP_MsgProcess() --> 54 | IOCTL, RTMPAPSetInformation() --> 55 | RT_SET_DEL_MAC_ENTRY --> 56 | Send MOVE-Response packet by using TCP, FT_KDP_MoveFrameSend() 57 | 58 | 5. When receiving a MOVE-Response packet, nothing to do. 59 | 60 | 6. When receiving a SSB packet (i.e. key request), send a unicast SAB 61 | packet to response the key to the R1KH. 62 | 63 | IAPP daemon --> 64 | Notify driver, IAPP_MsgProcess() --> 65 | IOCTL, RTMPAPSetInformation() --> 66 | FT_KDP_IOCTL_KEY_REQ() --> 67 | Notify IAPP daemon, FT_KDP_EventInform(FT_KDP_SIG_KEY_RSP_AUTO) --> 68 | Send SAB packet with my R0KHID, FT_KDP_SecurityBlockSend() by using TCP 69 | 70 | 7. When receiving a SAB packet (i.e. key response), set the PMK-R1 key. 71 | 72 | IAPP daemon --> 73 | Notify driver, IAPP_MsgProcess() --> 74 | IOCTL, RTMPAPSetInformation() --> 75 | FT_KDP_KeyResponseToUs() 76 | 77 | 8. Send a information broadcast to the LAN periodically. 78 | 79 | ***************************************************************************/ 80 | -------------------------------------------------------------------------------- /ap/ap_wds_inf.c: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | *************************************************************************** 4 | * Ralink Tech Inc. 5 | * 4F, No. 2 Technology 5th Rd. 6 | * Science-based Industrial Park 7 | * Hsin-chu, Taiwan, R.O.C. 8 | * 9 | * (c) Copyright 2002, Ralink Technology, Inc. 10 | * 11 | * All rights reserved. Ralink's source code is an unpublished work and the 12 | * use of a copyright notice does not imply otherwise. This source code 13 | * contains confidential trade secret material of Ralink Tech. Any attemp 14 | * or participation in deciphering, decoding, reverse engineering or in any 15 | * way altering the source code is stricitly prohibited, unless the prior 16 | * written consent of Ralink Technology, Inc. is obtained. 17 | *************************************************************************** 18 | 19 | Module Name: 20 | ap_wds.c 21 | 22 | Abstract: 23 | Support WDS function. 24 | 25 | Revision History: 26 | Who When What 27 | ------ ---------- ---------------------------------------------- 28 | Fonchi 02-13-2007 created 29 | */ 30 | #define RTMP_MODULE_OS 31 | -------------------------------------------------------------------------------- /ate/chips/rt30xx_ate.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-2011, 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 | rt5592_ate.c 20 | 21 | Abstract: 22 | Specific ATE funcitons and variables for RT5572/RT5592 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | -------------------------------------------------------------------------------- /ate/chips/rt33xx_ate.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-2011, 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 | rt5592_ate.c 20 | 21 | Abstract: 22 | Specific ATE funcitons and variables for RT5572/RT5592 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | -------------------------------------------------------------------------------- /ate/chips/rt5390_ate.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-2011, 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 | rt5592_ate.c 20 | 21 | Abstract: 22 | Specific ATE funcitons and variables for RT5572/RT5592 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | -------------------------------------------------------------------------------- /common/cmm_aes.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/cmm_aes.c -------------------------------------------------------------------------------- /common/cmm_cmd.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-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 | Module Name: 19 | cmm_cmd.c 20 | 21 | Abstract: 22 | All command related API. 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | Name Date Modification logs 28 | Paul Lin 06-25-2004 created 29 | */ 30 | 31 | #include "rt_config.h" 32 | 33 | /* 34 | ======================================================================== 35 | 36 | Routine Description: 37 | 38 | Arguments: 39 | 40 | Return Value: 41 | 42 | IRQL = 43 | 44 | Note: 45 | 46 | ======================================================================== 47 | */ 48 | VOID RTInitializeCmdQ(IN PCmdQ cmdq) 49 | { 50 | cmdq->head = NULL; 51 | cmdq->tail = NULL; 52 | cmdq->size = 0; 53 | cmdq->CmdQState = RTMP_TASK_STAT_INITED; 54 | } 55 | 56 | /* 57 | ======================================================================== 58 | 59 | Routine Description: 60 | 61 | Arguments: 62 | 63 | Return Value: 64 | 65 | IRQL = 66 | 67 | Note: 68 | 69 | ======================================================================== 70 | */ 71 | VOID RTThreadDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt) 72 | { 73 | *pcmdqelmt = cmdq->head; 74 | 75 | if (*pcmdqelmt != NULL) { 76 | cmdq->head = cmdq->head->next; 77 | cmdq->size--; 78 | if (cmdq->size == 0) 79 | cmdq->tail = NULL; 80 | } 81 | } 82 | 83 | /* 84 | ======================================================================== 85 | 86 | Routine Description: 87 | 88 | Arguments: 89 | 90 | Return Value: 91 | 92 | IRQL = 93 | 94 | Note: 95 | 96 | ======================================================================== 97 | */ 98 | NDIS_STATUS RTEnqueueInternalCmd(IN PRTMP_ADAPTER pAd, 99 | IN NDIS_OID Oid, 100 | IN PVOID pInformationBuffer, 101 | IN UINT32 InformationBufferLength) 102 | { 103 | NDIS_STATUS status; 104 | PCmdQElmt cmdqelmt = NULL; 105 | 106 | status = os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt, sizeof(CmdQElmt)); 107 | if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL)) 108 | return (NDIS_STATUS_RESOURCES); 109 | NdisZeroMemory(cmdqelmt, sizeof(CmdQElmt)); 110 | 111 | if (InformationBufferLength > 0) { 112 | status = 113 | os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt->buffer, 114 | InformationBufferLength); 115 | if ((status != NDIS_STATUS_SUCCESS) 116 | || (cmdqelmt->buffer == NULL)) { 117 | os_free_mem(pAd, cmdqelmt); 118 | return (NDIS_STATUS_RESOURCES); 119 | } else { 120 | NdisMoveMemory(cmdqelmt->buffer, pInformationBuffer, 121 | InformationBufferLength); 122 | cmdqelmt->bufferlength = InformationBufferLength; 123 | } 124 | } else { 125 | cmdqelmt->buffer = NULL; 126 | cmdqelmt->bufferlength = 0; 127 | } 128 | 129 | cmdqelmt->command = Oid; 130 | cmdqelmt->CmdFromNdis = FALSE; 131 | 132 | if (cmdqelmt != NULL) { 133 | NdisAcquireSpinLock(&pAd->CmdQLock); 134 | if (pAd->CmdQ.CmdQState & RTMP_TASK_CAN_DO_INSERT) { 135 | EnqueueCmd((&pAd->CmdQ), cmdqelmt); 136 | status = NDIS_STATUS_SUCCESS; 137 | } else { 138 | status = NDIS_STATUS_FAILURE; 139 | } 140 | NdisReleaseSpinLock(&pAd->CmdQLock); 141 | 142 | if (status == NDIS_STATUS_FAILURE) { 143 | if (cmdqelmt->buffer) 144 | os_free_mem(pAd, cmdqelmt->buffer); 145 | os_free_mem(pAd, cmdqelmt); 146 | } else 147 | RTCMDUp(&pAd->cmdQTask); 148 | } 149 | return (NDIS_STATUS_SUCCESS); 150 | } 151 | -------------------------------------------------------------------------------- /common/cmm_wpa.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/cmm_wpa.c -------------------------------------------------------------------------------- /common/crypt_hmac.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/crypt_hmac.c -------------------------------------------------------------------------------- /common/ee_efuse.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/ee_efuse.c -------------------------------------------------------------------------------- /common/eeprom.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 | eeprom.c 20 | 21 | Abstract: 22 | 23 | Revision History: 24 | Who When What 25 | -------- ---------- ---------------------------------------------- 26 | Name Date Modification logs 27 | */ 28 | #include "rt_config.h" 29 | 30 | INT RtmpChipOpsEepromHook(RTMP_ADAPTER * pAd, INT infType) 31 | { 32 | RTMP_CHIP_OP *pChipOps = &pAd->chipOps; 33 | /*UINT32 e2p_csr; */ 34 | 35 | #ifdef RTMP_FLASH_SUPPORT 36 | pChipOps->eeinit = rtmp_nv_init; 37 | pChipOps->eeread = rtmp_ee_flash_read; 38 | pChipOps->eewrite = rtmp_ee_flash_write; 39 | return 0; 40 | #endif /* RTMP_FLASH_SUPPORT */ 41 | 42 | #ifdef RTMP_EFUSE_SUPPORT 43 | efuse_probe(pAd); 44 | if (pAd->bUseEfuse) { 45 | pChipOps->eeinit = eFuse_init; 46 | pChipOps->eeread = rtmp_ee_efuse_read16; 47 | pChipOps->eewrite = rtmp_ee_efuse_write16; 48 | DBGPRINT(RT_DEBUG_OFF, ("NVM is EFUSE\n")); 49 | DBGPRINT(RT_DEBUG_TRACE, ("Efuse Size=0x%x [Range:%x-%x] \n", 50 | pAd->chipCap.EFUSE_USAGE_MAP_SIZE, 51 | pAd->chipCap.EFUSE_USAGE_MAP_START, 52 | pAd->chipCap.EFUSE_USAGE_MAP_END)); 53 | 54 | return 0; 55 | } else { 56 | pAd->bFroceEEPROMBuffer = FALSE; 57 | DBGPRINT(RT_DEBUG_OFF, ("NVM is EEPROM\n")); 58 | } 59 | #endif /* RTMP_EFUSE_SUPPORT */ 60 | 61 | switch (infType) { 62 | 63 | #ifdef RTMP_USB_SUPPORT 64 | case RTMP_DEV_INF_USB: 65 | pChipOps->eeinit = NULL; 66 | pChipOps->eeread = RTUSBReadEEPROM16; 67 | pChipOps->eewrite = RTUSBWriteEEPROM16; 68 | DBGPRINT(RT_DEBUG_OFF, 69 | ("pChipOps->eeread = RTUSBReadEEPROM16\n")); 70 | DBGPRINT(RT_DEBUG_OFF, 71 | ("pChipOps->eewrite = RTUSBWriteEEPROM16\n")); 72 | break; 73 | #endif /* RTMP_USB_SUPPORT */ 74 | default: 75 | DBGPRINT(RT_DEBUG_ERROR, ("RtmpChipOpsEepromHook() failed!\n")); 76 | break; 77 | } 78 | 79 | return 0; 80 | } 81 | -------------------------------------------------------------------------------- /common/image.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/image.bin -------------------------------------------------------------------------------- /common/misc.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 | misc.c 20 | 21 | Abstract: 22 | 23 | Handling Misc Problem 24 | 25 | Revision History: 26 | Who When What 27 | -------- ---------- ---------------------------------------------- 28 | Sean Wang 2009-08-12 Create 29 | John Li 2009-11-30 Modified 30 | */ 31 | 32 | #include "rt_config.h" 33 | #include "misc.h" 34 | -------------------------------------------------------------------------------- /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 | void initblockQueueTab(IN PRTMP_ADAPTER pAd) 10 | { 11 | int i; 12 | 13 | initList(&freeNetIfEntryList); 14 | for (i = 0; i < FREE_NETIF_POOL_SIZE; i++) 15 | insertTailList(&freeNetIfEntryList, 16 | (PLIST_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 | BOOLEAN blockNetIf(IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry, IN PNET_DEV pNetDev) 25 | { 26 | PNETIF_ENTRY pNetIfEntry = NULL; 27 | 28 | if ((pNetIfEntry = 29 | (PNETIF_ENTRY) removeHeadList(&freeNetIfEntryList)) != NULL) { 30 | RTMP_OS_NETDEV_STOP_QUEUE(pNetDev); 31 | pNetIfEntry->pNetDev = pNetDev; 32 | insertTailList(&pBlockQueueEntry->NetIfList, 33 | (PLIST_ENTRY) pNetIfEntry); 34 | 35 | pBlockQueueEntry->SwTxQueueBlockFlag = TRUE; 36 | DBGPRINT(RT_DEBUG_TRACE, 37 | ("RTMP_OS_NETDEV_STOP_QUEUE(%s)\n", 38 | RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); 39 | } else 40 | return FALSE; 41 | 42 | return TRUE; 43 | } 44 | 45 | VOID releaseNetIf(IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry) 46 | { 47 | PNETIF_ENTRY pNetIfEntry = NULL; 48 | PLIST_HEADER pNetIfList = &pBlockQueueEntry->NetIfList; 49 | 50 | while ((pNetIfEntry = 51 | (PNETIF_ENTRY) removeHeadList(pNetIfList)) != NULL) { 52 | PNET_DEV pNetDev = pNetIfEntry->pNetDev; 53 | RTMP_OS_NETDEV_WAKE_QUEUE(pNetDev); 54 | insertTailList(&freeNetIfEntryList, (PLIST_ENTRY) pNetIfEntry); 55 | 56 | DBGPRINT(RT_DEBUG_TRACE, 57 | ("RTMP_OS_NETDEV_WAKE_QUEUE(%s)\n", 58 | RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); 59 | } 60 | pBlockQueueEntry->SwTxQueueBlockFlag = FALSE; 61 | return; 62 | } 63 | 64 | VOID StopNetIfQueue(IN PRTMP_ADAPTER pAd, 65 | IN UCHAR QueIdx, IN PNDIS_PACKET pPacket) 66 | { 67 | PNET_DEV NetDev = NULL; 68 | UCHAR IfIdx = 0; 69 | BOOLEAN valid = FALSE; 70 | 71 | #ifdef P2P_SUPPORT 72 | if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= MIN_NET_DEVICE_FOR_P2P_GO) { 73 | IfIdx = 74 | (RTMP_GET_PACKET_NET_DEVICE(pPacket) - 75 | MIN_NET_DEVICE_FOR_P2P_GO) % MAX_P2P_NUM; 76 | NetDev = pAd->ApCfg.MBSSID[IfIdx].MSSIDDev; 77 | } else 78 | #endif /* P2P_SUPPORT */ 79 | #ifdef APCLI_SUPPORT 80 | if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= MIN_NET_DEVICE_FOR_APCLI) { 81 | IfIdx = 82 | (RTMP_GET_PACKET_NET_DEVICE(pPacket) - 83 | MIN_NET_DEVICE_FOR_APCLI) % MAX_APCLI_NUM; 84 | NetDev = pAd->ApCfg.ApCliTab[IfIdx].dev; 85 | } else 86 | #endif /* APCLI_SUPPORT */ 87 | { 88 | #ifdef MBSS_SUPPORT 89 | if (pAd->OpMode == OPMODE_AP) { 90 | IfIdx = 91 | (RTMP_GET_PACKET_NET_DEVICE(pPacket) - 92 | MIN_NET_DEVICE_FOR_MBSSID) % MAX_MBSSID_NUM(pAd); 93 | NetDev = pAd->ApCfg.MBSSID[IfIdx].MSSIDDev; 94 | } else { 95 | IfIdx = MAIN_MBSSID; 96 | NetDev = pAd->net_dev; 97 | } 98 | #else 99 | IfIdx = MAIN_MBSSID; 100 | NetDev = pAd->net_dev; 101 | #endif 102 | } 103 | 104 | /* WMM support 4 software queues. */ 105 | /* One software queue full doesn't mean device have no capbility to transmit packet. */ 106 | /* So disable block Net-If queue function while WMM enable. */ 107 | #ifdef CONFIG_AP_SUPPORT 108 | IF_DEV_CONFIG_OPMODE_ON_AP(pAd) 109 | valid = 110 | (pAd->ApCfg.MBSSID[IfIdx].bWmmCapable == TRUE) ? FALSE : TRUE; 111 | #endif /* CONFIG_AP_SUPPORT */ 112 | #ifdef CONFIG_STA_SUPPORT 113 | { 114 | #ifdef P2P_SUPPORT 115 | if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= 116 | MIN_NET_DEVICE_FOR_P2P_GO) 117 | valid = 118 | (pAd->ApCfg.MBSSID[IfIdx].bWmmCapable == 119 | TRUE) ? FALSE : TRUE; 120 | else 121 | #endif /* P2P_SUPPORT */ 122 | IF_DEV_CONFIG_OPMODE_ON_STA(pAd) 123 | valid = 124 | (pAd->CommonCfg.bWmmCapable == TRUE) ? FALSE : TRUE; 125 | } 126 | #endif /* CONFIG_STA_SUPPORT */ 127 | 128 | if (valid) 129 | blockNetIf(&pAd->blockQueueTab[QueIdx], NetDev); 130 | return; 131 | } 132 | 133 | #endif /* BLOCK_NET_IF */ 134 | -------------------------------------------------------------------------------- /common/p2p_packet.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/p2p_packet.c -------------------------------------------------------------------------------- /common/rt2860.bin.dfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/rt2860.bin.dfs -------------------------------------------------------------------------------- /common/rt2860.bin.old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/rt2860.bin.old -------------------------------------------------------------------------------- /common/rt2870_wow.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/rt2870_wow.bin -------------------------------------------------------------------------------- /common/rt_rf.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 | rt_rf.c 20 | 21 | Abstract: 22 | Ralink Wireless driver RF related functions 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #include "rt_config.h" 30 | -------------------------------------------------------------------------------- /common/rtusb_data.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-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 | rtusb_data.c 20 | 21 | Abstract: 22 | Ralink USB driver Tx/Rx functions. 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | Jan 03-25-2006 created 28 | 29 | */ 30 | -------------------------------------------------------------------------------- /common/rtusb_dev_id.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 | rtusb_dev_id.c 18 | 19 | Abstract: 20 | 21 | Revision History: 22 | Who When What 23 | --------- ---------- ---------------------------------------------- 24 | */ 25 | 26 | #define RTMP_MODULE_OS 27 | 28 | /*#include "rt_config.h"*/ 29 | #include "rtmp_comm.h" 30 | #include "rt_os_util.h" 31 | #include "rt_os_net.h" 32 | 33 | /* module table */ 34 | USB_DEVICE_ID rtusb_dev_id[] = { 35 | #ifdef RT6570 36 | {USB_DEVICE(0x148f, 0x6570)} 37 | , /* Ralink 6570 */ 38 | #endif /* RT6570 */ 39 | {USB_DEVICE(0x148f, 0x7650)} 40 | , /* MT7650 */ 41 | #ifdef MT7601U 42 | {USB_DEVICE(0x148f, 0x6370)} 43 | , /* Ralink 6370 */ 44 | {USB_DEVICE(0x148f, 0x7601)} 45 | , /* MT 6370 */ 46 | #endif /* MT7601U */ 47 | {} /* Terminating entry */ 48 | }; 49 | 50 | INT const rtusb_usb_id_len = sizeof(rtusb_dev_id) / sizeof(USB_DEVICE_ID); 51 | MODULE_DEVICE_TABLE(usb, rtusb_dev_id); 52 | -------------------------------------------------------------------------------- /common/vht.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/vht.c -------------------------------------------------------------------------------- /common/wsc_tlv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/common/wsc_tlv.c -------------------------------------------------------------------------------- /elian/lib/plat.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MSC_PLAT_H__ 3 | #define __MSC_PLAT_H__ 4 | 5 | #include "sccb.h" 6 | #include "../msc/msc.h" 7 | 8 | int sc_plt_enter_monitor_mode(struct monitor_info *info, void *priv); 9 | int sc_plt_leave_monitor_mode(void *priv); 10 | int sc_plt_set_monitor_chan(struct chan_info *info, void *priv); 11 | char *sc_plt_get_la(void *priv); 12 | void sc_plt_aes128_decrypt(unsigned char *, unsigned int, unsigned char *, 13 | unsigned int, unsigned char *, unsigned int *); 14 | void sc_plt_add_timer(struct etimer *); 15 | int sc_plt_del_timer(struct etimer *); 16 | #endif 17 | -------------------------------------------------------------------------------- /elian/lib/plat_mt7601.c: -------------------------------------------------------------------------------- 1 | 2 | #include "plat.h" 3 | #include "../os/linux/osal.h" 4 | 5 | #include "rtmp_comm.h" 6 | #include "rt_os_util.h" 7 | #include "rt_os_net.h" 8 | #include "rt_config.h" 9 | static unsigned int g_iftype = 0; 10 | static struct timer_list rst_timer; 11 | 12 | int sc_plt_set_monitor_chan(struct chan_info *info, void *priv) 13 | { 14 | CFG80211_CB *p80211CB = NULL; 15 | CMD_RTPRIV_IOCTL_80211_CHAN ChanInfo; 16 | PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) priv; 17 | 18 | MSC_DBG(KERN_DEBUG "[MSC] set chl, chan_id:%d, width:%d, chan_flags:0x%x\n", 19 | info->chan_id, info->width, info->flags); 20 | 21 | memset(&ChanInfo, 0, sizeof(ChanInfo)); 22 | ChanInfo.ChanId = info->chan_id; 23 | 24 | RTMP_DRIVER_80211_CB_GET(pAd, &p80211CB); 25 | if (p80211CB == NULL) { 26 | return -1; 27 | } 28 | 29 | ChanInfo.MonFilterFlag = 0x17f93; //0x17f93 is a RX filter 30 | ChanInfo.IfType = RT_CMD_80211_IFTYPE_MONITOR; 31 | 32 | if (info->width == MSC_CHAN_WIDTH_20_NOHT) { 33 | ChanInfo.ChanType = RT_CMD_80211_CHANTYPE_NOHT; 34 | } else if (info->width == MSC_CHAN_WIDTH_20) { 35 | ChanInfo.ChanType = RT_CMD_80211_CHANTYPE_HT20; 36 | } else if (info->width == MSC_CHAN_WIDTH_40_PLUS) { 37 | ChanInfo.ChanType = RT_CMD_80211_CHANTYPE_HT40PLUS; 38 | } else if (info->width == MSC_CHAN_WIDTH_40_MINUS) { 39 | ChanInfo.ChanType = RT_CMD_80211_CHANTYPE_HT40MINUS; 40 | } else { 41 | ChanInfo.ChanType = RT_CMD_80211_CHANTYPE_NOHT; 42 | } 43 | 44 | /* set channel */ 45 | RTMP_DRIVER_80211_CHAN_SET(pAd, &ChanInfo); 46 | //PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)priv; 47 | //AsicSwitchChannel(pAd, info->chan_id, FALSE); 48 | 49 | return 0; 50 | } 51 | 52 | int sc_plt_enter_monitor_mode(struct monitor_info *info, void *priv) 53 | { 54 | PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) priv; 55 | unsigned int filter = 0; 56 | 57 | MSC_DBG 58 | ("[MSC] enter monitor mode: filter:0x%x, chan_id:%d, width:%d, chan_flags:0x%x, monitor_priv=%p, priv=%p\n", 59 | info->filter, info->chl_info.chan_id, info->chl_info.width, 60 | info->chl_info.flags, info->priv, priv); 61 | 62 | filter |= 0x07; 63 | 64 | /* 1.Save current state info. */ 65 | g_iftype = pAd->net_dev->ieee80211_ptr->iftype; 66 | MSC_DBG("[MSC] old iftype: 0x%x\n", g_iftype); 67 | 68 | /* 2.Switch to monitor mode. */ 69 | CFG80211DRV_OpsChgVirtualInf(pAd, &filter, RT_CMD_80211_IFTYPE_MONITOR); 70 | 71 | sc_plt_set_monitor_chan(&info->chl_info, priv); 72 | 73 | return 0; 74 | } 75 | 76 | int sc_plt_leave_monitor_mode(void *priv) 77 | { 78 | PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) priv; 79 | unsigned int filter = 0; 80 | 81 | MSC_DBG("[MSC] leave monitor mode.\n"); 82 | CFG80211DRV_OpsChgVirtualInf(pAd, &filter, g_iftype); 83 | return 0; 84 | } 85 | 86 | char *sc_plt_get_la(void *priv) 87 | { 88 | PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) priv; 89 | MSC_DBG("[MSC] get local address %p : %x:%x:%x:%x:%x:%x\n", 90 | priv, pAd->CurrentAddress[0] & 0xff, 91 | pAd->CurrentAddress[1] & 0xff, pAd->CurrentAddress[2] & 0xff, 92 | pAd->CurrentAddress[3] & 0xff, pAd->CurrentAddress[4] & 0xff, 93 | pAd->CurrentAddress[5] & 0xff); 94 | return (char *)pAd->CurrentAddress; 95 | } 96 | 97 | void sc_plt_aes128_decrypt(unsigned char *cipher_blk, 98 | unsigned int cipher_blk_size, unsigned char *key, 99 | unsigned int key_len, unsigned char *plain_blk, 100 | unsigned int *plain_blk_size) 101 | { 102 | return RT_AES_Decrypt(cipher_blk, cipher_blk_size, key, key_len, 103 | plain_blk, plain_blk_size); 104 | } 105 | 106 | void sc_plt_add_timer(struct etimer *p) 107 | { 108 | init_timer(&rst_timer); 109 | rst_timer.expires = jiffies + p->expires * HZ; 110 | rst_timer.data = p->data; 111 | rst_timer.function = p->func; 112 | return add_timer(&rst_timer); 113 | } 114 | 115 | int sc_plt_del_timer(struct etimer *p) 116 | { 117 | return del_timer(&rst_timer); 118 | } 119 | -------------------------------------------------------------------------------- /elian/lib/sccb.c: -------------------------------------------------------------------------------- 1 | 2 | #include "sccb.h" 3 | #include "plat.h" 4 | #include "../os/linux/osal.h" 5 | 6 | #define MSC_ENABLE_RX_BIT ((unsigned int)0x1<<31) //BIT(31) 7 | 8 | #define sccb_rx_enabled() (ctrl_data.flag&(MSC_ENABLE_RX_BIT)) 9 | 10 | struct sccb_ctrl_data { 11 | unsigned int flag; 12 | sc_input_func input_func; 13 | sc_sw_filter filter_func; 14 | } ctrl_data; 15 | 16 | int sccb_enable_input() 17 | { 18 | ctrl_data.flag |= MSC_ENABLE_RX_BIT; 19 | return 0; 20 | } 21 | 22 | int sccb_disable_input() 23 | { 24 | ctrl_data.flag &= ~MSC_ENABLE_RX_BIT; 25 | return 0; 26 | } 27 | 28 | int sccb_init(sc_input_func input_func, sc_sw_filter filter_func) 29 | { 30 | ctrl_data.input_func = input_func; 31 | ctrl_data.filter_func = filter_func; 32 | ctrl_data.flag = 0x00000000; 33 | return 0; 34 | } 35 | 36 | int sccb_deinit() 37 | { 38 | ctrl_data.input_func = NULL; 39 | ctrl_data.filter_func = NULL; 40 | ctrl_data.flag = 0x00000000; 41 | return 0; 42 | } 43 | 44 | int sccb_set_monitor_chan(struct chan_info *chl_info, void *priv) 45 | { 46 | return sc_plt_set_monitor_chan(chl_info, priv); 47 | } 48 | 49 | int sccb_enter_monitor_mode(struct monitor_info *info, void *priv) 50 | { 51 | return sc_plt_enter_monitor_mode(info, priv); 52 | } 53 | 54 | int sccb_leave_monitor_mode(void *priv) 55 | { 56 | return sc_plt_leave_monitor_mode(priv); 57 | } 58 | 59 | int sccb_rx(char *data, unsigned int data_len) 60 | { 61 | char *p = NULL; 62 | int len; 63 | 64 | if (!sccb_rx_enabled()) { 65 | return -1; 66 | } 67 | 68 | if (ctrl_data.input_func == NULL) { 69 | return -2; 70 | } 71 | 72 | p = data; 73 | len = data_len; 74 | 75 | if (ctrl_data.filter_func != NULL) { 76 | if (ctrl_data.filter_func(p, len)) { 77 | return -3; 78 | } 79 | } 80 | 81 | if (ctrl_data.input_func != NULL) { 82 | return ctrl_data.input_func(p, len); 83 | } 84 | return -4; 85 | } 86 | -------------------------------------------------------------------------------- /elian/lib/sccb.h: -------------------------------------------------------------------------------- 1 | #ifndef __MSC_LIB_H__ 2 | #define __MSC_LIB_H__ 3 | 4 | //#define BIT(n) (1UL << (n%(8*sizeof(unsigned long)))) 5 | 6 | #define ERR_NOTSUPPORT -1 7 | #define ERR_TIMEDOUT -2 8 | #define ERR_INVALIDPARAM -3 9 | 10 | //#define MSC_DROP_DATA BIT(0) 11 | //#define MSC_DROP_MGMT BIT(1) 12 | //#define MSC_DROP_MULTICAST BIT(2) 13 | //#define MSC_DROP_BROADCAST BIT(3) 14 | #if 0 15 | enum sc_ctrl_id { 16 | MSC_CTRLID_ENABLE_MONITOR_MODE = 0x00, 17 | MSC_CTRLID_DISABLE_MONITOR_MODE, 18 | MSC_CTRLID_GET_MODE, 19 | MSC_CTRLID_SET_CHANNEL, 20 | MSC_CTRLID_GET_CHANNEL, 21 | MSC_CTRLID_SET_FILTER, 22 | MSC_CTRLID_GET_FILTER, 23 | MSC_CTRLID_USE_ELIAN, 24 | MSC_CTRLID_MAX 25 | }; 26 | enum msc_band { 27 | MSC_BAND_2GHZ, 28 | MSC_BAND_5GHZ, 29 | MSC_BAND_60GHZ, 30 | MSC_BAND_NUM 31 | }; 32 | #endif 33 | 34 | enum msc_chan_width { 35 | MSC_CHAN_WIDTH_20_NOHT, 36 | MSC_CHAN_WIDTH_20, 37 | MSC_CHAN_WIDTH_40_PLUS, 38 | MSC_CHAN_WIDTH_80, 39 | MSC_CHAN_WIDTH_80P80, 40 | MSC_CHAN_WIDTH_160, 41 | MSC_CHAN_WIDTH_5, 42 | MSC_CHAN_WIDTH_10, 43 | MSC_CHAN_WIDTH_40_MINUS, 44 | }; 45 | 46 | enum msc_iftype { 47 | MSC_IFTYPE_UNSPECIFIED, 48 | MSC_IFTYPE_ADHOC, 49 | MSC_IFTYPE_STATION, 50 | MSC_IFTYPE_AP, 51 | MSC_IFTYPE_AP_VLAN, 52 | MSC_IFTYPE_WDS, 53 | MSC_IFTYPE_MONITOR, 54 | MSC_IFTYPE_MESH_POINT, 55 | MSC_IFTYPE_P2P_CLIENT, 56 | MSC_IFTYPE_P2P_GO, 57 | MSC_IFTYPE_P2P_DEVICE, 58 | 59 | MSC_IFTYPE_IFTYPES, 60 | }; 61 | 62 | struct chan_info { 63 | int chan_id; 64 | enum msc_chan_width width; 65 | unsigned int flags; 66 | }; 67 | 68 | struct monitor_info { 69 | //enum msc_iftype iftype; 70 | unsigned int filter; 71 | struct chan_info chl_info; 72 | void *priv; 73 | }; 74 | 75 | typedef int (*sc_input_func) (char *, int); 76 | typedef int (*sc_sw_filter) (char *, int); 77 | 78 | int sccb_init(sc_input_func input_func, sc_sw_filter filter_func); 79 | int sccb_deinit(void); 80 | int sccb_enter_monitor_mode(struct monitor_info *info, void *priv); 81 | int sccb_leave_monitor_mode(void *priv); 82 | int sccb_set_monitor_chan(struct chan_info *chl_info, void *priv); 83 | int sccb_rx(char *data, unsigned int data_len); 84 | int sccb_enable_input(void); 85 | int sccb_disable_input(void); 86 | #endif 87 | -------------------------------------------------------------------------------- /elian/msc/core.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/elian/msc/core.o -------------------------------------------------------------------------------- /elian/msc/msc.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MSC_H__ 3 | #define __MSC_H__ 4 | 5 | #include "core.h" 6 | 7 | #define MSC_RESULT_BUFFER_SIZE 256 8 | typedef void (*msc_evt_cb) (unsigned int eid); 9 | 10 | struct msc_param { 11 | msc_evt_cb evt_cb; 12 | int chl_num; 13 | unsigned char *chls; 14 | unsigned char *key; 15 | void *reserved; 16 | }; 17 | 18 | struct msc_result { 19 | unsigned char auth_mode; 20 | unsigned char cust_data_len; 21 | char ssid[33]; 22 | char pwd[65]; 23 | char user[65]; 24 | char cust_data[256]; 25 | }; 26 | 27 | int msc_start(struct msc_param *p, void *priv); 28 | void msc_stop(void *pirv); 29 | int msc_reset(void); 30 | int msc_get_result(struct msc_result *result); 31 | int msc_cmd_handler(char *cmd, int len, char *result_str, void *priv); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /elian/os/linux/glue.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MSC_GLUE_H__ 3 | #define __MSC_GLUE_H__ 4 | 5 | int msc_proc_create(void *priv); 6 | void msc_proc_destroy(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /elian/os/linux/osal.c: -------------------------------------------------------------------------------- 1 | 2 | #include "osal.h" 3 | 4 | inline void *osal_memset(void *buf, int i, unsigned int len) 5 | { 6 | return memset(buf, i, len); 7 | } 8 | 9 | inline void *osal_memcpy(void *dst, const void *src, unsigned int len) 10 | { 11 | return memcpy(dst, src, len); 12 | } 13 | 14 | inline int osal_memcmp(const void *buf1, const void *buf2, unsigned int len) 15 | { 16 | return memcmp(buf1, buf2, len); 17 | } 18 | 19 | inline int osal_timer_create(p_osal_timer ptimer) 20 | { 21 | struct timer_list *timer = &ptimer->timer; 22 | init_timer(timer); 23 | timer->function = ptimer->timeoutHandler; 24 | timer->data = (unsigned long)ptimer->data; 25 | return 0; 26 | } 27 | 28 | inline int osal_timer_start(p_osal_timer ptimer, unsigned ms) 29 | { 30 | struct timer_list *timer = &ptimer->timer; 31 | timer->expires = jiffies + (ms / (1000 / HZ)); 32 | add_timer(timer); 33 | return 0; 34 | } 35 | 36 | inline int osal_timer_stop(p_osal_timer ptimer) 37 | { 38 | struct timer_list *timer = &ptimer->timer; 39 | del_timer(timer); 40 | return 0; 41 | } 42 | 43 | inline int osal_timer_modify(p_osal_timer ptimer, unsigned int ms) 44 | { 45 | 46 | mod_timer(&ptimer->timer, jiffies + (ms) / (1000 / HZ)); 47 | return 0; 48 | } 49 | 50 | inline int osal_thread_create(p_osal_thread thread) 51 | { 52 | thread->thread = kthread_create(thread->thread_func, 53 | thread->data, thread->name); 54 | if (NULL == thread->thread) { 55 | return -1; 56 | } 57 | return 0; 58 | } 59 | 60 | inline int osal_thread_run(p_osal_thread thread) 61 | { 62 | if (thread->thread) { 63 | wake_up_process(thread->thread); 64 | return 0; 65 | } else { 66 | return -1; 67 | } 68 | } 69 | 70 | inline int osal_thread_stop(p_osal_thread thread) 71 | { 72 | int ret; 73 | if ((thread) && (thread->thread)) { 74 | ret = kthread_stop(thread->thread); 75 | return ret; 76 | } 77 | return -1; 78 | } 79 | 80 | inline int osal_thread_should_stop(p_osal_thread thread) 81 | { 82 | if ((thread) && (thread->thread)) { 83 | return kthread_should_stop(); 84 | } else { 85 | return 1; 86 | } 87 | } 88 | 89 | inline int osal_msleep(unsigned int ms) 90 | { 91 | msleep(ms); 92 | return 0; 93 | } 94 | 95 | inline unsigned int osal_strlen(const char *str) 96 | { 97 | return strlen(str); 98 | } 99 | 100 | inline int osal_strcmp(const char *dst, const char *src) 101 | { 102 | return strcmp(dst, src); 103 | } 104 | 105 | inline int osal_strncmp(const char *dst, const char *src, unsigned int len) 106 | { 107 | return strncmp(dst, src, len); 108 | } 109 | 110 | inline char *osal_strcpy(char *dst, const char *src) 111 | { 112 | return strcpy(dst, src); 113 | } 114 | 115 | inline long int osal_strtol(const char *str, char **c, int adecimal) 116 | { 117 | return simple_strtol(str, c, adecimal); 118 | } 119 | 120 | inline char *osal_strstr(const char *haystack, const char *needle) 121 | { 122 | return strstr(haystack, needle); 123 | } 124 | 125 | inline int osal_lock_init(spinlock_t * l) 126 | { 127 | //TODO:lock implenment depend on requirment. 128 | //spin_lock_init(l); 129 | return 0; 130 | } 131 | 132 | inline int osal_lock(spinlock_t * l) 133 | { 134 | //TODO:lock implenment depend on requirment. 135 | //spin_lock(l); 136 | return 0; 137 | } 138 | 139 | inline int osal_unlock(spinlock_t * l) 140 | { 141 | //TODO:lock implenment depend on requirment. 142 | //spin_unlock(l); 143 | return 0; 144 | } 145 | -------------------------------------------------------------------------------- /elian/os/linux/osal.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __MSC_OSAL_H__ 3 | #define __MSC_OSAL_H__ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #define MSC_WARN printk 14 | #define MSC_INFO printk 15 | #define MSC_DBG printk 16 | #define MAX_THREAD_NAME_LEN 16 17 | typedef void (*P_TIMEOUT_HANDLER) (unsigned long); 18 | typedef int (*thread_func) (unsigned long); 19 | 20 | typedef struct _osal_timer { 21 | struct timer_list timer; 22 | P_TIMEOUT_HANDLER timeoutHandler; 23 | unsigned long data; 24 | } osal_timer, *p_osal_timer; 25 | 26 | typedef struct _osal_thread { 27 | struct task_struct *thread; 28 | void *thread_func; 29 | void *data; 30 | char name[MAX_THREAD_NAME_LEN]; 31 | } osal_thread, *p_osal_thread; 32 | 33 | extern void *osal_memset(void *buf, int i, unsigned int len); 34 | extern void *osal_memcpy(void *dst, const void *src, unsigned int len); 35 | extern int osal_memcmp(const void *buf1, const void *buf2, unsigned int len); 36 | extern int osal_timer_modify(p_osal_timer ptimer, unsigned ms); 37 | extern int osal_timer_stop(p_osal_timer ptimer); 38 | extern int osal_timer_start(p_osal_timer ptimer, unsigned ms); 39 | extern int osal_timer_create(p_osal_timer ptimer); 40 | extern int osal_thread_create(p_osal_thread thread); 41 | extern int osal_thread_run(p_osal_thread thread); 42 | extern int osal_thread_stop(p_osal_thread thread); 43 | extern int osal_thread_should_stop(p_osal_thread thread); 44 | extern int osal_msleep(unsigned int ms); 45 | extern unsigned int osal_strlen(const char *str); 46 | extern int osal_strcmp(const char *dst, const char *src); 47 | extern int osal_strncmp(const char *dst, const char *src, unsigned int len); 48 | extern char *osal_strcpy(char *dst, const char *src); 49 | extern long int osal_strtol(const char *str, char **c, int adecimal); 50 | extern char *osal_strstr(const char *haystack, const char *needle); 51 | extern int osal_lock_init(spinlock_t * l); 52 | extern int osal_lock(spinlock_t * l); 53 | extern int osal_unlock(spinlock_t * l); 54 | #endif 55 | -------------------------------------------------------------------------------- /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 | Paul Lin 04-06-15 Initial 28 | */ 29 | 30 | #ifndef __ACTION_H__ 31 | #define __ACTION_H__ 32 | 33 | typedef struct GNU_PACKED __HT_INFO_OCTET { 34 | #ifdef RT_BIG_ENDIAN 35 | UCHAR Reserved:5; 36 | UCHAR STA_Channel_Width:1; 37 | UCHAR Forty_MHz_Intolerant:1; 38 | UCHAR Request:1; 39 | #else 40 | UCHAR Request:1; 41 | UCHAR Forty_MHz_Intolerant:1; 42 | UCHAR STA_Channel_Width:1; 43 | UCHAR Reserved:5; 44 | #endif 45 | } HT_INFORMATION_OCTET; 46 | 47 | typedef struct GNU_PACKED __FRAME_HT_INFO { 48 | HEADER_802_11 Hdr; 49 | UCHAR Category; 50 | UCHAR Action; 51 | HT_INFORMATION_OCTET HT_Info; 52 | } FRAME_HT_INFO, *PFRAME_HT_INFO; 53 | 54 | #endif /* __ACTION_H__ */ 55 | -------------------------------------------------------------------------------- /include/ags.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 AGS (Adaptive Group Switching) Related Structure & Definition 20 | 21 | ***************************************************************************/ 22 | 23 | #ifndef __AGS_H__ 24 | #define __AGS_H__ 25 | 26 | extern UCHAR AGS1x1HTRateTable[]; 27 | extern UCHAR AGS2x2HTRateTable[]; 28 | extern UCHAR AGS3x3HTRateTable[]; 29 | #ifdef DOT11_VHT_AC 30 | extern UCHAR Ags1x1VhtRateTable[]; 31 | extern UCHAR Ags2x2VhtRateTable[]; 32 | #endif /* DOT11_VHT_AC */ 33 | 34 | #define AGS_TX_QUALITY_WORST_BOUND 8 35 | #define AGS_QUICK_RA_TIME_INTERVAL 50 /* 50ms */ 36 | 37 | /* The size, in bytes, of an AGS entry in the rate switch table */ 38 | #define SIZE_OF_AGS_RATE_TABLE_ENTRY 9 39 | 40 | typedef struct _RTMP_RA_AGS_TB { 41 | UCHAR ItemNo; 42 | 43 | UCHAR STBC:1; 44 | UCHAR ShortGI:1; 45 | UCHAR BW:2; 46 | UCHAR Mode:3; 47 | UCHAR Rsv1:1; 48 | 49 | UCHAR Nss:2; // NSS_XXX (VHT only) 50 | UCHAR rsv2:6; // Reserved 51 | 52 | UCHAR CurrMCS; 53 | UCHAR TrainUp; 54 | UCHAR TrainDown; 55 | UCHAR downMcs; 56 | UCHAR upMcs3; 57 | UCHAR upMcs2; 58 | UCHAR upMcs1; 59 | } RTMP_RA_AGS_TB; 60 | 61 | /* AGS control */ 62 | typedef struct _AGS_CONTROL { 63 | UCHAR MCSGroup; /* The MCS group under testing */ 64 | UCHAR lastRateIdx; 65 | } AGS_CONTROL, *PAGS_CONTROL; 66 | 67 | /* The statistics information for AGS */ 68 | typedef struct _AGS_STATISTICS_INFO { 69 | CHAR RSSI; 70 | ULONG TxErrorRatio; 71 | ULONG AccuTxTotalCnt; 72 | ULONG TxTotalCnt; 73 | ULONG TxSuccess; 74 | ULONG TxRetransmit; 75 | ULONG TxFailCount; 76 | } AGS_STATISTICS_INFO, *PAGS_STATISTICS_INFO; 77 | 78 | /* Support AGS (Adaptive Group Switching) */ 79 | #define SUPPORT_AGS(__pAd) ((__pAd)->rateAlg == RATE_ALG_AGS) 80 | 81 | #ifdef DOT11_VHT_AC 82 | #define AGS_IS_USING(__pAd, __pRateTable) \ 83 | (SUPPORT_AGS(__pAd) && \ 84 | ((__pRateTable == AGS1x1HTRateTable) ||\ 85 | (__pRateTable == AGS2x2HTRateTable) ||\ 86 | (__pRateTable == AGS3x3HTRateTable) ||\ 87 | (__pRateTable == Ags1x1VhtRateTable) ||\ 88 | (__pRateTable == Ags2x2VhtRateTable))) 89 | #else 90 | #define AGS_IS_USING(__pAd, __pRateTable) \ 91 | (SUPPORT_AGS(__pAd) && \ 92 | ((__pRateTable == AGS1x1HTRateTable) || \ 93 | (__pRateTable == AGS2x2HTRateTable) || \ 94 | (__pRateTable == AGS3x3HTRateTable))) 95 | #endif /* DOT11_VHT_AC */ 96 | 97 | #endif /* __AGS_H__ */ 98 | -------------------------------------------------------------------------------- /include/ap_autoChSel.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 | Abstract: 17 | 18 | */ 19 | 20 | #include "ap_autoChSel_cmm.h" 21 | 22 | #ifndef __AUTOCHSELECT_H__ 23 | #define __AUTOCHSELECT_H__ 24 | 25 | #define AP_AUTO_CH_SEL(__P, __O) APAutoSelectChannel((__P), (__O)) 26 | 27 | ULONG AutoChBssSearchWithSSID(IN PRTMP_ADAPTER pAd, 28 | IN PUCHAR Bssid, 29 | IN PUCHAR pSsid, 30 | IN UCHAR SsidLen, IN UCHAR Channel); 31 | 32 | VOID APAutoChannelInit(IN PRTMP_ADAPTER pAd); 33 | 34 | VOID UpdateChannelInfo(IN PRTMP_ADAPTER pAd, IN int ch, IN ChannelSel_Alg Alg); 35 | 36 | ULONG AutoChBssInsertEntry(IN PRTMP_ADAPTER pAd, 37 | IN PUCHAR pBssid, 38 | IN CHAR Ssid[], 39 | IN UCHAR SsidLen, 40 | IN UCHAR ChannelNo, 41 | IN UCHAR ExtChOffset, IN CHAR Rssi); 42 | 43 | VOID AutoChBssTableInit(IN PRTMP_ADAPTER pAd); 44 | 45 | VOID ChannelInfoInit(IN PRTMP_ADAPTER pAd); 46 | 47 | VOID AutoChBssTableDestroy(IN PRTMP_ADAPTER pAd); 48 | 49 | VOID ChannelInfoDestroy(IN PRTMP_ADAPTER pAd); 50 | 51 | VOID CheckPhyModeIsABand(IN PRTMP_ADAPTER pAd); 52 | 53 | UCHAR SelectBestChannel(IN PRTMP_ADAPTER pAd, IN ChannelSel_Alg Alg); 54 | 55 | UCHAR APAutoSelectChannel(IN PRTMP_ADAPTER pAd, IN ChannelSel_Alg Alg); 56 | 57 | #endif /* __AUTOCHSELECT_H__ */ 58 | -------------------------------------------------------------------------------- /include/ap_autoChSel_cmm.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 | Abstract: 17 | 18 | */ 19 | 20 | #ifndef __AUTOCHSELECT_CMM_H__ 21 | #define __AUTOCHSELECT_CMM_H__ 22 | 23 | #define RSSI_TO_DBM_OFFSET 120 /* RSSI-115 = dBm */ 24 | 25 | typedef struct { 26 | ULONG dirtyness[MAX_NUM_OF_CHANNELS + 1]; 27 | ULONG ApCnt[MAX_NUM_OF_CHANNELS + 1]; 28 | UINT32 FalseCCA[MAX_NUM_OF_CHANNELS + 1]; 29 | BOOLEAN SkipList[MAX_NUM_OF_CHANNELS + 1]; 30 | #ifdef AP_QLOAD_SUPPORT 31 | UINT32 chanbusytime[MAX_NUM_OF_CHANNELS + 1]; /* QLOAD ALARM */ 32 | #endif /* AP_QLOAD_SUPPORT */ 33 | BOOLEAN IsABand; 34 | } CHANNELINFO, *PCHANNELINFO; 35 | 36 | typedef struct { 37 | UCHAR Bssid[MAC_ADDR_LEN]; 38 | UCHAR SsidLen; 39 | CHAR Ssid[MAX_LEN_OF_SSID]; 40 | UCHAR Channel; 41 | UCHAR ExtChOffset; 42 | CHAR Rssi; 43 | } BSSENTRY, *PBSSENTRY; 44 | 45 | typedef struct { 46 | UCHAR BssNr; 47 | BSSENTRY BssEntry[MAX_LEN_OF_BSS_TABLE]; 48 | } BSSINFO, *PBSSINFO; 49 | 50 | typedef enum ChannelSelAlg { 51 | ChannelAlgRandom, /*use by Dfs */ 52 | ChannelAlgApCnt, 53 | ChannelAlgCCA 54 | } ChannelSel_Alg; 55 | 56 | #endif /* __AUTOCHSELECT_CMM_H__ */ 57 | -------------------------------------------------------------------------------- /include/ap_cfg.h: -------------------------------------------------------------------------------- 1 | #ifndef __AP_CFG_H__ 2 | #define __AP_CFG_H__ 3 | 4 | #include "rt_config.h" 5 | 6 | INT RTMPAPPrivIoctlSet(IN RTMP_ADAPTER * pAd, 7 | IN RTMP_IOCTL_INPUT_STRUCT * pIoctlCmdStr); 8 | 9 | INT RTMPAPPrivIoctlShow(IN RTMP_ADAPTER * pAd, 10 | IN RTMP_IOCTL_INPUT_STRUCT * pIoctlCmdStr); 11 | 12 | #ifdef INF_AR9 13 | #ifdef AR9_MAPI_SUPPORT 14 | INT RTMPAPPrivIoctlAR9Show(IN RTMP_ADAPTER * pAd, 15 | IN RTMP_IOCTL_INPUT_STRUCT * pIoctlCmdStr); 16 | 17 | VOID RTMPAR9IoctlGetMacTable(IN PRTMP_ADAPTER pAd, 18 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 19 | 20 | VOID RTMPIoctlGetSTAT2(IN PRTMP_ADAPTER pAd, IN RTMP_IOCTL_INPUT_STRUCT * wrq); 21 | 22 | VOID RTMPIoctlGetRadioDynInfo(IN PRTMP_ADAPTER pAd, 23 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 24 | #endif /*AR9_MAPI_SUPPORT */ 25 | #endif /* INF_AR9 */ 26 | 27 | INT RTMPAPSetInformation(IN PRTMP_ADAPTER pAd, 28 | IN OUT RTMP_IOCTL_INPUT_STRUCT * rq, IN INT cmd); 29 | 30 | INT RTMPAPQueryInformation(IN PRTMP_ADAPTER pAd, 31 | IN OUT RTMP_IOCTL_INPUT_STRUCT * rq, IN INT cmd); 32 | 33 | VOID RTMPIoctlStatistics(IN PRTMP_ADAPTER pAd, 34 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 35 | 36 | VOID RTMPIoctlGetMacTable(IN PRTMP_ADAPTER pAd, 37 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 38 | 39 | VOID RTMPAPIoctlE2PROM(IN PRTMP_ADAPTER pAdapter, 40 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 41 | 42 | #ifdef DBG 43 | VOID RTMPAPIoctlBBP(IN PRTMP_ADAPTER pAdapter, 44 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 45 | 46 | VOID RTMPAPIoctlMAC(IN PRTMP_ADAPTER pAdapter, 47 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 48 | 49 | #endif /* DBG */ 50 | 51 | VOID RtmpDrvMaxRateGet(IN VOID * pReserved, 52 | /* IN PHTTRANSMIT_SETTING pHtPhyMode, */ 53 | IN UINT8 MODE, 54 | IN UINT8 ShortGI, 55 | IN UINT8 BW, IN UINT8 MCS, OUT UINT32 * pRate); 56 | 57 | #ifdef WSC_AP_SUPPORT 58 | VOID RTMPIoctlWscProfile(IN PRTMP_ADAPTER pAdapter, 59 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 60 | 61 | VOID RTMPIoctlWscProfile(IN PRTMP_ADAPTER pAdapter, 62 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 63 | /*add by woody */ 64 | #ifdef INF_AR9 65 | #ifdef AR9_MAPI_SUPPORT 66 | VOID RTMPAR9IoctlWscProfile(IN PRTMP_ADAPTER pAdapter, 67 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 68 | 69 | VOID RTMPIoctlWscPINCode(IN PRTMP_ADAPTER pAdapter, 70 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 71 | 72 | VOID RTMPIoctlWscStatus(IN PRTMP_ADAPTER pAdapter, 73 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 74 | 75 | VOID RTMPIoctlGetWscDynInfo(IN PRTMP_ADAPTER pAdapter, 76 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 77 | 78 | VOID RTMPIoctlGetWscRegsDynInfo(IN PRTMP_ADAPTER pAdapter, 79 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 80 | #endif /*AR9_MAPI_SUPPORT */ 81 | #endif /* INF_AR9 */ 82 | #endif /* WSC_AP_SUPPORT */ 83 | 84 | #ifdef DOT11_N_SUPPORT 85 | VOID RTMPIoctlQueryBaTable(IN PRTMP_ADAPTER pAd, 86 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 87 | #endif /* DOT11_N_SUPPORT */ 88 | 89 | #ifdef DOT1X_SUPPORT 90 | VOID RTMPIoctlStaticWepCopy(IN PRTMP_ADAPTER pAd, 91 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 92 | 93 | VOID RTMPIoctlRadiusData(IN PRTMP_ADAPTER pAd, 94 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 95 | 96 | VOID RTMPIoctlAddWPAKey(IN PRTMP_ADAPTER pAd, IN RTMP_IOCTL_INPUT_STRUCT * wrq); 97 | 98 | VOID RTMPIoctlAddPMKIDCache(IN PRTMP_ADAPTER pAd, 99 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 100 | 101 | VOID RTMPIoctlSetIdleTimeout(IN PRTMP_ADAPTER pAd, 102 | IN RTMP_IOCTL_INPUT_STRUCT * wrq); 103 | #endif /* DOT1X_SUPPORT */ 104 | 105 | INT ApCfg_Set_AuthMode_Proc(IN PRTMP_ADAPTER pAd, IN INT apidx, IN PSTRING arg); 106 | 107 | INT ApCfg_Set_MaxStaNum_Proc(IN PRTMP_ADAPTER pAd, 108 | IN INT apidx, IN PSTRING arg); 109 | 110 | INT ApCfg_Set_IdleTimeout_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 111 | 112 | #ifdef APCLI_SUPPORT 113 | #ifdef APCLI_WPA_SUPPLICANT_SUPPORT 114 | VOID RTMPApCliAddKey(IN PRTMP_ADAPTER pAd, 115 | IN INT apidx, IN PNDIS_APCLI_802_11_KEY pApcliKey); 116 | #endif /* APCLI_WPA_SUPPLICANT_SUPPORT */ 117 | #endif /* APCLI_SUPPORT */ 118 | #endif /* __AP_CFG_H__ */ 119 | -------------------------------------------------------------------------------- /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(IN PVOID SystemSpecific1, 28 | IN PVOID FunctionContext, 29 | IN PVOID SystemSpecific2, IN PVOID SystemSpecific3); 30 | 31 | BOOLEAN RTMPSpoofedMgmtDetection(IN PRTMP_ADAPTER pAd, 32 | IN PHEADER_802_11 pHeader, 33 | IN CHAR Rssi0, 34 | IN CHAR Rssi1, IN CHAR Rssi2, IN UCHAR AntSel); 35 | 36 | VOID RTMPConflictSsidDetection(IN PRTMP_ADAPTER pAd, 37 | IN PUCHAR pSsid, 38 | IN UCHAR SsidLen, 39 | IN CHAR Rssi0, 40 | IN CHAR Rssi1, IN CHAR Rssi2, IN UCHAR AntSel); 41 | 42 | BOOLEAN RTMPReplayAttackDetection(IN PRTMP_ADAPTER pAd, 43 | IN PUCHAR pAddr2, 44 | IN CHAR Rssi0, 45 | IN CHAR Rssi1, 46 | IN CHAR Rssi2, IN UCHAR AntSel, IN UCHAR BW); 47 | 48 | VOID RTMPUpdateStaMgmtCounter(IN PRTMP_ADAPTER pAd, IN USHORT type); 49 | 50 | VOID RTMPClearAllIdsCounter(IN PRTMP_ADAPTER pAd); 51 | 52 | VOID RTMPIdsStart(IN PRTMP_ADAPTER pAd); 53 | 54 | VOID RTMPIdsStop(IN PRTMP_ADAPTER pAd); 55 | 56 | VOID rtmp_read_ids_from_file(IN PRTMP_ADAPTER pAd, char *tmpbuf, char *buffer); 57 | -------------------------------------------------------------------------------- /include/ap_mbss.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 | ap_mbss.h 20 | 21 | Abstract: 22 | Support multi-BSS function. 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | Sample Lin 01-02-2007 created 28 | */ 29 | 30 | #ifndef MODULE_MBSS 31 | 32 | #define MBSS_EXTERN extern 33 | 34 | #else 35 | 36 | #define MBSS_EXTERN 37 | 38 | #endif /* MODULE_MBSS */ 39 | 40 | /* 41 | For MBSS, the phy mode is different; 42 | So MBSS_PHY_MODE_RESET() can help us to adjust the correct mode & 43 | maximum MCS for the BSS. 44 | */ 45 | #define MBSS_PHY_MODE_RESET(__BssId, __HtPhyMode) \ 46 | { \ 47 | UCHAR __PhyMode = pAd->ApCfg.MBSSID[__BssId].PhyMode; \ 48 | if ((__PhyMode == WMODE_B) && \ 49 | (__HtPhyMode.field.MODE != MODE_CCK)) \ 50 | { \ 51 | __HtPhyMode.field.MODE = MODE_CCK; \ 52 | __HtPhyMode.field.MCS = 3; \ 53 | } \ 54 | else if ((!WMODE_CAP_N(__PhyMode)) && \ 55 | (__PhyMode != WMODE_B) && \ 56 | (__HtPhyMode.field.MODE != MODE_OFDM)) \ 57 | { \ 58 | __HtPhyMode.field.MODE = MODE_OFDM; \ 59 | __HtPhyMode.field.MCS = 7; \ 60 | } \ 61 | } 62 | 63 | /* Public function list */ 64 | INT Show_MbssInfo_Display_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 65 | 66 | VOID MBSS_Init(IN PRTMP_ADAPTER pAd, IN RTMP_OS_NETDEV_OP_HOOK * pNetDevOps); 67 | 68 | VOID MBSS_Remove(IN PRTMP_ADAPTER pAd); 69 | 70 | INT MBSS_Open(IN PNET_DEV pDev); 71 | 72 | INT MBSS_Close(IN PNET_DEV pDev); 73 | 74 | INT32 RT28xx_MBSS_IdxGet(IN PRTMP_ADAPTER pAd, IN PNET_DEV pDev); 75 | -------------------------------------------------------------------------------- /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(IN PNDIS_PACKET pPacket); 76 | 77 | #endif /* __BR_FTPH_H__ */ 78 | 79 | /* End of br_ftph.h */ 80 | -------------------------------------------------------------------------------- /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 | 23 | #ifdef RT_CFG80211_SUPPORT 24 | 25 | #include 26 | 27 | typedef enum _NDIS_HOSTAPD_STATUS { 28 | Hostapd_Diable = 0, 29 | Hostapd_EXT, 30 | Hostapd_CFG 31 | } NDIS_HOSTAPD_STATUS, *PNDIS_HOSTAPD_STATUS; 32 | 33 | typedef struct __CFG80211_CB { 34 | 35 | /* we can change channel/rate information on the fly so we backup them */ 36 | struct ieee80211_supported_band Cfg80211_bands[IEEE80211_NUM_BANDS]; 37 | struct ieee80211_channel *pCfg80211_Channels; 38 | struct ieee80211_rate *pCfg80211_Rates; 39 | 40 | /* used in wiphy_unregister */ 41 | struct wireless_dev *pCfg80211_Wdev; 42 | 43 | /* used in scan end */ 44 | struct cfg80211_scan_request *pCfg80211_ScanReq; 45 | 46 | /* monitor filter */ 47 | UINT32 MonFilterFlag; 48 | 49 | /* channel information */ 50 | struct ieee80211_channel ChanInfo[MAX_NUM_OF_CHANNELS]; 51 | 52 | #if 1 //patch : cfg80211_scan_done() crash issue! 53 | /* to protect scan status */ 54 | spinlock_t scan_notify_lock; 55 | #endif 56 | 57 | } CFG80211_CB; 58 | 59 | /* 60 | ======================================================================== 61 | Routine Description: 62 | Register MAC80211 Module. 63 | 64 | Arguments: 65 | pAd - WLAN control block pointer 66 | pDev - Generic device interface 67 | pNetDev - Network device 68 | 69 | Return Value: 70 | NONE 71 | 72 | Note: 73 | pDev != pNetDev 74 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) 75 | 76 | Can not use pNetDev to replace pDev; Or kernel panic. 77 | ======================================================================== 78 | */ 79 | BOOLEAN CFG80211_Register(VOID * pAd, 80 | struct device *pDev, struct net_device *pNetDev); 81 | 82 | #endif /* RT_CFG80211_SUPPORT */ 83 | 84 | /* End of cfg80211.h */ 85 | -------------------------------------------------------------------------------- /include/chip/chip_id.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 | chip_id.h 18 | 19 | Abstract: 20 | 21 | Revision History: 22 | Who When What 23 | --------- ---------- ---------------------------------------------- 24 | */ 25 | 26 | #ifndef __CHIP_ID_H__ 27 | #define __CHIP_ID_H__ 28 | 29 | #define NIC_PCI_VENDOR_ID 0x1814 30 | 31 | #define NIC2860_PCI_DEVICE_ID 0x0601 32 | #define NIC2860_PCIe_DEVICE_ID 0x0681 33 | #define NIC2760_PCI_DEVICE_ID 0x0701 /* 1T/2R Cardbus ??? */ 34 | #define NIC2790_PCIe_DEVICE_ID 0x0781 /* 1T/2R miniCard */ 35 | 36 | #define VEN_AWT_PCIe_DEVICE_ID 0x1059 37 | #define VEN_AWT_PCI_VENDOR_ID 0x1A3B 38 | 39 | #define EDIMAX_PCI_VENDOR_ID 0x1432 40 | 41 | #define NIC3090_PCIe_DEVICE_ID 0x3090 /* 1T/1R miniCard */ 42 | #define NIC3091_PCIe_DEVICE_ID 0x3091 /* 1T/2R miniCard */ 43 | #define NIC3092_PCIe_DEVICE_ID 0x3092 /* 2T/2R miniCard */ 44 | #define NIC3390_PCIe_DEVICE_ID 0x3390 /* 1T/1R miniCard */ 45 | 46 | #define NIC3062_PCI_DEVICE_ID 0x3062 /* 2T/2R miniCard */ 47 | #define NIC3562_PCI_DEVICE_ID 0x3562 /* 2T/2R miniCard */ 48 | #define NIC3060_PCI_DEVICE_ID 0x3060 /* 1T/1R miniCard */ 49 | 50 | #define NIC3592_PCIe_DEVICE_ID 0x3592 /* 2T/2R miniCard */ 51 | 52 | #define NIC3593_PCI_OR_PCIe_DEVICE_ID 0x3593 53 | #define NIC5390_PCIe_DEVICE_ID 0x5390 54 | #define NIC539F_PCIe_DEVICE_ID 0x539F 55 | #define NIC5392_PCIe_DEVICE_ID 0x5392 56 | #define NIC5360_PCI_DEVICE_ID 0x5360 57 | #define NIC5362_PCI_DEVICE_ID 0x5362 58 | 59 | #define NIC5592_PCIe_DEVICE_ID 0x5592 60 | 61 | #define NIC3290_PCIe_DEVICE_ID 0x3290 62 | 63 | #define NIC6590_PCIe_DEVICE_ID 0x6590 64 | #define NIC7601_PCIe_DEVICE_ID 0x7601 65 | 66 | #define NIC8592_5592_PCIe_DEVICE_ID 0x5592 67 | #define NIC8592_PCIe_DEVICE_ID 0x8592 68 | 69 | #define NIC6390_PCIe_DEVICE_ID 0x6390 70 | 71 | #endif /* __CHIP_ID_H__ */ 72 | -------------------------------------------------------------------------------- /include/chip/rt28xx.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 | rt28xx.h 18 | 19 | Abstract: 20 | 21 | Revision History: 22 | Who When What 23 | --------- ---------- ---------------------------------------------- 24 | */ 25 | 26 | #ifndef __RT28XX_H__ 27 | #define __RT28XX_H__ 28 | 29 | #ifdef RT28xx 30 | 31 | VOID RT28xx_ChipSwitchChannel(IN struct _RTMP_ADAPTER *pAd, 32 | IN UCHAR Channel, IN BOOLEAN bScan); 33 | 34 | #endif /* RT28xx */ 35 | 36 | #endif /*__RT28XX_H__ */ 37 | -------------------------------------------------------------------------------- /include/chip/rt3290.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 | rt3290.h 18 | 19 | Abstract: 20 | 21 | Revision History: 22 | Who When What 23 | --------- ---------- ---------------------------------------------- 24 | */ 25 | 26 | #ifndef __RT3290_H__ 27 | #define __RT3290_H__ 28 | 29 | #ifdef RT3290 30 | 31 | #error "For RT3290, you should define the compile flag -DRTMP_PCI_SUPPORT" 32 | 33 | #error "For RT3290, you should define the compile flag -DRTMP_MAC_PCI" 34 | 35 | #error "For RT3290, you should define the compile flag -DRTMP_RF_RW_SUPPORT" 36 | 37 | #error "For RT3290, you should define the compile flag -DRT30xx" 38 | 39 | #include "chip/mac_pci.h" 40 | #include "chip/rt30xx.h" 41 | 42 | struct _RTMP_ADAPTER; 43 | 44 | #define NIC3290_PCIe_DEVICE_ID 0x3290 45 | 46 | #define RT3290_CHECK_SW_EEP_BUSY(pAd) \ 47 | { \ 48 | UINT32 _val, _cnt = 0; \ 49 | do { \ 50 | RTMP_IO_FORCE_READ32(pAd, WLAN_FUN_INFO, &_val); \ 51 | if ((_val & 0x80000000) == 0 || (_val == 0xffffffff)) \ 52 | break; \ 53 | _cnt++; \ 54 | DBGPRINT_ERR(("RT3290: EEP is busy!!!! BusyCnt%d : fail\n", _cnt)); \ 55 | RTMPusecDelay(500); \ 56 | } while (_cnt<300); \ 57 | } \ 58 | 59 | #define RT3290_CURRENT_LEAKAGE(_pAd,_A,_e) \ 60 | { \ 61 | if (IS_RT3290(_pAd)) \ 62 | { \ 63 | UINT32 btFunInfo, _val = 0; \ 64 | RTMP_IO_FORCE_READ32(_pAd, _A, &_val); \ 65 | if (_e) \ 66 | _val &= ~(EESK|EEDI); \ 67 | else \ 68 | { \ 69 | _val &= ~(EESK); \ 70 | _val |= EEDI; \ 71 | } \ 72 | RT3290_CHECK_SW_EEP_BUSY(_pAd); \ 73 | RTMP_IO_FORCE_READ32(_pAd, BT_FUN_INFO, &btFunInfo); \ 74 | btFunInfo |= 0x80000000; \ 75 | RTMP_IO_FORCE_WRITE32(_pAd, BT_FUN_INFO, btFunInfo); \ 76 | \ 77 | RTMP_IO_FORCE_WRITE32(_pAd, _A, _V); \ 78 | \ 79 | btFunInfo &= ~(0x80000000); \ 80 | RTMP_IO_FORCE_WRITE32(_pAd, BT_FUN_INFO, btFunInfo); \ 81 | } \ 82 | } 83 | 84 | VOID MlmeAntSelection(IN struct _RTMP_ADAPTER *pAd, 85 | IN ULONG AccuTxTotalCnt, 86 | IN ULONG TxErrorRatio, IN ULONG TxSuccess, IN CHAR Rssi); 87 | 88 | INT RT3290_eeprom_access_grant(IN struct _RTMP_ADAPTER *pAd, 89 | IN BOOLEAN bGetCtrl); 90 | 91 | VOID RTMP_MAC_PWRSV_EN(IN struct _RTMP_ADAPTER *pAd, 92 | IN BOOLEAN EnterIdle, IN BOOLEAN use40M); 93 | 94 | VOID RTMPEnableWlan(IN struct _RTMP_ADAPTER *pAd, 95 | IN BOOLEAN bOn, IN BOOLEAN bResetWLAN); 96 | 97 | VOID RT3290_Init(IN struct _RTMP_ADAPTER *pAd); 98 | 99 | #endif /* RT3290 */ 100 | 101 | #endif /* __RT5390_H__ */ 102 | -------------------------------------------------------------------------------- /include/chip/rt6590.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 | rt6590.h 18 | 19 | Abstract: 20 | 21 | Revision History: 22 | Who When What 23 | --------- ---------- ---------------------------------------------- 24 | */ 25 | 26 | #ifndef __RT6590_H__ 27 | #define __RT6590_H__ 28 | 29 | struct _RTMP_ADAPTER; 30 | 31 | #define NIC6590_PCIe_DEVICE_ID 0x6590 32 | #define MAX_RF_ID 127 33 | #define MAC_RF_BANK 7 34 | 35 | /* 36 | rsv: Reserved 37 | tcp: packet type, tcp : 1, udp:0 38 | tups: TCP/UDP header start offset (in unit of DWORD) 39 | ips: IP start offset (in unit of byte), base address of ips is the beginning of TXWI 40 | mss: Max Segment size (in unit of byte) 41 | */ 42 | #ifdef RT_BIG_ENDIAN 43 | typedef struct _TSO_INFO_ { 44 | UINT32 mss:16; 45 | UINT32 ips:8; 46 | UINT32 tups:6; 47 | UINT32 tcp:1; 48 | UINT32 rsv:1; 49 | } TSO_INFO; 50 | #else 51 | typedef struct _TSO_INFO_ { 52 | UINT32 rsv:1; 53 | UINT32 tcp:1; 54 | UINT32 tups:6; 55 | UINT32 ips:8; 56 | UINT32 mss:16; 57 | } TSO_INFO; 58 | #endif /* RT_BIG_ENDIAN */ 59 | 60 | /* 61 | * Frequency plan item for RT85592 62 | * N: R9[4], R8[7:0] 63 | * K: R7[7], R9[3:0] 64 | * mod: R9[7:5], R11[3:2] (eg. mod=8 => 0x0, mod=10 => 0x2) 65 | * R: R11[1:0] (eg. R=1 => 0x0, R=3 => 0x2) 66 | */ 67 | typedef struct _RT8592_FREQ_ITEM { 68 | UINT8 Channel; 69 | UINT16 N; 70 | UINT8 K; 71 | UINT8 mod; 72 | UINT8 R; 73 | } RT8592_FREQ_ITEM; 74 | 75 | #define RT6590_RF_VER "MT7650_WiFi_RF_Register_20120516.xls" 76 | //#define RT6590_BBP_VER "TC6008_BBP_CR_20120518.xls" 77 | #define RT6590_BBP_VER "TC6008_BBP_CR_20120522.xls" 78 | 79 | /* 80 | Rdiv: R24[1:0] (2-bits) 81 | PLL_N: R29[7:0], R30[0] (9-bits) 82 | PLL_K(Nominator): R31[4:0] (5-bits) 83 | Non-Sigma: !SDM R31[7:5] (3-bits) 84 | Den: (Denomina - 8) R32[4:0] (5-bits) 85 | Loop Filter Config: R33, R34 86 | Pll_idiv: frac comp R35[6:0] (7-bits) 87 | 88 | 5G only 89 | Pll_LDO: R16 [6:4] = <010> 90 | */ 91 | typedef struct _RT6590_FREQ_ITEM { 92 | UINT8 Channel; 93 | UINT8 Band; 94 | UINT16 PLL_N; 95 | UINT8 PLL_K; 96 | UINT8 Rdiv; 97 | UINT8 NonSigma; 98 | UINT8 Den; 99 | UINT8 LFC_R33; 100 | UINT8 LFC_R34; 101 | UINT32 Pll_idiv; 102 | UINT8 Pll_LDO; // 5G only 103 | } RT6590_FREQ_ITEM; 104 | 105 | #define RF_G_BAND 0x01 106 | #define RF_A_BAND 0x02 107 | #define RF_A_BAND_LB 0x04 108 | #define RF_A_BAND_MB 0x08 109 | #define RF_A_BAND_HB 0x10 110 | typedef struct _RT6590_RF_SWITCH_ITEM { 111 | UCHAR Bank; 112 | UCHAR Register; 113 | UCHAR Band; /* G_Band, A_Band_LB, A_Band_MB, A_Band_HB */ 114 | UCHAR BW; 115 | UCHAR Value; 116 | } RT6590_RF_SWITCH_ITEM, *PRT6590_RF_SWITCH_ITEM; 117 | 118 | typedef struct _RT6590_DCOC_Table { 119 | UCHAR Band; /* G_Band, A_Band_LB, A_Band_MB, A_Band_HB */ 120 | RTMP_REG_PAIR RegDate; 121 | } RT6590_DOCO_Table, *PRT6590_DOCO_Table; 122 | 123 | VOID RT6590_Init(struct _RTMP_ADAPTER *pAd); 124 | INT RT6590_ReadChannelPwr(struct _RTMP_ADAPTER *pAd); 125 | 126 | #ifdef RT8592 127 | VOID RT85592_Init(struct _RTMP_ADAPTER *pAd); 128 | INT RT85592_ReadChannelPwr(struct _RTMP_ADAPTER *pAd); 129 | VOID RT85592ReadTxPwrPerRate(struct _RTMP_ADAPTER *pAd); 130 | #endif /* RT8592 */ 131 | VOID RT6590ReadTxPwrPerRate(struct _RTMP_ADAPTER *pAd); 132 | 133 | VOID dump_bw_info(struct _RTMP_ADAPTER *pAd); 134 | 135 | #endif /* __RT6590_H__ */ 136 | -------------------------------------------------------------------------------- /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(IN PRTMP_ADAPTER pAd); 30 | 31 | VOID CliWds_ProxyTabDestory(IN PRTMP_ADAPTER pAd); 32 | 33 | PCLIWDS_PROXY_ENTRY CliWdsEntyAlloc(IN PRTMP_ADAPTER pAd); 34 | 35 | VOID CliWdsEntyFree(IN PRTMP_ADAPTER pAd, IN PCLIWDS_PROXY_ENTRY pCliWdsEntry); 36 | 37 | PUCHAR CliWds_ProxyLookup(IN PRTMP_ADAPTER pAd, IN PUCHAR pMac); 38 | 39 | VOID CliWds_ProxyTabUpdate(IN PRTMP_ADAPTER pAd, IN SHORT Aid, IN PUCHAR pMac); 40 | 41 | VOID CliWds_ProxyTabMaintain(IN PRTMP_ADAPTER pAd); 42 | 43 | #endif /* __CLIENT_WDS_H__ */ 44 | -------------------------------------------------------------------------------- /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 | #define CLI_WDS_ENTRY_AGEOUT 5000 /* seconds */ 32 | 33 | #define CLIWDS_POOL_SIZE 128 34 | #define CLIWDS_HASH_TAB_SIZE 64 /* the legth of hash table must be power of 2. */ 35 | typedef struct _CLIWDS_PROXY_ENTRY { 36 | struct _CLIWDS_PROXY_ENTRY *pNext; 37 | ULONG LastRefTime; 38 | SHORT Aid; 39 | UCHAR Addr[MAC_ADDR_LEN]; 40 | } CLIWDS_PROXY_ENTRY, *PCLIWDS_PROXY_ENTRY; 41 | 42 | #endif /* CLIENT_WDS */ 43 | 44 | #endif /* __CLIENT_WDS_CMM_H__ */ 45 | -------------------------------------------------------------------------------- /include/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(IN ARC4_CTX_STRUC * pARC4_CTX, 43 | IN PUCHAR pKey, IN UINT KeyLength); 44 | 45 | VOID ARC4_Compute(IN ARC4_CTX_STRUC * pARC4_CTX, 46 | IN UINT8 InputBlock[], 47 | IN UINT InputBlockSize, OUT UINT8 OutputBlock[]); 48 | 49 | VOID ARC4_Discard_KeyLength(IN ARC4_CTX_STRUC * pARC4_CTX, IN UINT Length); 50 | 51 | #endif /* __CRYPT_ARC4_H__ */ 52 | -------------------------------------------------------------------------------- /include/crypt_biginteger.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 | BigInteger 18 | 19 | 20 | Revision History: 21 | Who When What 22 | -------- ---------- ------------------------------------------ 23 | Eddy 2009/01/12 Create 24 | ***************************************************************************/ 25 | 26 | #ifndef __CRYPT_BIGINTEGER_H__ 27 | #define __CRYPT_BIGINTEGER_H__ 28 | 29 | #include "rt_config.h" 30 | 31 | /* BigInteger definition & structure */ 32 | #define SLIDING_WINDOW 16 33 | typedef struct _BIG_INTEGER_STRUC { 34 | STRING Name[10]; 35 | UINT32 *pIntegerArray; 36 | UINT AllocSize; 37 | UINT ArrayLength; 38 | UINT IntegerLength; 39 | INT Signed; 40 | } BIG_INTEGER, *PBIG_INTEGER; 41 | 42 | /* BigInteger operations */ 43 | VOID BigInteger_Print(IN PBIG_INTEGER pBI); 44 | 45 | VOID BigInteger_Init(INOUT PBIG_INTEGER * pBI); 46 | 47 | VOID BigInteger_Free_AllocSize(IN PBIG_INTEGER * pBI); 48 | 49 | VOID BigInteger_Free(IN PBIG_INTEGER * pBI); 50 | 51 | VOID BigInteger_AllocSize(IN PBIG_INTEGER * pBI, IN INT Length); 52 | 53 | VOID BigInteger_ClearHighBits(IN PBIG_INTEGER pBI); 54 | 55 | VOID BigInteger_BI2Bin(IN PBIG_INTEGER pBI, 56 | OUT UINT8 * pValue, OUT UINT * Length); 57 | 58 | VOID BigInteger_Bin2BI(IN UINT8 * pValue, 59 | IN UINT Length, OUT PBIG_INTEGER * pBI); 60 | 61 | VOID BigInteger_BitsOfBI(IN PBIG_INTEGER pBI, OUT UINT * Bits_Of_P); 62 | 63 | INT BigInteger_GetBitValue(IN PBIG_INTEGER pBI, IN UINT Index); 64 | 65 | UINT8 BigInteger_GetByteValue(IN PBIG_INTEGER pBI, IN UINT Index); 66 | 67 | VOID BigInteger_Copy(IN PBIG_INTEGER pBI_Copied, OUT PBIG_INTEGER * pBI_Result); 68 | 69 | INT BigInteger_UnsignedCompare(IN PBIG_INTEGER pFirstOperand, 70 | IN PBIG_INTEGER pSecondOperand); 71 | 72 | VOID BigInteger_Add(IN PBIG_INTEGER pFirstOperand, 73 | IN PBIG_INTEGER pSecondOperand, 74 | OUT PBIG_INTEGER * pBI_Result); 75 | 76 | VOID BigInteger_Sub(IN PBIG_INTEGER pFirstOperand, 77 | IN PBIG_INTEGER pSecondOperand, 78 | OUT PBIG_INTEGER * pBI_Result); 79 | 80 | VOID BigInteger_Mul(IN PBIG_INTEGER pFirstOperand, 81 | IN PBIG_INTEGER pSecondOperand, 82 | OUT PBIG_INTEGER * pBI_Result); 83 | 84 | VOID BigInteger_Square(IN PBIG_INTEGER pBI, OUT PBIG_INTEGER * pBI_Result); 85 | 86 | VOID BigInteger_Div(IN PBIG_INTEGER pFirstOperand, 87 | IN PBIG_INTEGER pSecondOperand, 88 | OUT PBIG_INTEGER * pBI_Result, 89 | OUT PBIG_INTEGER * pBI_Remainder); 90 | 91 | VOID BigInteger_Montgomery_Reduction(IN PBIG_INTEGER pBI_A, 92 | IN PBIG_INTEGER pBI_P, 93 | IN PBIG_INTEGER pBI_R, 94 | OUT PBIG_INTEGER * pBI_Result); 95 | 96 | VOID BigInteger_Montgomery_ExpMod(IN PBIG_INTEGER pBI_G, 97 | IN PBIG_INTEGER pBI_E, 98 | IN PBIG_INTEGER pBI_P, 99 | OUT PBIG_INTEGER * pBI_Result); 100 | 101 | #endif /* __CRYPT_BIGINTEGER_H__ */ 102 | -------------------------------------------------------------------------------- /include/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 | /* DH operations */ 34 | void DH_PublicKey_Generate(IN UINT8 GValue[], 35 | IN UINT GValueLength, 36 | IN UINT8 PValue[], 37 | IN UINT PValueLength, 38 | IN UINT8 PrivateKey[], 39 | IN UINT PrivateKeyLength, 40 | OUT UINT8 PublicKey[], INOUT UINT * PublicKeyLength); 41 | 42 | void DH_SecretKey_Generate(IN UINT8 PublicKey[], 43 | IN UINT PublicKeyLength, 44 | IN UINT8 PValue[], 45 | IN UINT PValueLength, 46 | IN UINT8 PrivateKey[], 47 | IN UINT PrivateKeyLength, 48 | OUT UINT8 SecretKey[], INOUT UINT * SecretKeyLength); 49 | 50 | #define RT_DH_PublicKey_Generate(GK, GKL, PV, PVL, PriK, PriKL, PubK, PubKL) \ 51 | DH_PublicKey_Generate((GK), (GKL), (PV), (PVL), (PriK), (PriKL), (UINT8 *) (PubK), (UINT *) (PubKL)) 52 | 53 | #define RT_DH_SecretKey_Generate(PubK, PubKL, PV, PVL, PriK, PriKL, SecK, SecKL) \ 54 | DH_SecretKey_Generate((PubK), (PubKL), (PV), (PVL), (PriK), (PriKL), (UINT8 *) (SecK), (UINT *) (SecKL)) 55 | 56 | #define RT_DH_FREE_ALL() 57 | 58 | #endif /* __CRYPT_DH_H__ */ 59 | -------------------------------------------------------------------------------- /include/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 | #ifdef SHA1_SUPPORT 34 | #define HMAC_SHA1_SUPPORT 35 | VOID RT_HMAC_SHA1(IN const UINT8 Key[], 36 | IN UINT KeyLen, 37 | IN const UINT8 Message[], 38 | IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen); 39 | #endif /* SHA1_SUPPORT */ 40 | 41 | #ifdef SHA256_SUPPORT 42 | #define HMAC_SHA256_SUPPORT 43 | VOID RT_HMAC_SHA256(IN const UINT8 Key[], 44 | IN UINT KeyLen, 45 | IN const UINT8 Message[], 46 | IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen); 47 | #endif /* SHA256_SUPPORT */ 48 | 49 | #ifdef MD5_SUPPORT 50 | #define HMAC_MD5_SUPPORT 51 | VOID RT_HMAC_MD5(IN const UINT8 Key[], 52 | IN UINT KeyLen, 53 | IN const UINT8 Message[], 54 | IN UINT MessageLen, OUT UINT8 MAC[], IN UINT MACLen); 55 | #endif /* MD5_SUPPORT */ 56 | 57 | #endif /* __CRYPT_HMAC_H__ */ 58 | -------------------------------------------------------------------------------- /include/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 | /* Algorithm options */ 32 | #define MD5_SUPPORT 33 | 34 | #ifdef MD5_SUPPORT 35 | #define MD5_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ 36 | #define MD5_DIGEST_SIZE 16 /* 128 bits = 16 bytes */ 37 | typedef struct { 38 | UINT32 HashValue[4]; 39 | UINT64 MessageLen; 40 | UINT8 Block[MD5_BLOCK_SIZE]; 41 | UINT BlockLen; 42 | } MD5_CTX_STRUC, *PMD5_CTX_STRUC; 43 | 44 | VOID RT_MD5_Init(IN MD5_CTX_STRUC * pMD5_CTX); 45 | VOID RT_MD5_Hash(IN MD5_CTX_STRUC * pMD5_CTX); 46 | VOID RT_MD5_Append(IN MD5_CTX_STRUC * pMD5_CTX, 47 | IN const UINT8 Message[], IN UINT MessageLen); 48 | VOID RT_MD5_End(IN MD5_CTX_STRUC * pMD5_CTX, OUT UINT8 DigestMessage[]); 49 | VOID RT_MD5(IN const UINT8 Message[], 50 | IN UINT MessageLen, OUT UINT8 DigestMessage[]); 51 | #endif /* MD5_SUPPORT */ 52 | 53 | #endif /* __CRYPT_MD5_H__ */ 54 | -------------------------------------------------------------------------------- /include/crypt_sha2.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 | SHA2 18 | 19 | Abstract: 20 | FIPS 180-2: Secure Hash Standard (SHS) 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ------------------------------------------ 25 | Eddy 2008/11/24 Create SHA1 26 | Eddy 2008/07/23 Create SHA256 27 | ***************************************************************************/ 28 | 29 | #ifndef __CRYPT_SHA2_H__ 30 | #define __CRYPT_SHA2_H__ 31 | 32 | /* Algorithm options */ 33 | #define SHA1_SUPPORT 34 | #define SHA256_SUPPORT 35 | 36 | #ifdef SHA1_SUPPORT 37 | #define SHA1_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ 38 | #define SHA1_DIGEST_SIZE 20 /* 160 bits = 20 bytes */ 39 | typedef struct _SHA1_CTX_STRUC { 40 | UINT32 HashValue[5]; /* 5 = (SHA1_DIGEST_SIZE / 32) */ 41 | UINT64 MessageLen; /* total size */ 42 | UINT8 Block[SHA1_BLOCK_SIZE]; 43 | UINT BlockLen; 44 | } SHA1_CTX_STRUC, *PSHA1_CTX_STRUC; 45 | 46 | VOID RT_SHA1_Init(IN SHA1_CTX_STRUC * pSHA_CTX); 47 | VOID RT_SHA1_Hash(IN SHA1_CTX_STRUC * pSHA_CTX); 48 | VOID RT_SHA1_Append(IN SHA1_CTX_STRUC * pSHA_CTX, 49 | IN const UINT8 Message[], IN UINT MessageLen); 50 | VOID RT_SHA1_End(IN SHA1_CTX_STRUC * pSHA_CTX, OUT UINT8 DigestMessage[]); 51 | VOID RT_SHA1(IN const UINT8 Message[], 52 | IN UINT MessageLen, OUT UINT8 DigestMessage[]); 53 | #endif /* SHA1_SUPPORT */ 54 | 55 | #ifdef SHA256_SUPPORT 56 | #define SHA256_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ 57 | #define SHA256_DIGEST_SIZE 32 /* 256 bits = 32 bytes */ 58 | typedef struct _SHA256_CTX_STRUC { 59 | UINT32 HashValue[8]; /* 8 = (SHA256_DIGEST_SIZE / 32) */ 60 | UINT64 MessageLen; /* total size */ 61 | UINT8 Block[SHA256_BLOCK_SIZE]; 62 | UINT BlockLen; 63 | } SHA256_CTX_STRUC, *PSHA256_CTX_STRUC; 64 | 65 | VOID RT_SHA256_Init(IN SHA256_CTX_STRUC * pSHA_CTX); 66 | VOID RT_SHA256_Hash(IN SHA256_CTX_STRUC * pSHA_CTX); 67 | VOID RT_SHA256_Append(IN SHA256_CTX_STRUC * pSHA_CTX, 68 | IN const UINT8 Message[], IN UINT MessageLen); 69 | VOID RT_SHA256_End(IN SHA256_CTX_STRUC * pSHA_CTX, OUT UINT8 DigestMessage[]); 70 | VOID RT_SHA256(IN const UINT8 Message[], 71 | IN UINT MessageLen, OUT UINT8 DigestMessage[]); 72 | #endif /* SHA256_SUPPORT */ 73 | 74 | #endif /* __CRYPT_SHA2_H__ */ 75 | -------------------------------------------------------------------------------- /include/dot11r_ft.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 | dot11r_ft.h 18 | 19 | Abstract: 20 | Defined status code, IE and frame structures that FT (802.11rD9.0) needed. 21 | 22 | Revision History: 23 | Who When What 24 | --------- ---------- ---------------------------------------------- 25 | Fonchi Wu 12-02-2008 created for 11r soft-AP 26 | */ 27 | 28 | #ifndef __DOT11R_FT_H 29 | #define __DOT11R_FT_H 30 | 31 | #include "rtmp_type.h" 32 | 33 | #if defined(DOT11R_FT_SUPPORT) || defined(DOT11Z_TDLS_SUPPORT) 34 | #define FT_MIC_LEN 16 35 | #define FT_NONCE_LEN 32 36 | #endif 37 | 38 | #if defined(DOT11R_FT_SUPPORT) || defined(DOT11Z_TDLS_SUPPORT) 39 | /* Information element ID defined in 802.11rD9.0 specification. */ 40 | #define IE_FT_MDIE 54 41 | #define IE_FT_FTIE 55 42 | #define IE_FT_TIMEOUT_INTERVAL 56 43 | #define IE_FT_RIC_DATA 57 44 | #define IE_FT_RIC_DESCRIPTOR 75 45 | 46 | /* RIC Type */ 47 | #define FT_RIC_TYPE_BA 1 48 | 49 | /* AKM SUITE */ 50 | #define FT_AKM_SUITE_1X 3 51 | #define FT_AKM_SUITE_PSK 4 52 | #endif 53 | 54 | #if defined(DOT11R_FT_SUPPORT) || defined(DOT11Z_TDLS_SUPPORT) 55 | typedef union GNU_PACKED _FT_MIC_CTR_FIELD { 56 | /* 57 | IECnt: contains the number of IEs 58 | that are included int eht MIC calculation. 59 | */ 60 | struct GNU_PACKED { 61 | #ifdef RT_BIG_ENDIAN 62 | UINT16 IECnt:8; 63 | UINT16:8; 64 | #else 65 | UINT16:8; 66 | UINT16 IECnt:8; 67 | #endif 68 | } field; 69 | UINT16 word; 70 | } FT_MIC_CTR_FIELD, *PFT_MIC_CTR_FIELD; 71 | 72 | /* 73 | ** FTIE: Fast Transition IE. 74 | */ 75 | typedef struct GNU_PACKED _FT_FTIE { 76 | FT_MIC_CTR_FIELD MICCtr; /* 2 Octects. */ 77 | UINT8 MIC[FT_MIC_LEN]; /* 16 Octects. */ 78 | UINT8 ANonce[FT_NONCE_LEN]; /* 32 Octects. */ 79 | UINT8 SNonce[FT_NONCE_LEN]; /* 32 Octects. */ 80 | UINT8 Option[0]; /* 1:R1KHID, 2:GTK, 3:ROKHId, else:Res */ 81 | } FT_FTIE, *PFT_FTIE; 82 | #endif 83 | 84 | #if defined(DOT11R_FT_SUPPORT) || defined(DOT11Z_TDLS_SUPPORT) 85 | /* 86 | ** Timeout Interval IE. 87 | */ 88 | typedef enum _FT_TIMEOUT_INTERVAL_TYPE { 89 | REASSOC_DEADLINE_INTERVAL = 1, /* TUs */ 90 | KEY_LIFETIME_INTERVAL, /* seconds. */ 91 | RESERVED_INTERVAL 92 | } FT_TIMEOUT_INTERVAL_TYPE, *PFT_TIMEOUT_INTERVAL_TYPE; 93 | 94 | typedef struct GNU_PACKED _FT_TIMEOUT_INTERVAL_IE { 95 | UINT8 TimeoutIntervalType; 96 | UINT32 TimeoutIntervalValue; 97 | } FT_TIMEOUT_INTERVAL_IE, *PFT_TIMEOUT_INTERVAL_IE; 98 | #endif 99 | 100 | #endif /* __DOT11R_FT_H */ 101 | -------------------------------------------------------------------------------- /include/frq_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-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 | eeprom.h 20 | 21 | Abstract: 22 | Miniport header file for eeprom related information 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | #ifndef __FRQCAL_H__ 29 | #define __FRQCAL_H__ 30 | 31 | /* */ 32 | /* The frequency calibration control */ 33 | /* */ 34 | typedef struct _FREQUENCY_CALIBRATION_CONTROL { 35 | BOOLEAN bEnableFrequencyCalibration; /* Enable the frequency calibration algorithm */ 36 | 37 | BOOLEAN bSkipFirstFrequencyCalibration; /* Avoid calibrating frequency at the time the STA is just link-up */ 38 | BOOLEAN bApproachFrequency; /* Approach the frequency */ 39 | UCHAR AdaptiveFreqOffset; /* Adaptive frequency offset */ 40 | CHAR LatestFreqOffsetOverBeacon; /* Latest frequency offset from the beacon */ 41 | CHAR BeaconPhyMode; /* Latest frequency offset from the beacon */ 42 | 43 | } FREQUENCY_CALIBRATION_CONTROL, *PFREQUENCY_CALIBRATION_CONTROL; 44 | 45 | #define RTMP_FREQ_CAL_DISABLE(__pAd) \ 46 | __pAd->FreqCalibrationCtrl.bEnableFrequencyCalibration = FALSE; 47 | 48 | /* */ 49 | /* Invalid frequency offset */ 50 | /* */ 51 | #define INVALID_FREQUENCY_OFFSET -128 52 | 53 | /* */ 54 | /* The upperbound/lowerbound of the frequency offset */ 55 | /* */ 56 | #define UPPERBOUND_OF_FREQUENCY_OFFSET 127 57 | #define LOWERBOUND_OF_FREQUENCY_OFFSET -127 58 | 59 | /*#ifdef RT5390 */ 60 | /* */ 61 | /* The trigger point of the high/low frequency */ 62 | /* */ 63 | #define HIGH_FREQUENCY_TRIGGER_POINT_OFDM 20 64 | #define LOW_FREQUENCY_TRIGGER_POINT_OFDM -20 65 | #define HIGH_FREQUENCY_TRIGGER_POINT_CCK 4 66 | #define LOW_FREQUENCY_TRIGGER_POINT_CCK -4 67 | 68 | #ifdef MT7601 69 | #define MT7601_HIGH_FREQUENCY_TRIGGER_POINT_CCK 19 70 | #define MT7601_LOW_FREQUENCY_TRIGGER_POINT_CCK -19 71 | #define MT7601_DECREASE_FREQUENCY_OFFSET_CCK 5 72 | #define MT7601_INCREASE_FREQUENCY_OFFSET_CCK -5 73 | 74 | #define MT7601_HIGH_FREQUENCY_TRIGGER_POINT_OFDM20 102 75 | #define MT7601_LOW_FREQUENCY_TRIGGER_POINT_OFDM20 -102 76 | #define MT7601_DECREASE_FREQUENCY_OFFSET_OFDM20 32 77 | #define MT7601_INCREASE_FREQUENCY_OFFSET_OFDM20 -32 78 | 79 | #define MT7601_HIGH_FREQUENCY_TRIGGER_POINT_OFDM40 82 80 | #define MT7601_LOW_FREQUENCY_TRIGGER_POINT_OFDM40 -82 81 | #define MT7601_DECREASE_FREQUENCY_OFFSET_OFDM40 20 82 | #define MT7601_INCREASE_FREQUENCY_OFFSET_OFDM40 -20 83 | #endif /* MT7601 */ 84 | 85 | /* */ 86 | /* The trigger point of decreasng/increasing the frequency offset */ 87 | /* */ 88 | #define DECREASE_FREQUENCY_OFFSET_OFDM 10 89 | #define INCREASE_FREQUENCY_OFFSET_OFDM -10 90 | #define DECREASE_FREQUENCY_OFFSET_CCK 2 91 | #define INCREASE_FREQUENCY_OFFSET_CCK -2 92 | /*#endif // RT5390 */ 93 | /* */ 94 | /* The trigger point of decreasng/increasing the frequency offset */ 95 | /* */ 96 | #define DECREASE_FREQUENCY_OFFSET 3 97 | #define INCREASE_FREQUENCY_OFFSET -3 98 | 99 | /* */ 100 | /* Frequency calibration period */ 101 | /* */ 102 | 103 | #define FREQUENCY_CALIBRATION_PERIOD 100 104 | 105 | #endif /* __FRQCAL_H__ */ 106 | -------------------------------------------------------------------------------- /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 | #define UNLINK_TIMEOUT_MS 3 55 | 56 | #define USBD_TRANSFER_DIRECTION_OUT 0 57 | #define USBD_TRANSFER_DIRECTION_IN 0 58 | #define USBD_SHORT_TRANSFER_OK 0 59 | #define PURB purbb_t 60 | 61 | #define OS_RTUSBMlmeUp RtmpOsMlmeUp 62 | 63 | #endif /* __RTMP_UTIL_H__ */ 64 | -------------------------------------------------------------------------------- /include/iface/rtmp_usb.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTMP_USB_H__ 2 | #define __RTMP_USB_H__ 3 | 4 | #include "rtusb_io.h" 5 | 6 | extern UCHAR EpToQueue[6]; 7 | 8 | #define RXBULKAGGRE_SIZE 12 9 | #define MAX_TXBULK_LIMIT (LOCAL_TXBUF_SIZE*(BULKAGGRE_SIZE-1)) 10 | #define MAX_TXBULK_SIZE (LOCAL_TXBUF_SIZE*BULKAGGRE_SIZE) 11 | #define MAX_RXBULK_SIZE (LOCAL_TXBUF_SIZE*RXBULKAGGRE_SIZE) 12 | #define MAX_MLME_HANDLER_MEMORY 20 13 | #define CMD_RSP_BULK_SIZE 1024 14 | #ifdef USB_BULK_BUF_ALIGMENT 15 | //#define ALIGMENT_BULKAGGRE_SIZE 16 16 | #ifndef ALIGMENT_BULKAGGRE_SIZE 17 | //#undef 18 | #define ALIGMENT_BULKAGGRE_SIZE 7 /* must >= 4 */ 19 | #endif 20 | #define MAX_ALIGMENT_TXBULK_SIZE (LOCAL_TXBUF_SIZE*ALIGMENT_BULKAGGRE_SIZE) 21 | #define BULKOUT_SIZE (LOCAL_TXBUF_SIZE * (ALIGMENT_BULKAGGRE_SIZE -2)) 22 | 23 | #endif /* USB_BULK_BUF_ALIGMENT */ 24 | 25 | //#define BULKOUT_SIZE 0x00006000 26 | 27 | /*Power saving */ 28 | #define PowerWakeCID 3 29 | #define CID0MASK 0x000000ff 30 | #define CID1MASK 0x0000ff00 31 | #define CID2MASK 0x00ff0000 32 | #define CID3MASK 0xff000000 33 | 34 | /* Flags for Bulkflags control for bulk out data */ 35 | /* */ 36 | #define fRTUSB_BULK_OUT_DATA_NULL 0x00000001 37 | #define fRTUSB_BULK_OUT_RTS 0x00000002 38 | #define fRTUSB_BULK_OUT_MLME 0x00000004 39 | 40 | #define fRTUSB_BULK_OUT_PSPOLL 0x00000010 41 | #define fRTUSB_BULK_OUT_DATA_FRAG 0x00000020 42 | #define fRTUSB_BULK_OUT_DATA_FRAG_2 0x00000040 43 | #define fRTUSB_BULK_OUT_DATA_FRAG_3 0x00000080 44 | #define fRTUSB_BULK_OUT_DATA_FRAG_4 0x00000100 45 | 46 | #define fRTUSB_BULK_OUT_DATA_NORMAL 0x00010000 47 | #define fRTUSB_BULK_OUT_DATA_NORMAL_2 0x00020000 48 | #define fRTUSB_BULK_OUT_DATA_NORMAL_3 0x00040000 49 | #define fRTUSB_BULK_OUT_DATA_NORMAL_4 0x00080000 50 | 51 | /* TODO:move to ./ate/include/iface/ate_usb.h */ 52 | #ifdef RALINK_ATE 53 | #define fRTUSB_BULK_OUT_DATA_ATE 0x00100000 54 | #endif /* RALINK_ATE */ 55 | 56 | #define FREE_HTTX_RING(_pCookie, _pipeId, _txContext) \ 57 | { \ 58 | if ((_txContext)->ENextBulkOutPosition == (_txContext)->CurWritePosition) \ 59 | { \ 60 | (_txContext)->bRingEmpty = TRUE; \ 61 | } \ 62 | /*NdisInterlockedDecrement(&(_p)->TxCount); */\ 63 | } 64 | 65 | #define NT_SUCCESS(status) (((status) >=0) ? (TRUE):(FALSE)) 66 | 67 | #define PIRP PVOID 68 | /*#define NDIS_OID UINT */ 69 | #ifndef USB_ST_NOERROR 70 | #define USB_ST_NOERROR 0 71 | #endif 72 | 73 | /* vendor-specific control operations */ 74 | #define CONTROL_TIMEOUT_JIFFIES ( (300 * OS_HZ) / 1000) 75 | /*#define UNLINK_TIMEOUT_MS 3 // os abl move */ 76 | 77 | #define DEVICE_VENDOR_REQUEST_OUT 0x40 78 | #define DEVICE_VENDOR_REQUEST_IN 0xc0 79 | /*#define INTERFACE_VENDOR_REQUEST_OUT 0x41 */ 80 | /*#define INTERFACE_VENDOR_REQUEST_IN 0xc1 */ 81 | #define BULKOUT_MGMT_RESET_FLAG 0x80 82 | 83 | #define RTUSB_SET_BULK_FLAG(_M, _F) ((_M)->BulkFlags |= (_F)) 84 | #define RTUSB_CLEAR_BULK_FLAG(_M, _F) ((_M)->BulkFlags &= ~(_F)) 85 | #define RTUSB_TEST_BULK_FLAG(_M, _F) (((_M)->BulkFlags & (_F)) != 0) 86 | 87 | #endif /* __RTMP_USB_H__ */ 88 | -------------------------------------------------------------------------------- /include/mac_ral/fce.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #ifndef __FCE_H__ 6 | #define __FCE_H__ 7 | 8 | #include "rt_config.h" 9 | 10 | #define FCE_PSE_CTRL 0x0800 11 | #define FCE_CSO 0x0808 12 | #define FCE_L2_STUFF 0x080c 13 | #define TX_CPU_PORT_FROM_FCE_BASE_PTR 0x09A0 14 | #define TX_CPU_PORT_FROM_FCE_MAX_COUNT 0x09A4 15 | #define FCE_PDMA_GLOBAL_CONF 0x09C4 16 | #define TX_CPU_PORT_FROM_FCE_CPU_DESC_INDEX 0x09A8 17 | #define FCE_SKIP_FS 0x0A6C 18 | #define PER_PORT_PAUSE_ENABLE_CONTROL1 0x0A38 19 | 20 | #ifdef BIG_ENDIAN 21 | typedef union _L2_STUFFING_STRUC { 22 | struct { 23 | UINT32 RSV:6; 24 | UINT32 OTHER_PORT:2; 25 | UINT32 TS_LENGTH_EN:8; 26 | UINT32 TS_CMD_QSEL_EN:8; 27 | UINT32 RSV2:2; 28 | UINT32 MVINF_BYTE_SWP:1; 29 | UINT32 FS_WR_MPDU_LEN_EN:1; 30 | UINT32 TX_L2_DE_STUFFING_EN:1; 31 | UINT32 RX_L2_STUFFING_EN:1; 32 | UINT32 QoS_L2_EN:1; 33 | UINT32 HT_L2_EN:1; 34 | } field; 35 | 36 | UINT32 word; 37 | } L2_STUFFING_STRUC, *PL2_STUFFING_STRUC; 38 | #else 39 | typedef union _L2_STUFFING_STRUC { 40 | struct { 41 | UINT32 HT_L2_EN:1; 42 | UINT32 QoS_L2_EN:1; 43 | UINT32 RX_L2_STUFFING_EN:1; 44 | UINT32 TX_L2_DE_STUFFING_EN:1; 45 | UINT32 FS_WR_MPDU_LEN_EN:1; 46 | UINT32 MVINF_BYTE_SWP:1; 47 | UINT32 RSV2:2; 48 | UINT32 TS_CMD_QSEL_EN:8; 49 | UINT32 TS_LENGTH_EN:8; 50 | UINT32 OTHER_PORT:2; 51 | UINT32 RSV:6; 52 | } field; 53 | 54 | UINT32 word; 55 | } L2_STUFFING_STRUC, *PL2_STUFFING_STRUC; 56 | #endif 57 | 58 | #define NORMAL_PKT 0x0 59 | #define CMD_PKT 0x1 60 | 61 | #define FCE_WLAN_PORT 0x0 62 | #define FCE_CPU_RX_PORT 0x1 63 | #define FCE_CPU_TX_PORT 0x2 64 | #define FCE_HOST_PORT 0x3 65 | #define FCE_VIRTUAL_CPU_RX_PORT 0x4 66 | #define FCE_VIRTUAL_CPU_TX_PORT 0x5 67 | #define FCE_DISCARD 0x6 68 | #endif /*__FCE_H__ */ 69 | -------------------------------------------------------------------------------- /include/mac_ral/nmac/ral_nmac_rxwi.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 | ral_nmac_rxwi.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 __RAL_NMAC_RXWI_H__ 30 | #define __RAL_NMAC_RXWI_H__ 31 | 32 | #include "rtmp_type.h" 33 | 34 | /* 35 | RXWI wireless information format. 36 | */ 37 | #ifdef RT_BIG_ENDIAN 38 | typedef struct GNU_PACKED _RXWI_NMAC { 39 | /* Word 0 */ 40 | UINT32 eof:1; 41 | UINT32 rsv:1; 42 | UINT32 MPDUtotalByteCnt:14; 43 | UINT32 udf:3; 44 | UINT32 bss_idx:3; 45 | UINT32 key_idx:2; 46 | UINT32 wcid:8; 47 | 48 | /* Word 1 */ 49 | UINT32 phy_mode:3; 50 | UINT32 i_txbf:1; 51 | UINT32 e_txbf:1; 52 | UINT32 stbc:1; 53 | UINT32 sgi:1; 54 | UINT32 bw:2; 55 | UINT32 mcs:7; 56 | UINT32 sn:12; 57 | UINT32 tid:4; 58 | 59 | /* Word 2 */ 60 | UINT8 rssi[4]; 61 | 62 | /* Word 3~6 */ 63 | UINT8 bbp_rxinfo[16]; 64 | } RXWI_NMAC; 65 | #else 66 | typedef struct GNU_PACKED _RXWI_NMAC { 67 | /* Word 0 */ 68 | UINT32 wcid:8; 69 | UINT32 key_idx:2; 70 | UINT32 bss_idx:3; 71 | UINT32 udf:3; 72 | UINT32 MPDUtotalByteCnt:14; 73 | UINT32 rsv:1; 74 | UINT32 eof:1; 75 | 76 | /* Word 1 */ 77 | UINT32 tid:4; 78 | UINT32 sn:12; 79 | UINT32 mcs:7; 80 | UINT32 bw:2; 81 | UINT32 sgi:1; 82 | UINT32 stbc:1; 83 | UINT32 e_txbf:1; 84 | UINT32 i_txbf:1; 85 | UINT32 phy_mode:3; 86 | 87 | /* Word 2 */ 88 | UINT8 rssi[4]; 89 | 90 | /* Word 3~6 */ 91 | UINT8 bbp_rxinfo[16]; 92 | } RXWI_NMAC; 93 | #endif /* RT_BIG_ENDIAN */ 94 | 95 | #define RxWIMPDUByteCnt RXWI_N.MPDUtotalByteCnt 96 | #define RxWIWirelessCliID RXWI_N.wcid 97 | #define RxWIKeyIndex RXWI_N.key_idx 98 | #define RxWIMCS RXWI_N.mcs 99 | #define RxWIBW RXWI_N.bw 100 | #define RxWIBSSID RXWI_N.bss_idx 101 | #define RxWISGI RXWI_N.sgi 102 | #define RxWIPhyMode RXWI_N.phy_mode 103 | #define RxWISTBC RXWI_N.stbc 104 | #define RxWITID RXWI_N.tid 105 | #define RxWIRSSI0 RXWI_N.rssi[0] 106 | #define RxWIRSSI1 RXWI_N.rssi[1] 107 | #define RxWIRSSI2 RXWI_N.rssi[2] 108 | #define RxWISNR0 RXWI_N.bbp_rxinfo[0] 109 | #define RxWISNR1 RXWI_N.bbp_rxinfo[1] 110 | #define RxWISNR2 RXWI_N.bbp_rxinfo[2] 111 | #define RxWIFOFFSET RXWI_N.bbp_rxinfo[3] 112 | 113 | #endif /* __RAL_NMAC_RXWI_H__ */ 114 | -------------------------------------------------------------------------------- /include/mac_ral/omac/ral_omac_pbf.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 | ral_omac_pbf.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 __RAL_OMAC_PBF_H__ 30 | #define __RAL_OMAC_PBF_H__ 31 | 32 | #include "rtmp_type.h" 33 | 34 | /* ================================================================================= */ 35 | /* Register format for PBF */ 36 | /* ================================================================================= */ 37 | 38 | /* Most are for debug. Driver doesn't touch PBF register. */ 39 | #define PBF_SYS_CTRL 0x0400 40 | 41 | #ifdef RT_BIG_ENDIAN 42 | typedef union _PBF_SYS_CTRL_STRUC { 43 | struct { 44 | UINT32 Reserved5:12; /* Reserved */ 45 | UINT32 SHR_MSEL:1; /* Shared memory access selection */ 46 | UINT32 PBF_MSEL:2; /* Packet buffer memory access selection */ 47 | UINT32 HST_PM_SEL:1; /* The write selection of the host program RAM */ 48 | UINT32 Reserved4:1; /* Reserved */ 49 | UINT32 CAP_MODE:1; /* Packet buffer capture mode */ 50 | UINT32 Reserved3:1; /* Reserved */ 51 | UINT32 CLK_SEL:1; /* MAC/PBF clock source selection */ 52 | UINT32 PBF_CLK_EN:1; /* PBF clock enable */ 53 | UINT32 MAC_CLK_EN:1; /* MAC clock enable */ 54 | UINT32 DMA_CLK_EN:1; /* DMA clock enable */ 55 | UINT32 Reserved2:1; /* Reserved */ 56 | UINT32 MCU_READY:1; /* MCU ready */ 57 | UINT32 Reserved1:2; /* Reserved */ 58 | UINT32 ASY_RESET:1; /* ASYNC interface reset */ 59 | UINT32 PBF_RESET:1; /* PBF hardware reset */ 60 | UINT32 MAC_RESET:1; /* MAC hardware reset */ 61 | UINT32 DMA_RESET:1; /* DMA hardware reset */ 62 | UINT32 MCU_RESET:1; /* MCU hardware reset */ 63 | } field; 64 | UINT32 word; 65 | } PBF_SYS_CTRL_STRUC; 66 | #else 67 | typedef union _PBF_SYS_CTRL_STRUC { 68 | struct { 69 | UINT32 MCU_RESET:1; 70 | UINT32 DMA_RESET:1; 71 | UINT32 MAC_RESET:1; 72 | UINT32 PBF_RESET:1; 73 | UINT32 ASY_RESET:1; 74 | UINT32 Reserved1:2; 75 | UINT32 MCU_READY:1; 76 | UINT32 Reserved2:1; 77 | UINT32 DMA_CLK_EN:1; 78 | UINT32 MAC_CLK_EN:1; 79 | UINT32 PBF_CLK_EN:1; 80 | UINT32 CLK_SEL:1; 81 | UINT32 Reserved3:1; 82 | UINT32 CAP_MODE:1; 83 | UINT32 Reserved4:1; 84 | UINT32 HST_PM_SEL:1; 85 | UINT32 PBF_MSEL:2; 86 | UINT32 SHR_MSEL:1; 87 | UINT32 Reserved5:12; 88 | } field; 89 | UINT32 word; 90 | } PBF_SYS_CTRL_STRUC; 91 | #endif 92 | 93 | #define PBF_CFG 0x0408 94 | #define PBF_MAX_PCNT 0x040C 95 | #define PBF_CAP_CTRL 0x0440 96 | 97 | #define BCN_OFFSET0 0x042C 98 | #define BCN_OFFSET1 0x0430 99 | 100 | #endif /* __RAL_OMAC_PBF_H__ */ 101 | -------------------------------------------------------------------------------- /include/mac_ral/omac/ral_omac_rf_ctrl.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 | ral_omac_rf_ctrl.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 __RAL_OMAC_RF_CTRL_H__ 30 | #define __RAL_OMAC_RF_CTRL_H__ 31 | 32 | /* ================================================================================= */ 33 | /* Register format for RFCTRL */ 34 | /* ================================================================================= */ 35 | 36 | #define OSC_CTRL 0x5a4 37 | #define PCIE_PHY_TX_ATTENUATION_CTRL 0x05C8 38 | #define INTERNAL_1 0x05C8 39 | 40 | #ifdef RT_BIG_ENDIAN 41 | typedef union _INTERNAL_1_STRUCT { 42 | struct { 43 | UINT32 Reserve1:10; 44 | UINT32 CSO_RX_IPV6_CHKSUM_EN:1; 45 | UINT32 CSO_TX_IPV6_CHKSUM_EN:1; 46 | UINT32 CSO_HW_PARSE_TCP:1; 47 | UINT32 CSO_HW_PARSE_IP:1; 48 | UINT32 CSO_RX_CHKSUM_EN:1; 49 | UINT32 CSO_TX_CHKSUM_EN:1; 50 | UINT32 CSO_TIMEOUT_VALUE:4; 51 | UINT32 PCIE_PHY_TX_ATTEN_EN:1; 52 | UINT32 PCIE_PHY_TX_ATTEN_VALUE:3; 53 | UINT32 Reserve2:7; 54 | UINT32 RF_ISOLATION_ENABLE:1; 55 | } field; 56 | 57 | UINT32 word; 58 | } INTERNAL_1_STRUCT, *PINTERNAL_1_STRUCT; 59 | #else 60 | typedef union _TX_ATTENUATION_CTRL_STRUC { 61 | struct { 62 | UINT32 RF_ISOLATION_ENABLE:1; 63 | UINT32 Reserve2:7; 64 | UINT32 PCIE_PHY_TX_ATTEN_VALUE:3; 65 | UINT32 PCIE_PHY_TX_ATTEN_EN:1; 66 | UINT32 CSO_TIMEOUT_VALUE:4; 67 | UINT32 CSO_TX_CHKSUM_EN:1; 68 | UINT32 CSO_RX_CHKSUM_EN:1; 69 | UINT32 CSO_HW_PARSE_IP:1; 70 | UINT32 CSO_HW_PARSE_TCP:1; 71 | UINT32 CSO_TX_IPV6_CHKSUM_EN:1; 72 | UINT32 CSO_RX_IPV6_CHKSUM_EN:1; 73 | UINT32 Reserve1:10; 74 | } field; 75 | 76 | UINT32 word; 77 | } INTERNAL_1_STRUCT, *PINTERNAL_1_STRUCT; 78 | #endif 79 | 80 | #define LDO_CFG0 0x05d4 81 | #define GPIO_SWITCH 0x05dc 82 | 83 | #define DEBUG_INDEX 0x05e8 84 | 85 | #endif /* __RAL_OMAC_RF_CTRL_H__ */ 86 | -------------------------------------------------------------------------------- /include/mac_ral/omac/ral_omac_rxwi.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 | ral_omac_rxwi.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 __RAL_OMAC_RXWI_H__ 30 | #define __RAL_OMAC_RXWI_H__ 31 | 32 | #include "rtmp_type.h" 33 | 34 | /* 35 | RXWI wireless information format, in PBF. invisible in driver. 36 | */ 37 | #ifdef RT_BIG_ENDIAN 38 | typedef struct GNU_PACKED _RXWI_OMAC { 39 | /* Word 0 */ 40 | UINT32 tid:4; 41 | UINT32 MPDUtotalByteCnt:12; 42 | UINT32 UDF:3; 43 | UINT32 bss_idx:3; 44 | UINT32 key_idx:2; 45 | UINT32 wcid:8; 46 | 47 | /* Word 1 */ 48 | UINT32 phy_mode:2; /* 1: this RX frame is unicast to me */ 49 | UINT32 iTxBF:1; /* iTxBF enable */ 50 | UINT32 Sounding:1; /* Sounding enable */ 51 | UINT32 eTxBF:1; /* eTxBF enable */ 52 | UINT32 stbc:2; 53 | UINT32 sgi:1; 54 | UINT32 bw:1; 55 | UINT32 mcs:7; 56 | UINT32 SEQUENCE:12; 57 | UINT32 FRAG:4; 58 | 59 | /* Word 2 */ 60 | UINT32 rsv1:8; 61 | UINT32 RSSI2:8; 62 | UINT32 RSSI1:8; 63 | UINT32 RSSI0:8; 64 | 65 | /* Word 3 */ 66 | UINT32 FOFFSET:8; 67 | UINT32 SNR2:8; 68 | UINT32 SNR1:8; 69 | UINT32 SNR0:8; 70 | 71 | UINT32 rsv3; 72 | 73 | #if defined(RT5592) || defined(MT7601) 74 | /* Word 5 */ 75 | /* For Exper Antenna */ 76 | UINT32 rsv4:24; 77 | UINT32 EANT_ID:8; 78 | #endif /* RT5592 */ 79 | } RXWI_OMAC, *PRXWI_OMAC; 80 | #else 81 | typedef struct GNU_PACKED _RXWI_OMAC { 82 | /* Word 0 */ 83 | UINT32 wcid:8; 84 | UINT32 key_idx:2; 85 | UINT32 bss_idx:3; 86 | UINT32 UDF:3; 87 | UINT32 MPDUtotalByteCnt:12; 88 | UINT32 tid:4; 89 | 90 | /* Word 1 */ 91 | UINT32 FRAG:4; 92 | UINT32 SEQUENCE:12; 93 | UINT32 mcs:7; 94 | UINT32 bw:1; 95 | UINT32 sgi:1; 96 | UINT32 stbc:2; 97 | UINT32 eTxBF:1; /* eTxBF enable */ 98 | UINT32 Sounding:1; /* Sounding enable */ 99 | UINT32 iTxBF:1; /* iTxBF enable */ 100 | UINT32 phy_mode:2; /* 1: this RX frame is unicast to me */ 101 | 102 | /*Word2 */ 103 | UINT32 RSSI0:8; 104 | UINT32 RSSI1:8; 105 | UINT32 RSSI2:8; 106 | UINT32 rsv1:8; 107 | 108 | /*Word3 */ 109 | UINT32 SNR0:8; 110 | UINT32 SNR1:8; 111 | UINT32 SNR2:8; 112 | UINT32 FOFFSET:8; 113 | 114 | UINT32 rsv3; 115 | 116 | #if defined(RT5592) || defined(MT7601) 117 | /* Word 5 */ 118 | /* For Exper Antenna */ 119 | UINT32 EANT_ID:8; 120 | UINT32 rsv4:24; 121 | #endif /* RT5592 */ 122 | } RXWI_OMAC, *PRXWI_OMAC; 123 | #endif 124 | 125 | #define RxWIMPDUByteCnt RXWI_O.MPDUtotalByteCnt 126 | #define RxWIWirelessCliID RXWI_O.wcid 127 | #define RxWIKeyIndex RXWI_O.key_idx 128 | #define RxWIMCS RXWI_O.mcs 129 | #define RxWIBW RXWI_O.bw 130 | #define RxWISGI RXWI_O.sgi 131 | #define RxWIBSSID RXWI_O.bss_idx 132 | #define RxWIPhyMode RXWI_O.phy_mode 133 | #define RxWISTBC RXWI_O.stbc 134 | #define RxWITID RXWI_O.tid 135 | #define RxWIRSSI0 RXWI_O.RSSI0 136 | #define RxWIRSSI1 RXWI_O.RSSI1 137 | #define RxWIRSSI2 RXWI_O.RSSI2 138 | #define RxWISNR0 RXWI_O.SNR0 139 | #define RxWISNR1 RXWI_O.SNR1 140 | #define RxWISNR2 RXWI_O.SNR2 141 | #define RxWIFOFFSET RXWI_O.FOFFSET 142 | 143 | #endif /* __RAL_OMAC_RXWI_H__ */ 144 | -------------------------------------------------------------------------------- /include/mac_ral/omac/ral_omac_usb.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 | ral_omac_usb.h 18 | 19 | Abstract: 20 | 21 | Revision History: 22 | Who When What 23 | --------- ---------- ---------------------------------------------- 24 | */ 25 | 26 | #ifndef __RAL_OMAC_USB_H__ 27 | #define __RAL_OMAC_USB_H__ 28 | 29 | #define USB_DMA_CFG 0x02a0 30 | #ifdef RT_BIG_ENDIAN 31 | typedef union _USB_DMA_CFG_STRUC { 32 | struct { 33 | UINT32 TxBusy:1; /*USB DMA TX FSM busy. debug only */ 34 | UINT32 RxBusy:1; /*USB DMA RX FSM busy. debug only */ 35 | UINT32 EpoutValid:6; /*OUT endpoint data valid. debug only */ 36 | UINT32 TxBulkEn:1; /*Enable USB DMA Tx */ 37 | UINT32 RxBulkEn:1; /*Enable USB DMA Rx */ 38 | UINT32 RxBulkAggEn:1; /*Enable Rx Bulk Aggregation */ 39 | UINT32 TxopHalt:1; /*Halt TXOP count down when TX buffer is full. */ 40 | UINT32 TxClear:1; /*Clear USB DMA TX path */ 41 | UINT32 rsv:2; 42 | UINT32 phyclear:1; /*phy watch dog enable. write 1 */ 43 | UINT32 RxBulkAggLmt:8; /*Rx Bulk Aggregation Limit in unit of 1024 bytes */ 44 | UINT32 RxBulkAggTOut:8; /*Rx Bulk Aggregation TimeOut in unit of 33ns */ 45 | } field; 46 | UINT32 word; 47 | } USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC; 48 | #else 49 | typedef union _USB_DMA_CFG_STRUC { 50 | struct { 51 | UINT32 RxBulkAggTOut:8; /*Rx Bulk Aggregation TimeOut in unit of 33ns */ 52 | UINT32 RxBulkAggLmt:8; /*Rx Bulk Aggregation Limit in unit of 256 bytes */ 53 | UINT32 phyclear:1; /*phy watch dog enable. write 1 */ 54 | UINT32 rsv:2; 55 | UINT32 TxClear:1; /*Clear USB DMA TX path */ 56 | UINT32 TxopHalt:1; /*Halt TXOP count down when TX buffer is full. */ 57 | UINT32 RxBulkAggEn:1; /*Enable Rx Bulk Aggregation */ 58 | UINT32 RxBulkEn:1; /*Enable USB DMA Rx */ 59 | UINT32 TxBulkEn:1; /*Enable USB DMA Tx */ 60 | UINT32 EpoutValid:6; /*OUT endpoint data valid */ 61 | UINT32 RxBusy:1; /*USB DMA RX FSM busy */ 62 | UINT32 TxBusy:1; /*USB DMA TX FSM busy */ 63 | } field; 64 | UINT32 word; 65 | } USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC; 66 | #endif 67 | 68 | #endif /*__RAL_OMAC_USB_H__ */ 69 | -------------------------------------------------------------------------------- /include/mac_ral/pbf.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 | pbf.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 __PBF_H__ 30 | #define __PBF_H__ 31 | 32 | #ifdef RLT_MAC 33 | #include "mac_ral/nmac/ral_nmac_pbf.h" 34 | #endif /* RLT_MAC */ 35 | 36 | #ifdef RTMP_MAC 37 | #include "mac_ral/omac/ral_omac_pbf.h" 38 | #endif /* RTMP_MAC */ 39 | 40 | /* ================================================================================= */ 41 | /* Register format for PBF */ 42 | /* ================================================================================= */ 43 | 44 | #define WPDMA_GLO_CFG 0x208 45 | #ifdef RT_BIG_ENDIAN 46 | typedef union _WPDMA_GLO_CFG_STRUC { 47 | struct { 48 | UINT32 rx_2b_offset:1; 49 | UINT32 clk_gate_dis:1; 50 | UINT32 rsv:14; 51 | UINT32 HDR_SEG_LEN:8; 52 | UINT32 BigEndian:1; 53 | UINT32 EnTXWriteBackDDONE:1; 54 | UINT32 WPDMABurstSIZE:2; 55 | UINT32 RxDMABusy:1; 56 | UINT32 EnableRxDMA:1; 57 | UINT32 TxDMABusy:1; 58 | UINT32 EnableTxDMA:1; 59 | } field; 60 | UINT32 word; 61 | } WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC; 62 | #else 63 | typedef union _WPDMA_GLO_CFG_STRUC { 64 | struct { 65 | UINT32 EnableTxDMA:1; 66 | UINT32 TxDMABusy:1; 67 | UINT32 EnableRxDMA:1; 68 | UINT32 RxDMABusy:1; 69 | UINT32 WPDMABurstSIZE:2; 70 | UINT32 EnTXWriteBackDDONE:1; 71 | UINT32 BigEndian:1; 72 | UINT32 HDR_SEG_LEN:8; 73 | UINT32 rsv:14; 74 | UINT32 clk_gate_dis:1; 75 | UINT32 rx_2b_offset:1; 76 | } field; 77 | UINT32 word; 78 | } WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC; 79 | #endif 80 | 81 | #define PBF_CTRL 0x0410 82 | #define MCU_INT_STA 0x0414 83 | #define MCU_INT_ENA 0x0418 84 | #define TXRXQ_PCNT 0x0438 85 | #define PBF_DBG 0x043c 86 | 87 | #endif /* __PBF_H__ */ 88 | -------------------------------------------------------------------------------- /include/mac_ral/rf_ctrl.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 | rf_ctrl.h 20 | 21 | Abstract: 22 | Ralink wireless chip RF related definition & structures 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #ifndef __RF_CTRL_H__ 30 | #define __RF_CTRL_H__ 31 | 32 | #ifdef RTMP_MAC 33 | #include "mac_ral/omac/ral_omac_rf_ctrl.h" 34 | #endif /* RTMP_MAC */ 35 | 36 | #ifdef RLT_MAC 37 | 38 | #endif /* RLT_MAC */ 39 | 40 | /* ================================================================================= */ 41 | /* Register format for RFCTRL */ 42 | /* ================================================================================= */ 43 | 44 | #define RF_CSR_CFG 0x500 45 | 46 | #ifdef RLT_RF 47 | 48 | #define RF_BANK0 0 49 | #define RF_BANK1 1 50 | #define RF_BANK2 2 51 | #define RF_BANK3 3 52 | #define RF_BANK4 4 53 | #define RF_BANK5 5 54 | #define RF_BANK6 6 55 | #define RF_BANK7 7 56 | #define RF_BANK8 8 57 | #define RF_BANK9 9 58 | #define RF_BANK10 10 59 | #define RF_BANK11 11 60 | #define RF_BANK12 12 61 | #define RF_BANK13 13 62 | #define RF_BANK14 14 63 | #define RF_BANK15 15 64 | 65 | /* @!Release 66 | RF_CSR_KICK:1 67 | Write - kick RF register read/write 68 | 0: do nothing 69 | 1: kick read/write process 70 | Read - Polling RF register read/write 71 | 0: idle 72 | 1: busy 73 | RF_CSR_RW:1 74 | 0: read 1: write 75 | rsv:12 76 | RF_CSR_REG_ID:10 77 | RF register ID, 0 for R0, 1 for R1 and so on 78 | Bits [17:15] 3 bits, indicates the bank number 79 | Bits [14:08] 7 bits, indicates the register number 80 | 81 | RF_CSR_DATA:8 82 | DATA written to/read from RF 83 | */ 84 | typedef union _RLT_RF_CSR_CFG { 85 | #ifdef RT_BIG_ENDIAN 86 | struct { 87 | UINT RF_CSR_KICK:1; 88 | UINT RF_CSR_WR:1; 89 | UINT rsv:12; 90 | #ifdef MT7601 91 | UINT RF_CSR_REG_BANK:4; 92 | UINT RF_CSR_REG_ID:6; 93 | #else 94 | UINT RF_CSR_REG_BANK:3; 95 | UINT RF_CSR_REG_ID:7; 96 | #endif /* MT7601 */ 97 | UINT RF_CSR_DATA:8; 98 | } field; 99 | #else 100 | struct { 101 | UINT RF_CSR_DATA:8; 102 | #ifdef MT7601 103 | UINT RF_CSR_REG_ID:6; 104 | UINT RF_CSR_REG_BANK:4; 105 | #else 106 | UINT RF_CSR_REG_ID:7; 107 | UINT RF_CSR_REG_BANK:3; 108 | #endif /* MT7601 */ 109 | UINT rsv:12; 110 | UINT RF_CSR_WR:1; 111 | UINT RF_CSR_KICK:1; 112 | } field; 113 | #endif /* RT_BIG_ENDIAN */ 114 | UINT word; 115 | } RLT_RF_CSR_CFG; 116 | #endif /* RLT_RF */ 117 | 118 | typedef union _RF_CSR_CFG_STRUC { 119 | #ifdef RT_BIG_ENDIAN 120 | struct { 121 | UINT32 Rsvd1:14; /* Reserved */ 122 | UINT32 RF_CSR_KICK:1; /* kick RF register read/write */ 123 | UINT32 RF_CSR_WR:1; /* 0: read 1: write */ 124 | UINT32 TESTCSR_RFACC_REGNUM:8; /* RF register ID */ 125 | UINT32 RF_CSR_DATA:8; /* DATA */ 126 | } field; 127 | #else 128 | struct { 129 | UINT32 RF_CSR_DATA:8; 130 | UINT32 TESTCSR_RFACC_REGNUM:8; 131 | UINT32 RF_CSR_WR:1; 132 | UINT32 RF_CSR_KICK:1; 133 | UINT32 Rsvd1:14; 134 | } field; 135 | #endif /* RT_BIG_ENDIAN */ 136 | UINT32 word; 137 | } RF_CSR_CFG_STRUC; 138 | 139 | #define RF_BYPASS_0 0x0504 140 | 141 | #define RF_SETTING_0 0x050C 142 | 143 | #endif /* __RF_CTRL_H__ */ 144 | -------------------------------------------------------------------------------- /include/mcu/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/include/mcu/.empty -------------------------------------------------------------------------------- /include/misc.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 | misc.h 20 | 21 | Abstract: 22 | 23 | Handling Misc Problem 24 | 25 | Revision History: 26 | Who When What 27 | -------- ---------- ---------------------------------------------- 28 | Sean Wang 2009-08-12 Create 29 | John Li 2009-12-23 Modified 30 | */ 31 | -------------------------------------------------------------------------------- /include/misc_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-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 | misc_cmm.h 20 | 21 | Abstract: 22 | 23 | Handling Misc Problem 24 | 25 | Revision History: 26 | Who When What 27 | -------- ---------- ---------------------------------------------- 28 | Sean Wang 2009-08-12 Create 29 | John Li 2009-12-23 Modified 30 | */ 31 | -------------------------------------------------------------------------------- /include/mlme_sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "rtmp_type.h" 6 | -------------------------------------------------------------------------------- /include/netif_block.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __NET_IF_BLOCK_H__ 3 | #define __NET_IF_BLOCK_H__ 4 | 5 | #include "link_list.h" 6 | #include "rtmp.h" 7 | 8 | #define FREE_NETIF_POOL_SIZE 32 9 | 10 | typedef struct _NETIF_ENTRY { 11 | struct _NETIF_ENTRY *pNext; 12 | PNET_DEV pNetDev; 13 | } NETIF_ENTRY, *PNETIF_ENTRY; 14 | 15 | void initblockQueueTab(IN PRTMP_ADAPTER pAd); 16 | 17 | BOOLEAN blockNetIf(IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry, IN PNET_DEV pNetDev); 18 | 19 | VOID releaseNetIf(IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry); 20 | 21 | VOID StopNetIfQueue(IN PRTMP_ADAPTER pAd, 22 | IN UCHAR QueIdx, IN PNDIS_PACKET pPacket); 23 | #endif /* __NET_IF_BLOCK_H__ */ 24 | -------------------------------------------------------------------------------- /include/p2p_inf.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 attempt 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 | p2p_inf.h 20 | 21 | Abstract: 22 | 23 | Revision History: 24 | Who When What 25 | -------- ---------- ---------------------------------------------- 26 | 27 | */ 28 | 29 | #ifndef __P2P_INF_H__ 30 | #define __P2P_INF_H__ 31 | 32 | #define P2P_DISABLE 0x0 33 | #define P2P_GO_UP 0x1 34 | #define P2P_CLI_UP 0x2 35 | /*#define P2P_GO_ON(_p) (OPSTATUS_TEST_FLAG(_p, fOP_STATUS_P2P_GO)) */ 36 | /*#define P2P_CLI_ON(_p) (OPSTATUS_TEST_FLAG(_p, fOP_STATUS_P2P_CLI)) */ 37 | 38 | #define P2P_GO_ON(_pAd) \ 39 | (((_pAd)->flg_p2p_init) \ 40 | && ((_pAd)->flg_p2p_OpStatusFlags == P2P_GO_UP)) 41 | 42 | #define P2P_CLI_ON(_pAd) \ 43 | (((_pAd)->flg_p2p_init) \ 44 | && ((_pAd)->flg_p2p_OpStatusFlags == P2P_CLI_UP)) 45 | 46 | /* P2P interface hook function definition */ 47 | VOID RTMP_P2P_Init(IN PRTMP_ADAPTER ad_p, IN PNET_DEV main_dev_p); 48 | 49 | INT P2P_VirtualIF_Open(IN PNET_DEV dev_p); 50 | 51 | INT P2P_VirtualIF_Close(IN PNET_DEV dev_p); 52 | 53 | INT P2P_VirtualIF_PacketSend(IN PNDIS_PACKET skb_p, IN PNET_DEV dev_p); 54 | 55 | INT P2P_VirtualIF_Ioctl(IN PNET_DEV dev_p, 56 | IN OUT struct ifreq *rq_p, IN INT cmd); 57 | 58 | VOID RTMP_P2P_Remove(IN PRTMP_ADAPTER pAd); 59 | 60 | #endif /* __P2P_INF_H__ */ 61 | -------------------------------------------------------------------------------- /include/radar.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 | radar.h 20 | 21 | Abstract: 22 | CS/DFS common functions. 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | #ifndef __RADAR_H__ 29 | #define __RADAR_H__ 30 | 31 | /* RESTRICTION_BAND_1: 5600MHz ~ 5650MHz */ 32 | #define RESTRICTION_BAND_1(_pAd) \ 33 | _pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40 ? \ 34 | ((_pAd->CommonCfg.Channel >= 116) && (_pAd->CommonCfg.Channel <= 128)) : \ 35 | ((_pAd->CommonCfg.Channel >= 120) && (_pAd->CommonCfg.Channel <= 128)) 36 | 37 | /* 802.11H */ 38 | typedef struct _DOT11_H { 39 | /* 802.11H and DFS related params */ 40 | UCHAR CSCount; /*Channel switch counter */ 41 | UCHAR CSPeriod; /*Channel switch period (beacon count) */ 42 | USHORT RDCount; /*Radar detection counter, if RDCount > ChMovingTime, start to send beacons */ 43 | UCHAR RDMode; /*Radar Detection mode */ 44 | USHORT ChMovingTime; 45 | BOOLEAN bDFSIndoor; 46 | ULONG InServiceMonitorCount; /* unit: sec */ 47 | } DOT11_H, *PDOT11_H; 48 | 49 | BOOLEAN RadarChannelCheck(IN PRTMP_ADAPTER pAd, IN UCHAR Ch); 50 | 51 | ULONG JapRadarType(IN PRTMP_ADAPTER pAd); 52 | 53 | #ifdef CONFIG_AP_SUPPORT 54 | VOID ChannelSwitchingCountDownProc(IN PRTMP_ADAPTER pAd); 55 | #endif /* CONFIG_AP_SUPPORT */ 56 | 57 | VOID RadarDetectPeriodic(IN PRTMP_ADAPTER pAd); 58 | 59 | INT Set_CSPeriod_Proc(IN PRTMP_ADAPTER pAdapter, IN PSTRING arg); 60 | 61 | INT Set_ChMovingTime_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 62 | 63 | INT Set_BlockChReset_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 64 | 65 | #if defined(DFS_SUPPORT) || defined(CARRIER_DETECTION_SUPPORT) 66 | INT Set_RadarShow_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 67 | 68 | VOID CckMrcStatusCtrl(IN PRTMP_ADAPTER pAd); 69 | 70 | VOID RadarGLRTCompensate(IN PRTMP_ADAPTER pAd); 71 | 72 | #endif /*defined(DFS_SUPPORT) || defined(CARRIER_DETECTION_SUPPORT) */ 73 | 74 | #endif /* __RADAR_H__ */ 75 | -------------------------------------------------------------------------------- /include/rtmp_M51.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 | rtmp_M51.h 20 | 21 | Abstract: 22 | Miniport header file for mcu related information 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #ifndef __RTMP_M51_H__ 30 | #define __RTMP_M51_H__ 31 | 32 | struct _RTMP_ADAPTER; 33 | 34 | INT RtmpAsicEraseFirmware(struct _RTMP_ADAPTER *pAd); 35 | 36 | NDIS_STATUS RtmpAsicLoadFirmware(struct _RTMP_ADAPTER *pAd); 37 | 38 | NDIS_STATUS isMCUnotReady(struct _RTMP_ADAPTER *pAd); 39 | 40 | #if 0 41 | NDIS_STATUS isMCUNeedToLoadFIrmware(struct _RTMP_ADAPTER *pAd); 42 | #endif 43 | 44 | INT RtmpAsicSendCommandToMcu(struct _RTMP_ADAPTER *pAd, 45 | UCHAR Command, 46 | UCHAR Token, 47 | UCHAR Arg0, UCHAR Arg1, BOOLEAN FlgIsNeedLocked); 48 | #endif 49 | -------------------------------------------------------------------------------- /include/rtmp_dot11.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #ifndef __DOT11_BASE_H__ 6 | #define __DOT11_BASE_H__ 7 | 8 | #include "rtmp_type.h" 9 | 10 | #ifdef DOT11_VHT_AC 11 | #include "dot11ac_vht.h" 12 | #endif /* DOT11_VHT_AC */ 13 | 14 | #ifdef TXBF_SUPPORT 15 | /* CSI/Steering values */ 16 | #define DOT11N_BF_FB_NONE 0 17 | #define DOT11N_BF_FB_CSI 1 18 | #define DOT11N_BF_FB_NOCOMP 2 19 | #define DOT11N_BF_FB_COMP 3 20 | #endif /* TXBF_SUPPORT */ 21 | 22 | /* 4-byte HTC field. maybe included in any frame except non-QOS data frame. The Order bit must set 1. */ 23 | typedef struct GNU_PACKED _HT_CONTROL { 24 | #ifdef RT_BIG_ENDIAN 25 | UINT32 RDG:1; 26 | UINT32 ACConstraint:1; 27 | UINT32 rsv2:5; 28 | UINT32 NDPAnnounce:1; 29 | UINT32 CSISTEERING:2; 30 | UINT32 rsv1:2; 31 | UINT32 CalSeq:2; 32 | UINT32 CalPos:2; 33 | UINT32 MFBorASC:7; 34 | UINT32 MFSI:3; 35 | UINT32 MSI:3; 36 | UINT32 MRQ:1; 37 | UINT32 TRQ:1; 38 | UINT32 vht:1; 39 | #else 40 | UINT32 vht:1; /* indicate for VHT variant or HT variant */ 41 | UINT32 TRQ:1; /*sounding request */ 42 | UINT32 MRQ:1; /*MCS feedback. Request for a MCS feedback */ 43 | UINT32 MSI:3; /*MCS Request, MRQ Sequence identifier */ 44 | UINT32 MFSI:3; /*SET to the received value of MRS. 0x111 for unsolicited MFB. */ 45 | UINT32 MFBorASC:7; /*Link adaptation feedback containing recommended MCS. 0x7f for no feedback or not available */ 46 | UINT32 CalPos:2; /* calibration position */ 47 | UINT32 CalSeq:2; /*calibration sequence */ 48 | UINT32 rsv1:2; /* Reserved */ 49 | UINT32 CSISTEERING:2; /*CSI/ STEERING */ 50 | UINT32 NDPAnnounce:1; /* ZLF announcement */ 51 | UINT32 rsv2:5; /*calibration sequence */ 52 | UINT32 ACConstraint:1; /*feedback request */ 53 | UINT32 RDG:1; /*RDG / More PPDU */ 54 | #endif /* !RT_BIG_ENDIAN */ 55 | } HT_CONTROL, *PHT_CONTROL; 56 | 57 | /* 2-byte QOS CONTROL field */ 58 | typedef struct GNU_PACKED _QOS_CONTROL { 59 | #ifdef RT_BIG_ENDIAN 60 | USHORT Txop_QueueSize:8; 61 | USHORT AMsduPresent:1; 62 | USHORT AckPolicy:2; /*0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA */ 63 | USHORT EOSP:1; 64 | USHORT TID:4; 65 | #else 66 | USHORT TID:4; 67 | USHORT EOSP:1; 68 | USHORT AckPolicy:2; /*0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA */ 69 | USHORT AMsduPresent:1; 70 | USHORT Txop_QueueSize:8; 71 | #endif /* !RT_BIG_ENDIAN */ 72 | } QOS_CONTROL, *PQOS_CONTROL; 73 | 74 | typedef struct GNU_PACKED _AC_PARAM_RECORD { 75 | UINT8 aci_aifsn; 76 | UINT8 ecw_max:4; 77 | UINT8 ecw_min:4; 78 | UINT16 txop_limit; 79 | } AC_PARAM_RECORD; 80 | 81 | typedef struct GNU_PACKED _PSPOLL_FRAME { 82 | FRAME_CONTROL FC; 83 | USHORT Aid; 84 | UCHAR Bssid[MAC_ADDR_LEN]; 85 | UCHAR Ta[MAC_ADDR_LEN]; 86 | } PSPOLL_FRAME, *PPSPOLL_FRAME; 87 | 88 | typedef struct GNU_PACKED _RTS_FRAME { 89 | FRAME_CONTROL FC; 90 | USHORT Duration; 91 | UCHAR Addr1[MAC_ADDR_LEN]; 92 | UCHAR Addr2[MAC_ADDR_LEN]; 93 | } RTS_FRAME, *PRTS_FRAME; 94 | 95 | #endif /* __DOT11_BASE_H__ */ 96 | -------------------------------------------------------------------------------- /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_USB_SUPPORT 30 | #include "iface/rtmp_usb.h" 31 | #endif /* RTMP_USB_SUPPORT */ 32 | 33 | typedef struct _INF_PCI_CONFIG_ { 34 | unsigned long CSRBaseAddress; /* PCI MMIO Base Address, all access will use */ 35 | unsigned int irq_num; 36 | } INF_PCI_CONFIG; 37 | 38 | typedef struct _INF_USB_CONFIG_ { 39 | unsigned char BulkInEpAddr; /* bulk-in endpoint address */ 40 | unsigned char BulkOutEpAddr[6]; /* bulk-out endpoint address */ 41 | } INF_USB_CONFIG; 42 | 43 | typedef struct _INF_RBUS_CONFIG_ { 44 | unsigned long csr_addr; 45 | unsigned int irq; 46 | } INF_RBUS_CONFIG; 47 | 48 | typedef union _RTMP_INF_CONFIG_ { 49 | struct _INF_PCI_CONFIG_ pciConfig; 50 | struct _INF_USB_CONFIG_ usbConfig; 51 | struct _INF_RBUS_CONFIG_ rbusConfig; 52 | } RTMP_INF_CONFIG; 53 | 54 | #endif /* __RTMP_IFACE_H__ */ 55 | -------------------------------------------------------------------------------- /include/rtmp_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 | rtmp_mcu.h 20 | 21 | Abstract: 22 | Miniport header file for mcu related information 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | */ 28 | 29 | #ifndef __RTMP_MCU_H__ 30 | #define __RTMP_MCU_H__ 31 | 32 | enum MCU_TYPE { 33 | SWMCU, 34 | M8051, 35 | ANDES, 36 | }; 37 | 38 | struct _RTMP_ADAPTER; 39 | 40 | typedef void (*CMD_RSP_HANDLER) (struct _RTMP_ADAPTER * pAd, UCHAR * Data); 41 | 42 | /* 43 | * CMD Unit (8051, Andes, ...,and etc) 44 | */ 45 | struct CMD_UNIT { 46 | union { 47 | struct { 48 | UCHAR Command; 49 | UCHAR Token; 50 | UCHAR Arg0; 51 | UCHAR Arg1; 52 | } MCU51; 53 | struct { 54 | UINT8 Type; 55 | USHORT CmdPayloadLen; 56 | PUCHAR CmdPayload; 57 | USHORT RspPayloadLen; 58 | PUCHAR RspPayload; 59 | ULONG Timeout; 60 | BOOLEAN NeedRsp; 61 | BOOLEAN NeedWait; 62 | CMD_RSP_HANDLER CmdRspHdler; 63 | } ANDES; 64 | } u; 65 | }; 66 | 67 | struct MCU_CTRL { 68 | UCHAR CmdSeq; 69 | NDIS_SPIN_LOCK CmdRspEventListLock; 70 | DL_LIST CmdRspEventList; 71 | }; 72 | 73 | struct CMD_RSP_EVENT { 74 | DL_LIST List; 75 | UCHAR CmdSeq; 76 | UINT32 Timeout; 77 | BOOLEAN NeedWait; 78 | PVOID AckDone; 79 | UCHAR **RspPayload; 80 | USHORT *RspPayloadLen; 81 | }; 82 | 83 | VOID ChipOpsMCUHook(struct _RTMP_ADAPTER *pAd, enum MCU_TYPE MCUType); 84 | VOID MCUCtrlInit(struct _RTMP_ADAPTER *pAd); 85 | VOID MCUCtrlExit(struct _RTMP_ADAPTER *pAd); 86 | NDIS_STATUS isMCUNeedToLoadFIrmware(struct _RTMP_ADAPTER *pAd); 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /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 | #define RTMP_MAC_PCI 22 | #define RTMP_PCI_SUPPORT 23 | #endif /* OS_ABL_OS_PCI_SUPPORT */ 24 | 25 | #ifdef OS_ABL_OS_USB_SUPPORT 26 | #include 27 | 28 | #ifndef RTMP_MAC_USB 29 | #define RTMP_MAC_USB 30 | #endif /* RTMP_MAC_USB */ 31 | #ifndef RTMP_USB_SUPPORT 32 | #define RTMP_USB_SUPPORT 33 | #endif /* 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 | #ifndef CONFIG_STA_SUPPORT 48 | #define CONFIG_STA_SUPPORT 49 | #endif /* CONFIG_STA_SUPPORT */ 50 | #endif /* OS_ABL_OS_STA_SUPPORT */ 51 | 52 | /* AP & STA con-current */ 53 | #undef RT_CONFIG_IF_OPMODE_ON_AP 54 | #undef RT_CONFIG_IF_OPMODE_ON_STA 55 | 56 | #if defined(CONFIG_AP_SUPPORT) && defined(CONFIG_STA_SUPPORT) 57 | #define RT_CONFIG_IF_OPMODE_ON_AP(__OpMode) if (__OpMode == OPMODE_AP) 58 | #define RT_CONFIG_IF_OPMODE_ON_STA(__OpMode) if (__OpMode == OPMODE_STA) 59 | #else 60 | #define RT_CONFIG_IF_OPMODE_ON_AP(__OpMode) 61 | #define RT_CONFIG_IF_OPMODE_ON_STA(__OpMode) 62 | #endif 63 | 64 | #endif /* OS_ABL_FUNC_SUPPORT */ 65 | 66 | #endif /* __RTMP_OS_ABL_H__ */ 67 | -------------------------------------------------------------------------------- /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(IN RTMP_ADAPTER * pAd, 34 | IN PSTRING SetProcName, IN PSTRING ProcArg); 35 | 36 | #if (defined(WOW_SUPPORT) && defined(RTMP_MAC_USB)) || defined(NEW_WOW_SUPPORT) 37 | /* set WOW enable */ 38 | INT Set_WOW_Enable(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 39 | /* set GPIO pin for wake-up signal */ 40 | INT Set_WOW_GPIO(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 41 | /* set delay time for WOW really enable */ 42 | INT Set_WOW_Delay(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 43 | /* set wake up hold time */ 44 | INT Set_WOW_Hold(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 45 | /* set wakeup signal type */ 46 | INT Set_WOW_InBand(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 47 | #endif /* (defined(WOW_SUPPORT) && defined(RTMP_MAC_USB)) || defined(NEW_WOW_SUPPORT) */ 48 | #ifdef RTMP_MAC_USB 49 | /* Sets the FW into WOW Suspend mode */ 50 | INT Set_UsbWOWSuspend(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 51 | /* Resume the FW to Normal mode */ 52 | INT Set_UsbWOWResume(IN PRTMP_ADAPTER pAd, IN PSTRING arg); 53 | #endif /* RTMP_MAC_USB */ 54 | #endif /* __STA_CFG_H__ */ 55 | -------------------------------------------------------------------------------- /include/vht.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "dot11ac_vht.h" 6 | 7 | struct _RTMP_ADAPTER; 8 | struct _RT_PHY_INFO; 9 | 10 | VOID dump_vht_cap(struct _RTMP_ADAPTER *pAd, VHT_CAP_IE * vht_ie); 11 | VOID dump_vht_op(struct _RTMP_ADAPTER *pAd, VHT_OP_IE * vht_ie); 12 | 13 | INT build_vht_ies(struct _RTMP_ADAPTER *pAd, UCHAR * buf, UCHAR frm); 14 | INT build_vht_cap_ie(RTMP_ADAPTER * pAd, UCHAR * buf); 15 | 16 | UCHAR vht_cent_ch_freq(struct _RTMP_ADAPTER *pAd, UCHAR prim_ch); 17 | INT vht_mode_adjust(struct _RTMP_ADAPTER *pAd, MAC_TABLE_ENTRY * pEntry, 18 | VHT_CAP_IE * cap, VHT_OP_IE * op); 19 | INT SetCommonVHT(struct _RTMP_ADAPTER *pAd); 20 | VOID rtmp_set_vht(struct _RTMP_ADAPTER *pAd, struct _RT_PHY_INFO *phy_info); 21 | 22 | void assoc_vht_info_debugshow(IN RTMP_ADAPTER * pAd, 23 | IN MAC_TABLE_ENTRY * pEntry, 24 | IN VHT_CAP_IE * vht_cap, IN VHT_OP_IE * vht_op); 25 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | struct net_device *netdev; 43 | IkanosWlanTxCbFuncP *fp; 44 | }; 45 | #endif /* IKANOS_VX_1X0 */ 46 | 47 | IKANOS_EXTERN void VR_IKANOS_FP_Init(UINT8 BssNum, UINT8 * pApMac); 48 | 49 | IKANOS_EXTERN INT32 IKANOS_DataFramesTx(struct sk_buff *pSkb, 50 | struct net_device *pNetDev); 51 | 52 | IKANOS_EXTERN void IKANOS_DataFrameRx(PRTMP_ADAPTER pAd, struct sk_buff *pSkb); 53 | 54 | #endif /* __VR_IKANS_H__ */ 55 | 56 | /* End of vr_ikans.h */ 57 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /include/wapi_sms4.h: -------------------------------------------------------------------------------- 1 | 2 | /* SMS4 encryption/decryption definition */ 3 | /* Parameter : */ 4 | /* Input - the incoming message packet */ 5 | /* Ouput - the result ouput */ 6 | /* rk - key */ 7 | void SMS4Crypt(unsigned char *Input, unsigned char *Output, unsigned int *rk); 8 | 9 | /* SMS4 key extend algorithm */ 10 | void SMS4KeyExt(unsigned char *Key, unsigned int *rk, unsigned int CryptFlag); 11 | -------------------------------------------------------------------------------- /mac/ral_nmac.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "rt_config.h" 6 | 7 | INT get_pkt_phymode_by_rxwi(RXWI_STRUC * rxwi) 8 | { 9 | return rxwi->RXWI_N.phy_mode; 10 | } 11 | 12 | INT get_pkt_rssi_by_rxwi(struct _RTMP_ADAPTER * pAd, RXWI_STRUC * rxwi, 13 | INT size, CHAR * rssi) 14 | { 15 | if (size < sizeof(rxwi->RXWI_N.rssi) / sizeof(UINT8)) 16 | NdisMoveMemory(rssi, &rxwi->RXWI_N.rssi[0], size); 17 | 18 | return 0; 19 | } 20 | 21 | INT get_pkt_snr_by_rxwi(struct _RTMP_ADAPTER * pAd, RXWI_STRUC * rxwi, INT size, 22 | UCHAR * snr) 23 | { 24 | // TODO: shiang-6590, fix me for SNR info of RXWI!! 25 | if (size < 3) 26 | NdisMoveMemory(snr, &rxwi->RXWI_N.bbp_rxinfo[0], size); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /mac/ral_omac.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "rt_config.h" 6 | 7 | INT get_pkt_phymode_by_rxwi(RXWI_STRUC * rxwi) 8 | { 9 | return rxwi->RXWI_O.phy_mode; 10 | } 11 | 12 | INT get_pkt_rssi_by_rxwi(struct _RTMP_ADAPTER * pAd, RXWI_STRUC * rxwi, 13 | INT size, CHAR * rssi) 14 | { 15 | switch (size) { 16 | case 3: 17 | rssi[2] = rxwi->RxWIRSSI2; 18 | case 2: 19 | rssi[1] = rxwi->RxWIRSSI1; 20 | case 1: 21 | default: 22 | #ifdef MT7601 23 | if (IS_MT7601(pAd)) 24 | rssi[0] = rxwi->RxWISNR2; 25 | else 26 | #endif /* MT7601 */ 27 | rssi[0] = rxwi->RxWIRSSI0; 28 | break; 29 | } 30 | 31 | return 0; 32 | } 33 | 34 | INT get_pkt_snr_by_rxwi(struct _RTMP_ADAPTER * pAd, RXWI_STRUC * rxwi, INT size, 35 | UCHAR * snr) 36 | { 37 | 38 | #ifdef MT7601 39 | /* 40 | snr[2] = Gain Report 41 | snr[1] = Antenna report 42 | */ 43 | 44 | if (IS_MT7601(pAd)) { 45 | snr[0] = rxwi->RxWISNR0; 46 | snr[1] = 0; 47 | snr[2] = 0; 48 | return 0; 49 | } 50 | #endif /* MT7601 */ 51 | 52 | switch (size) { 53 | case 3: 54 | snr[2] = rxwi->RxWISNR2; 55 | case 2: 56 | snr[1] = rxwi->RxWISNR1; 57 | case 1: 58 | default: 59 | snr[0] = rxwi->RxWISNR0; 60 | break; 61 | } 62 | 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /mcu/bin/MT7601.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/mcu/bin/MT7601.bin -------------------------------------------------------------------------------- /mcu/bin/MT7601.bin_PRE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/mcu/bin/MT7601.bin_PRE -------------------------------------------------------------------------------- /mcu/bin/MT7601_formal_1.3_Debug.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/mcu/bin/MT7601_formal_1.3_Debug.bin -------------------------------------------------------------------------------- /mcu/bin/MT7650.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/mcu/bin/MT7650.bin -------------------------------------------------------------------------------- /mcu/bin/RT85592.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/mcu/bin/RT85592.bin -------------------------------------------------------------------------------- /mcu/bin/rt2860.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/mcu/bin/rt2860.bin -------------------------------------------------------------------------------- /mcu/bin/rt2870.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/mcu/bin/rt2870.bin -------------------------------------------------------------------------------- /mcu/bin/rt2870_wow.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/mcu/bin/rt2870_wow.bin -------------------------------------------------------------------------------- /mcu/rtmp_mcu.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 | rtmp_mcu.c 20 | 21 | Abstract: 22 | 23 | Revision History: 24 | Who When What 25 | -------- ---------- ---------------------------------------------- 26 | */ 27 | 28 | #include "rt_config.h" 29 | 30 | INT MCUBurstWrite(PRTMP_ADAPTER pAd, UINT32 Offset, UINT32 * Data, UINT32 Cnt) 31 | { 32 | RTUSBMultiWrite_nBytes(pAd, Offset, (PUCHAR) Data, Cnt * 4, 64); 33 | return 0; 34 | } 35 | 36 | INT MCURandomWrite(PRTMP_ADAPTER pAd, UINT32 Num, 37 | ... /*RTMP_REG_PAIR *RegPair */ ) 38 | { 39 | UINT32 Index; 40 | va_list arg_ptr; 41 | RTMP_REG_PAIR *RegPair = NULL; 42 | va_start(arg_ptr, Num); 43 | RegPair = va_arg(arg_ptr, PRTMP_REG_PAIR); 44 | for (Index = 0; Index < Num; Index++) 45 | RTMP_IO_WRITE32(pAd, RegPair->Register, RegPair->Value); 46 | va_end(arg_ptr); 47 | return 0; 48 | } 49 | 50 | VOID ChipOpsMCUHook(PRTMP_ADAPTER pAd, enum MCU_TYPE MCUType) 51 | { 52 | 53 | RTMP_CHIP_OP *pChipOps = &pAd->chipOps; 54 | 55 | if (MCUType == M8051) { 56 | pChipOps->sendCommandToMcu = RtmpAsicSendCommandToMcu; 57 | pChipOps->BurstWrite = MCUBurstWrite; 58 | pChipOps->RandomWrite = MCURandomWrite; 59 | } 60 | #ifdef CONFIG_ANDES_SUPPORT 61 | if (MCUType == ANDES) { 62 | 63 | #ifdef RTMP_USB_SUPPORT 64 | pChipOps->loadFirmware = USBLoadFirmwareToAndes; 65 | #endif 66 | //pChipOps->sendCommandToMcu = AsicSendCmdToAndes; 67 | pChipOps->Calibration = AndesCalibrationOP; 68 | pChipOps->BurstWrite = AndesBurstWrite; 69 | pChipOps->BurstRead = AndesBurstRead; 70 | pChipOps->RandomRead = AndesRandomRead; 71 | pChipOps->RFRandomRead = AndesRFRandomRead; 72 | pChipOps->ReadModifyWrite = AndesReadModifyWrite; 73 | pChipOps->RFReadModifyWrite = AndesRFReadModifyWrite; 74 | pChipOps->RandomWrite = AndesRandomWrite; 75 | pChipOps->RFRandomWrite = AndesRFRandomWrite; 76 | pChipOps->PwrSavingOP = AndesPwrSavingOP; 77 | } 78 | #endif 79 | } 80 | 81 | NDIS_STATUS isMCUNeedToLoadFIrmware(IN PRTMP_ADAPTER pAd) 82 | { 83 | NDIS_STATUS Status = NDIS_STATUS_SUCCESS; 84 | ULONG Index; 85 | UINT32 MacReg; 86 | 87 | Index = 0; 88 | 89 | #ifdef CONFIG_ANDES_SUPPORT 90 | if (WaitForAsicReady(pAd) == TRUE) { 91 | DBGPRINT(RT_DEBUG_TRACE, 92 | ("%s WaitForAsicReady ====> TRUE\n", __FUNCTION__)); 93 | #if 1 // don't need to reset MAC in normal cases. 94 | MT7601_WLAN_ChipOnOff(pAd, FALSE, FALSE); 95 | #else 96 | MT7601_WLAN_ChipOnOff(pAd, TRUE, TRUE); 97 | #endif 98 | } else { 99 | DBGPRINT(RT_DEBUG_ERROR, ("%s ====> \n", __FUNCTION__)); 100 | } 101 | #endif 102 | do { 103 | if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) 104 | return NDIS_STATUS_FAILURE; 105 | 106 | #ifdef CONFIG_ANDES_SUPPORT 107 | RTMP_IO_READ32(pAd, COM_REG0, &MacReg); 108 | 109 | if (MacReg == 0x1) 110 | break; 111 | 112 | RtmpOsMsDelay(10); 113 | #else 114 | RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &MacReg); 115 | 116 | if (MacReg & 0x100) /* check bit 8 */ 117 | break; 118 | 119 | RTMPusecDelay(1000); 120 | #endif 121 | } while (Index++ < 100); 122 | 123 | if (Index >= 100) 124 | Status = NDIS_STATUS_FAILURE; 125 | return Status; 126 | } 127 | -------------------------------------------------------------------------------- /mgmt/mgmt_dev.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "rt_config.h" 6 | 7 | struct wifi_dev *get_wdev_by_idx(RTMP_ADAPTER * pAd, INT idx) 8 | { 9 | struct wifi_dev *wdev = NULL; 10 | 11 | do { 12 | #ifdef P2P_SUPPORT 13 | if (idx >= MIN_NET_DEVICE_FOR_P2P_GO) { 14 | wdev = 15 | &pAd->ApCfg.MBSSID[idx - 16 | MIN_NET_DEVICE_FOR_P2P_GO].wdev; 17 | break; 18 | } 19 | #endif /* P2P_SUPPORT */ 20 | 21 | #ifdef CONFIG_AP_SUPPORT 22 | #ifdef APCLI_SUPPORT 23 | if (idx >= MIN_NET_DEVICE_FOR_APCLI) { 24 | idx -= MIN_NET_DEVICE_FOR_APCLI; 25 | if (idx < MAX_APCLI_NUM) { 26 | wdev = &pAd->ApCfg.ApCliTab[idx].wdev; 27 | break; 28 | } 29 | } 30 | #endif /* APCLI_SUPPORT */ 31 | 32 | IF_DEV_CONFIG_OPMODE_ON_AP(pAd) { 33 | 34 | if ((idx < pAd->ApCfg.BssidNum) 35 | && (idx < MAX_MBSSID_NUM(pAd)) 36 | && (idx < HW_BEACON_MAX_NUM)) 37 | wdev = &pAd->ApCfg.MBSSID[idx].wdev; 38 | 39 | break; 40 | } 41 | #endif /* CONFIG_AP_SUPPORT */ 42 | #ifdef CONFIG_STA_SUPPORT 43 | IF_DEV_CONFIG_OPMODE_ON_STA(pAd) { 44 | wdev = &pAd->StaCfg.wdev; 45 | break; 46 | } 47 | #endif /* CONFIG_STA_SUPPORT */ 48 | } while (FALSE); 49 | 50 | if (wdev == NULL) { 51 | DBGPRINT(RT_DEBUG_ERROR, 52 | ("RTMPSetIndividualHT: invalid idx(%d)\n", idx)); 53 | } 54 | 55 | return wdev; 56 | } 57 | -------------------------------------------------------------------------------- /mgmt/mgmt_hw.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 4 | */ 5 | 6 | #include 7 | 8 | INT dev_adjust_radio(RTMP_ADAPTER * pAd) 9 | { 10 | struct hw_setting *hw_cfg = &pAd->hw_cfg, new_cfg; 11 | 12 | NdisZeroMemory(&new_cfg, sizeof(struct hw_setting)); 13 | 14 | /* For all wdev, find the maximum inter-set */ 15 | 16 | if (hw_cfg->bbp_bw != new_cfg.bbp_bw) { 17 | rtmp_bbp_set_bw(pAd, new_cfg.bbp_bw); 18 | hw_cfg->bbp_bw = new_cfg.bbp_bw; 19 | } 20 | 21 | if (hw_cfg->cent_ch != new_cfg.cent_ch) { 22 | UCHAR ext_ch = EXTCHA_NONE; 23 | 24 | rtmp_bbp_set_ctrlch(pAd, ext_ch); 25 | rtmp_mac_set_ctrlch(pAd, ext_ch); 26 | } 27 | 28 | return TRUE; 29 | } 30 | -------------------------------------------------------------------------------- /mgmt/mgmt_vht.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "rt_config.h" 6 | 7 | #ifdef DOT11_VHT_AC 8 | 9 | VOID rtmp_set_vht(RTMP_ADAPTER * pAd, RT_PHY_INFO * phy_info) 10 | { 11 | if (!phy_info) 12 | return; 13 | 14 | if (phy_info->bVhtEnable) 15 | phy_info->vht_bw = VHT_BW_80; 16 | 17 | } 18 | 19 | INT SetCommonVHT(RTMP_ADAPTER * pAd) 20 | { 21 | UCHAR cent_ch = 0; 22 | 23 | if (!WMODE_CAP_AC(pAd->CommonCfg.PhyMode)) { 24 | /* Clear previous VHT information */ 25 | return FALSE; 26 | } 27 | 28 | pAd->CommonCfg.vht_cent_ch = 29 | vht_cent_ch_freq(pAd, pAd->CommonCfg.Channel); 30 | 31 | DBGPRINT(RT_DEBUG_TRACE, 32 | ("%s(): Config VHT parameters!cent_ch=%d!vht_cent_ch = %d, vht_cent_ch2 = %d\n", 33 | __FUNCTION__, cent_ch, pAd->CommonCfg.vht_cent_ch, 34 | pAd->CommonCfg.vht_cent_ch2)); 35 | return TRUE; 36 | } 37 | 38 | #endif /* DOT11_VHT_AC */ 39 | -------------------------------------------------------------------------------- /os/linux/EEPROMDump.txt: -------------------------------------------------------------------------------- 1 | 00000000 = 7650 2 | 00000002 = 0100 3 | 00000004 = 0c00 4 | 00000006 = 7643 5 | 00000008 = 1750 6 | 0000000a = 7650 7 | 0000000c = 1814 8 | 0000000e = 6598 9 | 00000010 = 1814 10 | 00000012 = 7550 11 | 00000014 = 1814 12 | 00000016 = 6598 13 | 00000018 = 1814 14 | 0000001a = 0c00 15 | 0000001c = 4643 16 | 0000001e = 0100 17 | 00000020 = 000a 18 | 00000022 = f7c4 19 | 00000024 = ffff 20 | 00000026 = ffff 21 | 00000028 = ffff 22 | 0000002a = ffff 23 | 0000002c = ffff 24 | 0000002e = ffff 25 | 00000030 = 758e 26 | 00000032 = 4301 27 | 00000034 = ff11 28 | 00000036 = 2824 29 | 00000038 = ffff 30 | 0000003a = 0100 31 | 0000003c = ffff 32 | 0000003e = 9999 33 | 00000040 = 888c 34 | 00000042 = 0011 35 | 00000044 = 080a 36 | 00000046 = 0000 37 | 00000048 = 080a 38 | 0000004a = 0000 39 | 0000004c = 0800 40 | 0000004e = ffff 41 | 00000050 = 0000 42 | 00000052 = 0505 43 | 00000054 = 0505 44 | 00000056 = 0505 45 | 00000058 = 0505 46 | 0000005a = 0505 47 | 0000005c = 0505 48 | 0000005e = 0505 49 | 00000060 = ffff 50 | 00000062 = ffff 51 | 00000064 = ffff 52 | 00000066 = ffff 53 | 00000068 = ffff 54 | 55 | 0000006c = ffff 56 | 0000006e = ffff 57 | 00000070 = ffff 58 | 00000072 = ffff 59 | 00000074 = ffff 60 | 00000076 = ffff 61 | 00000078 = ffff 62 | 0000007a = 0606 63 | 0000007c = 0606 64 | 0000007e = 0606 65 | 00000080 = 0606 66 | 00000082 = 0606 67 | 00000084 = 0606 68 | 00000086 = 0606 69 | 00000088 = 0606 70 | 0000008a = 0606 71 | 0000008c = 0606 72 | 0000008e = 0606 73 | 00000090 = 0606 74 | 00000092 = 0606 75 | 00000094 = 0606 76 | 00000096 = 0606 77 | 00000098 = 0606 78 | 0000009a = ff06 79 | 0000009c = ffff 80 | 0000009e = ffff 81 | 000000a0 = ffff 82 | 000000a2 = ffff 83 | 000000a4 = ffff 84 | 000000a6 = ffff 85 | 000000a8 = ffff 86 | 000000aa = ffff 87 | 000000ac = ffff 88 | 000000ae = ffff 89 | 000000b0 = ffff 90 | 000000b2 = ffff 91 | 000000b4 = ffff 92 | 000000b6 = ffff 93 | 000000b8 = ffff 94 | 000000ba = ffff 95 | 000000bc = ffff 96 | 000000be = ffff 97 | 000000c0 = ffff 98 | 000000c2 = ffff 99 | 000000c4 = ffff 100 | 000000c6 = ffff 101 | 000000c8 = ffff 102 | 000000ca = ffff 103 | 000000cc = ffff 104 | 000000ce = efff 105 | 000000d0 = ffff 106 | 000000d2 = ffff 107 | 000000d4 = ffff 108 | 000000d6 = ffff 109 | 000000d8 = ffff 110 | 000000da = ffff 111 | 000000dc = ffff 112 | 000000de = 3030 113 | 000000e0 = 3030 114 | 000000e2 = 3030 115 | 000000e4 = 3030 116 | 000000e6 = 3030 117 | 000000e8 = 3030 118 | 000000ea = 3030 119 | 000000ec = 3030 120 | 000000ee = 3030 121 | 000000f0 = ffff 122 | 000000f2 = ffff 123 | 000000f4 = ffff 124 | 000000f6 = ffff 125 | 000000f8 = ffff 126 | 000000fa = ffff 127 | 000000fc = ffff 128 | 000000fe = ffff 129 | -------------------------------------------------------------------------------- /os/linux/Kconfig.ap.soc: -------------------------------------------------------------------------------- 1 | config RT2860V2_AP 2 | tristate "Ralink RT2860 802.11n AP support" 3 | depends on NET_RADIO 4 | 5 | config RT2860V2_AP_V24_DATA_STRUCTURE 6 | bool 7 | depends on RT2860V2_AP 8 | default y 9 | 10 | config RT2860V2_AP_LED 11 | bool "LED Support" 12 | depends on RT2860V2_AP 13 | 14 | config RT2860V2_AP_WSC 15 | bool "WSC (WiFi Simple Config)" 16 | depends on RT2860V2_AP 17 | 18 | config RT2860V2_AP_LLTD 19 | bool "LLTD (Link Layer Topology Discovery Protocol)" 20 | depends on RT2860V2_AP 21 | 22 | config RT2860V2_AP_WDS 23 | bool "WDS" 24 | depends on RT2860V2_AP 25 | 26 | config RT2860V2_AP_NINTENDO 27 | bool "Nintendo" 28 | depends on RT2860V2_AP 29 | 30 | config RT2860V2_AP_WMM_ACM 31 | bool "WMM ACM" 32 | depends on RT2860V2_AP 33 | 34 | config RT2860V2_AP_MBSS 35 | bool "MBSSID" 36 | depends on RT2860V2_AP 37 | 38 | config NEW_MBSSID_MODE 39 | bool "New MBSSID MODE" 40 | depends on RT2860V2_AP 41 | depends on RT2860V2_AP_MBSS 42 | depends on RALINK_RT3883 || RALINK_RT3352 || RALINK_RT5350 43 | default n 44 | 45 | config RT2860V2_AP_APCLI 46 | bool "AP-CLient Support" 47 | depends on RT2860V2_AP 48 | 49 | config RT2860V2_AP_IGMP_SNOOP 50 | bool "IGMP snooping" 51 | depends on RT2860V2_AP 52 | 53 | config RT2860V2_AP_NETIF_BLOCK 54 | bool "NETIF Block" 55 | depends on RT2860V2_AP 56 | help 57 | Support Net interface block while Tx-Sw queue full 58 | 59 | config RT2860V2_AP_DFS 60 | bool "DFS" 61 | depends on RT2860V2_AP 62 | select RALINK_TIMER_DFS 63 | 64 | config RT2860V2_AP_CARRIER 65 | bool "Carrier Detect" 66 | depends on RT2860V2_AP 67 | select RALINK_TIMER_DFS 68 | 69 | config RT2860V2_AP_DLS 70 | bool "DLS ((Direct-Link Setup) Support" 71 | depends on RT2860V2_AP 72 | 73 | config RT2860V2_AP_IDS 74 | bool "IDS (Intrusion Detection System) Support" 75 | depends on RT2860V2_AP 76 | 77 | config RT2860V2_AP_MESH 78 | bool "MESH Support" 79 | depends on RT2860V2_AP 80 | 81 | config RT2860V2_HW_ANTENNA_DIVERSITY 82 | bool "Antenna Diversity Support" 83 | depends on RT2860V2_AP 84 | depends on RALINK_RT5350 85 | 86 | config RT2860V2_RT3XXX_AP_ANTENNA_DIVERSITY 87 | bool "Antenna Diversity Support" 88 | depends on RT2860V2_AP 89 | 90 | config RT2860V2_AP_WAPI 91 | bool "WAPI Support" 92 | depends on RT2860V2_AP 93 | 94 | config RT2860V2_AP_COC 95 | bool "CoC Support" 96 | depends on RT2860V2_AP 97 | 98 | config RT2860V2_AP_MEMORY_OPTIMIZATION 99 | bool "Memory Optimization" 100 | depends on RT2860V2_AP 101 | 102 | config RT2860V2_AP_VIDEO_TURBINE 103 | bool "Video Turbine support" 104 | depends on RT2860V2_AP 105 | 106 | config RA_CLASSIFIER 107 | tristate "Ralink Flow Classifier" 108 | depends on RT2860V2_AP_VIDEO_TURBINE 109 | default n 110 | 111 | config RT2860V2_80211N_DRAFT3 112 | bool "802.11n Draft3" 113 | depends on RT2860V2_AP 114 | 115 | config RT2860V2_AP_INTELLIGENT_RATE_ADAPTION 116 | bool "Intelligent Rate Adaption" 117 | depends on RT2860V2_AP 118 | 119 | config RT2860V2_AP_TXBF 120 | bool "Tx Beam Forming" 121 | depends on RT2860V2_AP 122 | depends on RALINK_RT3883 123 | 124 | config RT2860V2_AP_RTMP_INTERNAL_TX_ALC 125 | bool "TSSI Compensation" 126 | depends on RT2860V2_AP 127 | depends on RALINK_RT3350 || RALINK_RT3352 || RALINK_RT5350 128 | 129 | #config RT2860V2_EXT_CHANNEL_LIST 130 | # bool "Extension Channel List" 131 | # depends on RT2860V2_AP 132 | 133 | #config RT2860V2_KTHREAD 134 | # bool "Kernel Thread" 135 | # depends on RT2860V2_AP 136 | 137 | #config RT2860V2_AUTO_CH_SELECT_ENHANCE 138 | # bool "Auto Channel Selection Enhancement" 139 | # depends on RT2860V2_AP 140 | 141 | #config RT2860V2_80211R_FT 142 | # bool "802.11r Fast BSS Transition" 143 | # depends on RT2860V2_AP 144 | 145 | #config RT2860V2_80211R_RR 146 | # bool "802.11k Radio Resource Management" 147 | # depends on RT2860V2_AP 148 | 149 | #config RT2860V2_SINGLE_SKU 150 | # bool "Single SKU" 151 | # depends on RT2860V2_AP 152 | 153 | #config RT2860V2_MCAST_RATE_SPECIFIC 154 | # bool "User specific tx rate of mcast pkt" 155 | # depends on RT2860V2_AP 156 | 157 | #config RT2860V2_SNMP 158 | # bool "Net-SNMP Support" 159 | # depends on RT2860V2_AP 160 | -------------------------------------------------------------------------------- /os/linux/Kconfig.ap.usb: -------------------------------------------------------------------------------- 1 | config RTUSB_AP 2 | tristate "Ralink WiFi USB combo driver AP module" 3 | depends on m 4 | default m 5 | 6 | config RTUSB_AP_WSC 7 | bool "WPS support including WPS2.0" 8 | depends on RTUSB_AP 9 | default y 10 | 11 | config RTUSB_AP_MBSS 12 | bool "MBSS support" 13 | depends on RTUSB_AP 14 | default y 15 | 16 | config RTUSB_AP_NEW_MBSS_MODE 17 | bool "New MBSS support" 18 | depends on RTUSB_AP_MBSS 19 | 20 | config RTUSB_WDS 21 | bool "WDS support" 22 | depends on RTUSB_AP 23 | 24 | config RTUSB_APCLI 25 | bool "APClient support" 26 | depends on RTUSB_AP 27 | 28 | config RTUSB_DFS 29 | bool "DFS support" 30 | depends on RTUSB_AP 31 | 32 | config RTUSB_CS 33 | bool "CS support" 34 | depends on RTUSB_AP 35 | 36 | config RTUSB_IGMP_SNOOP 37 | bool "IGMP snoop support" 38 | depends on RTUSB_AP 39 | 40 | config RTUSB_NETIF_BLOCK 41 | bool "NETIF block support" 42 | depends on RTUSB_AP 43 | 44 | config RTUSB_DLS 45 | bool "DLS support" 46 | depends on RTUSB_AP 47 | 48 | config RTUSB_IDS 49 | bool "IDS support" 50 | depends on RTUSB_AP 51 | 52 | config RTUSB_AP_FLASH_SUPPORT 53 | bool "FLASH support" 54 | depends on RTUSB_AP 55 | 56 | config RTUSB_AP_80211N_DRAFT3 57 | bool "802.11n Draft3 support" 58 | depends on RTUSB_AP 59 | default y 60 | 61 | # Chip related 62 | config RT2870_AP 63 | bool "RT2870 support" 64 | depends on RTUSB_AP 65 | 66 | config RT3572_AP 67 | bool "RT3572 support" 68 | depends on RTUSB_AP 69 | 70 | config RT3573_AP 71 | bool "RT3573 support" 72 | depends on RTUSB_AP 73 | 74 | config RT5572_AP 75 | bool "RT5572 support" 76 | depends on RTUSB_AP 77 | default y 78 | 79 | # ATE 80 | config RTUSB_AP_ATE 81 | bool "ATE support" 82 | depends on RTUSB_AP 83 | 84 | config RT2870_AP_ATE 85 | bool "RT2870 ATE support" 86 | depends on RTUSB_AP_ATE && RT2870_AP 87 | 88 | config RT3572_AP_ATE 89 | bool "RT3572 ATE support" 90 | depends on RTUSB_AP_ATE && RT3572_AP 91 | 92 | config RT5572_AP_ATE 93 | bool "RT5572 ATE support" 94 | depends on RTUSB_AP_ATE && RT5572_AP 95 | default y 96 | 97 | # QA 98 | config RTUSB_AP_QA 99 | bool "QA tool support" 100 | depends on RTUSB_AP_ATE 101 | default y 102 | 103 | config RTUSB_AP_WAPI 104 | bool "WAPI support" 105 | depends on RTUSB_AP 106 | 107 | # Platform specific 108 | config RT5572_AP_WDS 109 | bool 110 | depends on RTUSB_WDS 111 | default y 112 | -------------------------------------------------------------------------------- /os/linux/Kconfig.sta.soc: -------------------------------------------------------------------------------- 1 | config RT2860V2_STA 2 | tristate "Ralink RT2860 802.11n STA support" 3 | depends on NET_RADIO 4 | 5 | config RT2860V2_STA_WPA_SUPPLICANT 6 | bool "WPA Supplicant" 7 | depends on RT2860V2_STA 8 | 9 | config RT2860V2_STA_ETH_CONVERT 10 | bool "Ethernet Convert Support" 11 | depends on RT2860V2_STA 12 | 13 | config RT2860V2_STA_DPB 14 | bool 15 | depends on RT2860V2_STA_ETH_CONVERT 16 | default y 17 | 18 | config RT2860V2_STA_WMM_ACM 19 | bool "WMM ACM Support" 20 | depends on RT2860V2_STA 21 | 22 | config RT2860V2_STA_LED 23 | bool "LED Support" 24 | depends on RT2860V2_STA 25 | 26 | config RT2860V2_STA_IDS 27 | bool "IDS (Intrusion Detection System) Support" 28 | depends on RT2860V2_STA 29 | 30 | config RT2860V2_STA_WSC 31 | bool "WSC (WiFi Simple Config)" 32 | depends on RT2860V2_STA 33 | 34 | config RT2860V2_STA_CARRIER 35 | bool "Carrier Sense Support" 36 | depends on RT2860V2_STA 37 | select RALINK_TIMER 38 | select RALINK_TIMER_DFS 39 | 40 | config RT2860V2_STA_DLS 41 | bool "DLS ((Direct-Link Setup) Support" 42 | depends on RT2860V2_STA 43 | 44 | config RT2860V2_STA_MESH 45 | bool "MESH Support" 46 | depends on RT2860V2_STA 47 | 48 | config RT2860V2_RT3XXX_STA_ANTENNA_DIVERSITY 49 | bool "Antenna Diversity Support" 50 | depends on RT2860V2_STA 51 | 52 | config RT2860V2_HW_STA_ANTENNA_DIVERSITY 53 | bool "Antenna Diversity Support" 54 | depends on RT2860V2_STA 55 | depends on RALINK_RT5350 56 | 57 | #config RT2860V2_STA_WAPI 58 | # bool "WAPI Support" 59 | # depends on RT2860V2_STA 60 | 61 | config RT2860V2_STA_VIDEO_TURBINE 62 | bool "Video Turbine support" 63 | depends on RT2860V2_STA 64 | 65 | config RT2860V2_STA_INTELLIGENT_RATE_ADAPTION 66 | bool "Intelligent Rate Adaption" 67 | depends on RT2860V2_STA 68 | 69 | config RT2860V2_STA_TXBF 70 | bool "Tx Bean Forming Support (Only 3883)" 71 | depends on RT2860V2_STA 72 | depends on RALINK_RT3883 73 | 74 | config RT2860V2_STA_RTMP_INTERNAL_TX_ALC 75 | bool "TSSI Compensation" 76 | depends on RT2860V2_STA 77 | depends on RALINK_RT3350 || RALINK_RT3352 || RALINK_RT5350 78 | 79 | config RT2860V2_STA_80211N_DRAFT3 80 | bool "802.11n Draft3" 81 | depends on RT2860V2_STA 82 | 83 | #config RT2860V2_EXT_CHANNEL_LIST 84 | # bool "Extension Channel List" 85 | # depends on RT2860V2_STA 86 | 87 | #config RT2860V2_SNMP 88 | # bool "Net-SNMP Support" 89 | # depends on RT2860V2_STA 90 | -------------------------------------------------------------------------------- /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 | #ifdef CONFIG_STA_SUPPORT 10 | ifeq ($(RT28xx_MODE), STA) 11 | MOD_NAME = rtnet$(MODULE)sta 12 | endif 13 | #endif // CONFIG_STA_SUPPORT // 14 | 15 | #ifdef CONFIG_APSTA_SUPPORT 16 | ifeq ($(RT28xx_MODE), APSTA) 17 | MOD_NAME = rtnet$(MODULE)apsta 18 | endif 19 | #endif // CONFIG_APSTA_SUPPORT // 20 | 21 | OBJ := $(MOD_NAME).o 22 | 23 | #ifdef CONFIG_AP_SUPPORT 24 | 25 | RT28XX_AP_OBJ := \ 26 | ../../ap/ap_mbss_inf.o\ 27 | ../../os/linux/ap_ioctl.o\ 28 | ../../os/linux/rt_main_dev.o 29 | 30 | ifeq ($(HAS_WDS),y) 31 | RT28XX_AP_OBJ += \ 32 | ../../ap/ap_wds_inf.o 33 | endif 34 | 35 | ifeq ($(HAS_APCLI),y) 36 | RT28XX_AP_OBJ += \ 37 | ../../ap/ap_apcli_inf.o 38 | endif 39 | 40 | ifeq ($(HAS_MESH_SUPPORT),y) 41 | RT28XX_AP_OBJ += \ 42 | ../../common/mesh_inf.o 43 | endif 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | #endif // CONFIG_AP_SUPPORT // 61 | 62 | #ifdef CONFIG_STA_SUPPORT 63 | RT28XX_STA_OBJ := \ 64 | ../../os/linux/sta_ioctl.o\ 65 | ../../os/linux/rt_main_dev.o 66 | 67 | ifeq ($(HAS_MESH_SUPPORT),y) 68 | RT28XX_STA_OBJ += \ 69 | ../../common/mesh_inf.o 70 | endif 71 | 72 | ifeq ($(HAS_P2P_SUPPORT), y) 73 | RT28XX_STA_OBJ += \ 74 | ../../common/p2p_inf.o\ 75 | ../../os/linux/ap_ioctl.o 76 | endif 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | #endif // CONFIG_STA_SUPPORT // 95 | 96 | #ifdef CONFIG_APSTA_SUPPORT 97 | RT28XX_APSTA_OBJ := \ 98 | ../../ap/ap_mbss_inf.o\ 99 | ../../common/p2p_inf.o\ 100 | ../../os/linux/ap_ioctl.o\ 101 | ../../os/linux/sta_ioctl.o\ 102 | ../../os/linux/rt_main_dev.o 103 | 104 | ifeq ($(HAS_WDS),y) 105 | RT28XX_APSTA_OBJ += \ 106 | ../../ap/ap_wds_inf.o 107 | endif 108 | 109 | ifeq ($(HAS_APCLI),y) 110 | RT28XX_APSTA_OBJ += \ 111 | ../../ap/ap_apcli_inf.o 112 | endif 113 | 114 | ifeq ($(HAS_MESH_SUPPORT),y) 115 | RT28XX_APSTA_OBJ += \ 116 | ../../common/mesh_inf.o 117 | endif 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | #endif // CONFIG_APSTA_SUPPORT // 132 | 133 | PHONY := all clean 134 | 135 | all:$(OBJ) 136 | 137 | rtnet$(MODULE)sta.o: $(RT28XX_STA_OBJ) 138 | $(LD) -r $^ -o $@ 139 | 140 | rtnet$(MODULE)ap.o: $(RT28XX_AP_OBJ) 141 | $(LD) -r $^ -o $@ 142 | 143 | rtnet$(MODULE)apsta.o: $(RT28XX_APSTA_OBJ) 144 | $(LD) -r $^ -o $@ 145 | 146 | clean: 147 | rm -f $(RT28xx_DIR)/common/*.o 148 | rm -f $(RT28xx_DIR)/common/.*.{cmd,flags,d} 149 | rm -f $(RT28xx_DIR)/os/linux/*.{o,ko,mod.{o,c}} 150 | rm -f $(RT28xx_DIR)/os/linux/.*.{cmd,flags,d} 151 | rm -fr $(RT28xx_DIR)/os/linux/.tmp_versions 152 | rm -f $(RT28xx_DIR)/chips/*.o 153 | rm -f $(RT28xx_DIR)/chips/.*.{cmd,flags,d} 154 | ifeq ($(RT28xx_MODE),AP) 155 | rm -f $(RT28xx_DIR)/ap/*.o 156 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 157 | else 158 | ifeq ($(RT28xx_MODE),STA) 159 | rm -f $(RT28xx_DIR)/sta/*.o 160 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 161 | else 162 | ifeq ($(RT28xx_MODE),APSTA) 163 | rm -f $(RT28xx_DIR)/ap/*.o 164 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 165 | rm -f $(RT28xx_DIR)/sta/*.o 166 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 167 | endif 168 | endif 169 | endif 170 | 171 | install: 172 | install -d $(LINUX_SRC_MODULE) 173 | install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE) 174 | /sbin/depmod -a ${shell uname -r} 175 | 176 | uninstall: 177 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME))) 178 | /sbin/depmod -a ${shell uname -r} 179 | 180 | # Declare the contents of the .PHONY variable as phony. We keep that 181 | # # information in a variable so we can use it in if_changed and friends. 182 | .PHONY: $(PHONY) 183 | -------------------------------------------------------------------------------- /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 | #ifdef CONFIG_STA_SUPPORT 10 | ifeq ($(RT28xx_MODE), STA) 11 | MOD_NAME = rtutil$(MODULE)sta 12 | endif 13 | #endif // CONFIG_STA_SUPPORT // 14 | 15 | #ifdef CONFIG_APSTA_SUPPORT 16 | ifeq ($(RT28xx_MODE), APSTA) 17 | MOD_NAME = rtutil$(MODULE)apsta 18 | endif 19 | #endif // CONFIG_APSTA_SUPPORT // 20 | 21 | OBJ := $(MOD_NAME).o 22 | 23 | #ifdef CONFIG_AP_SUPPORT 24 | 25 | RT28XX_AP_OBJ := \ 26 | ../../common/rt_os_util.o\ 27 | ../../os/linux/rt_linux_symb.o\ 28 | ../../os/linux/rt_rbus_pci_util.o\ 29 | ../../os/linux/rt_usb_util.o\ 30 | ../../os/linux/rt_linux.o 31 | 32 | ifeq ($(HAS_BGFP_SUPPORT),y) 33 | RT28XX_AP_OBJ += \ 34 | $(RT28xx_DIR)/os/linux/br_ftph.o 35 | endif 36 | 37 | #endif // CONFIG_AP_SUPPORT // 38 | 39 | 40 | #ifdef CONFIG_STA_SUPPORT 41 | 42 | RT28XX_STA_OBJ := \ 43 | ../../common/rt_os_util.o\ 44 | ../../os/linux/rt_linux_symb.o\ 45 | ../../os/linux/rt_rbus_pci_util.o\ 46 | ../../os/linux/rt_usb_util.o\ 47 | ../../os/linux/rt_linux.o 48 | #endif // CONFIG_STA_SUPPORT // 49 | 50 | 51 | #ifdef CONFIG_APSTA_SUPPORT 52 | RT28XX_APSTA_OBJ := \ 53 | ../../common/rt_os_util.o\ 54 | ../../os/linux/rt_linux_symb.o\ 55 | ../../os/linux/rt_rbus_pci_util.o\ 56 | ../../os/linux/rt_usb_util.o\ 57 | ../../os/linux/rt_linux.o 58 | 59 | #endif // CONFIG_APSTA_SUPPORT // 60 | 61 | PHONY := all clean 62 | 63 | all:$(OBJ) 64 | 65 | rtutil$(MODULE)sta.o: $(RT28XX_STA_OBJ) 66 | $(LD) -r $^ -o $@ 67 | 68 | rtutil$(MODULE)ap.o: $(RT28XX_AP_OBJ) 69 | $(LD) -r $^ -o $@ 70 | 71 | rtutil$(MODULE)apsta.o: $(RT28XX_APSTA_OBJ) 72 | $(LD) -r $^ -o $@ 73 | 74 | clean: 75 | rm -f $(RT28xx_DIR)/common/*.o 76 | rm -f $(RT28xx_DIR)/common/.*.{cmd,flags,d} 77 | rm -f $(RT28xx_DIR)/os/linux/*.{o,ko,mod.{o,c}} 78 | rm -f $(RT28xx_DIR)/os/linux/.*.{cmd,flags,d} 79 | rm -fr $(RT28xx_DIR)/os/linux/.tmp_versions 80 | rm -f $(RT28xx_DIR)/chips/*.o 81 | rm -f $(RT28xx_DIR)/chips/.*.{cmd,flags,d} 82 | ifeq ($(RT28xx_MODE),AP) 83 | rm -f $(RT28xx_DIR)/ap/*.o 84 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 85 | else 86 | ifeq ($(RT28xx_MODE),STA) 87 | rm -f $(RT28xx_DIR)/sta/*.o 88 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 89 | else 90 | ifeq ($(RT28xx_MODE),APSTA) 91 | rm -f $(RT28xx_DIR)/ap/*.o 92 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 93 | rm -f $(RT28xx_DIR)/sta/*.o 94 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 95 | endif 96 | endif 97 | endif 98 | 99 | install: 100 | install -d $(LINUX_SRC_MODULE) 101 | install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE) 102 | /sbin/depmod -a ${shell uname -r} 103 | 104 | uninstall: 105 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME))) 106 | /sbin/depmod -a ${shell uname -r} 107 | 108 | # Declare the contents of the .PHONY variable as phony. We keep that 109 | # # information in a variable so we can use it in if_changed and friends. 110 | .PHONY: $(PHONY) 111 | -------------------------------------------------------------------------------- /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 = rtnet$(MODULE)ap 6 | endif 7 | #endif // CONFIG_AP_SUPPORT // 8 | 9 | #ifdef CONFIG_STA_SUPPORT 10 | ifeq ($(RT28xx_MODE), STA) 11 | ifneq ($(findstring 7601,$(CHIPSET)),) 12 | MOD_NAME = mtnet$(MODULE)sta 13 | else 14 | MOD_NAME = rtnet$(MODULE)sta 15 | endif 16 | endif 17 | #endif // CONFIG_STA_SUPPORT // 18 | 19 | #ifdef CONFIG_APSTA_SUPPORT 20 | ifeq ($(RT28xx_MODE), APSTA) 21 | MOD_NAME = rtnet$(MODULE)apsta 22 | endif 23 | #endif // CONFIG_APSTA_SUPPORT // 24 | 25 | obj-m := $(MOD_NAME).o 26 | 27 | #ifdef CONFIG_AP_SUPPORT 28 | ifeq ($(RT28xx_MODE),AP) 29 | $(MOD_NAME)-objs := \ 30 | ../../ap/ap_mbss_inf.o\ 31 | ../../os/linux/ap_ioctl.o\ 32 | ../../os/linux/rt_main_dev.o 33 | 34 | ifeq ($(HAS_CFG80211_SUPPORT),y) 35 | $(MOD_NAME)-objs += \ 36 | ../../os/linux/cfg80211.o 37 | endif 38 | 39 | ifeq ($(HAS_WDS),y) 40 | $(MOD_NAME)-objs += \ 41 | ../../ap/ap_wds_inf.o 42 | endif 43 | 44 | ifeq ($(HAS_APCLI),y) 45 | $(MOD_NAME)-objs += \ 46 | ../../ap/ap_apcli_inf.o 47 | endif 48 | 49 | ifeq ($(HAS_MESH_SUPPORT),y) 50 | $(MOD_NAME)-objs += \ 51 | ../../common/mesh_inf.o 52 | endif 53 | 54 | endif 55 | #endif // CONFIG_AP_SUPPORT // 56 | 57 | #ifdef CONFIG_STA_SUPPORT 58 | ifeq ($(RT28xx_MODE), STA) 59 | $(MOD_NAME)-objs := \ 60 | ../../os/linux/sta_ioctl.o\ 61 | ../../os/linux/rt_main_dev.o 62 | 63 | ifeq ($(HAS_CFG80211_SUPPORT),y) 64 | $(MOD_NAME)-objs += \ 65 | ../../os/linux/cfg80211.o 66 | endif 67 | 68 | ifeq ($(HAS_MESH_SUPPORT),y) 69 | $(MOD_NAME)-objs += \ 70 | ../../common/mesh_inf.o 71 | endif 72 | 73 | ifeq ($(HAS_P2P_SUPPORT), y) 74 | $(MOD_NAME)-objs += \ 75 | ../../common/p2p_inf.o\ 76 | ../../os/linux/ap_ioctl.o 77 | endif 78 | 79 | endif 80 | #endif // CONFIG_STA_SUPPORT // 81 | 82 | #ifdef CONFIG_APSTA_SUPPORT 83 | ifeq ($(RT28xx_MODE), APSTA) 84 | $(MOD_NAME)-objs := \ 85 | ../../ap/ap_mbss_inf.o\ 86 | ../../common/p2p_inf.o\ 87 | ../../os/linux/ap_ioctl.o\ 88 | ../../os/linux/sta_ioctl.o\ 89 | ../../os/linux/rt_main_dev.o 90 | 91 | ifeq ($(HAS_CFG80211_SUPPORT),y) 92 | $(MOD_NAME)-objs += \ 93 | ../../os/linux/cfg80211.o 94 | endif 95 | 96 | ifeq ($(HAS_WDS),y) 97 | $(MOD_NAME)-objs += \ 98 | ../../ap/ap_wds_inf.o 99 | endif 100 | 101 | ifeq ($(HAS_APCLI),y) 102 | $(MOD_NAME)-objs += \ 103 | ../../ap/ap_apcli_inf.o 104 | endif 105 | 106 | ifeq ($(HAS_MESH_SUPPORT),y) 107 | $(MOD_NAME)-objs += \ 108 | ../../common/mesh_inf.o 109 | endif 110 | 111 | 112 | endif 113 | #endif // CONFIG_APSTA_SUPPORT // 114 | 115 | #chip related 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | #ifdef MT7601 133 | ifneq ($(findstring 7601,$(CHIPSET)),) 134 | $(MOD_NAME)-objs += \ 135 | ../../common/rtusb_dev_id.o\ 136 | ../../os/linux/usb_main_dev.o 137 | endif 138 | #endif // MT7601 // 139 | 140 | clean: 141 | rm -f ../../common/*.o 142 | rm -f ../../common/.*.{cmd,flags,d} 143 | rm -f ../../os/linux/*.{o,ko,mod.{o,c}} 144 | rm -f ../../os/linux/.*.{cmd,flags,d} 145 | rm -fr ../../os/linux/.tmp_versions 146 | rm -f ../../os/linux/Module.symvers 147 | rm -f ../../os/linux/Modules.symvers 148 | rm -f ../../os/linux/Module.markers 149 | rm -f ../../os/linux/modules.order 150 | rm -f ../../chips/*.o 151 | rm -f ../../chips/.*.{cmd,flags,d} 152 | ifeq ($(RT28xx_MODE),AP) 153 | rm -f ../../ap/*.o 154 | rm -f ../../ap/.*.{cmd,flags,d} 155 | else 156 | ifeq ($(RT28xx_MODE),STA) 157 | rm -f ../../sta/*.o 158 | rm -f ../../sta/.*.{cmd,flags,d} 159 | endif 160 | endif 161 | 162 | install: 163 | install -d $(LINUX_SRC_MODULE) 164 | install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE) 165 | /sbin/depmod -a ${shell uname -r} 166 | 167 | uninstall: 168 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME))) 169 | /sbin/depmod -a ${shell uname -r} 170 | -------------------------------------------------------------------------------- /os/linux/Makefile.6.prealloc: -------------------------------------------------------------------------------- 1 | include $(RT28xx_DIR)/os/linux/config.mk 2 | 3 | #ifdef CONFIG_STA_SUPPORT 4 | ifeq ($(RT28xx_MODE), STA) 5 | ifneq ($(findstring 7601,$(CHIPSET)),) 6 | MOD_NAME = mtprealloc 7 | else 8 | MOD_NAME = rtprealloc$(MODULE)sta 9 | endif 10 | endif 11 | #endif // CONFIG_STA_SUPPORT // 12 | 13 | #ifdef CONFIG_APSTA_SUPPORT 14 | ifeq ($(RT28xx_MODE), APSTA) 15 | MOD_NAME = rtprealloc$(MODULE)apsta 16 | endif 17 | #endif // CONFIG_APSTA_SUPPORT // 18 | 19 | obj-m := $(MOD_NAME).o 20 | 21 | 22 | #ifdef CONFIG_STA_SUPPORT 23 | ifeq ($(RT28xx_MODE), STA) 24 | $(MOD_NAME)-objs := prealloc.o 25 | endif 26 | #endif // CONFIG_STA_SUPPORT // 27 | 28 | 29 | #ifdef CONFIG_APSTA_SUPPORT 30 | ifeq ($(RT28xx_MODE), APSTA) 31 | $(MOD_NAME)-objs := \ 32 | ../../prealloc.o 33 | 34 | ifeq ($(PLATFORM),BL2348) 35 | $(MOD_NAME)-objs += \ 36 | ../../os/linux/vr_bdlt.o 37 | endif 38 | 39 | ifeq ($(PLATFORM),BLUBB) 40 | $(MOD_NAME)-objs += \ 41 | ../../os/linux/vr_bdlt.o 42 | endif 43 | 44 | ifeq ($(HAS_BGFP_SUPPORT),y) 45 | $(MOD_NAME)-objs += \ 46 | ../../os/linux/br_ftph.o 47 | endif 48 | endif 49 | #endif // CONFIG_APSTA_SUPPORT // 50 | 51 | clean: 52 | rm -f ../../prealloc.o 53 | 54 | install: 55 | install -d $(LINUX_SRC_MODULE) 56 | install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE) 57 | /sbin/depmod -a ${shell uname -r} 58 | 59 | uninstall: 60 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME))) 61 | /sbin/depmod -a ${shell uname -r} 62 | -------------------------------------------------------------------------------- /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 = rtutil$(MODULE)ap 6 | endif 7 | #endif // CONFIG_AP_SUPPORT // 8 | 9 | #ifdef CONFIG_STA_SUPPORT 10 | ifeq ($(RT28xx_MODE), STA) 11 | ifneq ($(findstring 7601,$(CHIPSET)),) 12 | MOD_NAME = mtutil$(MODULE)sta 13 | else 14 | MOD_NAME = rtutil$(MODULE)sta 15 | endif 16 | endif 17 | #endif // CONFIG_STA_SUPPORT // 18 | 19 | #ifdef CONFIG_APSTA_SUPPORT 20 | ifeq ($(RT28xx_MODE), APSTA) 21 | MOD_NAME = rtutil$(MODULE)apsta 22 | endif 23 | #endif // CONFIG_APSTA_SUPPORT // 24 | 25 | obj-m := $(MOD_NAME).o 26 | 27 | #ifdef CONFIG_AP_SUPPORT 28 | ifeq ($(RT28xx_MODE),AP) 29 | $(MOD_NAME)-objs := \ 30 | ../../common/rt_os_util.o\ 31 | ../../os/linux/rt_linux_symb.o\ 32 | ../../os/linux/rt_rbus_pci_util.o\ 33 | ../../os/linux/rt_usb_util.o\ 34 | ../../os/linux/rt_linux.o 35 | 36 | ifeq ($(PLATFORM),BL2348) 37 | $(MOD_NAME)-objs += \ 38 | ../../os/linux/vr_bdlt.o 39 | endif 40 | 41 | ifeq ($(PLATFORM),BLUBB) 42 | $(MOD_NAME)-objs += \ 43 | ../../os/linux/vr_bdlt.o 44 | endif 45 | 46 | ifeq ($(HAS_BGFP_SUPPORT),y) 47 | $(MOD_NAME)-objs += \ 48 | ../../os/linux/br_ftph.o 49 | endif 50 | endif 51 | #endif // CONFIG_AP_SUPPORT // 52 | 53 | 54 | #ifdef CONFIG_STA_SUPPORT 55 | ifeq ($(RT28xx_MODE), STA) 56 | $(MOD_NAME)-objs := \ 57 | ../../common/rt_os_util.o\ 58 | ../../os/linux/rt_linux_symb.o\ 59 | ../../os/linux/rt_rbus_pci_util.o\ 60 | ../../os/linux/rt_usb_util.o\ 61 | ../../os/linux/rt_linux.o 62 | endif 63 | #endif // CONFIG_STA_SUPPORT // 64 | 65 | 66 | #ifdef CONFIG_APSTA_SUPPORT 67 | ifeq ($(RT28xx_MODE), APSTA) 68 | $(MOD_NAME)-objs := \ 69 | ../../common/rt_os_util.o\ 70 | ../../os/linux/rt_linux_symb.o\ 71 | ../../os/linux/rt_rbus_pci_util.o\ 72 | ../../os/linux/rt_usb_util.o\ 73 | ../../os/linux/rt_linux.o 74 | 75 | ifeq ($(PLATFORM),BL2348) 76 | $(MOD_NAME)-objs += \ 77 | ../../os/linux/vr_bdlt.o 78 | endif 79 | 80 | ifeq ($(PLATFORM),BLUBB) 81 | $(MOD_NAME)-objs += \ 82 | ../../os/linux/vr_bdlt.o 83 | endif 84 | 85 | ifeq ($(HAS_BGFP_SUPPORT),y) 86 | $(MOD_NAME)-objs += \ 87 | ../../os/linux/br_ftph.o 88 | endif 89 | endif 90 | #endif // CONFIG_APSTA_SUPPORT // 91 | 92 | clean: 93 | rm -f ../../common/*.o 94 | rm -f ../../common/.*.{cmd,flags,d} 95 | rm -f ../../os/linux/*.{o,ko,mod.{o,c}} 96 | rm -f ../../os/linux/.*.{cmd,flags,d} 97 | rm -fr ../../os/linux/.tmp_versions 98 | rm -f ../../os/linux/Module.symvers 99 | rm -f ../../os/linux/Modules.symvers 100 | rm -f ../../os/linux/Module.markers 101 | rm -f ../../os/linux/modules.order 102 | rm -f ../../chips/*.o 103 | rm -f ../../chips/.*.{cmd,flags,d} 104 | ifeq ($(RT28xx_MODE),AP) 105 | rm -f ../../ap/*.o 106 | rm -f ../../ap/.*.{cmd,flags,d} 107 | else 108 | ifeq ($(RT28xx_MODE),STA) 109 | rm -f ../../sta/*.o 110 | rm -f ../../sta/.*.{cmd,flags,d} 111 | endif 112 | endif 113 | 114 | install: 115 | install -d $(LINUX_SRC_MODULE) 116 | install -m 644 -c $(addsuffix .ko,$(MOD_NAME)) $(LINUX_SRC_MODULE) 117 | /sbin/depmod -a ${shell uname -r} 118 | 119 | uninstall: 120 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .ko,$(MOD_NAME))) 121 | /sbin/depmod -a ${shell uname -r} 122 | -------------------------------------------------------------------------------- /os/linux/Makefile.clean: -------------------------------------------------------------------------------- 1 | include $(RT28xx_DIR)/os/linux/config.mk 2 | 3 | PHONY := clean install uninstall 4 | 5 | clean: 6 | rm -f ../../common/*.o 7 | rm -f ../../common/.*.cmd .*.flags .*.d 8 | rm -f ../../os/linux/*.o *.ko *.mod.o *.mod.c 9 | rm -f ../../os/linux/.*.cmd .*.flags .*.d 10 | rm -fr ../../os/linux/.tmp_versions 11 | #Must clean Module.symvers; or you will suffer symbol version not match 12 | #when OS_ABL = YES. 13 | rm -f ../../os/linux/Module.symvers 14 | rm -f ../../os/linux/Modules.symvers 15 | rm -f ../../os/linux/Module.markers 16 | rm -f ../../os/linux/modules.order 17 | rm -f ../../chips/*.o 18 | rm -f ../../chips/.*.cmd .*.flags .*.d 19 | rm -f ../../rate_ctrl/*.o 20 | rm -f ../../rate_ctrl/.*.cmd .*.flags .*.d 21 | rm -f ../../ate/common/*.o 22 | rm -f ../../ate/common/.*.cmd .*.flags .*.d 23 | rm -f ../../ate/chips/*.o 24 | rm -f ../../ate/chips/.*.cmd .*.flags .*.d 25 | rm -f ../../phy/*.o 26 | rm -f ../../phy/.*.cmd .*.flags .*.d 27 | rm -f ../../mac/*.o 28 | rm -f ../../mac/.*.cmd .*.flags .*.d 29 | rm -f ../../mcu/*.o 30 | rm -f ../../mcu/.*.cmd .*.flags .*.d 31 | rm -f ../../mgmt/*.o 32 | rm -f ../../mgmt/.*.cmd .*.flags .*.d 33 | rm -f ../../naf/*.o 34 | rm -f ../../naf/.*.cmd .*.flags .*.d 35 | ifeq ($(HAS_CONFIG_ELIAN_SUPPORT),y) 36 | rm -f ../../elian/lib/*.o 37 | rm -f ../../elian/lib/.*.cmd .*.flags .*.d 38 | rm -f ../../elian/msc/msc.o 39 | rm -f ../../elian/msc/.*.cmd .*.flags .*.d 40 | rm -f ../../elian/os/linux/*.o 41 | rm -f ../../elian/os/linux/.*.cmd .*.flags .*.d 42 | endif 43 | ifeq ($(RT28xx_MODE),AP) 44 | rm -f ../../ap/*.o 45 | rm -f ../../ap/.*.cmd .*.flags .*.d 46 | else 47 | ifeq ($(RT28xx_MODE),STA) 48 | rm -f ../../sta/*.o 49 | rm -f ../../sta/.*.cmd .*.flags .*.d 50 | ifeq ($(HAS_P2P_SUPPORT),y) 51 | rm -f ../../ap/*.o 52 | rm -f ../../ap/.*.cmd .*.flags .*.d 53 | endif 54 | else 55 | ifeq ($(RT28xx_MODE),APSTA) 56 | rm -f ../../ap/*.o 57 | rm -f ../../ap/.*.cmd .*.flags .*.d 58 | rm -f ../../sta/*.o 59 | rm -f ../../sta/.*.cmd .*.flags .*.d 60 | endif 61 | endif 62 | endif 63 | 64 | # Declare the contents of the .PHONY variable as phony. We keep that 65 | # information in a variable so we can use it in if_changed and friends. 66 | .PHONY: $(PHONY) 67 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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) -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /os/linux/android_priv_cmd.c: -------------------------------------------------------------------------------- 1 | 2 | #define RTMP_MODULE_OS 3 | 4 | #include "rt_config.h" 5 | #include "rtmp_comm.h" 6 | #include "rt_os_util.h" 7 | #include "rt_os_net.h" 8 | 9 | #ifdef RT_CFG80211_SUPPORT 10 | int rt_android_private_command_entry(IN VOID * pAdSrc, 11 | IN VOID * pData, IN int cmd) 12 | { 13 | //PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc; 14 | 15 | return 0; 16 | } 17 | #endif /* RT_CFG80211_SUPPORT */ 18 | -------------------------------------------------------------------------------- /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(IN struct sk_buff *skb_p, 38 | IN struct net_device *net_dev); 39 | 40 | int ifx_ra_start_xmit(struct net_device *rx_dev, 41 | struct net_device *tx_dev, struct sk_buff *skb, int len) 42 | { 43 | if (tx_dev != NULL) { 44 | SET_OS_PKT_NETDEV(skb, tx_dev); 45 | rt28xx_send_packets(skb, tx_dev); 46 | } else if (rx_dev != NULL) { 47 | skb->protocol = eth_type_trans(skb, skb->dev); 48 | netif_rx(skb); 49 | } else { 50 | dev_kfree_skb_any(skb); 51 | } 52 | return 0; 53 | } 54 | #endif /* INF_PPA_SUPPORT */ 55 | -------------------------------------------------------------------------------- /os/linux/rt_rbus_pci_drv.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /os/linux/usb_main_dev.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/os/linux/usb_main_dev.c -------------------------------------------------------------------------------- /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 | #if defined(PLATFORM_BL2348) || defined(PLATFORM_BL23570) 27 | 28 | /* global variables */ 29 | int (*pToUpperLayerPktSent) (struct sk_buff * pSkb) = netif_rx; 30 | 31 | /* 32 | ======================================================================== 33 | Routine Description: 34 | Assign the briding function. 35 | 36 | Arguments: 37 | xi_destination_ptr - bridging function 38 | 39 | Return Value: 40 | None 41 | 42 | Note: 43 | The function name must be replace_upper_layer_packet_destination. 44 | ======================================================================== 45 | */ 46 | VOID replace_upper_layer_packet_destination(VOID * pXiDestination) 47 | { 48 | DBGPRINT(RT_DEBUG_TRACE, 49 | ("ralink broad light> replace_upper_layer_packet_destination\n")); 50 | pToUpperLayerPktSent = pXiDestination; 51 | } /* End of replace_upper_layer_packet_destination */ 52 | 53 | EXPORT_SYMBOL(pToUpperLayerPktSent); 54 | EXPORT_SYMBOL(replace_upper_layer_packet_destination); 55 | 56 | #endif /* PLATFORM_BL2348 */ 57 | 58 | /* End of vr_bdlt.c */ 59 | -------------------------------------------------------------------------------- /sta/assoc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/sta/assoc.c -------------------------------------------------------------------------------- /sta/p2pcli_assoc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/sta/p2pcli_assoc.c -------------------------------------------------------------------------------- /sta_ate_iwpriv_usage.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hi35xx/mt7601u/e1868fc22e0acc6a8429acb01985bb3a655d7bc6/sta_ate_iwpriv_usage.txt -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gcc -g bin2h.c -o bin2h 3 | clean: 4 | rm -f *.o bin2h 5 | 6 | 7 | --------------------------------------------------------------------------------