rt73(usb) problems on freescale mpc8272 with kernel2.4.26!

Live forum: http://rt2x00.serialmonkey.com/viewtopic.php?t=4667

dlutmmcl

12-03-2008 03:00:51

I solved this problem.
(1)First,I buy two dlink dwl-g520+A card [/color3qw1io03].The chips in it are ralink rt61.
I download the source code from the http//www.ralinktech.com/ralink/Home/Support/Linux.html.[/color3qw1io03]
Then I find a file named "Makefile.RTL865x[/color3qw1io03]",and it is for big endian.
My platform is ppc.and it is big endian before configuration.
Then
$make
I get the rt61.o,and download it to the board.
In the board,
$insmod rt61.o
$ifconfig ra0 up
$iwlist ra0 scanning
It can scan the wireless network.
It success.
yeah!

(2)Second,In the rt73 source code ,thers is no "Makefile.RTL865x",So I think can I use it in the rt73 codes.
And I do it as follows
#
CC = /mpc8272/powerpc-gcc/bin/powerpc-linux-gcc
LD = /mpc8272/powerpc-gcc/bin/powerpc-linux-ld
KERNELDIR = /mpc8272/kernel-2.4.26-free
#
#CFLAGS = -Wall -O2 -D__KERNEL__ -DMODULE -D__MIPSEB__ \
-DBIG_ENDIAN -DRALINK_ATE\
-DAGGREGATION_SUPPORT -DWMM_SUPPORT\
-fomit-frame-pointer -fno-common \
-mlong-calls -mno-abicalls -fno-pic -pipe \
-I$(KERNELDIR)/include -I$(KERNELDIR)/drivers/net -include $(KERNELDIR)/include/linux/modversions.h

CFLAGS = -Wall -O2 -D__KERNEL__ -DMODULE -D__MIPSEB__ \
-DBIG_ENDIAN -DRALINK_ATE\
-DAGGREGATION_SUPPORT -DWMM_SUPPORT\
-fomit-frame-pointer -fno-common \
-m -m -fno-pic -pipe \
-I$(KERNELDIR)/include -I$(KERNELDIR)/drivers/net -include $(KERNELDIR)/include/linux/modversions.h
# -DDBG -DSINGLE_ADHOC_LINKUP



MOD_TARGET = rt73.o
CONF_FILE = rt73sta.dat

OBJ = rt73.o

#all $(MOD_TARGET)
all $(OBJ)

RT73_OBJ = rtmp_main.o mlme.o connect.o rtusb_bulk.o rtusb_io.o sync.o assoc.o auth.o auth_rsp.o rtusb_data.o rtmp_init.o sanity.o rtmp_wep.o rtmp_info.o rtmp_tkip.o wpa.o md5.o

#ifdef MAT_SUPPORT
ifeq ($(HAS_ETH_CONVERT),y)
RT73_OBJ += cmm_mat.o \
cmm_mat_iparp.o \
cmm_mat_ipv6.o \
cmm_mat_pppoe.o
endif
#endif // MAT_SUPPORT //

#$(MOD_TARGET) $(OBJS)
# $(LD) -r -o $@ $(OBJS)

rt73.o $(RT73_OBJ)

$(LD) -r $^ -o $@

clean
rm -f *.o *.bak

romfs
cp -f $(MOD_TARGET) $(ROMFSDIR)/lib/modules/$(MOD_TARGET)
#cp -f $(CONF_FILE) $(ROMFSDIR)/etc/$(CONF_FILE)[/color3qw1io03]$make
There are errors in the rtmp_info.c.[/color3qw1io03]
Simply to solve them.
Then,get the rt73.o,and download to the board.
In the board
$insmod rt61.o
$ifconfig ra0 up
$iwlist ra0 scanning
It can scan the wireless network.
It success too.
yeah!
yeah!
yeah!
yeah!
yeah!

(3)Then I success to transplant the dlink dwl-g520+A(pci rt61) and ausu wl-167g(usb rt73) [/color3qw1io03]wireless network card.

You can contact me.
My email is dlutmmcl@foxmail.com[/color3qw1io03]
Dalian University of Technology In China.[/color3qw1io03]

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

HI
I have a embed board named freescale [b3qw1io03]mpc8272ads.[/b3qw1io03]
The cpu is the powerpc mpc8272,the kernel is [b3qw1io03]linux 2.4.26[/b3qw1io03].
Now,I want to transplant the [b3qw1io03]ASUS Wl-167G[/b3qw1io03] to the board.
(1)First,I use [b3qw1io03]the driver of RT73_Linux_STA_Drv1.0.4.0[/b3qw1io03],and it can be insmoded successfully and also can detect the wireless card.
But ,when I put i[b3qw1io03]wlist rausb0 scanning[/b3qw1io03],I [b3qw1io03]can't detect the wireless AP.And the card don't send or receive any packets.[/b3qw1io03]

(2)Second ,so I change [b3qw1io03]the driver of[/b3qw1io03] [b3qw1io03]rt73-cvs-2008022523[/b3qw1io03].Then I cross compile the source and get the rt73.o.
Then put it into the board.and input [b3qw1io03]insmod rt73.o[/b3qw1io03] ,and insert the ASUS WL-167G wireless network card .And I get the following information
[b3qw1io03] rt73 Device Descriptor not matching[/b3qw1io03]
I don't know where is the problem.
Please give me a hand!
Thank you very much!


---------------------------------------------------------------------------
Then Makefile of the rt73-cvs-2008022523(I haved changed)

>>>>>>>>>>>>>>>>>>>>>>
MODULE_NAME = rt73
IF_NAME = wlan*

FIRMWARES = rt73.bin
FIRM_DIR = /lib/firmware

OLD_IF_NAME = ra0
CONFIG_DIR = /etc/Wireless/RT73STA
CONFIG_FILE = rt73sta.dat

ifeq ($(PATCHLEVEL),)
PATCHLEVEL = $(shell uname -r | cut -d. -f2)
endif

$(MODULE_NAME)-objs = rtmp_main.o mlme.o connect.o rtusb_bulk.o rtusb_io.o \
sync.o assoc.o auth.o auth_rsp.o rtusb_data.o \
rtmp_init.o sanity.o rtmp_wep.o rtmp_info.o \
rtmp_tkip.o wpa.o md5.o rt2x00debug.o

ifdef TOPDIR
obj-m += $(MODULE_NAME).o
endif

EXTRA_CFLAGS += -I$(src)
EXTRA_CFLAGS += -DAGGREGATION_SUPPORT -DWMM_SUPPORT
#EXTRA_CFLAGS += -DRALINK_ATE
#EXTRA_CFLAGS += -DSINGLE_ADHOC_LINKUP

[b3qw1io03]#ifdef KERNDIR
#KERNEL_SOURCES = $(KERNDIR)
#else
# KERNEL_SOURCES = /lib/modules/$(shell uname -r)/build
#endif

KERNEL_SOURCES = /mpc8272/kernel-2.4.26-free
CC = /mpc8272/powerpc-gcc/bin/powerpc-linux-gcc
LD = /mpc8272/powerpc-gcc/bin/powerpc-linux-ld[/b3qw1io03]


ifdef MODDIR
MODULE_ROOT = $(MODDIR)
else
MODULE_ROOT = /lib/modules/$(shell uname -r)/extra
endif

ifdef KERNOUT
KERNEL_OUTPUT = KBUILD_OUTPUT=$(KERNOUT)
else
KERNEL_OUTPUT =
endif

src ?= .
obj ?= .

ifeq ($(PATCHLEVEL), 4)
MODULE_OBJECT = $(MODULE_NAME).o
MODULE_CONF = /etc/modules.conf
else
MODULE_OBJECT = $(MODULE_NAME).ko
MODULE_CONF = /etc/modprobe.d/ralink
endif

all module

ifeq ($(PATCHLEVEL), 4)
$(obj)/$(MODULE_NAME).o $($(MODULE_NAME)-objs)
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $($(MODULE_NAME)-objs)
endif

KBUILD_PARAMS = -C $(KERNEL_SOURCES) SUBDIRS=$(CURDIR) $(KERNEL_OUTPUT)

MODULE_CHECK = if ! [ -f $(MODULE_OBJECT) ]; then \
echo "$(MODULE_OBJECT) failed to build!"; \
exit 1; \
fi; \
if [ `du -b $(MODULE_OBJECT) | sed -e 's/\t.*//g'` -gt 1000000 ]; then \
echo "!!! WARNING Module file much too big (>1MB)"; \
echo "!!! Check your kernel settings or use 'strip'"; \
fi; \
echo "*** Module $(MODULE_OBJECT) built successfully"

module
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' modules; \
$(MODULE_CHECK)

arm
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS) \
-DRTMP_EMBEDDED' \
modules; \
$(MODULE_CHECK)

armdebug
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS) \
-DRTMP_EMBEDDED -DDBG' \
modules; \
$(MODULE_CHECK)

debug
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS) \
-DDBG' modules; \
$(MODULE_CHECK)

debugfs
@$(MAKE) $(KBUILD_PARAMS) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS) \
-DDBG -DRT2X00DEBUGFS' modules; \
$(MODULE_CHECK)

clean
@rm -f *.o .*.{cmd,flags}
@rm -f $(MODULE_NAME).{o,ko,mod.{o,c}} built-in.o $(VERSION_HEADER) *~
@rm -fr .tmp_versions Module.symvers

modules_install
@if ! [ -f $(MODULE_OBJECT) ]; then \
echo "!!! $(MODULE_OBJECT) does not exist run 'make'"; \
exit 1; \
fi
@echo "*** Install module in $(MODULE_ROOT) ..."
ifeq ($(PATCHLEVEL),4)
install -m 755 -o 0 -g 0 -d $(MODULE_ROOT)
install -m 644 -o 0 -g 0 $(MODULE_OBJECT) $(MODULE_ROOT)
else
@$(MAKE) $(KBUILD_PARAMS) modules_install
endif
/sbin/depmod -a

install modules_install
@echo "*** Update $(MODULE_CONF) alias for $(IF_NAME)"; \
if [ -d `dirname $(MODULE_CONF)` ]; then \
if [ -s $(MODULE_CONF) ]; then \
if ! grep -q '$(IF_NAME)' $(MODULE_CONF) ; then \
echo "alias $(IF_NAME) $(MODULE_NAME)" >> $(MODULE_CONF) ; \
fi; \
else \
echo "alias $(IF_NAME) $(MODULE_NAME)" >> $(MODULE_CONF) ; \
fi; \
if grep -q '$(OLD_IF_NAME)' $(MODULE_CONF) ; then \
echo "!!! -> $(OLD_IF_NAME) interface name is deprecated" \
"remove old $(MODULE_CONF) alias"; \
fi; \
else \
echo "*** Config dir `dirname $(MODULE_CONF)` not found" >&2; \
fi
@echo "*** Install firmware in $(FIRM_DIR) ..."; \
if ! [ -d $(FIRM_DIR) ]; then \
mkdir $(FIRM_DIR); \
fi; \
cp -f $(FIRMWARES) $(FIRM_DIR)
@echo "*** Check old config ..."; \
if [ -d $(CONFIG_DIR) ]; then \
echo "!!!"; \
echo "!!! WARNING DEPRECATED CONFIG FOUND !"; \
echo "!!!"; \
echo "!!! -> Update your config and remove $(CONFIG_DIR)"; \
if [ -f $(CONFIG_DIR)/$(CONFIG_FILE) ]; then \
echo "!!! -> $(CONFIG_FILE) file is deprecated" \
"use iwconfig/iwpriv instead"; \
fi; \
if [ -f $(CONFIG_DIR)/$(FIRMWARES) ]; then \
echo "!!! -> $(FIRMWARES) firmware has moved to $(FIRM_DIR)"; \
fi; \
fi

ifeq ($(PATCHLEVEL), 4)
include $(KERNEL_SOURCES)/Rules.make
endif

<<<<<<<<<<<<<<<<<<<<<<<
Then I input the command
[b3qw1io03]#make[/b3qw1io03]
Then I get the rt73.o.Later,download the rt73.o to the board.
input the command (the wireless card has already inserted in the board) [b3qw1io03]#insmod rt73.o[/b3qw1io03]
[i3qw1io03]Using rt73.o
rt73 init
usb.c registered new driver rt73
[b3qw1io03]rt73 Device Descriptor not matching[/b3qw1io03][/i3qw1io03] cry

-----------------------------------------------------------
Regards
JackieXu

Vern

12-03-2008 15:58:01

" rt73 Device Descriptor not matching" is telling you that the device is not one the driver recognizes.

What is the output of lsub?

dlutmmcl

13-03-2008 00:28:40

" rt73 Device Descriptor not matching" is telling you that the device is not one the driver recognizes.

What is the output of lsub?[/quote2l6746qq]

----------------------------------------------------------------
When I insert the wireless network card,I get the following
[code2l6746qq]
[b]hub.c: new USB device 00:17.2-1, assigned address 3
usb.c: USB device 3 (vend/prod 0x7d1/0x3c03) is not claimed by any active driver
.[/b][/code2l6746qq]
In it,the usb can read the card information
[b2l6746qq]vend/prod 0x7d1/0x3c03[/b2l6746qq]
But whe I use the [b2l6746qq]RT73_Linux_STA_Drv1.0.4.0,the driver can recognize the card.[/b2l6746qq]
So I think it's the rt73-cvs-2008022523 driver problem.
So I say the [b2l6746qq]rt73-cvs-2008022523/Module/rtmp_def.h[/b2l6746qq],and it defines RT73_USB_DEVICES with
[code2l6746qq]/* ASUS */\
{USB_DEVICE(0x0b05,0x1723)},\
{USB_DEVICE(0x0b05,0x1724)},\
/* D-Link */\
{USB_DEVICE(0x07d1,0x3c03)},\
{USB_DEVICE(0x07d1,0x3c04)},\[/code2l6746qq]
[b2l6746qq]So the driver has defined the network card type and the usb also read the card type information.
why can't it recognize the asus card?[/b2l6746qq]

Vern

13-03-2008 03:54:01

Please enter the command "lsusb" and post the results here.

Thanks,

dlutmmcl

13-03-2008 04:29:01

Please enter the command "lsusb" and post the results here.

Thanks,[/quotesznudw9h]

The embed board which I buy don't include the "lsusb" command in the file system.
I am trying to add it to the system.
Pleast wait a moment

dlutmmcl

13-03-2008 06:04:14

Please enter the command "lsusb" and post the results here.

Thanks,[/quote2rblljum]

I use a PCI-USB card to get the USB port.
And I can't get the "lsusb" command.Becasue the busybox don't include it and I can't the "lsusb" source code to crosscompile to the command.

So I only have the following information
input [b2rblljum]lspci[/b2rblljum]
[code2rblljum]00:00.0 Class 0600: 1057:18c1 (rev 10)
00:18.0 Class 0c03: 1033:0035 (rev 41)
00:18.1 Class 0c03: 1033:0035 (rev 41)
00:18.2 Class 0c03: 1033:00e0 (rev 01)[/code2rblljum]

When insert the ASUS wl-167G.
[code2rblljum] hub.c: new USB device 00:18.2-3, assigned address 3
usb.c: USB device 3 (vend/prod 0xb05/0x1723) is not claimed by any active driver
.[/code2rblljum]

unfortunately I can't get the lsusb command according with this board.
Sorry cry

Starcrasher

13-03-2008 17:12:31

It's really surprising since I have an ASUS WL-167G V2 like yours ( with the same USB id) and I used the rt73 driver all next year before switching to the new one a month ago. The only difference is that it was on an X86 system.

Another surprising thing is that this message in your third post seems relative to a D-Link dongle according to extract of rtmp_def.h you posted below.
[code31gl2i6o][b]hub.c: new USB device 00:17.2-1, assigned address 3
usb.c: USB device 3 (vend/prod 0x7d1/0x3c03) is not claimed by any active driver.[/b][/code31gl2i6o]

Vern

13-03-2008 17:26:25

Hi dlutmmcl,

Forget lsusb. The info you posted is sufficient. I see that the mpc8272 is a power PC based architecture. The message " rt73 Device Descriptor not matching" may be a clue that what you're really looking at is an endian issue.

If so, you may want to look here[/url117k2pyc], download and install the patch, and have at.

Thanks,

dlutmmcl

14-03-2008 02:40:46

It's really surprising since I have an ASUS WL-167G V2 like yours ( with the same USB id) and I used the rt73 driver all next year before switching to the new one a month ago. The only difference is that it was on an X86 system.

Another surprising thing is that this message in your third post seems relative to a D-Link dongle according to extract of rtmp_def.h you posted below.
[code13e3r4q3][b]hub.c: new USB device 00:17.2-1, assigned address 3
usb.c: USB device 3 (vend/prod 0x7d1/0x3c03) is not claimed by any active driver.[/b][/code13e3r4q3][/quote13e3r4q3]

Hi,Starcrasher
[code13e3r4q3][b]hub.c: new USB device 00:17.2-1, assigned address 3
usb.c: USB device 3 (vend/prod 0x7d1/0x3c03) is not claimed by any active driver.[/b][/code13e3r4q3]
That's my problem.I have two types of wireless network card.
One is ASUS wl-167G.The other is the D-Link DWL_G122.
When I copy the information to here,I don't take care of which card I insert to the board.
oops


Then the ASUS wl-167G has worked successfully on the x86 system with FC6.
Do you do this on the powerpc platform?

dlutmmcl

14-03-2008 03:37:18

Hi dlutmmcl,

Forget lsusb. The info you posted is sufficient. I see that the mpc8272 is a power PC based architecture. The message " rt73 Device Descriptor not matching" may be a clue that what you're really looking at is an endian issue.

If so, you may want to look here[/urlqvp6sybd], download and install the patch, and have at.

Thanks,[/quoteqvp6sybd]

HI Vern
I have see the endian issue.
And I change the rtmp_main.c
[codeqvp6sybd]< if (le16_to_cpu(dev->descriptor.idVendor) == rtusb_usb_id[i].idVendor &&
< le16_to_cpu(dev->descriptor.idProduct) == rtusb_usb_id[i].idProduct)
---
> if (le16_to_cpu(dev->descriptor.idVendor)>>16 == rtusb_usb_id[i].idVendor &&
> le16_to_cpu(dev->descriptor.idProduct)>>16 == rtusb_usb_id[i].idProduct)
[/codeqvp6sybd]
Then cross-compile to get the rt73.o
Download to the board,get the information
[codeqvp6sybd]# insmod rt73.o
Using rt73.o
rt73: init
usb.c: registered new driver rt73
rt73: idVendor = 0x50b, idProduct = 0x2317
call_usermodehelper return -2
rt73: Failed to request_firmware. Check your firmware file location
rt73: Failed to load Firmware.
#[/codeqvp6sybd]

I don't what's the problem of [bqvp6sybd]call_usermodehelper return -2[/bqvp6sybd]

Then when I compile the kernel,I have include the firmware module.
But why ?
[codeqvp6sybd]rt73: Failed to request_firmware. Check your firmware file location
rt73: Failed to load Firmware.[/codeqvp6sybd]

And the endian issue don't refer this problem. (