A while ago we have tried to enable the RT2870 module, here is some tips about porting and setting, hope it will help, if there is some warning asking you to copy the RT2870STA.dat to a specific location on the target board, just follow the prompt to copy it there.
1) We have to modify the Makefile in the base directory
PLATFORM = BLACKFIN
ifeq ($(PLATFORM), BLACKFIN)
LINUX_SRC =/home/rajiv/BF527-EZKIT/uClinux-dist-ezkit-bf527-2009R1-RC1/linux-2.6.x/ ---> specify the kernel path
linux-2.6.x/drivers/net/wireless/ ---> specify the kernel path
CROSS_COMPILE = bfin-uclinux-
ARCH := blackfin
2) There will be a config.mk file inside /os/linux/ This will have to be modified to add our platform.
ifneq (,$(findstring 2.4,$(LINUX_SRC)))
# Linux 2.4
CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -O2
-fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=i686 -DMODULE -DMODVERSIONS -include $(LINUX_SRC)/include/linux/modversions.h $(WFLAGS)
# Linux 2.6
EXTRA_CFLAGS := $(WFLAGS) -I$(RT28xx_DIR)/include
3) We need to do one modification in the code before we start compiling for our module. In the file
in structure HTTRANSMIT_SETTING we have to change MODE to MODE1
in structure MACHTTRANSMIT_SETTING we have to change MODE to MODE1
We will have to change all instances of structure.MODE to structure.MODE1 in the entire base. For example
In file sta/rtmp_data.c
we have to change (pAd->StaCfg.HTPhyMode.field.MODE == MODE_HTMIX)
(pAd->StaCfg.HTPhyMode.field.MODE1 == MODE_HTMIX)
Similarly we have to change all MODE to MODE1.
4) Once this is done then we need to come to the base directory and execute the command
make (Please do this in supervisor mode)
5) Th .ko files will be generated in the folder /os/linux.
Thanks for your reply.
I just followed your insruction to try make the module, but i got following errors
make -C tools
make: Entering directory `/opt/sf/sf/wifi/new/tools'
gcc -g bin2h.c -o bin2h
make: Leaving directory `/opt/sf/sf/wifi/new/tools'
cp -f os/linux/Makefile.6 /opt/sf/sf/wifi/new/os/linux/Makefile
make -C /opt/sf/sf/build_ip12/blackfin-linux-dist/linux-2.6.x SUBDIRS=/opt/sf/sf/wifi/new/os/linux modules
make: Entering directory `/opt/sf/sf/build_ip12/blackfin-linux-dist/linux-2.6.x'
CC [M] /opt/sf/sf/wifi/new/os/linux/../../common/crypt_md5.o
In file included from /opt/sf/sf/wifi/new/include/chip/mac_usb.h:32,
/opt/sf/sf/wifi/new/include/chip/rtmp_mac.h:699: error: expected identifier or '(' before numeric constant
/opt/sf/sf/wifi/new/include/chip/rtmp_mac.h:700: error: expected ';' before 'ULONG'
make: *** [/opt/sf/sf/wifi/new/os/linux/../../common/crypt_md5.o] Error 1
make: *** [_module_/opt/sf/sf/wifi/new/os/linux] Error 2
make: Leaving directory `/opt/sf/sf/build_ip12/blackfin-linux-dist/linux-2.6.x'
make: *** [LINUX] Error 2
I used blackfin-toolchain-2010R1-RC4, blackfin-linux-dist-2010R1-RC5 and Ralink 2011_0407_5700_5800_Linux_android_V184.108.40.206_DPO package for compiling.
Prior to doing some modifications to a 2010_0710_RT2870_Linux_STA_v220.127.116.11 according to the above (I did modify, but there are still errors), I have a more fundamental question.
The tr2800usb.ko and associated dependencies are already supplied with the 2011-kernel. So I'd guess that I don't need to build it from this separate package. However, the driver apparently fails to load the firmware for the USB-wlan stick (rt2870.bin), as is also indicated by the thread starter. I'd also guess that this firmware is independent of host system. If not, I'd only need to build this .bin-file. Please supply some hints or at least some pointers to some comprehensive information. I'm using a BF526 system.
Well, in most cases, it is usual to append comparable stuff to an existing thread in order to contribute to not fragmentarizing topics - and in this this case the thread is really not old. Moreover: appending to an existing thread shows that topic issuers did not issue without a prior forum search.
Regarding the question: Is firmware loaded into the wifi-stick (in this case rt2870.bin) always the same, regardless the architecture of the host system? The page http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:wifi_over_usb&s=wifi suggests that a firmware file can be taken "off the shelf".
(BTW: I am surprised by the complexity of getting wifi working. It is much easier to establish an internet connection via a 3G-stick)
One thread for one issue and one author makes it easy for us the track the status of issues, thanks for your understanding.
We happened to use the RT2870 module a while ago so there is something we can share, but indeed you need to consult them if have more issues. check if you have missed the following, the RT30xxEEPROM.bin is attached.
In the file rtusb_dev_id.c we need to add to the structure rtusb_dev_id the following:
also might need to do the following for the RT3370 module for the driver the come up properly.
1. Add the attached file RT30xxEEPROM.bin in folder /tmp/ once the kernel has come up.
2. This is mainly done since the ee_fuse start and end values are different for the module. We have got updated files from Ralink for this but this can be handled also using the attached file since it will read the EEPROM values from the file.
RT30xxEEPROM.bin.zip 400 bytes