├── src ├── os │ └── linux │ │ ├── modules.order │ │ ├── rt_symb.c │ │ ├── Makefile.libwapi.6 │ │ ├── .mt7601Uap.ko.cmd │ │ ├── Makefile.libautoprovision.6 │ │ ├── .rtnet7601Uap.ko.cmd │ │ ├── .rtutil7601Uap.ko.cmd │ │ ├── .tmp_versions │ │ └── rtnet7601Uap.mod │ │ ├── .rtnet7601Uap.o.cmd │ │ ├── .rtutil7601Uap.o.cmd │ │ ├── Makefile.libwapi.4 │ │ ├── rt_rbus_pci_util.c │ │ ├── rt_rbus_pci_drv.c │ │ ├── inf_ppa.c │ │ ├── Makefile.clean │ │ ├── Kconfig.sta.soc │ │ ├── Kconfig.ap.usb │ │ ├── rtnet7601Uap.mod.c │ │ ├── Makefile.4.util │ │ ├── Makefile.6.util │ │ ├── Makefile │ │ ├── Makefile.6.netif │ │ ├── Makefile.4.netif │ │ ├── Kconfig.ap.soc │ │ └── .mt7601Uap.o.cmd ├── sta │ ├── assoc.c │ ├── p2pcli_assoc.c │ └── tdls_link_mng.c ├── tools │ ├── bin2h │ └── Makefile ├── common │ ├── vht.c │ ├── cmm_aes.c │ ├── cmm_wpa.c │ ├── wsc_tlv.c │ ├── crypt_hmac.c │ ├── ee_efuse.c │ ├── p2p_packet.c │ ├── rt2860.bin.dfs │ ├── rt2860.bin.old │ ├── rt_rf.c │ ├── rtusb_data.c │ ├── misc.c │ ├── rtusb_dev_id.c │ ├── eeprom.c │ ├── .frq_cal.o.cmd │ ├── .rtusb_data.o.cmd │ ├── netif_block.c │ └── cmm_cmd.c ├── include │ ├── mlme_sys.h │ ├── wapi_sms4.h │ ├── video.h │ ├── netif_block.h │ ├── vht.h │ ├── misc.h │ ├── misc_cmm.h │ ├── chip │ │ ├── rt28xx.h │ │ ├── chip_id.h │ │ ├── rt3290.h │ │ └── rt6590.h │ ├── vrut_ubm.h │ ├── client_wds_cmm.h │ ├── client_wds.h │ ├── rtmp_M51.h │ ├── action.h │ ├── mac_ral │ │ ├── fce.h │ │ ├── pbf.h │ │ ├── omac │ │ │ ├── ral_omac_rf_ctrl.h │ │ │ ├── ral_omac_usb.h │ │ │ ├── ral_omac_pbf.h │ │ │ └── ral_omac_rxwi.h │ │ ├── nmac │ │ │ └── ral_nmac_rxwi.h │ │ └── rf_ctrl.h │ ├── crypt_arc4.h │ ├── ap_autoChSel_cmm.h │ ├── vr_ikans.h │ ├── rtmp_iface.h │ ├── rtmp_osabl.h │ ├── ap_autoChSel.h │ ├── crypt_md5.h │ ├── crypt_hmac.h │ ├── p2p_inf.h │ ├── ap_ids.h │ ├── br_ftph.h │ ├── iface │ │ ├── iface_util.h │ │ └── rtmp_usb.h │ ├── rtmp_mcu.h │ ├── sta_cfg.h │ ├── crypt_dh.h │ ├── cfg80211.h │ ├── ap_mbss.h │ ├── radar.h │ ├── rtmp_dot11.h │ ├── crypt_sha2.h │ ├── ags.h │ ├── dot11r_ft.h │ ├── frq_cal.h │ └── crypt_biginteger.h ├── mcu │ ├── bin │ │ ├── MT7601.bin │ │ ├── MT7650.bin │ │ ├── RT85592.bin │ │ ├── rt2860.bin │ │ ├── rt2870.bin │ │ ├── rt2870_wow.bin │ │ ├── MT7601_formal_1.7.bin │ │ └── MT7601_formal_1.7_Debug.bin │ └── rtmp_mcu.c ├── mgmt │ ├── mgmt_hw.c │ ├── mgmt_vht.c │ └── mgmt_dev.c ├── mac │ ├── ral_nmac.c │ └── ral_omac.c ├── ate │ └── chips │ │ ├── rt30xx_ate.c │ │ ├── rt33xx_ate.c │ │ └── rt5390_ate.c ├── rate_ctrl │ └── .alg_ags.o.cmd └── ap │ └── ap_ftkd.c ├── doc ├── README_STA_usb ├── sta_ate_iwpriv_usage.txt └── ReadMe.txt ├── Makefile ├── .gitignore ├── etc └── Wireless │ └── RT2870AP │ ├── RT2870APCard.dat │ ├── RT2870STACard.dat │ ├── RT2870STA.dat │ ├── SingleSKU.dat │ └── RT2870AP.dat ├── LICENSE ├── Makefile.clean └── README /src/os/linux/modules.order: -------------------------------------------------------------------------------- 1 | kernel//home/pi/mt7601u/src/os/linux/rtnet7601Uap.ko 2 | -------------------------------------------------------------------------------- /src/sta/assoc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/sta/assoc.c -------------------------------------------------------------------------------- /src/tools/bin2h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/tools/bin2h -------------------------------------------------------------------------------- /doc/README_STA_usb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/doc/README_STA_usb -------------------------------------------------------------------------------- /src/common/vht.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/vht.c -------------------------------------------------------------------------------- /src/common/cmm_aes.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/cmm_aes.c -------------------------------------------------------------------------------- /src/common/cmm_wpa.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/cmm_wpa.c -------------------------------------------------------------------------------- /src/common/wsc_tlv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/wsc_tlv.c -------------------------------------------------------------------------------- /src/common/crypt_hmac.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/crypt_hmac.c -------------------------------------------------------------------------------- /src/common/ee_efuse.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/ee_efuse.c -------------------------------------------------------------------------------- /src/common/p2p_packet.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/p2p_packet.c -------------------------------------------------------------------------------- /src/include/mlme_sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | 6 | #include "rtmp_type.h" 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/mcu/bin/MT7601.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/mcu/bin/MT7601.bin -------------------------------------------------------------------------------- /src/mcu/bin/MT7650.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/mcu/bin/MT7650.bin -------------------------------------------------------------------------------- /src/mcu/bin/RT85592.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/mcu/bin/RT85592.bin -------------------------------------------------------------------------------- /src/mcu/bin/rt2860.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/mcu/bin/rt2860.bin -------------------------------------------------------------------------------- /src/mcu/bin/rt2870.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/mcu/bin/rt2870.bin -------------------------------------------------------------------------------- /src/sta/p2pcli_assoc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/sta/p2pcli_assoc.c -------------------------------------------------------------------------------- /src/sta/tdls_link_mng.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/sta/tdls_link_mng.c -------------------------------------------------------------------------------- /src/tools/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gcc -g bin2h.c -o bin2h 3 | clean: 4 | rm -f *.o bin2h 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/common/rt2860.bin.dfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/rt2860.bin.dfs -------------------------------------------------------------------------------- /src/common/rt2860.bin.old: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/common/rt2860.bin.old -------------------------------------------------------------------------------- /doc/sta_ate_iwpriv_usage.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/doc/sta_ate_iwpriv_usage.txt -------------------------------------------------------------------------------- /src/mcu/bin/rt2870_wow.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/mcu/bin/rt2870_wow.bin -------------------------------------------------------------------------------- /src/mcu/bin/MT7601_formal_1.7.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/mcu/bin/MT7601_formal_1.7.bin -------------------------------------------------------------------------------- /src/mcu/bin/MT7601_formal_1.7_Debug.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/muratdemirtas/MT7601u/HEAD/src/mcu/bin/MT7601_formal_1.7_Debug.bin -------------------------------------------------------------------------------- /src/os/linux/rt_symb.c: -------------------------------------------------------------------------------- 1 | #ifdef OS_ABL_SUPPORT 2 | 3 | #include 4 | #include "rt_config.h" 5 | 6 | EXPORT_SYMBOL(RTMP_DRV_OPS_FUNCTION); 7 | 8 | #endif /* OS_ABL_SUPPORT */ 9 | 10 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | make -C src/ osutil 3 | make -C src/ build_tools 4 | make -C src/ osdrv 5 | make -C src/ osnet 6 | 7 | clean: 8 | make -C src/ clean 9 | 10 | install: 11 | make -C src/ install 12 | 13 | uninstall: 14 | make -C src/ uninstall 15 | -------------------------------------------------------------------------------- /src/os/linux/.mt7601Uap.ko.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/mt7601Uap.ko := ld -r -T ./scripts/module-common.lds --build-id -o /home/pi/mt7601u/src/os/linux/mt7601Uap.ko /home/pi/mt7601u/src/os/linux/mt7601Uap.o /home/pi/mt7601u/src/os/linux/mt7601Uap.mod.o 2 | -------------------------------------------------------------------------------- /src/os/linux/Makefile.libautoprovision.6: -------------------------------------------------------------------------------- 1 | include $(RT28xx_DIR)/os/linux/config.mk 2 | 3 | #ifdef CONFIG_AP_SUPPORT 4 | 5 | ifeq ($(HAS_SAMSUNG_EASY_CONFIG_SUPPORT),y) 6 | lib-y := ../../common/auto_provision.o 7 | endif 8 | 9 | #endif // CONFIG_AP_SUPPORT // 10 | -------------------------------------------------------------------------------- /src/os/linux/.rtnet7601Uap.ko.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/rtnet7601Uap.ko := ld -r -T ./scripts/module-common.lds --build-id -o /home/pi/mt7601u/src/os/linux/rtnet7601Uap.ko /home/pi/mt7601u/src/os/linux/rtnet7601Uap.o /home/pi/mt7601u/src/os/linux/rtnet7601Uap.mod.o 2 | -------------------------------------------------------------------------------- /src/os/linux/.rtutil7601Uap.ko.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/rtutil7601Uap.ko := ld -r -T ./scripts/module-common.lds --build-id -o /home/pi/mt7601u/src/os/linux/rtutil7601Uap.ko /home/pi/mt7601u/src/os/linux/rtutil7601Uap.o /home/pi/mt7601u/src/os/linux/rtutil7601Uap.mod.o 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Libraries 8 | *.lib 9 | *.a 10 | 11 | # Shared objects (inc. Windows DLLs) 12 | *.dll 13 | *.so 14 | *.so.* 15 | *.dylib 16 | 17 | # Executables 18 | *.exe 19 | *.out 20 | *.app 21 | *.i*86 22 | *.x86_64 23 | *.hex 24 | .directory 25 | *.bak 26 | -------------------------------------------------------------------------------- /src/os/linux/.tmp_versions/rtnet7601Uap.mod: -------------------------------------------------------------------------------- 1 | /home/pi/mt7601u/src/os/linux/rtnet7601Uap.ko 2 | /home/pi/mt7601u/src/os/linux/../../ap/ap_mbss_inf.o /home/pi/mt7601u/src/os/linux/../../os/linux/ap_ioctl.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_main_dev.o /home/pi/mt7601u/src/os/linux/../../common/rtusb_dev_id.o /home/pi/mt7601u/src/os/linux/../../os/linux/usb_main_dev.o 3 | -------------------------------------------------------------------------------- /src/os/linux/.rtnet7601Uap.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/rtnet7601Uap.o := ld -r -o /home/pi/mt7601u/src/os/linux/rtnet7601Uap.o /home/pi/mt7601u/src/os/linux/../../ap/ap_mbss_inf.o /home/pi/mt7601u/src/os/linux/../../os/linux/ap_ioctl.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_main_dev.o /home/pi/mt7601u/src/os/linux/../../common/rtusb_dev_id.o /home/pi/mt7601u/src/os/linux/../../os/linux/usb_main_dev.o 2 | -------------------------------------------------------------------------------- /src/include/wapi_sms4.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* SMS4 encryption/decryption definition */ 4 | /* Parameter : */ 5 | /* Input - the incoming message packet */ 6 | /* Ouput - the result ouput */ 7 | /* rk - key */ 8 | void SMS4Crypt(unsigned char *Input, unsigned char *Output, unsigned int *rk); 9 | 10 | /* SMS4 key extend algorithm */ 11 | void SMS4KeyExt(unsigned char *Key, unsigned int *rk, unsigned int CryptFlag); 12 | 13 | -------------------------------------------------------------------------------- /src/os/linux/.rtutil7601Uap.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/rtutil7601Uap.o := ld -r -o /home/pi/mt7601u/src/os/linux/rtutil7601Uap.o /home/pi/mt7601u/src/os/linux/../../common/rt_os_util.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_linux_symb.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_rbus_pci_util.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_usb_util.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_linux.o 2 | -------------------------------------------------------------------------------- /src/include/video.h: -------------------------------------------------------------------------------- 1 | #ifdef VIDEO_TURBINE_SUPPORT 2 | extern AP_VIDEO_STRUCT GLOBAL_AP_VIDEO_CONFIG; 3 | 4 | VOID VideoModeUpdate(IN PRTMP_ADAPTER pAd); 5 | VOID VideoModeDynamicTune(IN PRTMP_ADAPTER pAd); 6 | UINT32 GetAsicDefaultRetry(IN PRTMP_ADAPTER pAd); 7 | UCHAR GetAsicDefaultTxBA(IN PRTMP_ADAPTER pAd); 8 | UINT32 GetAsicVideoRetry(IN PRTMP_ADAPTER pAd); 9 | UCHAR GetAsicVideoTxBA(IN PRTMP_ADAPTER pAd); 10 | VOID VideoConfigInit(IN PRTMP_ADAPTER pAd); 11 | #endif /* VIDEO_TURBINE_SUPPORT */ 12 | 13 | -------------------------------------------------------------------------------- /src/os/linux/Makefile.libwapi.4: -------------------------------------------------------------------------------- 1 | # 2 | # Release file for AP Mode 3 | # 4 | include $(RT28xx_DIR)/os/linux/config.mk 5 | 6 | MOD_NAME = wapi_module 7 | 8 | OBJ := $(MOD_NAME).o 9 | 10 | WAPI_M_OBJ := \ 11 | $(RT28xx_DIR)/common/wapi_sms4.o\ 12 | $(RT28xx_DIR)/common/wapi_crypt.o 13 | 14 | PHONY := all 15 | 16 | all:$(OBJ) 17 | 18 | $(MOD_NAME).o: $(WAPI_M_OBJ) 19 | $(LD) -r $^ -o $@ 20 | 21 | # Declare the contents of the .PHONY variable as phony. We keep that 22 | # information in a variable so we can use it in if_changed and friends. 23 | .PHONY: $(PHONY) -------------------------------------------------------------------------------- /src/os/linux/rt_rbus_pci_util.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | 3 | Module Name: 4 | rt_rbus_pci_util.c 5 | 6 | Abstract: 7 | Any utility is used in UTIL module for PCI/RBUS function. 8 | 9 | Revision History: 10 | Who When What 11 | --------- ---------- ---------------------------------------------- 12 | 13 | ***************************************************************************/ 14 | 15 | #define RTMP_MODULE_OS 16 | #define RTMP_MODULE_OS_UTIL 17 | 18 | /*#include "rt_config.h" */ 19 | #include "rtmp_comm.h" 20 | #include "rtmp_osabl.h" 21 | #include "rt_os_util.h" 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /etc/Wireless/RT2870AP/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 | -------------------------------------------------------------------------------- /src/mgmt/mgmt_hw.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | 4 | */ 5 | 6 | 7 | #include 8 | 9 | 10 | INT dev_adjust_radio(RTMP_ADAPTER *pAd) 11 | { 12 | struct hw_setting *hw_cfg = &pAd->hw_cfg, new_cfg; 13 | 14 | 15 | NdisZeroMemory(&new_cfg, sizeof(struct hw_setting)); 16 | 17 | 18 | /* For all wdev, find the maximum inter-set */ 19 | 20 | 21 | if (hw_cfg->bbp_bw != new_cfg.bbp_bw) 22 | { 23 | rtmp_bbp_set_bw(pAd, new_cfg.bbp_bw); 24 | hw_cfg->bbp_bw = new_cfg.bbp_bw; 25 | } 26 | 27 | if (hw_cfg->cent_ch != new_cfg.cent_ch) 28 | { 29 | UCHAR ext_ch = EXTCHA_NONE; 30 | 31 | rtmp_bbp_set_ctrlch(pAd, ext_ch); 32 | rtmp_mac_set_ctrlch(pAd, ext_ch); 33 | } 34 | 35 | return TRUE; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /src/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 | { 12 | struct _NETIF_ENTRY *pNext; 13 | PNET_DEV pNetDev; 14 | } NETIF_ENTRY, *PNETIF_ENTRY; 15 | 16 | void initblockQueueTab( 17 | IN PRTMP_ADAPTER pAd); 18 | 19 | BOOLEAN blockNetIf( 20 | IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry, 21 | IN PNET_DEV pNetDev); 22 | 23 | VOID releaseNetIf( 24 | IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry); 25 | 26 | VOID StopNetIfQueue( 27 | IN PRTMP_ADAPTER pAd, 28 | IN UCHAR QueIdx, 29 | IN PNDIS_PACKET pPacket); 30 | #endif /* __NET_IF_BLOCK_H__ */ 31 | 32 | -------------------------------------------------------------------------------- /src/mac/ral_nmac.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | 6 | #include "rt_config.h" 7 | 8 | 9 | INT get_pkt_phymode_by_rxwi(RXWI_STRUC *rxwi) 10 | { 11 | return rxwi->RXWI_N.phy_mode; 12 | } 13 | 14 | INT get_pkt_rssi_by_rxwi(struct _RTMP_ADAPTER *pAd, RXWI_STRUC *rxwi, INT size, CHAR *rssi) 15 | { 16 | if (size < sizeof(rxwi->RXWI_N.rssi)/ sizeof(UINT8)) 17 | NdisMoveMemory(rssi, &rxwi->RXWI_N.rssi[0], size); 18 | 19 | return 0; 20 | } 21 | 22 | 23 | INT get_pkt_snr_by_rxwi(struct _RTMP_ADAPTER *pAd, RXWI_STRUC *rxwi, INT size, UCHAR *snr) 24 | { 25 | // TODO: shiang-6590, fix me for SNR info of RXWI!! 26 | if (size < 3) 27 | NdisMoveMemory(snr, &rxwi->RXWI_N.bbp_rxinfo[0], size); 28 | 29 | return 0; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /etc/Wireless/RT2870AP/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 | -------------------------------------------------------------------------------- /src/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 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 2 | 3 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 4 | 5 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 6 | 7 | MediaTek Inc. 8 | Address : 5F., No.5, Tai-Yuan 1st St., Jhubei City, 9 | Hsinchu County 302,Taiwan, R.O.C. 10 | (c) Copyright 2002-2013, MediaTek Inc. 11 | -------------------------------------------------------------------------------- /src/mgmt/mgmt_vht.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "rt_config.h" 6 | 7 | 8 | #ifdef DOT11_VHT_AC 9 | 10 | VOID rtmp_set_vht(RTMP_ADAPTER *pAd, RT_PHY_INFO *phy_info) 11 | { 12 | if (!phy_info) 13 | return; 14 | 15 | if (phy_info->bVhtEnable) 16 | phy_info->vht_bw = VHT_BW_80; 17 | 18 | } 19 | 20 | 21 | INT SetCommonVHT(RTMP_ADAPTER *pAd) 22 | { 23 | UCHAR cent_ch = 0; 24 | 25 | if (!WMODE_CAP_AC(pAd->CommonCfg.PhyMode)) 26 | { 27 | /* Clear previous VHT information */ 28 | return FALSE; 29 | } 30 | 31 | 32 | pAd->CommonCfg.vht_cent_ch = vht_cent_ch_freq(pAd, pAd->CommonCfg.Channel); 33 | 34 | DBGPRINT(RT_DEBUG_TRACE, ("%s(): Config VHT parameters!cent_ch=%d!vht_cent_ch = %d, vht_cent_ch2 = %d\n", 35 | __FUNCTION__, cent_ch, pAd->CommonCfg.vht_cent_ch, pAd->CommonCfg.vht_cent_ch2)); 36 | return TRUE; 37 | } 38 | 39 | #endif /* DOT11_VHT_AC */ 40 | -------------------------------------------------------------------------------- /src/include/vht.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "dot11ac_vht.h" 6 | 7 | 8 | struct _RTMP_ADAPTER; 9 | struct _RT_PHY_INFO; 10 | 11 | 12 | VOID dump_vht_cap(struct _RTMP_ADAPTER *pAd, VHT_CAP_IE *vht_ie); 13 | VOID dump_vht_op(struct _RTMP_ADAPTER *pAd, VHT_OP_IE *vht_ie); 14 | 15 | INT build_vht_ies(struct _RTMP_ADAPTER *pAd, UCHAR *buf, UCHAR frm); 16 | INT build_vht_cap_ie(RTMP_ADAPTER *pAd, UCHAR *buf); 17 | 18 | UCHAR vht_cent_ch_freq(struct _RTMP_ADAPTER *pAd, UCHAR prim_ch); 19 | INT vht_mode_adjust(struct _RTMP_ADAPTER *pAd, MAC_TABLE_ENTRY *pEntry, VHT_CAP_IE *cap, VHT_OP_IE *op); 20 | INT SetCommonVHT(struct _RTMP_ADAPTER *pAd); 21 | VOID rtmp_set_vht(struct _RTMP_ADAPTER *pAd, struct _RT_PHY_INFO *phy_info); 22 | 23 | void assoc_vht_info_debugshow( 24 | IN RTMP_ADAPTER *pAd, 25 | IN MAC_TABLE_ENTRY *pEntry, 26 | IN VHT_CAP_IE *vht_cap, 27 | IN VHT_OP_IE *vht_op); 28 | 29 | -------------------------------------------------------------------------------- /src/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 | 29 | -------------------------------------------------------------------------------- /src/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 | 29 | -------------------------------------------------------------------------------- /src/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 | 29 | 30 | -------------------------------------------------------------------------------- /src/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 | 32 | 33 | -------------------------------------------------------------------------------- /src/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 | 30 | #include "rt_config.h" 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/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 | 32 | 33 | -------------------------------------------------------------------------------- /src/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 | 31 | 32 | -------------------------------------------------------------------------------- /src/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 | 35 | 36 | -------------------------------------------------------------------------------- /src/mac/ral_omac.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | 6 | #include "rt_config.h" 7 | 8 | 9 | INT get_pkt_phymode_by_rxwi(RXWI_STRUC *rxwi) 10 | { 11 | return rxwi->RXWI_O.phy_mode; 12 | } 13 | 14 | INT get_pkt_rssi_by_rxwi(struct _RTMP_ADAPTER *pAd, RXWI_STRUC *rxwi, INT size, CHAR *rssi) 15 | { 16 | switch (size) { 17 | case 3: 18 | rssi[2] = rxwi->RxWIRSSI2; 19 | case 2: 20 | rssi[1] = rxwi->RxWIRSSI1; 21 | case 1: 22 | default: 23 | #ifdef MT7601 24 | if ( IS_MT7601(pAd) ) 25 | rssi[0] = rxwi->RxWISNR2; 26 | else 27 | #endif /* MT7601 */ 28 | rssi[0] = rxwi->RxWIRSSI0; 29 | break; 30 | } 31 | 32 | return 0; 33 | } 34 | 35 | 36 | INT get_pkt_snr_by_rxwi(struct _RTMP_ADAPTER *pAd, RXWI_STRUC *rxwi, INT size, UCHAR *snr) 37 | { 38 | 39 | #ifdef MT7601 40 | /* 41 | snr[2] = Gain Report 42 | snr[1] = Antenna report 43 | */ 44 | 45 | if ( IS_MT7601(pAd) ) 46 | { 47 | snr[0] = rxwi->RxWISNR0; 48 | snr[1] = 0; 49 | snr[2] = 0; 50 | return 0; 51 | } 52 | #endif /* MT7601 */ 53 | 54 | switch (size) { 55 | case 3: 56 | snr[2] = rxwi->RxWISNR2; 57 | case 2: 58 | snr[1] = rxwi->RxWISNR1; 59 | case 1: 60 | default: 61 | snr[0] = rxwi->RxWISNR0; 62 | break; 63 | } 64 | 65 | return 0; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /src/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( 32 | IN struct _RTMP_ADAPTER *pAd, 33 | IN UCHAR Channel, 34 | IN BOOLEAN bScan); 35 | 36 | #endif /* RT28xx */ 37 | 38 | #endif /*__RT28XX_H__ */ 39 | 40 | -------------------------------------------------------------------------------- /src/mgmt/mgmt_dev.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | */ 4 | 5 | #include "rt_config.h" 6 | 7 | 8 | struct wifi_dev *get_wdev_by_idx(RTMP_ADAPTER *pAd, INT idx) 9 | { 10 | struct wifi_dev *wdev = NULL; 11 | 12 | do 13 | { 14 | #ifdef P2P_SUPPORT 15 | if (idx >= MIN_NET_DEVICE_FOR_P2P_GO) 16 | { 17 | wdev = &pAd->ApCfg.MBSSID[idx - MIN_NET_DEVICE_FOR_P2P_GO].wdev; 18 | break; 19 | } 20 | #endif /* P2P_SUPPORT */ 21 | 22 | 23 | #ifdef CONFIG_AP_SUPPORT 24 | #ifdef APCLI_SUPPORT 25 | if (idx >= MIN_NET_DEVICE_FOR_APCLI) 26 | { 27 | idx -= MIN_NET_DEVICE_FOR_APCLI; 28 | if (idx < MAX_APCLI_NUM) 29 | { 30 | wdev = &pAd->ApCfg.ApCliTab[idx].wdev; 31 | break; 32 | } 33 | } 34 | #endif /* APCLI_SUPPORT */ 35 | 36 | IF_DEV_CONFIG_OPMODE_ON_AP(pAd) 37 | { 38 | 39 | if ((idx < pAd->ApCfg.BssidNum) && (idx < MAX_MBSSID_NUM(pAd)) && (idx < HW_BEACON_MAX_NUM)) 40 | wdev = &pAd->ApCfg.MBSSID[idx].wdev; 41 | 42 | break; 43 | } 44 | #endif /* CONFIG_AP_SUPPORT */ 45 | #ifdef CONFIG_STA_SUPPORT 46 | IF_DEV_CONFIG_OPMODE_ON_STA(pAd) 47 | { 48 | wdev = &pAd->StaCfg.wdev; 49 | break; 50 | } 51 | #endif /* CONFIG_STA_SUPPORT */ 52 | } while (FALSE); 53 | 54 | if (wdev == NULL) 55 | { 56 | DBGPRINT(RT_DEBUG_ERROR, ("RTMPSetIndividualHT: invalid idx(%d)\n", idx)); 57 | } 58 | 59 | return wdev; 60 | } 61 | 62 | -------------------------------------------------------------------------------- /src/include/vrut_ubm.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2010, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | 17 | Abstract: 18 | 19 | All Related Structure & Definition for UBICOM platform. 20 | 21 | Only used in UTIL module. 22 | 23 | ***************************************************************************/ 24 | 25 | #ifndef __VR_UBICOM_H__ 26 | #define __VR_UBICOM_H__ 27 | 28 | #ifdef PLATFORM_UBM_IPX8 29 | 30 | #include 31 | 32 | #undef RTMP_UTIL_DCACHE_FLUSH 33 | #define RTMP_UTIL_DCACHE_FLUSH(__AddrStart, __Size) \ 34 | flush_dcache_range((ULONG)(__AddrStart), \ 35 | (ULONG)(((UCHAR *)(__AddrStart)) + __Size - 1)) 36 | 37 | #endif /* PLATFORM_UBM_IPX8 */ 38 | 39 | #endif /* __VR_UBICOM_H__ */ 40 | 41 | /* End of vrut_ubm.h */ 42 | 43 | -------------------------------------------------------------------------------- /src/include/client_wds_cmm.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | client_wds_cmm.h 20 | 21 | Abstract: 22 | */ 23 | 24 | #ifndef __CLIENT_WDS_CMM_H__ 25 | #define __CLIENT_WDS_CMM_H__ 26 | 27 | #include "rtmp_def.h" 28 | 29 | #ifdef CLIENT_WDS 30 | 31 | 32 | #define CLI_WDS_ENTRY_AGEOUT 5000 /* seconds */ 33 | 34 | #define CLIWDS_POOL_SIZE 128 35 | #define CLIWDS_HASH_TAB_SIZE 64 /* the legth of hash table must be power of 2. */ 36 | typedef struct _CLIWDS_PROXY_ENTRY { 37 | struct _CLIWDS_PROXY_ENTRY * pNext; 38 | ULONG LastRefTime; 39 | SHORT Aid; 40 | UCHAR Addr[MAC_ADDR_LEN]; 41 | } CLIWDS_PROXY_ENTRY, *PCLIWDS_PROXY_ENTRY; 42 | 43 | #endif /* CLIENT_WDS */ 44 | 45 | #endif /* __CLIENT_WDS_CMM_H__ */ 46 | 47 | -------------------------------------------------------------------------------- /etc/Wireless/RT2870AP/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 | -------------------------------------------------------------------------------- /src/include/client_wds.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | client_wds.h 20 | 21 | Abstract: 22 | */ 23 | 24 | #ifndef __CLIENT_WDS_H__ 25 | #define __CLIENT_WDS_H__ 26 | 27 | #include "client_wds_cmm.h" 28 | 29 | VOID CliWds_ProxyTabInit( 30 | IN PRTMP_ADAPTER pAd); 31 | 32 | VOID CliWds_ProxyTabDestory( 33 | IN PRTMP_ADAPTER pAd); 34 | 35 | PCLIWDS_PROXY_ENTRY CliWdsEntyAlloc( 36 | IN PRTMP_ADAPTER pAd); 37 | 38 | 39 | VOID CliWdsEntyFree( 40 | IN PRTMP_ADAPTER pAd, 41 | IN PCLIWDS_PROXY_ENTRY pCliWdsEntry); 42 | 43 | 44 | PUCHAR CliWds_ProxyLookup( 45 | IN PRTMP_ADAPTER pAd, 46 | IN PUCHAR pMac); 47 | 48 | 49 | VOID CliWds_ProxyTabUpdate( 50 | IN PRTMP_ADAPTER pAd, 51 | IN SHORT Aid, 52 | IN PUCHAR pMac); 53 | 54 | 55 | VOID CliWds_ProxyTabMaintain( 56 | IN PRTMP_ADAPTER pAd); 57 | 58 | #endif /* __CLIENT_WDS_H__ */ 59 | 60 | -------------------------------------------------------------------------------- /src/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( 35 | struct _RTMP_ADAPTER *pAd); 36 | 37 | NDIS_STATUS RtmpAsicLoadFirmware( 38 | struct _RTMP_ADAPTER *pAd); 39 | 40 | NDIS_STATUS isMCUnotReady( 41 | struct _RTMP_ADAPTER *pAd); 42 | 43 | NDIS_STATUS isMCUNeedToLoadFIrmware( 44 | struct _RTMP_ADAPTER *pAd); 45 | 46 | INT RtmpAsicSendCommandToMcu( 47 | struct _RTMP_ADAPTER *pAd, 48 | UCHAR Command, 49 | UCHAR Token, 50 | UCHAR Arg0, 51 | UCHAR Arg1, 52 | BOOLEAN FlgIsNeedLocked); 53 | #endif 54 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | { 23 | struct { 24 | UINT32 RSV:6; 25 | UINT32 OTHER_PORT:2; 26 | UINT32 TS_LENGTH_EN:8; 27 | UINT32 TS_CMD_QSEL_EN:8; 28 | UINT32 RSV2:2; 29 | UINT32 MVINF_BYTE_SWP:1; 30 | UINT32 FS_WR_MPDU_LEN_EN:1; 31 | UINT32 TX_L2_DE_STUFFING_EN:1; 32 | UINT32 RX_L2_STUFFING_EN:1; 33 | UINT32 QoS_L2_EN:1; 34 | UINT32 HT_L2_EN:1; 35 | } field; 36 | 37 | UINT32 word; 38 | } L2_STUFFING_STRUC, *PL2_STUFFING_STRUC; 39 | #else 40 | typedef union _L2_STUFFING_STRUC 41 | { 42 | struct { 43 | UINT32 HT_L2_EN:1; 44 | UINT32 QoS_L2_EN:1; 45 | UINT32 RX_L2_STUFFING_EN:1; 46 | UINT32 TX_L2_DE_STUFFING_EN:1; 47 | UINT32 FS_WR_MPDU_LEN_EN:1; 48 | UINT32 MVINF_BYTE_SWP:1; 49 | UINT32 RSV2:2; 50 | UINT32 TS_CMD_QSEL_EN:8; 51 | UINT32 TS_LENGTH_EN:8; 52 | UINT32 OTHER_PORT:2; 53 | UINT32 RSV:6; 54 | } field; 55 | 56 | UINT32 word; 57 | } L2_STUFFING_STRUC, *PL2_STUFFING_STRUC; 58 | #endif 59 | 60 | #define NORMAL_PKT 0x0 61 | #define CMD_PKT 0x1 62 | 63 | #define FCE_WLAN_PORT 0x0 64 | #define FCE_CPU_RX_PORT 0x1 65 | #define FCE_CPU_TX_PORT 0x2 66 | #define FCE_HOST_PORT 0x3 67 | #define FCE_VIRTUAL_CPU_RX_PORT 0x4 68 | #define FCE_VIRTUAL_CPU_TX_PORT 0x5 69 | #define FCE_DISCARD 0x6 70 | #endif /*__FCE_H__ */ 71 | -------------------------------------------------------------------------------- /etc/Wireless/RT2870AP/SingleSKU.dat: -------------------------------------------------------------------------------- 1 | # Single SKU Max Power Table 2 | # |CCK 1~11 | | OFDM 6 ~ 54 | | HT20 MCS 0 ~ 15 | | HT40 MCS 0 ~ 15 | 3 | ch1 16 16 16 16 14 14 14 14 14 14 14 14 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 4 | ch2 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 5 | ch3 19 19 19 19 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 6 | ch4 19 19 19 19 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 7 | ch5 19 19 19 19 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 18 18 18 18 17 17 17 17 18 18 18 18 17 17 17 17 8 | ch6 19 19 19 19 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 18 18 18 18 17 17 17 17 18 18 18 18 17 17 17 17 9 | ch7 19 19 19 19 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 18 18 18 18 17 17 17 17 18 18 18 18 17 17 17 17 10 | ch8 19 19 19 19 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 19 19 19 19 17 17 17 17 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 11 | ch9 19 19 19 19 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 17 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 | ch10 18 18 18 18 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 13 | ch11 16 16 16 16 14 14 14 14 14 14 14 14 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 14 | ch12 16 16 16 16 14 14 14 14 14 14 14 14 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 15 | ch13 14 14 14 14 14 14 14 14 14 14 14 14 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 13 16 | ch14 14 14 14 14 17 | # End of Single SKU Table -------------------------------------------------------------------------------- /src/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( 38 | IN struct sk_buff *skb_p, 39 | IN struct net_device *net_dev); 40 | 41 | int ifx_ra_start_xmit( 42 | struct net_device *rx_dev, 43 | struct net_device *tx_dev, 44 | struct sk_buff *skb, int len) 45 | { 46 | if(tx_dev != NULL) 47 | { 48 | SET_OS_PKT_NETDEV(skb, tx_dev); 49 | rt28xx_send_packets(skb, tx_dev); 50 | } 51 | else if(rx_dev != NULL) 52 | { 53 | skb->protocol = eth_type_trans(skb, skb->dev); 54 | netif_rx(skb); 55 | } 56 | else 57 | { 58 | dev_kfree_skb_any(skb); 59 | } 60 | return 0; 61 | } 62 | #endif /* INF_PPA_SUPPORT */ 63 | -------------------------------------------------------------------------------- /src/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( 43 | IN ARC4_CTX_STRUC * pARC4_CTX, 44 | IN PUCHAR pKey, 45 | IN UINT KeyLength); 46 | 47 | VOID ARC4_Compute( 48 | IN ARC4_CTX_STRUC * pARC4_CTX, 49 | IN UINT8 InputBlock[], 50 | IN UINT InputBlockSize, 51 | OUT UINT8 OutputBlock[]); 52 | 53 | VOID ARC4_Discard_KeyLength( 54 | IN ARC4_CTX_STRUC * pARC4_CTX, 55 | IN UINT Length); 56 | 57 | #endif /* __CRYPT_ARC4_H__ */ 58 | -------------------------------------------------------------------------------- /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 ($(RT28xx_MODE),AP) 36 | rm -f ../../ap/*.o 37 | rm -f ../../ap/.*.cmd .*.flags .*.d 38 | else 39 | ifeq ($(RT28xx_MODE),STA) 40 | rm -f ../../sta/*.o 41 | rm -f ../../sta/.*.cmd .*.flags .*.d 42 | ifeq ($(HAS_P2P_SUPPORT),y) 43 | rm -f ../../ap/*.o 44 | rm -f ../../ap/.*.cmd .*.flags .*.d 45 | endif 46 | else 47 | ifeq ($(RT28xx_MODE),APSTA) 48 | rm -f ../../ap/*.o 49 | rm -f ../../ap/.*.cmd .*.flags .*.d 50 | rm -f ../../sta/*.o 51 | rm -f ../../sta/.*.cmd .*.flags .*.d 52 | endif 53 | endif 54 | endif 55 | 56 | # Declare the contents of the .PHONY variable as phony. We keep that 57 | # information in a variable so we can use it in if_changed and friends. 58 | .PHONY: $(PHONY) 59 | -------------------------------------------------------------------------------- /src/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 | 21 | 22 | #ifndef __AUTOCHSELECT_CMM_H__ 23 | #define __AUTOCHSELECT_CMM_H__ 24 | 25 | #define RSSI_TO_DBM_OFFSET 120 /* RSSI-115 = dBm */ 26 | 27 | 28 | typedef struct { 29 | ULONG dirtyness[MAX_NUM_OF_CHANNELS+1]; 30 | ULONG ApCnt[MAX_NUM_OF_CHANNELS+1]; 31 | UINT32 FalseCCA[MAX_NUM_OF_CHANNELS+1]; 32 | BOOLEAN SkipList[MAX_NUM_OF_CHANNELS+1]; 33 | #ifdef AP_QLOAD_SUPPORT 34 | UINT32 chanbusytime[MAX_NUM_OF_CHANNELS+1]; /* QLOAD ALARM */ 35 | #endif /* AP_QLOAD_SUPPORT */ 36 | BOOLEAN IsABand; 37 | } CHANNELINFO, *PCHANNELINFO; 38 | 39 | typedef struct { 40 | UCHAR Bssid[MAC_ADDR_LEN]; 41 | UCHAR SsidLen; 42 | CHAR Ssid[MAX_LEN_OF_SSID]; 43 | UCHAR Channel; 44 | UCHAR ExtChOffset; 45 | CHAR Rssi; 46 | } BSSENTRY, *PBSSENTRY; 47 | 48 | typedef struct { 49 | UCHAR BssNr; 50 | BSSENTRY BssEntry[MAX_LEN_OF_BSS_TABLE]; 51 | } BSSINFO, *PBSSINFO; 52 | 53 | typedef enum ChannelSelAlg 54 | { 55 | ChannelAlgRandom, /*use by Dfs */ 56 | ChannelAlgApCnt, 57 | ChannelAlgCCA 58 | } ChannelSel_Alg; 59 | 60 | #endif /* __AUTOCHSELECT_CMM_H__ */ 61 | 62 | -------------------------------------------------------------------------------- /src/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 | 34 | /* module table */ 35 | USB_DEVICE_ID rtusb_dev_id[] = { 36 | #ifdef RT6570 37 | {USB_DEVICE(0x148f,0x6570)}, /* Ralink 6570 */ 38 | #endif /* RT6570 */ 39 | {USB_DEVICE(0x148f, 0x7650)}, /* MT7650 */ 40 | #ifdef MT7601U 41 | {USB_DEVICE(0x148f,0x6370)}, /* Ralink 6370 */ 42 | {USB_DEVICE(0x2955,0x1001)}, /* xiaodu wifi */ 43 | {USB_DEVICE(0x148f,0x7601)}, /* MT 6370 */ 44 | {USB_DEVICE(0x148f,0x760b)}, /* 360 wifi 2 */ 45 | {USB_DEVICE(0x2717,0x4106)}, /* XiaoMi wifi */ 46 | {USB_DEVICE(0x2001,0x3d04)}, /* D-Link DWA-127 */ 47 | #endif /* MT7601U */ 48 | { }/* Terminating entry */ 49 | }; 50 | 51 | INT const rtusb_usb_id_len = sizeof(rtusb_dev_id) / sizeof(USB_DEVICE_ID); 52 | MODULE_DEVICE_TABLE(usb, rtusb_dev_id); 53 | -------------------------------------------------------------------------------- /src/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 ($(RT28xx_MODE),AP) 36 | rm -f ../../ap/*.o 37 | rm -f ../../ap/.*.cmd .*.flags .*.d 38 | else 39 | ifeq ($(RT28xx_MODE),STA) 40 | rm -f ../../sta/*.o 41 | rm -f ../../sta/.*.cmd .*.flags .*.d 42 | ifeq ($(HAS_P2P_SUPPORT),y) 43 | rm -f ../../ap/*.o 44 | rm -f ../../ap/.*.cmd .*.flags .*.d 45 | endif 46 | else 47 | ifeq ($(RT28xx_MODE),APSTA) 48 | rm -f ../../ap/*.o 49 | rm -f ../../ap/.*.cmd .*.flags .*.d 50 | rm -f ../../sta/*.o 51 | rm -f ../../sta/.*.cmd .*.flags .*.d 52 | endif 53 | endif 54 | endif 55 | 56 | # Declare the contents of the .PHONY variable as phony. We keep that 57 | # information in a variable so we can use it in if_changed and friends. 58 | .PHONY: $(PHONY) 59 | -------------------------------------------------------------------------------- /src/include/vr_ikans.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | vr_ikans.h 18 | 19 | Abstract: 20 | Only for IKANOS Vx160 or Vx180 platform. 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | Sample Lin 01-28-2008 Created 26 | 27 | */ 28 | 29 | #ifndef __VR_IKANS_H__ 30 | #define __VR_IKANS_H__ 31 | 32 | #ifndef MODULE_IKANOS 33 | #define IKANOS_EXTERN extern 34 | #else 35 | #define IKANOS_EXTERN 36 | #endif /* MODULE_IKANOS */ 37 | 38 | #ifdef IKANOS_VX_1X0 39 | typedef void (*IkanosWlanTxCbFuncP)(void *, void *); 40 | 41 | struct IKANOS_TX_INFO 42 | { 43 | struct net_device *netdev; 44 | IkanosWlanTxCbFuncP *fp; 45 | }; 46 | #endif /* IKANOS_VX_1X0 */ 47 | 48 | 49 | IKANOS_EXTERN void VR_IKANOS_FP_Init(UINT8 BssNum, UINT8 *pApMac); 50 | 51 | IKANOS_EXTERN INT32 IKANOS_DataFramesTx(struct sk_buff *pSkb, 52 | struct net_device *pNetDev); 53 | 54 | IKANOS_EXTERN void IKANOS_DataFrameRx(PRTMP_ADAPTER pAd, 55 | struct sk_buff *pSkb); 56 | 57 | #endif /* __VR_IKANS_H__ */ 58 | 59 | /* End of vr_ikans.h */ 60 | -------------------------------------------------------------------------------- /src/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 | 30 | 31 | #ifdef RTMP_USB_SUPPORT 32 | #include "iface/rtmp_usb.h" 33 | #endif /* RTMP_USB_SUPPORT */ 34 | 35 | typedef struct _INF_PCI_CONFIG_ { 36 | unsigned long CSRBaseAddress; /* PCI MMIO Base Address, all access will use */ 37 | unsigned int irq_num; 38 | } INF_PCI_CONFIG; 39 | 40 | typedef struct _INF_USB_CONFIG_ { 41 | unsigned char BulkInEpAddr; /* bulk-in endpoint address */ 42 | unsigned char BulkOutEpAddr[6]; /* bulk-out endpoint address */ 43 | } INF_USB_CONFIG; 44 | 45 | typedef struct _INF_RBUS_CONFIG_ { 46 | unsigned long csr_addr; 47 | unsigned int irq; 48 | } INF_RBUS_CONFIG; 49 | 50 | 51 | typedef union _RTMP_INF_CONFIG_ { 52 | struct _INF_PCI_CONFIG_ pciConfig; 53 | struct _INF_USB_CONFIG_ usbConfig; 54 | struct _INF_RBUS_CONFIG_ rbusConfig; 55 | } RTMP_INF_CONFIG; 56 | 57 | #endif /* __RTMP_IFACE_H__ */ 58 | -------------------------------------------------------------------------------- /src/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 | 68 | -------------------------------------------------------------------------------- /src/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 | 21 | #include "ap_autoChSel_cmm.h" 22 | 23 | #ifndef __AUTOCHSELECT_H__ 24 | #define __AUTOCHSELECT_H__ 25 | 26 | #define AP_AUTO_CH_SEL(__P, __O) APAutoSelectChannel((__P), (__O)) 27 | 28 | ULONG AutoChBssSearchWithSSID( 29 | IN PRTMP_ADAPTER pAd, 30 | IN PUCHAR Bssid, 31 | IN PUCHAR pSsid, 32 | IN UCHAR SsidLen, 33 | IN UCHAR Channel); 34 | 35 | VOID APAutoChannelInit( 36 | IN PRTMP_ADAPTER pAd); 37 | 38 | VOID UpdateChannelInfo( 39 | IN PRTMP_ADAPTER pAd, 40 | IN int ch, 41 | IN ChannelSel_Alg Alg); 42 | 43 | ULONG AutoChBssInsertEntry( 44 | IN PRTMP_ADAPTER pAd, 45 | IN PUCHAR pBssid, 46 | IN CHAR Ssid[], 47 | IN UCHAR SsidLen, 48 | IN UCHAR ChannelNo, 49 | IN UCHAR ExtChOffset, 50 | IN CHAR Rssi); 51 | 52 | VOID AutoChBssTableInit( 53 | IN PRTMP_ADAPTER pAd); 54 | 55 | VOID ChannelInfoInit( 56 | IN PRTMP_ADAPTER pAd); 57 | 58 | VOID AutoChBssTableDestroy( 59 | IN PRTMP_ADAPTER pAd); 60 | 61 | VOID ChannelInfoDestroy( 62 | IN PRTMP_ADAPTER pAd); 63 | 64 | VOID CheckPhyModeIsABand( 65 | IN PRTMP_ADAPTER pAd); 66 | 67 | UCHAR SelectBestChannel( 68 | IN PRTMP_ADAPTER pAd, 69 | IN ChannelSel_Alg Alg); 70 | 71 | UCHAR APAutoSelectChannel( 72 | IN PRTMP_ADAPTER pAd, 73 | IN ChannelSel_Alg Alg); 74 | 75 | #endif /* __AUTOCHSELECT_H__ */ 76 | 77 | -------------------------------------------------------------------------------- /src/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 | 32 | /* Algorithm options */ 33 | #define MD5_SUPPORT 34 | 35 | #ifdef MD5_SUPPORT 36 | #define MD5_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ 37 | #define MD5_DIGEST_SIZE 16 /* 128 bits = 16 bytes */ 38 | typedef struct { 39 | UINT32 HashValue[4]; 40 | UINT64 MessageLen; 41 | UINT8 Block[MD5_BLOCK_SIZE]; 42 | UINT BlockLen; 43 | } MD5_CTX_STRUC, *PMD5_CTX_STRUC; 44 | 45 | VOID RT_MD5_Init( 46 | IN MD5_CTX_STRUC * pMD5_CTX); 47 | VOID RT_MD5_Hash( 48 | IN MD5_CTX_STRUC * pMD5_CTX); 49 | VOID RT_MD5_Append( 50 | IN MD5_CTX_STRUC * pMD5_CTX, 51 | IN const UINT8 Message[], 52 | IN UINT MessageLen); 53 | VOID RT_MD5_End( 54 | IN MD5_CTX_STRUC * pMD5_CTX, 55 | OUT UINT8 DigestMessage[]); 56 | VOID RT_MD5( 57 | IN const UINT8 Message[], 58 | IN UINT MessageLen, 59 | OUT UINT8 DigestMessage[]); 60 | #endif /* MD5_SUPPORT */ 61 | 62 | 63 | #endif /* __CRYPT_MD5_H__ */ 64 | -------------------------------------------------------------------------------- /src/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 | 34 | #ifdef SHA1_SUPPORT 35 | #define HMAC_SHA1_SUPPORT 36 | VOID RT_HMAC_SHA1( 37 | IN const UINT8 Key[], 38 | IN UINT KeyLen, 39 | IN const UINT8 Message[], 40 | IN UINT MessageLen, 41 | OUT UINT8 MAC[], 42 | IN UINT MACLen); 43 | #endif /* SHA1_SUPPORT */ 44 | 45 | #ifdef SHA256_SUPPORT 46 | #define HMAC_SHA256_SUPPORT 47 | VOID RT_HMAC_SHA256( 48 | IN const UINT8 Key[], 49 | IN UINT KeyLen, 50 | IN const UINT8 Message[], 51 | IN UINT MessageLen, 52 | OUT UINT8 MAC[], 53 | IN UINT MACLen); 54 | #endif /* SHA256_SUPPORT */ 55 | 56 | #ifdef MD5_SUPPORT 57 | #define HMAC_MD5_SUPPORT 58 | VOID RT_HMAC_MD5( 59 | IN const UINT8 Key[], 60 | IN UINT KeyLen, 61 | IN const UINT8 Message[], 62 | IN UINT MessageLen, 63 | OUT UINT8 MAC[], 64 | IN UINT MACLen); 65 | #endif /* MD5_SUPPORT */ 66 | 67 | 68 | #endif /* __CRYPT_HMAC_H__ */ 69 | -------------------------------------------------------------------------------- /src/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 | 39 | 40 | #define P2P_GO_ON(_pAd) \ 41 | (((_pAd)->flg_p2p_init) \ 42 | && ((_pAd)->flg_p2p_OpStatusFlags == P2P_GO_UP)) 43 | 44 | 45 | #define P2P_CLI_ON(_pAd) \ 46 | (((_pAd)->flg_p2p_init) \ 47 | && ((_pAd)->flg_p2p_OpStatusFlags == P2P_CLI_UP)) 48 | 49 | /* P2P interface hook function definition */ 50 | VOID RTMP_P2P_Init( 51 | IN PRTMP_ADAPTER ad_p, 52 | IN PNET_DEV main_dev_p); 53 | 54 | INT P2P_VirtualIF_Open( 55 | IN PNET_DEV dev_p); 56 | 57 | INT P2P_VirtualIF_Close( 58 | IN PNET_DEV dev_p); 59 | 60 | INT P2P_VirtualIF_PacketSend( 61 | IN PNDIS_PACKET skb_p, 62 | IN PNET_DEV dev_p); 63 | 64 | INT P2P_VirtualIF_Ioctl( 65 | IN PNET_DEV dev_p, 66 | IN OUT struct ifreq *rq_p, 67 | IN INT cmd); 68 | 69 | VOID RTMP_P2P_Remove( 70 | IN PRTMP_ADAPTER pAd); 71 | 72 | #endif /* __P2P_INF_H__ */ 73 | 74 | -------------------------------------------------------------------------------- /src/include/ap_ids.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | ap_ids.c 18 | 19 | Abstract: 20 | IDS definition 21 | 22 | Revision History: 23 | Who When What 24 | -------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | VOID RTMPIdsPeriodicExec( 28 | IN PVOID SystemSpecific1, 29 | IN PVOID FunctionContext, 30 | IN PVOID SystemSpecific2, 31 | IN PVOID SystemSpecific3); 32 | 33 | BOOLEAN RTMPSpoofedMgmtDetection( 34 | IN PRTMP_ADAPTER pAd, 35 | IN PHEADER_802_11 pHeader, 36 | IN CHAR Rssi0, 37 | IN CHAR Rssi1, 38 | IN CHAR Rssi2, 39 | IN UCHAR AntSel); 40 | 41 | VOID RTMPConflictSsidDetection( 42 | IN PRTMP_ADAPTER pAd, 43 | IN PUCHAR pSsid, 44 | IN UCHAR SsidLen, 45 | IN CHAR Rssi0, 46 | IN CHAR Rssi1, 47 | IN CHAR Rssi2, 48 | IN UCHAR AntSel); 49 | 50 | BOOLEAN RTMPReplayAttackDetection( 51 | IN PRTMP_ADAPTER pAd, 52 | IN PUCHAR pAddr2, 53 | IN CHAR Rssi0, 54 | IN CHAR Rssi1, 55 | IN CHAR Rssi2, 56 | IN UCHAR AntSel, 57 | IN UCHAR BW); 58 | 59 | VOID RTMPUpdateStaMgmtCounter( 60 | IN PRTMP_ADAPTER pAd, 61 | IN USHORT type); 62 | 63 | VOID RTMPClearAllIdsCounter( 64 | IN PRTMP_ADAPTER pAd); 65 | 66 | VOID RTMPIdsStart( 67 | IN PRTMP_ADAPTER pAd); 68 | 69 | VOID RTMPIdsStop( 70 | IN PRTMP_ADAPTER pAd); 71 | 72 | VOID rtmp_read_ids_from_file( 73 | IN PRTMP_ADAPTER pAd, 74 | char *tmpbuf, 75 | char *buffer); 76 | 77 | -------------------------------------------------------------------------------- /src/include/br_ftph.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * Taiwan, R.O.C. 4 | * 5 | * (c) Copyright 2002, Ralink Technology, Inc. 6 | * 7 | * All rights reserved. Ralink's source code is an unpublished work and the 8 | * use of a copyright notice does not imply otherwise. This source code 9 | * contains confidential trade secret material of Ralink Tech. Any attemp 10 | * or participation in deciphering, decoding, reverse engineering or in any 11 | * way altering the source code is stricitly prohibited, unless the prior 12 | * written consent of Ralink Technology, Inc. is obtained. 13 | ***************************************************************************/ 14 | 15 | /**************************************************************************** 16 | 17 | Abstract: 18 | 19 | All Bridge Fast Path Related Structure & Definition. 20 | 21 | ***************************************************************************/ 22 | 23 | #ifndef __BR_FTPH_H__ 24 | #define __BR_FTPH_H__ 25 | 26 | /* Public function prototype */ 27 | /* 28 | ======================================================================== 29 | Routine Description: 30 | Init bridge fast path module. 31 | 32 | Arguments: 33 | None 34 | 35 | Return Value: 36 | None 37 | 38 | Note: 39 | Used in module init. 40 | ======================================================================== 41 | */ 42 | VOID BG_FTPH_Init(VOID); 43 | 44 | /* 45 | ======================================================================== 46 | Routine Description: 47 | Remove bridge fast path module. 48 | 49 | Arguments: 50 | None 51 | 52 | Return Value: 53 | None 54 | 55 | Note: 56 | Used in module remove. 57 | ======================================================================== 58 | */ 59 | VOID BG_FTPH_Remove(VOID); 60 | 61 | /* 62 | ======================================================================== 63 | Routine Description: 64 | Forward the received packet. 65 | 66 | Arguments: 67 | pPacket - the received packet 68 | 69 | Return Value: 70 | None 71 | 72 | Note: 73 | ======================================================================== 74 | */ 75 | UINT32 BG_FTPH_PacketFromApHandle( 76 | IN PNDIS_PACKET pPacket); 77 | 78 | #endif /* __BR_FTPH_H__ */ 79 | 80 | /* End of br_ftph.h */ 81 | 82 | -------------------------------------------------------------------------------- /src/include/iface/iface_util.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * Ralink Tech Inc. 3 | * 4F, No. 2 Technology 5th Rd. 4 | * Science-based Industrial Park 5 | * Hsin-chu, Taiwan, R.O.C. 6 | * (c) Copyright 2002, Ralink Technology, Inc. 7 | * 8 | * All rights reserved. Ralink's source code is an unpublished work and the 9 | * use of a copyright notice does not imply otherwise. This source code 10 | * contains confidential trade secret material of Ralink Tech. Any attemp 11 | * or participation in deciphering, decoding, reverse engineering or in any 12 | * way altering the source code is stricitly prohibited, unless the prior 13 | * written consent of Ralink Technology, Inc. is obtained. 14 | **************************************************************************** 15 | 16 | Module Name: 17 | rtmp_util.h 18 | 19 | Abstract: 20 | Common for PCI/USB/RBUS. 21 | 22 | Revision History: 23 | Who When What 24 | --------- ---------- ---------------------------------------------- 25 | */ 26 | 27 | #ifndef __RTMP_UTIL_H__ 28 | #define __RTMP_UTIL_H__ 29 | 30 | /* maximum of PCI, USB, or RBUS, int PCI, it is 0 but in USB, it is 11 */ 31 | #define RTMP_PKT_TAIL_PADDING 11 /* 3(max 4 byte padding) + 4 (last packet padding) + 4 (MaxBulkOutsize align padding) */ 32 | 33 | #ifdef PCI_MSI_SUPPORT 34 | #define RTMP_MSI_ENABLE(_pAd) \ 35 | { POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ 36 | (_pAd)->HaveMsi = pci_enable_msi(_pObj->pci_dev) == 0 ? TRUE : FALSE; \ 37 | } 38 | 39 | #define RTMP_MSI_DISABLE(_pci_dev, _pHaveMsi) \ 40 | { \ 41 | if (*(_pHaveMsi) == TRUE) \ 42 | pci_disable_msi(_pci_dev); \ 43 | *(_pHaveMsi) = FALSE; \ 44 | } 45 | 46 | #else 47 | #define RTMP_MSI_ENABLE(_pAd) do{}while(0) 48 | #define RTMP_MSI_DISABLE(_pci_dev, _pHaveMsi) do{}while(0) 49 | #endif /* PCI_MSI_SUPPORT */ 50 | 51 | #define RTMP_PCI_DMA_TODEVICE 0xFF00 52 | #define RTMP_PCI_DMA_FROMDEVICE 0xFF01 53 | 54 | 55 | 56 | 57 | #define UNLINK_TIMEOUT_MS 3 58 | 59 | #define USBD_TRANSFER_DIRECTION_OUT 0 60 | #define USBD_TRANSFER_DIRECTION_IN 0 61 | #define USBD_SHORT_TRANSFER_OK 0 62 | #define PURB purbb_t 63 | 64 | #define OS_RTUSBMlmeUp RtmpOsMlmeUp 65 | 66 | 67 | 68 | 69 | #endif /* __RTMP_UTIL_H__ */ 70 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | [2013-03-13] 2 | Version 3.0.0.3 3 | 1. Fix Single-Sku and TSSI bug. 4 | 2. Support Multi-Channel feature. 5 | 3. Change ATELDE2PFROMBUF command to bufferWriteBack. 6 | 4. Support bufferLoadFromEfuse command to force enter buffer mode. 7 | 5. Support ATECALFREEINFO command to get calibration free info. 8 | 6. Support fast scan when ra0 or p2p0 is connected 9 | 7. Move IdleTimeout and StationKeepAlive profiles out to be supported in STA mode. 10 | 8. Fix P2P EAPOL packet using 1Mbps rate problem 11 | 9. Support wpa_cli p2p persistent group cmds 12 | 10. Fix ATE bug. 13 | 11. Fix bug when read channel power and BW delta power. 14 | 12. Fix crash issue in some platform when interface down. 15 | 13. Support HW PBC. 16 | 14. Fix bug in RTMP_TimerListRelease(). 17 | 15. Support Xtal freuency offset compersation. 18 | 16. Update firmware to V1.5 19 | 20 | [2013-01-23] 21 | Version 3.0.0.2 22 | 1. Update firmware to V1.3 23 | 2. Add software protect for PLL lock. 24 | 3. Support new WOWLAN. 25 | 4. Fix p2p sigma 4.2.2(Version 5.0) fail. 26 | 5. Fix frequency tracking bug. 27 | 6. Fix ATELDE2P cannot work. 28 | 7. Fix scan in 802.11 power saving cause dead lock. 29 | 8. Update SINGLE_SKU_V2. 30 | 9. Support ATETEMP. 31 | 10. Support ch14 CCK OBW. 32 | 11. Fix p2p sigma test fail issue. 33 | 12. Support Calibration free and ATELDE2PFROMBUF. 34 | 13. Update VCO calibration procedure. 35 | 14. Fix temperature calibration bug at low temp. 36 | 15. Check DMA done bit while load FW. 37 | 16. Fix WirelessMode=5 cannot connect to 11n only AP. 38 | 17. Support iwpriv ra0 set ATETSSIDC=1 command 39 | 40 | [2012-11-30] 41 | Version 3.0.0.1 42 | 1. Change text type to UNIX. 43 | 2. Fixed OS_ABL support crash at Kernel 2.6.32. 44 | 3. Fixed ATELDE2P=1 crash. 45 | 4. Update frequency tracking thresholds. 46 | 5. Update firmware to beta 0.4 47 | 6. Update RF CR to 10121122. 48 | 7. Fixed BulkInCmdRspEvent may submit multiple bulk-in urb. 49 | 8. Support ATE feature. 50 | 9. Fixed wps fail with external registrar. 51 | 10. Support Miracast. 52 | 53 | [2012-11-15] 54 | Version 3.0.0.0 55 | 1. Support suspend/resume. 56 | 2. Support 802.11 power saving. 57 | 3. Support P2P. 58 | 4. Support antenna diversity. 59 | 5. Support microwave oven detection. 60 | 61 | [2012-10-19] 62 | Version 3.0.0.0-Beta7 63 | 1. MT7601STA initial version. 64 | 2. Support RX_CSO. 65 | 3. Support header translation. 66 | 67 | -------------------------------------------------------------------------------- /doc/ReadMe.txt: -------------------------------------------------------------------------------- 1 | [2013-03-13] 2 | Version 3.0.0.3 3 | 1. Fix Single-Sku and TSSI bug. 4 | 2. Support Multi-Channel feature. 5 | 3. Change ATELDE2PFROMBUF command to bufferWriteBack. 6 | 4. Support bufferLoadFromEfuse command to force enter buffer mode. 7 | 5. Support ATECALFREEINFO command to get calibration free info. 8 | 6. Support fast scan when ra0 or p2p0 is connected 9 | 7. Move IdleTimeout and StationKeepAlive profiles out to be supported in STA mode. 10 | 8. Fix P2P EAPOL packet using 1Mbps rate problem 11 | 9. Support wpa_cli p2p persistent group cmds 12 | 10. Fix ATE bug. 13 | 11. Fix bug when read channel power and BW delta power. 14 | 12. Fix crash issue in some platform when interface down. 15 | 13. Support HW PBC. 16 | 14. Fix bug in RTMP_TimerListRelease(). 17 | 15. Support Xtal freuency offset compersation. 18 | 16. Update firmware to V1.5 19 | 20 | [2013-01-23] 21 | Version 3.0.0.2 22 | 1. Update firmware to V1.3 23 | 2. Add software protect for PLL lock. 24 | 3. Support new WOWLAN. 25 | 4. Fix p2p sigma 4.2.2(Version 5.0) fail. 26 | 5. Fix frequency tracking bug. 27 | 6. Fix ATELDE2P cannot work. 28 | 7. Fix scan in 802.11 power saving cause dead lock. 29 | 8. Update SINGLE_SKU_V2. 30 | 9. Support ATETEMP. 31 | 10. Support ch14 CCK OBW. 32 | 11. Fix p2p sigma test fail issue. 33 | 12. Support Calibration free and ATELDE2PFROMBUF. 34 | 13. Update VCO calibration procedure. 35 | 14. Fix temperature calibration bug at low temp. 36 | 15. Check DMA done bit while load FW. 37 | 16. Fix WirelessMode=5 cannot connect to 11n only AP. 38 | 17. Support iwpriv ra0 set ATETSSIDC=1 command 39 | 40 | [2012-11-30] 41 | Version 3.0.0.1 42 | 1. Change text type to UNIX. 43 | 2. Fixed OS_ABL support crash at Kernel 2.6.32. 44 | 3. Fixed ATELDE2P=1 crash. 45 | 4. Update frequency tracking thresholds. 46 | 5. Update firmware to beta 0.4 47 | 6. Update RF CR to 10121122. 48 | 7. Fixed BulkInCmdRspEvent may submit multiple bulk-in urb. 49 | 8. Support ATE feature. 50 | 9. Fixed wps fail with external registrar. 51 | 10. Support Miracast. 52 | 53 | [2012-11-15] 54 | Version 3.0.0.0 55 | 1. Support suspend/resume. 56 | 2. Support 802.11 power saving. 57 | 3. Support P2P. 58 | 4. Support antenna diversity. 59 | 5. Support microwave oven detection. 60 | 61 | [2012-10-19] 62 | Version 3.0.0.0-Beta7 63 | 1. MT7601STA initial version. 64 | 2. Support RX_CSO. 65 | 3. Support header translation. 66 | 67 | -------------------------------------------------------------------------------- /src/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 | 39 | struct _RTMP_ADAPTER; 40 | 41 | typedef void (*CMD_RSP_HANDLER)(struct _RTMP_ADAPTER *pAd, UCHAR *Data); 42 | 43 | /* 44 | * CMD Unit (8051, Andes, ...,and etc) 45 | */ 46 | struct CMD_UNIT { 47 | union { 48 | struct { 49 | UCHAR Command; 50 | UCHAR Token; 51 | UCHAR Arg0; 52 | UCHAR Arg1; 53 | } MCU51; 54 | struct { 55 | UINT8 Type; 56 | USHORT CmdPayloadLen; 57 | PUCHAR CmdPayload; 58 | USHORT RspPayloadLen; 59 | PUCHAR RspPayload; 60 | ULONG Timeout; 61 | BOOLEAN NeedRsp; 62 | BOOLEAN NeedWait; 63 | CMD_RSP_HANDLER CmdRspHdler; 64 | } ANDES; 65 | } u; 66 | }; 67 | 68 | 69 | struct MCU_CTRL { 70 | UCHAR CmdSeq; 71 | NDIS_SPIN_LOCK CmdRspEventListLock; 72 | DL_LIST CmdRspEventList; 73 | }; 74 | 75 | 76 | struct CMD_RSP_EVENT { 77 | DL_LIST List; 78 | UCHAR CmdSeq; 79 | UINT32 Timeout; 80 | BOOLEAN NeedWait; 81 | PVOID AckDone; 82 | UCHAR **RspPayload; 83 | USHORT *RspPayloadLen; 84 | }; 85 | 86 | VOID ChipOpsMCUHook(struct _RTMP_ADAPTER *pAd, enum MCU_TYPE MCUType); 87 | VOID MCUCtrlInit(struct _RTMP_ADAPTER *pAd); 88 | VOID MCUCtrlExit(struct _RTMP_ADAPTER *pAd); 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /src/include/sta_cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | *************************************************************************** 3 | * Ralink Tech Inc. 4 | * 4F, No. 2 Technology 5th Rd. 5 | * Science-based Industrial Park 6 | * Hsin-chu, Taiwan, R.O.C. 7 | * 8 | * (c) Copyright 2002-2009, Ralink Technology, Inc. 9 | * 10 | * All rights reserved. Ralink's source code is an unpublished work and the 11 | * use of a copyright notice does not imply otherwise. This source code 12 | * contains confidential trade secret material of Ralink Tech. Any attemp 13 | * or participation in deciphering, decoding, reverse engineering or in any 14 | * way altering the source code is stricitly prohibited, unless the prior 15 | * written consent of Ralink Technology, Inc. is obtained. 16 | *************************************************************************** 17 | 18 | Module Name: 19 | sta_cfg.h 20 | 21 | Abstract: 22 | 23 | 24 | Revision History: 25 | Who When What 26 | -------- ---------- ---------------------------------------------- 27 | 28 | */ 29 | 30 | #ifndef __STA_CFG_H__ 31 | #define __STA_CFG_H__ 32 | 33 | INT RTMPSTAPrivIoctlSet( 34 | IN RTMP_ADAPTER *pAd, 35 | IN PSTRING SetProcName, 36 | IN PSTRING ProcArg); 37 | 38 | #if (defined(WOW_SUPPORT) && defined(RTMP_MAC_USB)) || defined(NEW_WOW_SUPPORT) 39 | /* set WOW enable */ 40 | INT Set_WOW_Enable( 41 | IN PRTMP_ADAPTER pAd, 42 | IN PSTRING arg); 43 | /* set GPIO pin for wake-up signal */ 44 | INT Set_WOW_GPIO( 45 | IN PRTMP_ADAPTER pAd, 46 | IN PSTRING arg); 47 | /* set delay time for WOW really enable */ 48 | INT Set_WOW_Delay( 49 | IN PRTMP_ADAPTER pAd, 50 | IN PSTRING arg); 51 | /* set wake up hold time */ 52 | INT Set_WOW_Hold( 53 | IN PRTMP_ADAPTER pAd, 54 | IN PSTRING arg); 55 | /* set wakeup signal type */ 56 | INT Set_WOW_InBand( 57 | IN PRTMP_ADAPTER pAd, 58 | IN PSTRING arg); 59 | #endif /* (defined(WOW_SUPPORT) && defined(RTMP_MAC_USB)) || defined(NEW_WOW_SUPPORT) */ 60 | 61 | #ifdef RTMP_MAC_USB 62 | /* Sets the FW into WOW Suspend mode */ 63 | INT Set_UsbWOWSuspend( 64 | IN PRTMP_ADAPTER pAd, 65 | IN PSTRING arg); 66 | /* Resume the FW to Normal mode */ 67 | INT Set_UsbWOWResume( 68 | IN PRTMP_ADAPTER pAd, 69 | IN PSTRING arg); 70 | #endif /* RTMP_MAC_USB */ 71 | 72 | #endif /* __STA_CFG_H__ */ 73 | -------------------------------------------------------------------------------- /src/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 | 34 | /* DH operations */ 35 | void DH_PublicKey_Generate ( 36 | IN UINT8 GValue[], 37 | IN UINT GValueLength, 38 | IN UINT8 PValue[], 39 | IN UINT PValueLength, 40 | IN UINT8 PrivateKey[], 41 | IN UINT PrivateKeyLength, 42 | OUT UINT8 PublicKey[], 43 | INOUT UINT *PublicKeyLength); 44 | 45 | void DH_SecretKey_Generate ( 46 | IN UINT8 PublicKey[], 47 | IN UINT PublicKeyLength, 48 | IN UINT8 PValue[], 49 | IN UINT PValueLength, 50 | IN UINT8 PrivateKey[], 51 | IN UINT PrivateKeyLength, 52 | OUT UINT8 SecretKey[], 53 | INOUT UINT *SecretKeyLength); 54 | 55 | #define RT_DH_PublicKey_Generate(GK, GKL, PV, PVL, PriK, PriKL, PubK, PubKL) \ 56 | DH_PublicKey_Generate((GK), (GKL), (PV), (PVL), (PriK), (PriKL), (UINT8 *) (PubK), (UINT *) (PubKL)) 57 | 58 | #define RT_DH_SecretKey_Generate(PubK, PubKL, PV, PVL, PriK, PriKL, SecK, SecKL) \ 59 | DH_SecretKey_Generate((PubK), (PubKL), (PV), (PVL), (PriK), (PriKL), (UINT8 *) (SecK), (UINT *) (SecKL)) 60 | 61 | #define RT_DH_FREE_ALL() 62 | 63 | 64 | #endif /* __CRYPT_DH_H__ */ 65 | 66 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /etc/Wireless/RT2870AP/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=HD_MESH_1 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=WPA2PSK 59 | EncrypType=TKIP;AES 60 | RekeyInterval=0 61 | RekeyMethod=DISABLE 62 | PMKCachePeriod=10 63 | WPAPSK=1234567890 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 120 | -------------------------------------------------------------------------------- /src/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 struct __CFG80211_CB { 28 | 29 | /* we can change channel/rate information on the fly so we backup them */ 30 | struct ieee80211_supported_band Cfg80211_bands[IEEE80211_NUM_BANDS]; 31 | struct ieee80211_channel *pCfg80211_Channels; 32 | struct ieee80211_rate *pCfg80211_Rates; 33 | 34 | /* used in wiphy_unregister */ 35 | struct wireless_dev *pCfg80211_Wdev; 36 | 37 | /* used in scan end */ 38 | struct cfg80211_scan_request *pCfg80211_ScanReq; 39 | 40 | /* monitor filter */ 41 | UINT32 MonFilterFlag; 42 | 43 | /* channel information */ 44 | struct ieee80211_channel ChanInfo[MAX_NUM_OF_CHANNELS]; 45 | } CFG80211_CB; 46 | 47 | 48 | 49 | 50 | /* 51 | ======================================================================== 52 | Routine Description: 53 | Register MAC80211 Module. 54 | 55 | Arguments: 56 | pAd - WLAN control block pointer 57 | pDev - Generic device interface 58 | pNetDev - Network device 59 | 60 | Return Value: 61 | NONE 62 | 63 | Note: 64 | pDev != pNetDev 65 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) 66 | 67 | Can not use pNetDev to replace pDev; Or kernel panic. 68 | ======================================================================== 69 | */ 70 | BOOLEAN CFG80211_Register( 71 | VOID *pAd, 72 | struct device *pDev, 73 | struct net_device *pNetDev); 74 | 75 | 76 | #endif /* RT_CFG80211_SUPPORT */ 77 | 78 | /* End of cfg80211.h */ 79 | -------------------------------------------------------------------------------- /src/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 | 29 | #include "rt_config.h" 30 | 31 | INT MCUBurstWrite(PRTMP_ADAPTER pAd, UINT32 Offset, UINT32 *Data, UINT32 Cnt) 32 | { 33 | RTUSBMultiWrite_nBytes(pAd, Offset, Data, Cnt * 4, 64); 34 | } 35 | 36 | INT MCURandomWrite(PRTMP_ADAPTER pAd, RTMP_REG_PAIR *RegPair, UINT32 Num) 37 | { 38 | UINT32 Index; 39 | 40 | for (Index = 0; Index < Num; Index++) 41 | RTMP_IO_WRITE32(pAd, RegPair->Register, RegPair->Value); 42 | } 43 | 44 | VOID ChipOpsMCUHook(PRTMP_ADAPTER pAd, enum MCU_TYPE MCUType) 45 | { 46 | 47 | RTMP_CHIP_OP *pChipOps = &pAd->chipOps; 48 | 49 | 50 | if (MCUType == M8051) 51 | { 52 | pChipOps->sendCommandToMcu = RtmpAsicSendCommandToMcu; 53 | pChipOps->BurstWrite = MCUBurstWrite; 54 | pChipOps->RandomWrite = MCURandomWrite; 55 | } 56 | 57 | #ifdef CONFIG_ANDES_SUPPORT 58 | if (MCUType == ANDES) 59 | { 60 | 61 | #ifdef RTMP_USB_SUPPORT 62 | pChipOps->loadFirmware = USBLoadFirmwareToAndes; 63 | #endif 64 | //pChipOps->sendCommandToMcu = AsicSendCmdToAndes; 65 | pChipOps->Calibration = AndesCalibrationOP; 66 | pChipOps->BurstWrite = AndesBurstWrite; 67 | pChipOps->BurstRead = AndesBurstRead; 68 | pChipOps->RandomRead = AndesRandomRead; 69 | pChipOps->RFRandomRead = AndesRFRandomRead; 70 | pChipOps->ReadModifyWrite = AndesReadModifyWrite; 71 | pChipOps->RFReadModifyWrite = AndesRFReadModifyWrite; 72 | pChipOps->RandomWrite = AndesRandomWrite; 73 | pChipOps->RFRandomWrite = AndesRFRandomWrite; 74 | pChipOps->PwrSavingOP = AndesPwrSavingOP; 75 | } 76 | #endif 77 | } 78 | -------------------------------------------------------------------------------- /src/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 | /* 42 | For MBSS, the phy mode is different; 43 | So MBSS_PHY_MODE_RESET() can help us to adjust the correct mode & 44 | maximum MCS for the BSS. 45 | */ 46 | #define MBSS_PHY_MODE_RESET(__BssId, __HtPhyMode) \ 47 | { \ 48 | UCHAR __PhyMode = pAd->ApCfg.MBSSID[__BssId].PhyMode; \ 49 | if ((__PhyMode == WMODE_B) && \ 50 | (__HtPhyMode.field.MODE != MODE_CCK)) \ 51 | { \ 52 | __HtPhyMode.field.MODE = MODE_CCK; \ 53 | __HtPhyMode.field.MCS = 3; \ 54 | } \ 55 | else if ((!WMODE_CAP_N(__PhyMode)) && \ 56 | (__PhyMode != WMODE_B) && \ 57 | (__HtPhyMode.field.MODE != MODE_OFDM)) \ 58 | { \ 59 | __HtPhyMode.field.MODE = MODE_OFDM; \ 60 | __HtPhyMode.field.MCS = 7; \ 61 | } \ 62 | } 63 | 64 | 65 | /* Public function list */ 66 | INT Show_MbssInfo_Display_Proc( 67 | IN PRTMP_ADAPTER pAd, 68 | IN PSTRING arg); 69 | 70 | VOID MBSS_Init( 71 | IN PRTMP_ADAPTER pAd, 72 | IN RTMP_OS_NETDEV_OP_HOOK *pNetDevOps); 73 | 74 | VOID MBSS_Remove( 75 | IN PRTMP_ADAPTER pAd); 76 | 77 | INT MBSS_Open( 78 | IN PNET_DEV pDev); 79 | 80 | INT MBSS_Close( 81 | IN PNET_DEV pDev); 82 | 83 | INT32 RT28xx_MBSS_IdxGet( 84 | IN PRTMP_ADAPTER pAd, 85 | IN PNET_DEV pDev); 86 | 87 | -------------------------------------------------------------------------------- /src/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 | 30 | #define NIC_PCI_VENDOR_ID 0x1814 31 | 32 | #define NIC2860_PCI_DEVICE_ID 0x0601 33 | #define NIC2860_PCIe_DEVICE_ID 0x0681 34 | #define NIC2760_PCI_DEVICE_ID 0x0701 /* 1T/2R Cardbus ??? */ 35 | #define NIC2790_PCIe_DEVICE_ID 0x0781 /* 1T/2R miniCard */ 36 | 37 | #define VEN_AWT_PCIe_DEVICE_ID 0x1059 38 | #define VEN_AWT_PCI_VENDOR_ID 0x1A3B 39 | 40 | #define EDIMAX_PCI_VENDOR_ID 0x1432 41 | 42 | #define NIC3090_PCIe_DEVICE_ID 0x3090 /* 1T/1R miniCard */ 43 | #define NIC3091_PCIe_DEVICE_ID 0x3091 /* 1T/2R miniCard */ 44 | #define NIC3092_PCIe_DEVICE_ID 0x3092 /* 2T/2R miniCard */ 45 | #define NIC3390_PCIe_DEVICE_ID 0x3390 /* 1T/1R miniCard */ 46 | 47 | #define NIC3062_PCI_DEVICE_ID 0x3062 /* 2T/2R miniCard */ 48 | #define NIC3562_PCI_DEVICE_ID 0x3562 /* 2T/2R miniCard */ 49 | #define NIC3060_PCI_DEVICE_ID 0x3060 /* 1T/1R miniCard */ 50 | 51 | #define NIC3592_PCIe_DEVICE_ID 0x3592 /* 2T/2R miniCard */ 52 | 53 | 54 | #define NIC3593_PCI_OR_PCIe_DEVICE_ID 0x3593 55 | #define NIC5390_PCIe_DEVICE_ID 0x5390 56 | #define NIC539F_PCIe_DEVICE_ID 0x539F 57 | #define NIC5392_PCIe_DEVICE_ID 0x5392 58 | #define NIC5360_PCI_DEVICE_ID 0x5360 59 | #define NIC5362_PCI_DEVICE_ID 0x5362 60 | 61 | #define NIC5592_PCIe_DEVICE_ID 0x5592 62 | 63 | #define NIC3290_PCIe_DEVICE_ID 0x3290 64 | 65 | #define NIC6590_PCIe_DEVICE_ID 0x6590 66 | #define NIC7601_PCIe_DEVICE_ID 0x7601 67 | 68 | #define NIC8592_5592_PCIe_DEVICE_ID 0x5592 69 | #define NIC8592_PCIe_DEVICE_ID 0x8592 70 | 71 | #define NIC6390_PCIe_DEVICE_ID 0x6390 72 | 73 | #endif /* __CHIP_ID_H__ */ 74 | -------------------------------------------------------------------------------- /src/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 | 31 | INT RtmpChipOpsEepromHook(RTMP_ADAPTER *pAd, INT infType) 32 | { 33 | RTMP_CHIP_OP *pChipOps = &pAd->chipOps; 34 | UINT32 e2p_csr; 35 | 36 | #ifdef RTMP_FLASH_SUPPORT 37 | pChipOps->eeinit = rtmp_nv_init; 38 | pChipOps->eeread = rtmp_ee_flash_read; 39 | pChipOps->eewrite = rtmp_ee_flash_write; 40 | return 0; 41 | #endif /* RTMP_FLASH_SUPPORT */ 42 | 43 | #ifdef RTMP_EFUSE_SUPPORT 44 | efuse_probe(pAd); 45 | if(pAd->bUseEfuse) 46 | { 47 | pChipOps->eeinit = eFuse_init; 48 | pChipOps->eeread = rtmp_ee_efuse_read16; 49 | pChipOps->eewrite = rtmp_ee_efuse_write16; 50 | DBGPRINT(RT_DEBUG_OFF, ("NVM is EFUSE\n")); 51 | DBGPRINT(RT_DEBUG_TRACE, ("Efuse Size=0x%x [Range:%x-%x] \n", 52 | pAd->chipCap.EFUSE_USAGE_MAP_SIZE, 53 | pAd->chipCap.EFUSE_USAGE_MAP_START, 54 | pAd->chipCap.EFUSE_USAGE_MAP_END)); 55 | 56 | return 0 ; 57 | } 58 | else 59 | { 60 | pAd->bFroceEEPROMBuffer = FALSE; 61 | DBGPRINT(RT_DEBUG_OFF, ("NVM is EEPROM\n")); 62 | } 63 | #endif /* RTMP_EFUSE_SUPPORT */ 64 | 65 | switch(infType) 66 | { 67 | 68 | 69 | #ifdef RTMP_USB_SUPPORT 70 | case RTMP_DEV_INF_USB: 71 | pChipOps->eeinit = NULL; 72 | pChipOps->eeread = RTUSBReadEEPROM16; 73 | pChipOps->eewrite = RTUSBWriteEEPROM16; 74 | DBGPRINT(RT_DEBUG_OFF, ("pChipOps->eeread = RTUSBReadEEPROM16\n")); 75 | DBGPRINT(RT_DEBUG_OFF, ("pChipOps->eewrite = RTUSBWriteEEPROM16\n")); 76 | break; 77 | #endif /* RTMP_USB_SUPPORT */ 78 | default: 79 | DBGPRINT(RT_DEBUG_ERROR, ("RtmpChipOpsEepromHook() failed!\n")); 80 | break; 81 | } 82 | 83 | return 0; 84 | } 85 | 86 | -------------------------------------------------------------------------------- /src/common/.frq_cal.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/../../common/frq_cal.o := gcc -Wp,-MD,/home/pi/mt7601u/src/os/linux/../../common/.frq_cal.o.d -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/4.9/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs -DSYSTEM_LOG_SUPPORT -DRT28xx_MODE=AP -DCHIPSET=7601U -DRESOURCE_PRE_ALLOC -I/home/pi/mt7601u/src/include -DCONFIG_AP_SUPPORT -DUAPSD_SUPPORT -DMBSS_SUPPORT -DIAPP_SUPPORT -DDBG -DDOT1X_SUPPORT -DAP_SCAN_SUPPORT -DSCAN_SUPPORT -DHOSTAPD_SUPPORT -DRALINK_ATE -DCONFIG_RT2880_ATE_CMD_NEW -I/home/pi/mt7601u/src/ate/include -DRALINK_QA -DWSC_AP_SUPPORT -DWSC_V2_SUPPORT -DDOT11_N_SUPPORT -DDOT11N_DRAFT3 -DSTATS_COUNT_SUPPORT -DOS_ABL_SUPPORT -DOS_ABL_FUNC_SUPPORT -DOS_ABL_OS_PCI_SUPPORT -DOS_ABL_OS_USB_SUPPORT -DOS_ABL_OS_AP_SUPPORT -DOS_ABL_OS_STA_SUPPORT -DEXPORT_SYMTAB -DMT7601U -DMT7601 -DRLT_MAC -DRLT_RF -DRTMP_MAC_USB -DRTMP_USB_SUPPORT -DRTMP_TIMER_TASK_SUPPORT -DRX_DMA_SCATTER -DVCORECAL_SUPPORT -DRTMP_EFUSE_SUPPORT -DNEW_MBSSID_MODE -DRTMP_INTERNAL_TX_ALC -DCONFIG_ANDES_SUPPORT -DDPD_CALIBRATION_SUPPORT -DCONFIG_RX_CSO_SUPPORT -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(frq_cal)" -D"KBUILD_MODNAME=KBUILD_STR(mt7601Uap)" -c -o /home/pi/mt7601u/src/os/linux/../../common/.tmp_frq_cal.o /home/pi/mt7601u/src/os/linux/../../common/frq_cal.c 2 | 3 | source_/home/pi/mt7601u/src/os/linux/../../common/frq_cal.o := /home/pi/mt7601u/src/os/linux/../../common/frq_cal.c 4 | 5 | deps_/home/pi/mt7601u/src/os/linux/../../common/frq_cal.o := \ 6 | 7 | /home/pi/mt7601u/src/os/linux/../../common/frq_cal.o: $(deps_/home/pi/mt7601u/src/os/linux/../../common/frq_cal.o) 8 | 9 | $(deps_/home/pi/mt7601u/src/os/linux/../../common/frq_cal.o): 10 | -------------------------------------------------------------------------------- /src/common/.rtusb_data.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/../../common/rtusb_data.o := gcc -Wp,-MD,/home/pi/mt7601u/src/os/linux/../../common/.rtusb_data.o.d -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/4.9/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs -DSYSTEM_LOG_SUPPORT -DRT28xx_MODE=AP -DCHIPSET=7601U -DRESOURCE_PRE_ALLOC -I/home/pi/mt7601u/src/include -DCONFIG_AP_SUPPORT -DUAPSD_SUPPORT -DMBSS_SUPPORT -DIAPP_SUPPORT -DDBG -DDOT1X_SUPPORT -DAP_SCAN_SUPPORT -DSCAN_SUPPORT -DHOSTAPD_SUPPORT -DRALINK_ATE -DCONFIG_RT2880_ATE_CMD_NEW -I/home/pi/mt7601u/src/ate/include -DRALINK_QA -DWSC_AP_SUPPORT -DWSC_V2_SUPPORT -DDOT11_N_SUPPORT -DDOT11N_DRAFT3 -DSTATS_COUNT_SUPPORT -DOS_ABL_SUPPORT -DOS_ABL_FUNC_SUPPORT -DOS_ABL_OS_PCI_SUPPORT -DOS_ABL_OS_USB_SUPPORT -DOS_ABL_OS_AP_SUPPORT -DOS_ABL_OS_STA_SUPPORT -DEXPORT_SYMTAB -DMT7601U -DMT7601 -DRLT_MAC -DRLT_RF -DRTMP_MAC_USB -DRTMP_USB_SUPPORT -DRTMP_TIMER_TASK_SUPPORT -DRX_DMA_SCATTER -DVCORECAL_SUPPORT -DRTMP_EFUSE_SUPPORT -DNEW_MBSSID_MODE -DRTMP_INTERNAL_TX_ALC -DCONFIG_ANDES_SUPPORT -DDPD_CALIBRATION_SUPPORT -DCONFIG_RX_CSO_SUPPORT -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(rtusb_data)" -D"KBUILD_MODNAME=KBUILD_STR(mt7601Uap)" -c -o /home/pi/mt7601u/src/os/linux/../../common/.tmp_rtusb_data.o /home/pi/mt7601u/src/os/linux/../../common/rtusb_data.c 2 | 3 | source_/home/pi/mt7601u/src/os/linux/../../common/rtusb_data.o := /home/pi/mt7601u/src/os/linux/../../common/rtusb_data.c 4 | 5 | deps_/home/pi/mt7601u/src/os/linux/../../common/rtusb_data.o := \ 6 | 7 | /home/pi/mt7601u/src/os/linux/../../common/rtusb_data.o: $(deps_/home/pi/mt7601u/src/os/linux/../../common/rtusb_data.o) 8 | 9 | $(deps_/home/pi/mt7601u/src/os/linux/../../common/rtusb_data.o): 10 | -------------------------------------------------------------------------------- /src/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 | 33 | #ifdef RLT_MAC 34 | #include "mac_ral/nmac/ral_nmac_pbf.h" 35 | #endif /* RLT_MAC */ 36 | 37 | #ifdef RTMP_MAC 38 | #include "mac_ral/omac/ral_omac_pbf.h" 39 | #endif /* RTMP_MAC */ 40 | 41 | 42 | /* ================================================================================= */ 43 | /* Register format for PBF */ 44 | /* ================================================================================= */ 45 | 46 | 47 | #define WPDMA_GLO_CFG 0x208 48 | #ifdef RT_BIG_ENDIAN 49 | typedef union _WPDMA_GLO_CFG_STRUC { 50 | struct { 51 | UINT32 rx_2b_offset:1; 52 | UINT32 clk_gate_dis:1; 53 | UINT32 rsv:14; 54 | UINT32 HDR_SEG_LEN:8; 55 | UINT32 BigEndian:1; 56 | UINT32 EnTXWriteBackDDONE:1; 57 | UINT32 WPDMABurstSIZE:2; 58 | UINT32 RxDMABusy:1; 59 | UINT32 EnableRxDMA:1; 60 | UINT32 TxDMABusy:1; 61 | UINT32 EnableTxDMA:1; 62 | } field; 63 | UINT32 word; 64 | }WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC; 65 | #else 66 | typedef union _WPDMA_GLO_CFG_STRUC { 67 | struct { 68 | UINT32 EnableTxDMA:1; 69 | UINT32 TxDMABusy:1; 70 | UINT32 EnableRxDMA:1; 71 | UINT32 RxDMABusy:1; 72 | UINT32 WPDMABurstSIZE:2; 73 | UINT32 EnTXWriteBackDDONE:1; 74 | UINT32 BigEndian:1; 75 | UINT32 HDR_SEG_LEN:8; 76 | UINT32 rsv:14; 77 | UINT32 clk_gate_dis:1; 78 | UINT32 rx_2b_offset:1; 79 | } field; 80 | UINT32 word; 81 | } WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC; 82 | #endif 83 | 84 | 85 | #define PBF_CTRL 0x0410 86 | #define MCU_INT_STA 0x0414 87 | #define MCU_INT_ENA 0x0418 88 | #define TXRXQ_PCNT 0x0438 89 | #define PBF_DBG 0x043c 90 | 91 | 92 | #endif /* __PBF_H__ */ 93 | 94 | -------------------------------------------------------------------------------- /src/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 | 15 | /*Power saving */ 16 | #define PowerWakeCID 3 17 | #define CID0MASK 0x000000ff 18 | #define CID1MASK 0x0000ff00 19 | #define CID2MASK 0x00ff0000 20 | #define CID3MASK 0xff000000 21 | 22 | 23 | /* Flags for Bulkflags control for bulk out data */ 24 | /* */ 25 | #define fRTUSB_BULK_OUT_DATA_NULL 0x00000001 26 | #define fRTUSB_BULK_OUT_RTS 0x00000002 27 | #define fRTUSB_BULK_OUT_MLME 0x00000004 28 | 29 | #define fRTUSB_BULK_OUT_PSPOLL 0x00000010 30 | #define fRTUSB_BULK_OUT_DATA_FRAG 0x00000020 31 | #define fRTUSB_BULK_OUT_DATA_FRAG_2 0x00000040 32 | #define fRTUSB_BULK_OUT_DATA_FRAG_3 0x00000080 33 | #define fRTUSB_BULK_OUT_DATA_FRAG_4 0x00000100 34 | 35 | #define fRTUSB_BULK_OUT_DATA_NORMAL 0x00010000 36 | #define fRTUSB_BULK_OUT_DATA_NORMAL_2 0x00020000 37 | #define fRTUSB_BULK_OUT_DATA_NORMAL_3 0x00040000 38 | #define fRTUSB_BULK_OUT_DATA_NORMAL_4 0x00080000 39 | 40 | 41 | #define fRTUSB_BULK_OUT_DATA_HCCA 0x00100000 42 | #define fRTUSB_BULK_OUT_DATA_NULL_HCCA 0x00400000 43 | #define fRTUSB_BULK_OUT_MLME_HCCA 0x00800000 44 | 45 | 46 | 47 | /* TODO:move to ./ate/include/iface/ate_usb.h */ 48 | #ifdef RALINK_ATE 49 | #define fRTUSB_BULK_OUT_DATA_ATE 0x00100000 50 | #endif /* RALINK_ATE */ 51 | 52 | 53 | #define FREE_HTTX_RING(_pCookie, _pipeId, _txContext) \ 54 | { \ 55 | if ((_txContext)->ENextBulkOutPosition == (_txContext)->CurWritePosition) \ 56 | { \ 57 | (_txContext)->bRingEmpty = TRUE; \ 58 | } \ 59 | /*NdisInterlockedDecrement(&(_p)->TxCount); */\ 60 | } 61 | 62 | #define NT_SUCCESS(status) (((status) >=0) ? (TRUE):(FALSE)) 63 | 64 | 65 | 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 | 74 | /* vendor-specific control operations */ 75 | #define CONTROL_TIMEOUT_JIFFIES ( (300 * OS_HZ) / 1000) 76 | /*#define UNLINK_TIMEOUT_MS 3 // os abl move */ 77 | 78 | 79 | #define DEVICE_VENDOR_REQUEST_OUT 0x40 80 | #define DEVICE_VENDOR_REQUEST_IN 0xc0 81 | /*#define INTERFACE_VENDOR_REQUEST_OUT 0x41 */ 82 | /*#define INTERFACE_VENDOR_REQUEST_IN 0xc1 */ 83 | #define BULKOUT_MGMT_RESET_FLAG 0x80 84 | 85 | #define RTUSB_SET_BULK_FLAG(_M, _F) ((_M)->BulkFlags |= (_F)) 86 | #define RTUSB_CLEAR_BULK_FLAG(_M, _F) ((_M)->BulkFlags &= ~(_F)) 87 | #define RTUSB_TEST_BULK_FLAG(_M, _F) (((_M)->BulkFlags & (_F)) != 0) 88 | 89 | #endif /* __RTMP_USB_H__ */ 90 | -------------------------------------------------------------------------------- /src/rate_ctrl/.alg_ags.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.o := gcc -Wp,-MD,/home/pi/mt7601u/src/os/linux/../../rate_ctrl/.alg_ags.o.d -nostdinc -isystem /usr/lib/gcc/arm-linux-gnueabihf/4.9/include -I./arch/arm/include -Iarch/arm/include/generated/uapi -Iarch/arm/include/generated -Iinclude -I./arch/arm/include/uapi -Iarch/arm/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-bcm2709/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -fno-ipa-sra -mabi=aapcs-linux -mno-thumb-interwork -mfpu=vfp -funwind-tables -marm -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -fno-delete-null-pointer-checks -Wno-maybe-uninitialized -O2 --param=allow-store-data-races=0 -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -DCC_HAVE_ASM_GOTO -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs -DSYSTEM_LOG_SUPPORT -DRT28xx_MODE=AP -DCHIPSET=7601U -DRESOURCE_PRE_ALLOC -I/home/pi/mt7601u/src/include -DCONFIG_AP_SUPPORT -DUAPSD_SUPPORT -DMBSS_SUPPORT -DIAPP_SUPPORT -DDBG -DDOT1X_SUPPORT -DAP_SCAN_SUPPORT -DSCAN_SUPPORT -DHOSTAPD_SUPPORT -DRALINK_ATE -DCONFIG_RT2880_ATE_CMD_NEW -I/home/pi/mt7601u/src/ate/include -DRALINK_QA -DWSC_AP_SUPPORT -DWSC_V2_SUPPORT -DDOT11_N_SUPPORT -DDOT11N_DRAFT3 -DSTATS_COUNT_SUPPORT -DOS_ABL_SUPPORT -DOS_ABL_FUNC_SUPPORT -DOS_ABL_OS_PCI_SUPPORT -DOS_ABL_OS_USB_SUPPORT -DOS_ABL_OS_AP_SUPPORT -DOS_ABL_OS_STA_SUPPORT -DEXPORT_SYMTAB -DMT7601U -DMT7601 -DRLT_MAC -DRLT_RF -DRTMP_MAC_USB -DRTMP_USB_SUPPORT -DRTMP_TIMER_TASK_SUPPORT -DRX_DMA_SCATTER -DVCORECAL_SUPPORT -DRTMP_EFUSE_SUPPORT -DNEW_MBSSID_MODE -DRTMP_INTERNAL_TX_ALC -DCONFIG_ANDES_SUPPORT -DDPD_CALIBRATION_SUPPORT -DCONFIG_RX_CSO_SUPPORT -DMODULE -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(alg_ags)" -D"KBUILD_MODNAME=KBUILD_STR(mt7601Uap)" -c -o /home/pi/mt7601u/src/os/linux/../../rate_ctrl/.tmp_alg_ags.o /home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.c 2 | 3 | source_/home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.o := /home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.c 4 | 5 | deps_/home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.o := \ 6 | $(wildcard include/config/sta/support.h) \ 7 | $(wildcard include/config/ap/support.h) \ 8 | 9 | /home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.o: $(deps_/home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.o) 10 | 11 | $(deps_/home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.o): 12 | -------------------------------------------------------------------------------- /src/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 | 34 | /* ================================================================================= */ 35 | /* Register format for RFCTRL */ 36 | /* ================================================================================= */ 37 | 38 | #define OSC_CTRL 0x5a4 39 | #define PCIE_PHY_TX_ATTENUATION_CTRL 0x05C8 40 | #define INTERNAL_1 0x05C8 41 | 42 | #ifdef RT_BIG_ENDIAN 43 | typedef union _INTERNAL_1_STRUCT 44 | { 45 | struct 46 | { 47 | UINT32 Reserve1:10; 48 | UINT32 CSO_RX_IPV6_CHKSUM_EN:1; 49 | UINT32 CSO_TX_IPV6_CHKSUM_EN:1; 50 | UINT32 CSO_HW_PARSE_TCP:1; 51 | UINT32 CSO_HW_PARSE_IP:1; 52 | UINT32 CSO_RX_CHKSUM_EN:1; 53 | UINT32 CSO_TX_CHKSUM_EN:1; 54 | UINT32 CSO_TIMEOUT_VALUE:4; 55 | UINT32 PCIE_PHY_TX_ATTEN_EN:1; 56 | UINT32 PCIE_PHY_TX_ATTEN_VALUE:3; 57 | UINT32 Reserve2:7; 58 | UINT32 RF_ISOLATION_ENABLE:1; 59 | } field; 60 | 61 | UINT32 word; 62 | } INTERNAL_1_STRUCT, *PINTERNAL_1_STRUCT; 63 | #else 64 | typedef union _TX_ATTENUATION_CTRL_STRUC { 65 | struct 66 | { 67 | UINT32 RF_ISOLATION_ENABLE:1; 68 | UINT32 Reserve2:7; 69 | UINT32 PCIE_PHY_TX_ATTEN_VALUE:3; 70 | UINT32 PCIE_PHY_TX_ATTEN_EN:1; 71 | UINT32 CSO_TIMEOUT_VALUE:4; 72 | UINT32 CSO_TX_CHKSUM_EN:1; 73 | UINT32 CSO_RX_CHKSUM_EN:1; 74 | UINT32 CSO_HW_PARSE_IP:1; 75 | UINT32 CSO_HW_PARSE_TCP:1; 76 | UINT32 CSO_TX_IPV6_CHKSUM_EN:1; 77 | UINT32 CSO_RX_IPV6_CHKSUM_EN:1; 78 | UINT32 Reserve1:10; 79 | } field; 80 | 81 | UINT32 word; 82 | } INTERNAL_1_STRUCT, *PINTERNAL_1_STRUCT; 83 | #endif 84 | 85 | #define LDO_CFG0 0x05d4 86 | #define GPIO_SWITCH 0x05dc 87 | 88 | #define DEBUG_INDEX 0x05e8 89 | 90 | 91 | #endif /* __RAL_OMAC_RF_CTRL_H__ */ 92 | 93 | -------------------------------------------------------------------------------- /src/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( 50 | IN PRTMP_ADAPTER pAd, 51 | IN UCHAR Ch); 52 | 53 | ULONG JapRadarType( 54 | IN PRTMP_ADAPTER pAd); 55 | 56 | #ifdef CONFIG_AP_SUPPORT 57 | VOID ChannelSwitchingCountDownProc( 58 | IN PRTMP_ADAPTER pAd); 59 | #endif /* CONFIG_AP_SUPPORT */ 60 | 61 | VOID RadarDetectPeriodic( 62 | IN PRTMP_ADAPTER pAd); 63 | 64 | INT Set_CSPeriod_Proc( 65 | IN PRTMP_ADAPTER pAdapter, 66 | IN PSTRING arg); 67 | 68 | INT Set_ChMovingTime_Proc( 69 | IN PRTMP_ADAPTER pAd, 70 | IN PSTRING arg); 71 | 72 | INT Set_BlockChReset_Proc( 73 | IN PRTMP_ADAPTER pAd, 74 | IN PSTRING arg); 75 | 76 | #if defined(DFS_SUPPORT) || defined(CARRIER_DETECTION_SUPPORT) 77 | INT Set_RadarShow_Proc( 78 | IN PRTMP_ADAPTER pAd, 79 | IN PSTRING arg); 80 | 81 | VOID CckMrcStatusCtrl( 82 | IN PRTMP_ADAPTER pAd); 83 | 84 | VOID RadarGLRTCompensate( 85 | IN PRTMP_ADAPTER pAd); 86 | 87 | #endif /*defined(DFS_SUPPORT) || defined(CARRIER_DETECTION_SUPPORT)*/ 88 | 89 | #endif /* __RADAR_H__ */ 90 | -------------------------------------------------------------------------------- /src/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 | 75 | typedef struct GNU_PACKED _AC_PARAM_RECORD{ 76 | UINT8 aci_aifsn; 77 | UINT8 ecw_max:4; 78 | UINT8 ecw_min: 4; 79 | UINT16 txop_limit; 80 | }AC_PARAM_RECORD; 81 | 82 | 83 | typedef struct GNU_PACKED _PSPOLL_FRAME { 84 | FRAME_CONTROL FC; 85 | USHORT Aid; 86 | UCHAR Bssid[MAC_ADDR_LEN]; 87 | UCHAR Ta[MAC_ADDR_LEN]; 88 | } PSPOLL_FRAME, *PPSPOLL_FRAME; 89 | 90 | 91 | typedef struct GNU_PACKED _RTS_FRAME { 92 | FRAME_CONTROL FC; 93 | USHORT Duration; 94 | UCHAR Addr1[MAC_ADDR_LEN]; 95 | UCHAR Addr2[MAC_ADDR_LEN]; 96 | } RTS_FRAME, *PRTS_FRAME; 97 | 98 | #endif /* __DOT11_BASE_H__ */ 99 | -------------------------------------------------------------------------------- /src/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 | 30 | #define USB_DMA_CFG 0x02a0 31 | #ifdef RT_BIG_ENDIAN 32 | typedef union _USB_DMA_CFG_STRUC { 33 | struct { 34 | UINT32 TxBusy:1; /*USB DMA TX FSM busy. debug only */ 35 | UINT32 RxBusy:1; /*USB DMA RX FSM busy. debug only */ 36 | UINT32 EpoutValid:6; /*OUT endpoint data valid. debug only */ 37 | UINT32 TxBulkEn:1; /*Enable USB DMA Tx */ 38 | UINT32 RxBulkEn:1; /*Enable USB DMA Rx */ 39 | UINT32 RxBulkAggEn:1; /*Enable Rx Bulk Aggregation */ 40 | UINT32 TxopHalt:1; /*Halt TXOP count down when TX buffer is full. */ 41 | UINT32 TxClear:1; /*Clear USB DMA TX path */ 42 | UINT32 rsv:2; 43 | UINT32 phyclear:1; /*phy watch dog enable. write 1 */ 44 | UINT32 RxBulkAggLmt:8; /*Rx Bulk Aggregation Limit in unit of 1024 bytes */ 45 | UINT32 RxBulkAggTOut:8; /*Rx Bulk Aggregation TimeOut in unit of 33ns */ 46 | } field; 47 | UINT32 word; 48 | } USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC; 49 | #else 50 | typedef union _USB_DMA_CFG_STRUC { 51 | struct { 52 | UINT32 RxBulkAggTOut:8; /*Rx Bulk Aggregation TimeOut in unit of 33ns */ 53 | UINT32 RxBulkAggLmt:8; /*Rx Bulk Aggregation Limit in unit of 256 bytes */ 54 | UINT32 phyclear:1; /*phy watch dog enable. write 1 */ 55 | UINT32 rsv:2; 56 | UINT32 TxClear:1; /*Clear USB DMA TX path */ 57 | UINT32 TxopHalt:1; /*Halt TXOP count down when TX buffer is full. */ 58 | UINT32 RxBulkAggEn:1; /*Enable Rx Bulk Aggregation */ 59 | UINT32 RxBulkEn:1; /*Enable USB DMA Rx */ 60 | UINT32 TxBulkEn:1; /*Enable USB DMA Tx */ 61 | UINT32 EpoutValid:6; /*OUT endpoint data valid */ 62 | UINT32 RxBusy:1; /*USB DMA RX FSM busy */ 63 | UINT32 TxBusy:1; /*USB DMA TX FSM busy */ 64 | } field; 65 | UINT32 word; 66 | } USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC; 67 | #endif 68 | 69 | #endif /*__RAL_OMAC_USB_H__ */ 70 | 71 | -------------------------------------------------------------------------------- /src/os/linux/rtnet7601Uap.mod.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | MODULE_INFO(vermagic, VERMAGIC_STRING); 6 | 7 | __visible struct module __this_module 8 | __attribute__((section(".gnu.linkonce.this_module"))) = { 9 | .name = KBUILD_MODNAME, 10 | .init = init_module, 11 | #ifdef CONFIG_MODULE_UNLOAD 12 | .exit = cleanup_module, 13 | #endif 14 | .arch = MODULE_ARCH_INIT, 15 | }; 16 | 17 | static const struct modversion_info ____versions[] 18 | __used 19 | __attribute__((section("__versions"))) = { 20 | { 0xf51a0302, __VMLINUX_SYMBOL_STR(module_layout) }, 21 | { 0x2d3385d3, __VMLINUX_SYMBOL_STR(system_wq) }, 22 | { 0x61e836a8, __VMLINUX_SYMBOL_STR(RtmpDevPrivFlagsGet) }, 23 | { 0x2e5810c6, __VMLINUX_SYMBOL_STR(__aeabi_unwind_cpp_pr1) }, 24 | { 0xab7bc387, __VMLINUX_SYMBOL_STR(netif_carrier_on) }, 25 | { 0xf1883c08, __VMLINUX_SYMBOL_STR(RtmpOSNetDevFree) }, 26 | { 0x4c48d795, __VMLINUX_SYMBOL_STR(netif_carrier_off) }, 27 | { 0xc93c6831, __VMLINUX_SYMBOL_STR(RtmpOSNetDevDetach) }, 28 | { 0xb1ad28e0, __VMLINUX_SYMBOL_STR(__gnu_mcount_nc) }, 29 | { 0xf4fa543b, __VMLINUX_SYMBOL_STR(arm_copy_to_user) }, 30 | { 0x1700ab88, __VMLINUX_SYMBOL_STR(param_ops_charp) }, 31 | { 0xfa2a45e, __VMLINUX_SYMBOL_STR(__memzero) }, 32 | { 0x4c5ee785, __VMLINUX_SYMBOL_STR(RtmpOsSetNetDevPriv) }, 33 | { 0xd09cbdca, __VMLINUX_SYMBOL_STR(netif_tx_wake_queue) }, 34 | { 0xa4bc8397, __VMLINUX_SYMBOL_STR(usb_deregister) }, 35 | { 0x2a8ef6f7, __VMLINUX_SYMBOL_STR(Rtmp_Drv_Ops_usb) }, 36 | { 0x27e1a049, __VMLINUX_SYMBOL_STR(printk) }, 37 | { 0x71c90087, __VMLINUX_SYMBOL_STR(memcmp) }, 38 | { 0x8e865d3c, __VMLINUX_SYMBOL_STR(arm_delay_ops) }, 39 | { 0x28b897f8, __VMLINUX_SYMBOL_STR(RtmpOSNetDevAttach) }, 40 | { 0x42160169, __VMLINUX_SYMBOL_STR(flush_workqueue) }, 41 | { 0xc85e7638, __VMLINUX_SYMBOL_STR(module_put) }, 42 | { 0x9cd55864, __VMLINUX_SYMBOL_STR(os_free_mem) }, 43 | { 0xb7c027d4, __VMLINUX_SYMBOL_STR(usb_get_dev) }, 44 | { 0x62f2205a, __VMLINUX_SYMBOL_STR(usb_put_dev) }, 45 | { 0x9f901ef6, __VMLINUX_SYMBOL_STR(RtmpOsGetNetDevPriv) }, 46 | { 0x757d9021, __VMLINUX_SYMBOL_STR(RTDebugLevel) }, 47 | { 0x39f5da0f, __VMLINUX_SYMBOL_STR(RTDebugFunc) }, 48 | { 0x58963f53, __VMLINUX_SYMBOL_STR(usb_register_driver) }, 49 | { 0x20adc8cd, __VMLINUX_SYMBOL_STR(os_alloc_mem) }, 50 | { 0x676bbc0f, __VMLINUX_SYMBOL_STR(_set_bit) }, 51 | { 0x7b793024, __VMLINUX_SYMBOL_STR(RTMPFreeNdisPacket) }, 52 | { 0x49ebacbd, __VMLINUX_SYMBOL_STR(_clear_bit) }, 53 | { 0xd7945ba, __VMLINUX_SYMBOL_STR(try_module_get) }, 54 | }; 55 | 56 | static const char __module_depends[] 57 | __used 58 | __attribute__((section(".modinfo"))) = 59 | "depends=rtutil7601Uap,mt7601Uap"; 60 | 61 | MODULE_ALIAS("usb:v148Fp7650d*dc*dsc*dp*ic*isc*ip*in*"); 62 | MODULE_ALIAS("usb:v148Fp6370d*dc*dsc*dp*ic*isc*ip*in*"); 63 | MODULE_ALIAS("usb:v2955p1001d*dc*dsc*dp*ic*isc*ip*in*"); 64 | MODULE_ALIAS("usb:v148Fp7601d*dc*dsc*dp*ic*isc*ip*in*"); 65 | MODULE_ALIAS("usb:v148Fp760Bd*dc*dsc*dp*ic*isc*ip*in*"); 66 | MODULE_ALIAS("usb:v2717p4106d*dc*dsc*dp*ic*isc*ip*in*"); 67 | 68 | MODULE_INFO(srcversion, "5C72094716973CA9A8414C1"); 69 | -------------------------------------------------------------------------------- /src/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 = mtutil$(MODULE)ap 6 | endif 7 | #endif // CONFIG_AP_SUPPORT // 8 | 9 | #ifdef CONFIG_STA_SUPPORT 10 | ifeq ($(RT28xx_MODE), STA) 11 | MOD_NAME = mtutil$(MODULE)sta 12 | endif 13 | #endif // CONFIG_STA_SUPPORT // 14 | 15 | #ifdef CONFIG_APSTA_SUPPORT 16 | ifeq ($(RT28xx_MODE), APSTA) 17 | MOD_NAME = mtutil$(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 | mtutil$(MODULE)sta.o: $(RT28XX_STA_OBJ) 66 | $(LD) -r $^ -o $@ 67 | 68 | mtutil$(MODULE)ap.o: $(RT28XX_AP_OBJ) 69 | $(LD) -r $^ -o $@ 70 | 71 | mtutil$(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 | -------------------------------------------------------------------------------- /src/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 | 33 | /* Algorithm options */ 34 | #define SHA1_SUPPORT 35 | #define SHA256_SUPPORT 36 | 37 | #ifdef SHA1_SUPPORT 38 | #define SHA1_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ 39 | #define SHA1_DIGEST_SIZE 20 /* 160 bits = 20 bytes */ 40 | typedef struct _SHA1_CTX_STRUC { 41 | UINT32 HashValue[5]; /* 5 = (SHA1_DIGEST_SIZE / 32) */ 42 | UINT64 MessageLen; /* total size */ 43 | UINT8 Block[SHA1_BLOCK_SIZE]; 44 | UINT BlockLen; 45 | } SHA1_CTX_STRUC, *PSHA1_CTX_STRUC; 46 | 47 | VOID RT_SHA1_Init( 48 | IN SHA1_CTX_STRUC * pSHA_CTX); 49 | VOID RT_SHA1_Hash( 50 | IN SHA1_CTX_STRUC * pSHA_CTX); 51 | VOID RT_SHA1_Append( 52 | IN SHA1_CTX_STRUC * pSHA_CTX, 53 | IN const UINT8 Message[], 54 | IN UINT MessageLen); 55 | VOID RT_SHA1_End( 56 | IN SHA1_CTX_STRUC * pSHA_CTX, 57 | OUT UINT8 DigestMessage[]); 58 | VOID RT_SHA1( 59 | IN const UINT8 Message[], 60 | IN UINT MessageLen, 61 | OUT UINT8 DigestMessage[]); 62 | #endif /* SHA1_SUPPORT */ 63 | 64 | #ifdef SHA256_SUPPORT 65 | #define SHA256_BLOCK_SIZE 64 /* 512 bits = 64 bytes */ 66 | #define SHA256_DIGEST_SIZE 32 /* 256 bits = 32 bytes */ 67 | typedef struct _SHA256_CTX_STRUC { 68 | UINT32 HashValue[8]; /* 8 = (SHA256_DIGEST_SIZE / 32) */ 69 | UINT64 MessageLen; /* total size */ 70 | UINT8 Block[SHA256_BLOCK_SIZE]; 71 | UINT BlockLen; 72 | } SHA256_CTX_STRUC, *PSHA256_CTX_STRUC; 73 | 74 | VOID RT_SHA256_Init( 75 | IN SHA256_CTX_STRUC * pSHA_CTX); 76 | VOID RT_SHA256_Hash( 77 | IN SHA256_CTX_STRUC * pSHA_CTX); 78 | VOID RT_SHA256_Append( 79 | IN SHA256_CTX_STRUC * pSHA_CTX, 80 | IN const UINT8 Message[], 81 | IN UINT MessageLen); 82 | VOID RT_SHA256_End( 83 | IN SHA256_CTX_STRUC * pSHA_CTX, 84 | OUT UINT8 DigestMessage[]); 85 | VOID RT_SHA256( 86 | IN const UINT8 Message[], 87 | IN UINT MessageLen, 88 | OUT UINT8 DigestMessage[]); 89 | #endif /* SHA256_SUPPORT */ 90 | 91 | 92 | #endif /* __CRYPT_SHA2_H__ */ 93 | -------------------------------------------------------------------------------- /src/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 | 96 | #define RxWIMPDUByteCnt RXWI_N.MPDUtotalByteCnt 97 | #define RxWIWirelessCliID RXWI_N.wcid 98 | #define RxWIKeyIndex RXWI_N.key_idx 99 | #define RxWIMCS RXWI_N.mcs 100 | #define RxWIBW RXWI_N.bw 101 | #define RxWIBSSID RXWI_N.bss_idx 102 | #define RxWISGI RXWI_N.sgi 103 | #define RxWIPhyMode RXWI_N.phy_mode 104 | #define RxWISTBC RXWI_N.stbc 105 | #define RxWITID RXWI_N.tid 106 | #define RxWIRSSI0 RXWI_N.rssi[0] 107 | #define RxWIRSSI1 RXWI_N.rssi[1] 108 | #define RxWIRSSI2 RXWI_N.rssi[2] 109 | #define RxWISNR0 RXWI_N.bbp_rxinfo[0] 110 | #define RxWISNR1 RXWI_N.bbp_rxinfo[1] 111 | #define RxWISNR2 RXWI_N.bbp_rxinfo[2] 112 | #define RxWIFOFFSET RXWI_N.bbp_rxinfo[3] 113 | 114 | 115 | 116 | #endif /* __RAL_NMAC_RXWI_H__ */ 117 | 118 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | 27 | extern UCHAR AGS1x1HTRateTable[]; 28 | extern UCHAR AGS2x2HTRateTable[]; 29 | extern UCHAR AGS3x3HTRateTable[]; 30 | #ifdef DOT11_VHT_AC 31 | extern UCHAR Ags1x1VhtRateTable[]; 32 | extern UCHAR Ags2x2VhtRateTable[]; 33 | #endif /* DOT11_VHT_AC */ 34 | 35 | #define AGS_TX_QUALITY_WORST_BOUND 8 36 | #define AGS_QUICK_RA_TIME_INTERVAL 50 /* 50ms */ 37 | 38 | /* The size, in bytes, of an AGS entry in the rate switch table */ 39 | #define SIZE_OF_AGS_RATE_TABLE_ENTRY 9 40 | 41 | typedef struct _RTMP_RA_AGS_TB { 42 | UCHAR ItemNo; 43 | 44 | UCHAR STBC:1; 45 | UCHAR ShortGI:1; 46 | UCHAR BW:2; 47 | UCHAR Mode:3; 48 | UCHAR Rsv1:1; 49 | 50 | UCHAR Nss:2; // NSS_XXX (VHT only) 51 | UCHAR rsv2:6; // Reserved 52 | 53 | UCHAR CurrMCS; 54 | UCHAR TrainUp; 55 | UCHAR TrainDown; 56 | UCHAR downMcs; 57 | UCHAR upMcs3; 58 | UCHAR upMcs2; 59 | UCHAR upMcs1; 60 | }RTMP_RA_AGS_TB; 61 | 62 | 63 | /* AGS control */ 64 | typedef struct _AGS_CONTROL { 65 | UCHAR MCSGroup; /* The MCS group under testing */ 66 | UCHAR lastRateIdx; 67 | } AGS_CONTROL,*PAGS_CONTROL; 68 | 69 | 70 | /* The statistics information for AGS */ 71 | typedef struct _AGS_STATISTICS_INFO { 72 | CHAR RSSI; 73 | ULONG TxErrorRatio; 74 | ULONG AccuTxTotalCnt; 75 | ULONG TxTotalCnt; 76 | ULONG TxSuccess; 77 | ULONG TxRetransmit; 78 | ULONG TxFailCount; 79 | } AGS_STATISTICS_INFO, *PAGS_STATISTICS_INFO; 80 | 81 | 82 | /* Support AGS (Adaptive Group Switching) */ 83 | #define SUPPORT_AGS(__pAd) ((__pAd)->rateAlg == RATE_ALG_AGS) 84 | 85 | #ifdef DOT11_VHT_AC 86 | #define AGS_IS_USING(__pAd, __pRateTable) \ 87 | (SUPPORT_AGS(__pAd) && \ 88 | ((__pRateTable == AGS1x1HTRateTable) ||\ 89 | (__pRateTable == AGS2x2HTRateTable) ||\ 90 | (__pRateTable == AGS3x3HTRateTable) ||\ 91 | (__pRateTable == Ags1x1VhtRateTable) ||\ 92 | (__pRateTable == Ags2x2VhtRateTable))) 93 | #else 94 | #define AGS_IS_USING(__pAd, __pRateTable) \ 95 | (SUPPORT_AGS(__pAd) && \ 96 | ((__pRateTable == AGS1x1HTRateTable) || \ 97 | (__pRateTable == AGS2x2HTRateTable) || \ 98 | (__pRateTable == AGS3x3HTRateTable))) 99 | #endif /* DOT11_VHT_AC */ 100 | 101 | #endif /* __AGS_H__ */ 102 | 103 | -------------------------------------------------------------------------------- /src/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 | 81 | -------------------------------------------------------------------------------- /src/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 | 45 | #define NIC3290_PCIe_DEVICE_ID 0x3290 46 | 47 | 48 | #define RT3290_CHECK_SW_EEP_BUSY(pAd) \ 49 | { \ 50 | UINT32 _val, _cnt = 0; \ 51 | do { \ 52 | RTMP_IO_FORCE_READ32(pAd, WLAN_FUN_INFO, &_val); \ 53 | if ((_val & 0x80000000) == 0 || (_val == 0xffffffff)) \ 54 | break; \ 55 | _cnt++; \ 56 | DBGPRINT_ERR(("RT3290: EEP is busy!!!! BusyCnt%d : fail\n", _cnt)); \ 57 | RTMPusecDelay(500); \ 58 | } while (_cnt<300); \ 59 | } \ 60 | 61 | #define RT3290_CURRENT_LEAKAGE(_pAd,_A,_e) \ 62 | { \ 63 | if (IS_RT3290(_pAd)) \ 64 | { \ 65 | UINT32 btFunInfo, _val = 0; \ 66 | RTMP_IO_FORCE_READ32(_pAd, _A, &_val); \ 67 | if (_e) \ 68 | _val &= ~(EESK|EEDI); \ 69 | else \ 70 | { \ 71 | _val &= ~(EESK); \ 72 | _val |= EEDI; \ 73 | } \ 74 | RT3290_CHECK_SW_EEP_BUSY(_pAd); \ 75 | RTMP_IO_FORCE_READ32(_pAd, BT_FUN_INFO, &btFunInfo); \ 76 | btFunInfo |= 0x80000000; \ 77 | RTMP_IO_FORCE_WRITE32(_pAd, BT_FUN_INFO, btFunInfo); \ 78 | \ 79 | RTMP_IO_FORCE_WRITE32(_pAd, _A, _V); \ 80 | \ 81 | btFunInfo &= ~(0x80000000); \ 82 | RTMP_IO_FORCE_WRITE32(_pAd, BT_FUN_INFO, btFunInfo); \ 83 | } \ 84 | } 85 | 86 | 87 | VOID MlmeAntSelection( 88 | IN struct _RTMP_ADAPTER *pAd, 89 | IN ULONG AccuTxTotalCnt, 90 | IN ULONG TxErrorRatio, 91 | IN ULONG TxSuccess, 92 | IN CHAR Rssi); 93 | 94 | INT RT3290_eeprom_access_grant( 95 | IN struct _RTMP_ADAPTER *pAd, 96 | IN BOOLEAN bGetCtrl); 97 | 98 | VOID RTMP_MAC_PWRSV_EN( 99 | IN struct _RTMP_ADAPTER *pAd, 100 | IN BOOLEAN EnterIdle, 101 | IN BOOLEAN use40M); 102 | 103 | VOID RTMPEnableWlan( 104 | IN struct _RTMP_ADAPTER *pAd, 105 | IN BOOLEAN bOn, 106 | IN BOOLEAN bResetWLAN); 107 | 108 | VOID RT3290_Init( 109 | IN struct _RTMP_ADAPTER *pAd); 110 | 111 | #endif /* RT3290 */ 112 | 113 | #endif /* __RT5390_H__ */ 114 | 115 | -------------------------------------------------------------------------------- /src/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 | 29 | #ifndef __DOT11R_FT_H 30 | #define __DOT11R_FT_H 31 | 32 | #include "rtmp_type.h" 33 | 34 | 35 | 36 | #if defined(DOT11R_FT_SUPPORT) || defined(DOT11Z_TDLS_SUPPORT) 37 | #define FT_MIC_LEN 16 38 | #define FT_NONCE_LEN 32 39 | #endif 40 | 41 | 42 | #if defined(DOT11R_FT_SUPPORT) || defined(DOT11Z_TDLS_SUPPORT) 43 | /* Information element ID defined in 802.11rD9.0 specification. */ 44 | #define IE_FT_MDIE 54 45 | #define IE_FT_FTIE 55 46 | #define IE_FT_TIMEOUT_INTERVAL 56 47 | #define IE_FT_RIC_DATA 57 48 | #define IE_FT_RIC_DESCRIPTOR 75 49 | 50 | 51 | /* RIC Type */ 52 | #define FT_RIC_TYPE_BA 1 53 | 54 | /* AKM SUITE */ 55 | #define FT_AKM_SUITE_1X 3 56 | #define FT_AKM_SUITE_PSK 4 57 | #endif 58 | 59 | 60 | #if defined(DOT11R_FT_SUPPORT) || defined(DOT11Z_TDLS_SUPPORT) 61 | typedef union GNU_PACKED _FT_MIC_CTR_FIELD 62 | { 63 | /* 64 | IECnt: contains the number of IEs 65 | that are included int eht MIC calculation. 66 | */ 67 | struct GNU_PACKED 68 | { 69 | #ifdef RT_BIG_ENDIAN 70 | UINT16 IECnt:8; 71 | UINT16 :8; 72 | #else 73 | UINT16 :8; 74 | UINT16 IECnt:8; 75 | #endif 76 | } field; 77 | UINT16 word; 78 | } FT_MIC_CTR_FIELD, *PFT_MIC_CTR_FIELD; 79 | 80 | /* 81 | ** FTIE: Fast Transition IE. 82 | */ 83 | typedef struct GNU_PACKED _FT_FTIE 84 | { 85 | FT_MIC_CTR_FIELD MICCtr; /* 2 Octects. */ 86 | UINT8 MIC[FT_MIC_LEN]; /* 16 Octects. */ 87 | UINT8 ANonce[FT_NONCE_LEN]; /* 32 Octects. */ 88 | UINT8 SNonce[FT_NONCE_LEN]; /* 32 Octects. */ 89 | UINT8 Option[0]; /* 1:R1KHID, 2:GTK, 3:ROKHId, else:Res */ 90 | } FT_FTIE, *PFT_FTIE; 91 | #endif 92 | 93 | 94 | #if defined(DOT11R_FT_SUPPORT) || defined(DOT11Z_TDLS_SUPPORT) 95 | /* 96 | ** Timeout Interval IE. 97 | */ 98 | typedef enum _FT_TIMEOUT_INTERVAL_TYPE 99 | { 100 | REASSOC_DEADLINE_INTERVAL = 1, /* TUs */ 101 | KEY_LIFETIME_INTERVAL, /* seconds. */ 102 | RESERVED_INTERVAL 103 | } FT_TIMEOUT_INTERVAL_TYPE, *PFT_TIMEOUT_INTERVAL_TYPE; 104 | 105 | typedef struct GNU_PACKED _FT_TIMEOUT_INTERVAL_IE 106 | { 107 | UINT8 TimeoutIntervalType; 108 | UINT32 TimeoutIntervalValue; 109 | } FT_TIMEOUT_INTERVAL_IE, *PFT_TIMEOUT_INTERVAL_IE; 110 | #endif 111 | 112 | 113 | #endif /* __DOT11R_FT_H */ 114 | 115 | -------------------------------------------------------------------------------- /src/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 | 33 | #include "rtmp_type.h" 34 | 35 | /* ================================================================================= */ 36 | /* Register format for PBF */ 37 | /* ================================================================================= */ 38 | 39 | 40 | /* Most are for debug. Driver doesn't touch PBF register. */ 41 | #define PBF_SYS_CTRL 0x0400 42 | 43 | #ifdef RT_BIG_ENDIAN 44 | typedef union _PBF_SYS_CTRL_STRUC { 45 | struct { 46 | UINT32 Reserved5:12; /* Reserved */ 47 | UINT32 SHR_MSEL:1; /* Shared memory access selection */ 48 | UINT32 PBF_MSEL:2; /* Packet buffer memory access selection */ 49 | UINT32 HST_PM_SEL:1; /* The write selection of the host program RAM */ 50 | UINT32 Reserved4:1; /* Reserved */ 51 | UINT32 CAP_MODE:1; /* Packet buffer capture mode */ 52 | UINT32 Reserved3:1; /* Reserved */ 53 | UINT32 CLK_SEL:1; /* MAC/PBF clock source selection */ 54 | UINT32 PBF_CLK_EN:1; /* PBF clock enable */ 55 | UINT32 MAC_CLK_EN:1; /* MAC clock enable */ 56 | UINT32 DMA_CLK_EN:1; /* DMA clock enable */ 57 | UINT32 Reserved2:1; /* Reserved */ 58 | UINT32 MCU_READY:1; /* MCU ready */ 59 | UINT32 Reserved1:2; /* Reserved */ 60 | UINT32 ASY_RESET:1; /* ASYNC interface reset */ 61 | UINT32 PBF_RESET:1; /* PBF hardware reset */ 62 | UINT32 MAC_RESET:1; /* MAC hardware reset */ 63 | UINT32 DMA_RESET:1; /* DMA hardware reset */ 64 | UINT32 MCU_RESET:1; /* MCU hardware reset */ 65 | } field; 66 | UINT32 word; 67 | } PBF_SYS_CTRL_STRUC; 68 | #else 69 | typedef union _PBF_SYS_CTRL_STRUC { 70 | struct { 71 | UINT32 MCU_RESET:1; 72 | UINT32 DMA_RESET:1; 73 | UINT32 MAC_RESET:1; 74 | UINT32 PBF_RESET:1; 75 | UINT32 ASY_RESET:1; 76 | UINT32 Reserved1:2; 77 | UINT32 MCU_READY:1; 78 | UINT32 Reserved2:1; 79 | UINT32 DMA_CLK_EN:1; 80 | UINT32 MAC_CLK_EN:1; 81 | UINT32 PBF_CLK_EN:1; 82 | UINT32 CLK_SEL:1; 83 | UINT32 Reserved3:1; 84 | UINT32 CAP_MODE:1; 85 | UINT32 Reserved4:1; 86 | UINT32 HST_PM_SEL:1; 87 | UINT32 PBF_MSEL:2; 88 | UINT32 SHR_MSEL:1; 89 | UINT32 Reserved5:12; 90 | }field; 91 | UINT32 word; 92 | } PBF_SYS_CTRL_STRUC; 93 | #endif 94 | 95 | 96 | #define PBF_CFG 0x0408 97 | #define PBF_MAX_PCNT 0x040C 98 | #define PBF_CAP_CTRL 0x0440 99 | 100 | #define BCN_OFFSET0 0x042C 101 | #define BCN_OFFSET1 0x0430 102 | 103 | #endif /* __RAL_OMAC_PBF_H__ */ 104 | 105 | -------------------------------------------------------------------------------- /src/os/linux/Makefile: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | { 36 | BOOLEAN bEnableFrequencyCalibration; /* Enable the frequency calibration algorithm */ 37 | 38 | BOOLEAN bSkipFirstFrequencyCalibration; /* Avoid calibrating frequency at the time the STA is just link-up */ 39 | BOOLEAN bApproachFrequency; /* Approach the frequency */ 40 | UCHAR AdaptiveFreqOffset; /* Adaptive frequency offset */ 41 | CHAR LatestFreqOffsetOverBeacon; /* Latest frequency offset from the beacon */ 42 | CHAR BeaconPhyMode; /* Latest frequency offset from the beacon */ 43 | 44 | } FREQUENCY_CALIBRATION_CONTROL, *PFREQUENCY_CALIBRATION_CONTROL; 45 | 46 | #define RTMP_FREQ_CAL_DISABLE(__pAd) \ 47 | __pAd->FreqCalibrationCtrl.bEnableFrequencyCalibration = FALSE; 48 | 49 | /* */ 50 | /* Invalid frequency offset */ 51 | /* */ 52 | #define INVALID_FREQUENCY_OFFSET -128 53 | 54 | /* */ 55 | /* The upperbound/lowerbound of the frequency offset */ 56 | /* */ 57 | #define UPPERBOUND_OF_FREQUENCY_OFFSET 127 58 | #define LOWERBOUND_OF_FREQUENCY_OFFSET -127 59 | 60 | 61 | /*#ifdef RT5390 */ 62 | /* */ 63 | /* The trigger point of the high/low frequency */ 64 | /* */ 65 | #define HIGH_FREQUENCY_TRIGGER_POINT_OFDM 20 66 | #define LOW_FREQUENCY_TRIGGER_POINT_OFDM -20 67 | #define HIGH_FREQUENCY_TRIGGER_POINT_CCK 4 68 | #define LOW_FREQUENCY_TRIGGER_POINT_CCK -4 69 | 70 | #ifdef MT7601 71 | #define MT7601_HIGH_FREQUENCY_TRIGGER_POINT_CCK 19 72 | #define MT7601_LOW_FREQUENCY_TRIGGER_POINT_CCK -19 73 | #define MT7601_DECREASE_FREQUENCY_OFFSET_CCK 5 74 | #define MT7601_INCREASE_FREQUENCY_OFFSET_CCK -5 75 | 76 | #define MT7601_HIGH_FREQUENCY_TRIGGER_POINT_OFDM20 102 77 | #define MT7601_LOW_FREQUENCY_TRIGGER_POINT_OFDM20 -102 78 | #define MT7601_DECREASE_FREQUENCY_OFFSET_OFDM20 32 79 | #define MT7601_INCREASE_FREQUENCY_OFFSET_OFDM20 -32 80 | 81 | #define MT7601_HIGH_FREQUENCY_TRIGGER_POINT_OFDM40 82 82 | #define MT7601_LOW_FREQUENCY_TRIGGER_POINT_OFDM40 -82 83 | #define MT7601_DECREASE_FREQUENCY_OFFSET_OFDM40 20 84 | #define MT7601_INCREASE_FREQUENCY_OFFSET_OFDM40 -20 85 | #endif /* MT7601 */ 86 | 87 | /* */ 88 | /* The trigger point of decreasng/increasing the frequency offset */ 89 | /* */ 90 | #define DECREASE_FREQUENCY_OFFSET_OFDM 10 91 | #define INCREASE_FREQUENCY_OFFSET_OFDM -10 92 | #define DECREASE_FREQUENCY_OFFSET_CCK 2 93 | #define INCREASE_FREQUENCY_OFFSET_CCK -2 94 | /*#endif // RT5390 */ 95 | /* */ 96 | /* The trigger point of decreasng/increasing the frequency offset */ 97 | /* */ 98 | #define DECREASE_FREQUENCY_OFFSET 3 99 | #define INCREASE_FREQUENCY_OFFSET -3 100 | 101 | /* */ 102 | /* Frequency calibration period */ 103 | /* */ 104 | 105 | #define FREQUENCY_CALIBRATION_PERIOD 100 106 | 107 | #endif /* __FRQCAL_H__ */ 108 | -------------------------------------------------------------------------------- /src/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( 10 | IN PRTMP_ADAPTER pAd) 11 | { 12 | int i; 13 | 14 | initList(&freeNetIfEntryList); 15 | for (i = 0; i < FREE_NETIF_POOL_SIZE; i++) 16 | insertTailList(&freeNetIfEntryList, (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( 25 | IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry, 26 | IN PNET_DEV pNetDev) 27 | { 28 | PNETIF_ENTRY pNetIfEntry = NULL; 29 | 30 | if ((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(&freeNetIfEntryList)) != NULL) 31 | { 32 | RTMP_OS_NETDEV_STOP_QUEUE(pNetDev); 33 | pNetIfEntry->pNetDev = pNetDev; 34 | insertTailList(&pBlockQueueEntry->NetIfList, (PLIST_ENTRY)pNetIfEntry); 35 | 36 | pBlockQueueEntry->SwTxQueueBlockFlag = TRUE; 37 | DBGPRINT(RT_DEBUG_TRACE, ("RTMP_OS_NETDEV_STOP_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); 38 | } 39 | else 40 | return FALSE; 41 | 42 | return TRUE; 43 | } 44 | 45 | VOID releaseNetIf( 46 | IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry) 47 | { 48 | PNETIF_ENTRY pNetIfEntry = NULL; 49 | PLIST_HEADER pNetIfList = &pBlockQueueEntry->NetIfList; 50 | 51 | while((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(pNetIfList)) != NULL) 52 | { 53 | PNET_DEV pNetDev = pNetIfEntry->pNetDev; 54 | RTMP_OS_NETDEV_WAKE_QUEUE(pNetDev); 55 | insertTailList(&freeNetIfEntryList, (PLIST_ENTRY)pNetIfEntry); 56 | 57 | DBGPRINT(RT_DEBUG_TRACE, ("RTMP_OS_NETDEV_WAKE_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev))); 58 | } 59 | pBlockQueueEntry->SwTxQueueBlockFlag = FALSE; 60 | return; 61 | } 62 | 63 | 64 | VOID StopNetIfQueue( 65 | IN PRTMP_ADAPTER pAd, 66 | IN UCHAR QueIdx, 67 | IN PNDIS_PACKET pPacket) 68 | { 69 | PNET_DEV NetDev = NULL; 70 | UCHAR IfIdx = 0; 71 | BOOLEAN valid = FALSE; 72 | 73 | 74 | #ifdef P2P_SUPPORT 75 | if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= MIN_NET_DEVICE_FOR_P2P_GO) 76 | { 77 | IfIdx = (RTMP_GET_PACKET_NET_DEVICE(pPacket) - MIN_NET_DEVICE_FOR_P2P_GO) % MAX_P2P_NUM; 78 | NetDev = pAd->ApCfg.MBSSID[IfIdx].MSSIDDev; 79 | } 80 | else 81 | #endif /* P2P_SUPPORT */ 82 | #ifdef APCLI_SUPPORT 83 | if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= MIN_NET_DEVICE_FOR_APCLI) 84 | { 85 | IfIdx = (RTMP_GET_PACKET_NET_DEVICE(pPacket) - MIN_NET_DEVICE_FOR_APCLI) % MAX_APCLI_NUM; 86 | NetDev = pAd->ApCfg.ApCliTab[IfIdx].dev; 87 | } 88 | else 89 | #endif /* APCLI_SUPPORT */ 90 | { 91 | #ifdef MBSS_SUPPORT 92 | if (pAd->OpMode == OPMODE_AP) 93 | { 94 | IfIdx = (RTMP_GET_PACKET_NET_DEVICE(pPacket) - MIN_NET_DEVICE_FOR_MBSSID) % MAX_MBSSID_NUM(pAd); 95 | NetDev = pAd->ApCfg.MBSSID[IfIdx].MSSIDDev; 96 | } 97 | else 98 | { 99 | IfIdx = MAIN_MBSSID; 100 | NetDev = pAd->net_dev; 101 | } 102 | #else 103 | IfIdx = MAIN_MBSSID; 104 | NetDev = pAd->net_dev; 105 | #endif 106 | } 107 | 108 | /* WMM support 4 software queues.*/ 109 | /* One software queue full doesn't mean device have no capbility to transmit packet.*/ 110 | /* So disable block Net-If queue function while WMM enable.*/ 111 | #ifdef CONFIG_AP_SUPPORT 112 | IF_DEV_CONFIG_OPMODE_ON_AP(pAd) 113 | valid = (pAd->ApCfg.MBSSID[IfIdx].bWmmCapable == TRUE) ? FALSE : TRUE; 114 | #endif /* CONFIG_AP_SUPPORT */ 115 | #ifdef CONFIG_STA_SUPPORT 116 | { 117 | #ifdef P2P_SUPPORT 118 | if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= MIN_NET_DEVICE_FOR_P2P_GO) 119 | valid = (pAd->ApCfg.MBSSID[IfIdx].bWmmCapable == TRUE) ? FALSE : TRUE; 120 | else 121 | #endif /* P2P_SUPPORT */ 122 | IF_DEV_CONFIG_OPMODE_ON_STA(pAd) 123 | valid = (pAd->CommonCfg.bWmmCapable == TRUE) ? FALSE : TRUE; 124 | } 125 | #endif /* CONFIG_STA_SUPPORT */ 126 | 127 | if (valid) 128 | blockNetIf(&pAd->blockQueueTab[QueIdx], NetDev); 129 | return; 130 | } 131 | 132 | #endif /* BLOCK_NET_IF */ 133 | -------------------------------------------------------------------------------- /src/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 | 32 | /* BigInteger definition & structure */ 33 | #define SLIDING_WINDOW 16 34 | typedef struct _BIG_INTEGER_STRUC 35 | { 36 | STRING Name[10]; 37 | UINT32 *pIntegerArray; 38 | UINT AllocSize; 39 | UINT ArrayLength; 40 | UINT IntegerLength; 41 | INT Signed; 42 | } BIG_INTEGER, *PBIG_INTEGER; 43 | 44 | 45 | /* BigInteger operations */ 46 | VOID BigInteger_Print ( 47 | IN PBIG_INTEGER pBI); 48 | 49 | VOID BigInteger_Init ( 50 | INOUT PBIG_INTEGER *pBI); 51 | 52 | VOID BigInteger_Free_AllocSize ( 53 | IN PBIG_INTEGER *pBI); 54 | 55 | VOID BigInteger_Free ( 56 | IN PBIG_INTEGER *pBI); 57 | 58 | VOID BigInteger_AllocSize ( 59 | IN PBIG_INTEGER *pBI, 60 | IN INT Length); 61 | 62 | VOID BigInteger_ClearHighBits ( 63 | IN PBIG_INTEGER pBI); 64 | 65 | VOID BigInteger_BI2Bin ( 66 | IN PBIG_INTEGER pBI, 67 | OUT UINT8 *pValue, 68 | OUT UINT *Length); 69 | 70 | VOID BigInteger_Bin2BI ( 71 | IN UINT8 *pValue, 72 | IN UINT Length, 73 | OUT PBIG_INTEGER *pBI); 74 | 75 | VOID BigInteger_BitsOfBI ( 76 | IN PBIG_INTEGER pBI, 77 | OUT UINT *Bits_Of_P); 78 | 79 | INT BigInteger_GetBitValue ( 80 | IN PBIG_INTEGER pBI, 81 | IN UINT Index); 82 | 83 | UINT8 BigInteger_GetByteValue ( 84 | IN PBIG_INTEGER pBI, 85 | IN UINT Index); 86 | 87 | VOID BigInteger_Copy ( 88 | IN PBIG_INTEGER pBI_Copied, 89 | OUT PBIG_INTEGER *pBI_Result); 90 | 91 | INT BigInteger_UnsignedCompare ( 92 | IN PBIG_INTEGER pFirstOperand, 93 | IN PBIG_INTEGER pSecondOperand); 94 | 95 | VOID BigInteger_Add ( 96 | IN PBIG_INTEGER pFirstOperand, 97 | IN PBIG_INTEGER pSecondOperand, 98 | OUT PBIG_INTEGER *pBI_Result); 99 | 100 | VOID BigInteger_Sub ( 101 | IN PBIG_INTEGER pFirstOperand, 102 | IN PBIG_INTEGER pSecondOperand, 103 | OUT PBIG_INTEGER *pBI_Result); 104 | 105 | VOID BigInteger_Mul ( 106 | IN PBIG_INTEGER pFirstOperand, 107 | IN PBIG_INTEGER pSecondOperand, 108 | OUT PBIG_INTEGER *pBI_Result); 109 | 110 | VOID BigInteger_Square ( 111 | IN PBIG_INTEGER pBI, 112 | OUT PBIG_INTEGER *pBI_Result); 113 | 114 | VOID BigInteger_Div ( 115 | IN PBIG_INTEGER pFirstOperand, 116 | IN PBIG_INTEGER pSecondOperand, 117 | OUT PBIG_INTEGER *pBI_Result, 118 | OUT PBIG_INTEGER *pBI_Remainder); 119 | 120 | VOID BigInteger_Montgomery_Reduction ( 121 | IN PBIG_INTEGER pBI_A, 122 | IN PBIG_INTEGER pBI_P, 123 | IN PBIG_INTEGER pBI_R, 124 | OUT PBIG_INTEGER *pBI_Result); 125 | 126 | VOID BigInteger_Montgomery_ExpMod ( 127 | IN PBIG_INTEGER pBI_G, 128 | IN PBIG_INTEGER pBI_E, 129 | IN PBIG_INTEGER pBI_P, 130 | OUT PBIG_INTEGER *pBI_Result); 131 | 132 | 133 | #endif /* __CRYPT_BIGINTEGER_H__ */ 134 | 135 | -------------------------------------------------------------------------------- /src/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 = mtnet$(MODULE)ap 6 | endif 7 | #endif // CONFIG_AP_SUPPORT // 8 | 9 | #ifdef CONFIG_STA_SUPPORT 10 | ifeq ($(RT28xx_MODE), STA) 11 | MOD_NAME = mtnet$(MODULE)sta 12 | endif 13 | #endif // CONFIG_STA_SUPPORT // 14 | 15 | #ifdef CONFIG_APSTA_SUPPORT 16 | ifeq ($(RT28xx_MODE), APSTA) 17 | MOD_NAME = mtnet$(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 | #ifdef MT7601 81 | ifneq ($(findstring 7601,$(CHIPSET)),) 82 | RT28XX_STA_OBJ += \ 83 | ../../common/rtusb_dev_id.o\ 84 | ../../os/linux/usb_main_dev.o 85 | endif 86 | #endif // MT7601 // 87 | 88 | 89 | 90 | 91 | 92 | #endif // CONFIG_STA_SUPPORT // 93 | 94 | #ifdef CONFIG_APSTA_SUPPORT 95 | RT28XX_APSTA_OBJ := \ 96 | ../../ap/ap_mbss_inf.o\ 97 | ../../common/p2p_inf.o\ 98 | ../../os/linux/ap_ioctl.o\ 99 | ../../os/linux/sta_ioctl.o\ 100 | ../../os/linux/rt_main_dev.o 101 | 102 | ifeq ($(HAS_WDS),y) 103 | RT28XX_APSTA_OBJ += \ 104 | ../../ap/ap_wds_inf.o 105 | endif 106 | 107 | ifeq ($(HAS_APCLI),y) 108 | RT28XX_APSTA_OBJ += \ 109 | ../../ap/ap_apcli_inf.o 110 | endif 111 | 112 | ifeq ($(HAS_MESH_SUPPORT),y) 113 | RT28XX_APSTA_OBJ += \ 114 | ../../common/mesh_inf.o 115 | endif 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | #endif // CONFIG_APSTA_SUPPORT // 130 | 131 | 132 | PHONY := all clean 133 | 134 | all:$(OBJ) 135 | 136 | mtnet$(MODULE)sta.o: $(RT28XX_STA_OBJ) 137 | $(LD) -r $^ -o $@ 138 | 139 | mtnet$(MODULE)ap.o: $(RT28XX_AP_OBJ) 140 | $(LD) -r $^ -o $@ 141 | 142 | mtnet$(MODULE)apsta.o: $(RT28XX_APSTA_OBJ) 143 | $(LD) -r $^ -o $@ 144 | 145 | clean: 146 | rm -f $(RT28xx_DIR)/common/*.o 147 | rm -f $(RT28xx_DIR)/common/.*.{cmd,flags,d} 148 | rm -f $(RT28xx_DIR)/os/linux/*.{o,ko,mod.{o,c}} 149 | rm -f $(RT28xx_DIR)/os/linux/.*.{cmd,flags,d} 150 | rm -fr $(RT28xx_DIR)/os/linux/.tmp_versions 151 | rm -f $(RT28xx_DIR)/chips/*.o 152 | rm -f $(RT28xx_DIR)/chips/.*.{cmd,flags,d} 153 | ifeq ($(RT28xx_MODE),AP) 154 | rm -f $(RT28xx_DIR)/ap/*.o 155 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 156 | else 157 | ifeq ($(RT28xx_MODE),STA) 158 | rm -f $(RT28xx_DIR)/sta/*.o 159 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 160 | else 161 | ifeq ($(RT28xx_MODE),APSTA) 162 | rm -f $(RT28xx_DIR)/ap/*.o 163 | rm -f $(RT28xx_DIR)/ap/.*.{cmd,flags,d} 164 | rm -f $(RT28xx_DIR)/sta/*.o 165 | rm -f $(RT28xx_DIR)/sta/.*.{cmd,flags,d} 166 | endif 167 | endif 168 | endif 169 | 170 | install: 171 | install -d $(LINUX_SRC_MODULE) 172 | install -m 644 -c $(addsuffix .o,$(MOD_NAME)) $(LINUX_SRC_MODULE) 173 | /sbin/depmod -a ${shell uname -r} 174 | 175 | uninstall: 176 | rm -rf $(addprefix $(LINUX_SRC_MODULE),$(addsuffix .o,$(MOD_NAME))) 177 | /sbin/depmod -a ${shell uname -r} 178 | 179 | # Declare the contents of the .PHONY variable as phony. We keep that 180 | # # information in a variable so we can use it in if_changed and friends. 181 | .PHONY: $(PHONY) 182 | -------------------------------------------------------------------------------- /src/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 | 126 | #define RxWIMPDUByteCnt RXWI_O.MPDUtotalByteCnt 127 | #define RxWIWirelessCliID RXWI_O.wcid 128 | #define RxWIKeyIndex RXWI_O.key_idx 129 | #define RxWIMCS RXWI_O.mcs 130 | #define RxWIBW RXWI_O.bw 131 | #define RxWISGI RXWI_O.sgi 132 | #define RxWIBSSID RXWI_O.bss_idx 133 | #define RxWIPhyMode RXWI_O.phy_mode 134 | #define RxWISTBC RXWI_O.stbc 135 | #define RxWITID RXWI_O.tid 136 | #define RxWIRSSI0 RXWI_O.RSSI0 137 | #define RxWIRSSI1 RXWI_O.RSSI1 138 | #define RxWIRSSI2 RXWI_O.RSSI2 139 | #define RxWISNR0 RXWI_O.SNR0 140 | #define RxWISNR1 RXWI_O.SNR1 141 | #define RxWISNR2 RXWI_O.SNR2 142 | #define RxWIFOFFSET RXWI_O.FOFFSET 143 | 144 | 145 | 146 | #endif /* __RAL_OMAC_RXWI_H__ */ 147 | 148 | -------------------------------------------------------------------------------- /src/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 | /* 62 | * Frequency plan item for RT85592 63 | * N: R9[4], R8[7:0] 64 | * K: R7[7], R9[3:0] 65 | * mod: R9[7:5], R11[3:2] (eg. mod=8 => 0x0, mod=10 => 0x2) 66 | * R: R11[1:0] (eg. R=1 => 0x0, R=3 => 0x2) 67 | */ 68 | typedef struct _RT8592_FREQ_ITEM { 69 | UINT8 Channel; 70 | UINT16 N; 71 | UINT8 K; 72 | UINT8 mod; 73 | UINT8 R; 74 | } RT8592_FREQ_ITEM; 75 | 76 | #define RT6590_RF_VER "MT7650_WiFi_RF_Register_20120516.xls" 77 | //#define RT6590_BBP_VER "TC6008_BBP_CR_20120518.xls" 78 | #define RT6590_BBP_VER "TC6008_BBP_CR_20120522.xls" 79 | 80 | /* 81 | Rdiv: R24[1:0] (2-bits) 82 | PLL_N: R29[7:0], R30[0] (9-bits) 83 | PLL_K(Nominator): R31[4:0] (5-bits) 84 | Non-Sigma: !SDM R31[7:5] (3-bits) 85 | Den: (Denomina - 8) R32[4:0] (5-bits) 86 | Loop Filter Config: R33, R34 87 | Pll_idiv: frac comp R35[6:0] (7-bits) 88 | 89 | 5G only 90 | Pll_LDO: R16 [6:4] = <010> 91 | */ 92 | typedef struct _RT6590_FREQ_ITEM { 93 | UINT8 Channel; 94 | UINT8 Band; 95 | UINT16 PLL_N; 96 | UINT8 PLL_K; 97 | UINT8 Rdiv; 98 | UINT8 NonSigma; 99 | UINT8 Den; 100 | UINT8 LFC_R33; 101 | UINT8 LFC_R34; 102 | UINT32 Pll_idiv; 103 | UINT8 Pll_LDO; // 5G only 104 | } RT6590_FREQ_ITEM; 105 | 106 | #define RF_G_BAND 0x01 107 | #define RF_A_BAND 0x02 108 | #define RF_A_BAND_LB 0x04 109 | #define RF_A_BAND_MB 0x08 110 | #define RF_A_BAND_HB 0x10 111 | typedef struct _RT6590_RF_SWITCH_ITEM { 112 | UCHAR Bank; 113 | UCHAR Register; 114 | UCHAR Band; /* G_Band, A_Band_LB, A_Band_MB, A_Band_HB */ 115 | UCHAR BW; 116 | UCHAR Value; 117 | } RT6590_RF_SWITCH_ITEM, *PRT6590_RF_SWITCH_ITEM; 118 | 119 | typedef struct _RT6590_DCOC_Table { 120 | UCHAR Band; /* G_Band, A_Band_LB, A_Band_MB, A_Band_HB */ 121 | RTMP_REG_PAIR RegDate; 122 | } RT6590_DOCO_Table, *PRT6590_DOCO_Table; 123 | 124 | VOID RT6590_Init(struct _RTMP_ADAPTER *pAd); 125 | INT RT6590_ReadChannelPwr(struct _RTMP_ADAPTER *pAd); 126 | 127 | #ifdef RT8592 128 | VOID RT85592_Init(struct _RTMP_ADAPTER *pAd); 129 | INT RT85592_ReadChannelPwr(struct _RTMP_ADAPTER *pAd); 130 | VOID RT85592ReadTxPwrPerRate(struct _RTMP_ADAPTER *pAd); 131 | #endif /* RT8592 */ 132 | VOID RT6590ReadTxPwrPerRate(struct _RTMP_ADAPTER *pAd); 133 | 134 | VOID dump_bw_info(struct _RTMP_ADAPTER *pAd); 135 | 136 | #endif /* __RT6590_H__ */ 137 | 138 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | /* ================================================================================= */ 42 | /* Register format for RFCTRL */ 43 | /* ================================================================================= */ 44 | 45 | #define RF_CSR_CFG 0x500 46 | 47 | #ifdef RLT_RF 48 | 49 | #define RF_BANK0 0 50 | #define RF_BANK1 1 51 | #define RF_BANK2 2 52 | #define RF_BANK3 3 53 | #define RF_BANK4 4 54 | #define RF_BANK5 5 55 | #define RF_BANK6 6 56 | #define RF_BANK7 7 57 | #define RF_BANK8 8 58 | #define RF_BANK9 9 59 | #define RF_BANK10 10 60 | #define RF_BANK11 11 61 | #define RF_BANK12 12 62 | #define RF_BANK13 13 63 | #define RF_BANK14 14 64 | #define RF_BANK15 15 65 | 66 | /* @!Release 67 | RF_CSR_KICK:1 68 | Write - kick RF register read/write 69 | 0: do nothing 70 | 1: kick read/write process 71 | Read - Polling RF register read/write 72 | 0: idle 73 | 1: busy 74 | RF_CSR_RW:1 75 | 0: read 1: write 76 | rsv:12 77 | RF_CSR_REG_ID:10 78 | RF register ID, 0 for R0, 1 for R1 and so on 79 | Bits [17:15] 3 bits, indicates the bank number 80 | Bits [14:08] 7 bits, indicates the register number 81 | 82 | RF_CSR_DATA:8 83 | DATA written to/read from RF 84 | */ 85 | typedef union _RLT_RF_CSR_CFG { 86 | #ifdef RT_BIG_ENDIAN 87 | struct { 88 | UINT RF_CSR_KICK:1; 89 | UINT RF_CSR_WR:1; 90 | UINT rsv:12; 91 | #ifdef MT7601 92 | UINT RF_CSR_REG_BANK:4; 93 | UINT RF_CSR_REG_ID:6; 94 | #else 95 | UINT RF_CSR_REG_BANK:3; 96 | UINT RF_CSR_REG_ID:7; 97 | #endif /* MT7601 */ 98 | UINT RF_CSR_DATA:8; 99 | } field; 100 | #else 101 | struct { 102 | UINT RF_CSR_DATA:8; 103 | #ifdef MT7601 104 | UINT RF_CSR_REG_ID:6; 105 | UINT RF_CSR_REG_BANK:4; 106 | #else 107 | UINT RF_CSR_REG_ID:7; 108 | UINT RF_CSR_REG_BANK:3; 109 | #endif /* MT7601 */ 110 | UINT rsv:12; 111 | UINT RF_CSR_WR:1; 112 | UINT RF_CSR_KICK:1; 113 | } field; 114 | #endif /* RT_BIG_ENDIAN */ 115 | UINT word; 116 | }RLT_RF_CSR_CFG; 117 | #endif /* RLT_RF */ 118 | 119 | 120 | typedef union _RF_CSR_CFG_STRUC { 121 | #ifdef RT_BIG_ENDIAN 122 | struct { 123 | UINT32 Rsvd1:14; /* Reserved */ 124 | UINT32 RF_CSR_KICK:1; /* kick RF register read/write */ 125 | UINT32 RF_CSR_WR:1; /* 0: read 1: write */ 126 | UINT32 TESTCSR_RFACC_REGNUM:8; /* RF register ID */ 127 | UINT32 RF_CSR_DATA:8; /* DATA */ 128 | } field; 129 | #else 130 | struct { 131 | UINT32 RF_CSR_DATA:8; 132 | UINT32 TESTCSR_RFACC_REGNUM:8; 133 | UINT32 RF_CSR_WR:1; 134 | UINT32 RF_CSR_KICK:1; 135 | UINT32 Rsvd1:14; 136 | } field; 137 | #endif /* RT_BIG_ENDIAN */ 138 | UINT32 word; 139 | }RF_CSR_CFG_STRUC; 140 | 141 | #define RF_BYPASS_0 0x0504 142 | 143 | #define RF_SETTING_0 0x050C 144 | 145 | #endif /* __RF_CTRL_H__ */ 146 | 147 | -------------------------------------------------------------------------------- /src/os/linux/.mt7601Uap.o.cmd: -------------------------------------------------------------------------------- 1 | cmd_/home/pi/mt7601u/src/os/linux/mt7601Uap.o := ld -r -o /home/pi/mt7601u/src/os/linux/mt7601Uap.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_profile.o /home/pi/mt7601u/src/os/linux/../../ap/ap_mbss.o /home/pi/mt7601u/src/os/linux/../../ap/ap.o /home/pi/mt7601u/src/os/linux/../../ap/ap_assoc.o /home/pi/mt7601u/src/os/linux/../../ap/ap_auth.o /home/pi/mt7601u/src/os/linux/../../ap/ap_connect.o /home/pi/mt7601u/src/os/linux/../../ap/ap_mlme.o /home/pi/mt7601u/src/os/linux/../../ap/ap_sanity.o /home/pi/mt7601u/src/os/linux/../../ap/ap_sync.o /home/pi/mt7601u/src/os/linux/../../ap/ap_wpa.o /home/pi/mt7601u/src/os/linux/../../ap/ap_data.o /home/pi/mt7601u/src/os/linux/../../ap/ap_autoChSel.o /home/pi/mt7601u/src/os/linux/../../ap/ap_qload.o /home/pi/mt7601u/src/os/linux/../../ap/ap_cfg.o /home/pi/mt7601u/src/os/linux/../../common/crypt_md5.o /home/pi/mt7601u/src/os/linux/../../common/crypt_sha2.o /home/pi/mt7601u/src/os/linux/../../common/crypt_hmac.o /home/pi/mt7601u/src/os/linux/../../common/crypt_aes.o /home/pi/mt7601u/src/os/linux/../../common/crypt_arc4.o /home/pi/mt7601u/src/os/linux/../../common/mlme.o /home/pi/mt7601u/src/os/linux/../../common/cmm_wep.o /home/pi/mt7601u/src/os/linux/../../common/action.o /home/pi/mt7601u/src/os/linux/../../common/cmm_data.o /home/pi/mt7601u/src/os/linux/../../common/rtmp_init.o /home/pi/mt7601u/src/os/linux/../../common/rtmp_init_inf.o /home/pi/mt7601u/src/os/linux/../../common/cmm_tkip.o /home/pi/mt7601u/src/os/linux/../../common/cmm_aes.o /home/pi/mt7601u/src/os/linux/../../common/cmm_sync.o /home/pi/mt7601u/src/os/linux/../../common/eeprom.o /home/pi/mt7601u/src/os/linux/../../common/cmm_sanity.o /home/pi/mt7601u/src/os/linux/../../common/cmm_info.o /home/pi/mt7601u/src/os/linux/../../common/cmm_cfg.o /home/pi/mt7601u/src/os/linux/../../common/cmm_wpa.o /home/pi/mt7601u/src/os/linux/../../common/cmm_radar.o /home/pi/mt7601u/src/os/linux/../../common/spectrum.o /home/pi/mt7601u/src/os/linux/../../common/rtmp_timer.o /home/pi/mt7601u/src/os/linux/../../common/rt_channel.o /home/pi/mt7601u/src/os/linux/../../common/cmm_profile.o /home/pi/mt7601u/src/os/linux/../../common/cmm_asic.o /home/pi/mt7601u/src/os/linux/../../common/scan.o /home/pi/mt7601u/src/os/linux/../../common/cmm_cmd.o /home/pi/mt7601u/src/os/linux/../../common/uapsd.o /home/pi/mt7601u/src/os/linux/../../common/ps.o /home/pi/mt7601u/src/os/linux/../../rate_ctrl/ra_ctrl.o /home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_legacy.o /home/pi/mt7601u/src/os/linux/../../rate_ctrl/alg_ags.o /home/pi/mt7601u/src/os/linux/../../chips/rtmp_chip.o /home/pi/mt7601u/src/os/linux/../../common/txpower.o /home/pi/mt7601u/src/os/linux/../../mac/rtmp_mac.o /home/pi/mt7601u/src/os/linux/../../mgmt/mgmt_hw.o /home/pi/mt7601u/src/os/linux/../../mgmt/mgmt_entrytb.o /home/pi/mt7601u/src/os/linux/../../phy/rtmp_phy.o /home/pi/mt7601u/src/os/linux/../../phy/rlt_phy.o /home/pi/mt7601u/src/os/linux/../../phy/rlt_rf.o /home/pi/mt7601u/src/os/linux/../../common/ba_action.o /home/pi/mt7601u/src/os/linux/../../mgmt/mgmt_ht.o /home/pi/mt7601u/src/os/linux/../../common/wsc.o /home/pi/mt7601u/src/os/linux/../../common/wsc_tlv.o /home/pi/mt7601u/src/os/linux/../../common/crypt_biginteger.o /home/pi/mt7601u/src/os/linux/../../common/crypt_dh.o /home/pi/mt7601u/src/os/linux/../../common/wsc_v2.o /home/pi/mt7601u/src/os/linux/../../common/wsc_ufd.o /home/pi/mt7601u/src/os/linux/../../ate/common/rt_ate.o /home/pi/mt7601u/src/os/linux/../../ate/common/rt_qa.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_symb.o /home/pi/mt7601u/src/os/linux/../../common/cmm_mac_usb.o /home/pi/mt7601u/src/os/linux/../../common/cmm_data_usb.o /home/pi/mt7601u/src/os/linux/../../common/rtusb_io.o /home/pi/mt7601u/src/os/linux/../../common/rtusb_data.o /home/pi/mt7601u/src/os/linux/../../common/rtusb_bulk.o /home/pi/mt7601u/src/os/linux/../../os/linux/rt_usb.o /home/pi/mt7601u/src/os/linux/../../common/ee_prom.o /home/pi/mt7601u/src/os/linux/../../common/ee_efuse.o /home/pi/mt7601u/src/os/linux/../../mcu/rtmp_and.o /home/pi/mt7601u/src/os/linux/../../mcu/rtmp_mcu.o /home/pi/mt7601u/src/os/linux/../../mcu/rtmp_M51.o /home/pi/mt7601u/src/os/linux/../../common/rt_rf.o /home/pi/mt7601u/src/os/linux/../../chips/mt7601.o /home/pi/mt7601u/src/os/linux/../../mac/ral_omac.o /home/pi/mt7601u/src/os/linux/../../ate/chips/mt7601_ate.o /home/pi/mt7601u/src/os/linux/../../ate/common/ate_usb.o /home/pi/mt7601u/src/os/linux/../../common/frq_cal.o 2 | -------------------------------------------------------------------------------- /src/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 | /* 37 | ======================================================================== 38 | 39 | Routine Description: 40 | 41 | Arguments: 42 | 43 | Return Value: 44 | 45 | IRQL = 46 | 47 | Note: 48 | 49 | ======================================================================== 50 | */ 51 | VOID RTInitializeCmdQ( 52 | IN PCmdQ cmdq) 53 | { 54 | cmdq->head = NULL; 55 | cmdq->tail = NULL; 56 | cmdq->size = 0; 57 | cmdq->CmdQState = RTMP_TASK_STAT_INITED; 58 | } 59 | 60 | 61 | /* 62 | ======================================================================== 63 | 64 | Routine Description: 65 | 66 | Arguments: 67 | 68 | Return Value: 69 | 70 | IRQL = 71 | 72 | Note: 73 | 74 | ======================================================================== 75 | */ 76 | VOID RTThreadDequeueCmd( 77 | IN PCmdQ cmdq, 78 | OUT PCmdQElmt *pcmdqelmt) 79 | { 80 | *pcmdqelmt = cmdq->head; 81 | 82 | if (*pcmdqelmt != NULL) 83 | { 84 | cmdq->head = cmdq->head->next; 85 | cmdq->size--; 86 | if (cmdq->size == 0) 87 | cmdq->tail = NULL; 88 | } 89 | } 90 | 91 | 92 | /* 93 | ======================================================================== 94 | 95 | Routine Description: 96 | 97 | Arguments: 98 | 99 | Return Value: 100 | 101 | IRQL = 102 | 103 | Note: 104 | 105 | ======================================================================== 106 | */ 107 | NDIS_STATUS RTEnqueueInternalCmd( 108 | IN PRTMP_ADAPTER pAd, 109 | IN NDIS_OID Oid, 110 | IN PVOID pInformationBuffer, 111 | IN UINT32 InformationBufferLength) 112 | { 113 | NDIS_STATUS status; 114 | PCmdQElmt cmdqelmt = NULL; 115 | 116 | 117 | status = os_alloc_mem(pAd, (PUCHAR *)&cmdqelmt, sizeof(CmdQElmt)); 118 | if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL)) 119 | return (NDIS_STATUS_RESOURCES); 120 | NdisZeroMemory(cmdqelmt, sizeof(CmdQElmt)); 121 | 122 | if(InformationBufferLength > 0) 123 | { 124 | status = os_alloc_mem(pAd, (PUCHAR *)&cmdqelmt->buffer, InformationBufferLength); 125 | if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt->buffer == NULL)) 126 | { 127 | os_free_mem(pAd, cmdqelmt); 128 | return (NDIS_STATUS_RESOURCES); 129 | } 130 | else 131 | { 132 | NdisMoveMemory(cmdqelmt->buffer, pInformationBuffer, InformationBufferLength); 133 | cmdqelmt->bufferlength = InformationBufferLength; 134 | } 135 | } 136 | else 137 | { 138 | cmdqelmt->buffer = NULL; 139 | cmdqelmt->bufferlength = 0; 140 | } 141 | 142 | cmdqelmt->command = Oid; 143 | cmdqelmt->CmdFromNdis = FALSE; 144 | 145 | if (cmdqelmt != NULL) 146 | { 147 | NdisAcquireSpinLock(&pAd->CmdQLock); 148 | if (pAd->CmdQ.CmdQState & RTMP_TASK_CAN_DO_INSERT) 149 | { 150 | EnqueueCmd((&pAd->CmdQ), cmdqelmt); 151 | status = NDIS_STATUS_SUCCESS; 152 | } 153 | else 154 | { 155 | status = NDIS_STATUS_FAILURE; 156 | } 157 | NdisReleaseSpinLock(&pAd->CmdQLock); 158 | 159 | if (status == NDIS_STATUS_FAILURE) 160 | { 161 | if (cmdqelmt->buffer) 162 | os_free_mem(pAd, cmdqelmt->buffer); 163 | os_free_mem(pAd, cmdqelmt); 164 | } 165 | else 166 | RTCMDUp(&pAd->cmdQTask); 167 | } 168 | return(NDIS_STATUS_SUCCESS); 169 | } 170 | --------------------------------------------------------------------------------