Problem solved !! SIOCSIFFLAGS: Input/output error ...

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

userxy

13-10-2007 15:24:25

Hi all,
first, sorry my english is not so good.

I run a IPCOP-CF-System and like to install a WLAN-USB-Stick ASUS WL-167G (rt73)

Kernel 2.4.34

If I put the stick in I get
Oct 13 164149 ipcop kernel usb.c registered new driver rt73
Oct 13 164149 ipcop kernel idVendor = 0xb05, idProduct = 0x1723

Problem
I do a
root@ipcop/tmp # ifconfig wlan0 up

and get a
SIOCSIFFLAGS Input/output error


Like it is written in the test-doc
I did the "make clear" then "make debug" (no errors)

then "rmmod rt73"
then "modprobe rt73 debug=31"

and I did the
kern.=debug to /var/log/messages (the normal log-file)
in /etc/syslog.conf

My interface wlan0 is pressent after modprobe rt73 and disapears with rmmod rt73.
(ifconfig -a)


But in the message-log I only see
Oct 13 171802 ipcop kernel usb.c deregistering driver rt73
Oct 13 171802 ipcop kernel unregister_netdev()
Oct 13 171802 ipcop kernel <=== rtusb exit
Oct 13 171806 ipcop kernel rtusb init ====>
Oct 13 171806 ipcop kernel usb.c registered new driver rt73
Oct 13 171806 ipcop kernel idVendor = 0xb05, idProduct = 0x1723

Edit
After delete the complete source and modul and do the whole procdure again, the debug has a few more lines
Oct 13 190210 ipcop kernel rtusb init ====>
Oct 13 190210 ipcop kernel usb.c registered new driver rt73
Oct 13 190210 ipcop kernel idVendor = 0xb05, idProduct = 0x1723
Oct 13 190210 ipcop kernel rt73 usb device name wlan0
Oct 13 190210 ipcop kernel rt73 BulkOutMaxPacketSize 64
Oct 13 190210 ipcop kernel rt73 rt73_get_ether_stats --->
Oct 13 190229 ipcop kernel rt73 driver version - 1.0.3.6 CVS


Any idears

Greetings
Kurt

userxy

13-10-2007 18:50:41

Hi all,

I habe figured out something new

After send "ifconfig wlan0 up" two time, I get another log-message

[code3vgm1wxi]
Oct 13 20:33:17 ipcop kernel: rt73: Firmware not load
[/code3vgm1wxi]

Is this definitly an indication for rt73.bin is at the wrong place ?

Currently it is place in /lib/firmeware were the make-file has put it.

Thanks for helping
Kurt

hennichodernich

14-10-2007 13:27:47

After send "ifconfig wlan0 up" two time, I get another log-message

[code1i2yl08r]
Oct 13 20:33:17 ipcop kernel: rt73: Firmware not load
[/code1i2yl08r]

Is this definitly an indication for rt73.bin is at the wrong place ?

Currently it is place in /lib/firmeware were the make-file has put it.
[/quote1i2yl08r]

Do you have a firmware loading rule in your udev config?

regards
Henning

userxy

15-10-2007 16:39:02

Hi Henning,

Im running IPCOP with a 2.4.43 Kernel, so no udev.

I habe read and asked a litle bit around and they say that I have to switch "devfs" off in the kernel (means, to bild a new Kernel) und than install udef.

Im not the LINUX-crack, so Im a litle confused.

In the IPCOP-Forum they told me to load "hotplug" and I did, but with no success -((

Maby I have to try another FW-Distribution.

Maby anyone else has an idea.

regards
Kurt

hennichodernich

15-10-2007 17:41:52

Hi Henning,

Im running IPCOP with a 2.4.43 Kernel, so no udev.

I habe read and asked a litle bit around and they say that I have to switch "devfs" off in the kernel (means, to bild a new Kernel) und than install udef.

Im not the LINUX-crack, so Im a litle confused.

In the IPCOP-Forum they told me to load "hotplug" and I did, but with no success -((
[/quote23t3yy0b]

You can use hotplug instead of udev, but you will need a small firmware loading script triggered by hotplug.
firmware_class is enabled in the kernel?

Maybe your system has already a firmware loading script but it looks for firmware files in a different path, /usr/lib/hotplug/firmware e.g..

regards
Henning

userxy

17-10-2007 22:25:54

Hi Henning,

I searched on the IPCOP-Homepage and IPCOP (Kernel 2.4.34) needs hotplug and "firmware_class" can be loaded with modprobe.

But I have found "fxload" und as far as understand, it is possible to load firmware directly into a device.
If the dev is allready pressent then you just has to put in the command

[b1bhn24q2]fxload -D /proc/bus/usb/001/004 -I /lib/firrmware/rt73.bin[/b1bhn24q2]
But get [b1bhn24q2]can't modify CPUCS Broken pipe[/b1bhn24q2]

I have realy no more ideas cry


[code1bhn24q2]
dmesg:
usbdevfs: USBDEVFS_CONTROL failed dev 4 rqt 64 rq 160 len 1 ret -32
[/code1bhn24q2]

If I do a strac fxload (it is very long) I found a line

[code1bhn24q2]
strace fxload
ioctl(3, USBDEVFS_CONTROL, 0xbffffb80) = -1 EPIPE (Broken pipe)
[/code1bhn24q2]

The /proc/bus/usb/device I think is looking good.
[code1bhn24q2]
/proc/bus/usb/devices
T: Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#= 1 Spd=12 MxCh= 2
B: Alloc= 0/900 us ( 0%), #Int= 0, #Iso= 0
D: Ver= 1.00 Cls=09(hub ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0000 ProdID=0000 Rev= 0.00
S: Product=USB UHCI Root Hub
S: SerialNumber=d000
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr= 0mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=09(hub ) Sub=00 Prot=00 Driver=hub
E: Ad=81(I) Atr=03(Int.) MxPS= 8 Ivl=255ms
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 6 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=0b05 ProdID=1723 Rev= 0.01
S: Manufacturer=Ralink
S: Product=802.11 bg WLAN
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=300mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=rt73
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=01(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
[/code1bhn24q2]

Confust regarts
Kurt (and thank you for helping)

hennichodernich

18-10-2007 06:27:40

I searched on the IPCOP-Homepage and IPCOP (Kernel 2.4.34) needs hotplug and "firmware_class" can be loaded with modprobe.
[/quote10cxhxyv]
Fine.

But I have found "fxload" und as far as understand, it is possible to load firmware directly into a device.
[/quote10cxhxyv]
fxload is a tool that only works for chips manufactured by Cypress Semiconductors, and only for microcontrollers from the EZ-DSP, FX and FX2 series (I own one of these [url10cxhxyv]http://home.arcor.de/henning.paul/gallery/cypress.jpg[/url10cxhxyv], thus I happen to know this tool). But these chips use a proprietary firmware loading mechanism and not firmware_class, so this tool won't work for you.

I don't want to explain the whole mechanism over and over again so please look for instance into this thread [url10cxhxyv]http://rt2x00.serialmonkey.com/phpBB2/viewtopic.php?p=26212[/url10cxhxyv].

Don't you guys never search the forum before starting a new thread? ?

regards
Henning

userxy

21-10-2007 18:18:53

Hi Henning,

I can understand that ist is boring to answer the same question x times.

But -

1. I did search this forum, IPCOP-forum GOOGLE ... (nights long ...) Im not a cack so I pussel my infos peace by peace, sometimes not knowing the right term to search for.

2. I know the tread you mention above, but it is a Kernel 2.6, I use IPCOP with Kernel 2.4.34 (as written above) and there are def. a few changes with hotplug ...

Anyway, now I am a step further, hotplug it self is running but missing the usb.agent
But Im using a "special" IPCOP-hotplug and I have to ask (or search) in this forum.

So you see (and I understand too) that it is not easy for both sides.

Thanks and regards
Kurt

userxy

21-10-2007 21:59:15

Hi, Henning

its me again oops hoping you will stil read my posts.

I have found a puzzle-part more. (and hopfully a little bit more understanding)

My hotplug seems to by nothing special, only that there is a Firmware.agend already.

So just to point out the problems, I ask the qustions first.
(explanation follows)

1. Does the rt73-cvs-2007101215 works with the name "usb.agent"
(I called it "firmware.agent" and get an error message)

2. Does the 2.3.34 Kernel know the variable $DETHPATH, like used in
the agent (and in the ones I found) because hotplug seems to deliver
$DEVICE and $PATH

The explanation follows here

For me it looks like th rt73-driver searchs a "usb.agent"

The errormessage from hotplug was
[quotedduanrpz]
no runnable /etc/hotplug/usb.agent is installed
[/quotedduanrpz]

First I searcht if both was needed, but found no answer. Then tried the easy way, renaming firmware in to usb. (beside found out that usb.agent mast be executable)

Now it looks much better, only one variable (witch I could not figured out if is already in Kernel 2.4.34) seemes to be missing

It is the $DEVPATH witch is used in the agend and get me this error message
[codedduanrpz]
Oct 21 22:54:33 ipcop usb.agent[1102]: /proc// does not exist
[/codedduanrpz]

And this is the error-code in the agent
[codedduanrpz]
mesg "$SYSFS/$DEVPATH/ does not exist"[/codedduanrpz]
In line 48 (I underlined it below)


The dirver and firmware loading looks like this
[codedduanrpz]
Oct 21 22:54:13 ipcop kernel: rtusb init ====>
Oct 21 22:54:13 ipcop kernel: rtusb init ====>
Oct 21 22:54:13 ipcop kernel: usb.c: registered new driver rt73
Oct 21 22:54:13 ipcop kernel: usb.c: registered new driver rt73
Oct 21 22:54:28 ipcop kernel: hub.c: new USB device 00:07.2-1, assigned address 10
Oct 21 22:54:28 ipcop kernel: hub.c: new USB device 00:07.2-1, assigned address 10
Oct 21 22:54:28 ipcop kernel: idVendor = 0xb05, idProduct = 0x1723
Oct 21 22:54:28 ipcop kernel: idVendor = 0xb05, idProduct = 0x1723
Oct 21 22:54:28 ipcop kernel: rt73: usb device name wlan0
Oct 21 22:54:28 ipcop kernel: rt73: usb device name wlan0
Oct 21 22:54:28 ipcop kernel: rt73: BulkOutMaxPacketSize 64
Oct 21 22:54:28 ipcop kernel: rt73: BulkOutMaxPacketSize 64
Oct 21 22:54:28 ipcop kernel: rt73: rt73_get_ether_stats --->
Oct 21 22:54:28 ipcop kernel: rt73: rt73_get_ether_stats --->
Oct 21 22:54:28 ipcop default.hotplug[1099]: arguments (net) env (OLDPWD=/ PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=register PWD=/etc/hotplug HOME=/ SHLVL=2 INTERFACE=wlan0 DEBUG=yes _=/usr/bin/env)

Oct 21 22:54:28 ipcop default.hotplug[1099]:no runnable /etc/hotplug/net.agent is installed Oct 21 22:54:28 ipcop default.hotplug[1102]: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=add PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/001/010 INTERFACE=255/255/255 PRODUCT=b05/1723/1 TYPE=0/0/0 DEBUG=yes _=/usr/bin/env)

Oct 21 22:54:28 ipcop default.hotplug[1102]: invoke /etc/hotplug/usb.agent ()
Oct 21 22:54:33 ipcop usb.agent[1102]: [u][b]/proc// does not exist[/b][/u]
[/codedduanrpz]

The (renamed) firmware.agent has the entries

[codedduanrpz]
# use /proc for 2.4 kernels
if [ "$SYSFS" = "" ]; then
SYSFS=/proc
[/codedduanrpz]

Witch (for me) means it is also for a 2.4 Kernel

The usb.agent (old firmware.agent) looks like this
[codedduanrpz]
#!/bin/sh
#
# Firmware-specific hotplug policy agent.
#
# Kernel firmware hotplug params include:
#
# ACTION=%s [add or remove]
# DEVPATH=%s [in 2.5 kernels, /sys/$DEVPATH]
# FIRMWARE=%s
#
# HISTORY:
#
# 24-Jul-2003 Initial version of "new" hotplug agent.
#
# $Id: firmware.agent,v 1.3 2004/03/14 15:52:56 ukai Exp $
#
echo "firmware.agent"

cd /etc/hotplug
. ./hotplug.functions
# DEBUG=yes export DEBUG

# directories with the firmware files
FIRMWARE_DIRS="/lib/firmware /usr/local/lib/firmware /usr/lib/hotplug/firmware"

# mountpoint of sysfs
SYSFS=$(sed -n '/^.* \([^ ]*\) sysfs .*$/ { s//\1/p ; q }' /proc/mounts)

# use /proc for 2.4 kernels
if [ "$SYSFS" = "" ]; then
SYSFS=/proc
fi

#
# What to do with this firmware hotplug event?
#
case "$ACTION" in

add)
counter=5
while [ ! -e $SYSFS/$DEVPATH/loading -a $counter -gt 0 ]; do
sleep 1
counter=$(($counter - 1))
done

if [ $counter -eq 0 ]; then
mesg "$SYSFS/$DEVPATH/ does not exist"
exit 1
fi

for DIR in $FIRMWARE_DIRS; do
[ -e "$DIR/$FIRMWARE" ] || continue
echo 1 > $SYSFS/$DEVPATH/loading
cat "$DIR/$FIRMWARE" > $SYSFS/$DEVPATH/data
echo 0 > $SYSFS/$DEVPATH/loading
exit
done

# the firmware was not found
echo -1 > $SYSFS/$DEVPATH/loading

;;

remove)
;;

*)
mesg "Firmware '$ACTION' event not supported"
exit 1
;;

esac
[/codedduanrpz]

I know it is a long tread roll but hope to describe my problem well and that Henning or anyone else con help.

Thanks very much
Kurt

hennichodernich

22-10-2007 06:22:11


2. Does the 2.3.34 Kernel know the variable $DETHPATH, like used in
the agent (and in the ones I found) because hotplug seems to deliver
$DEVICE and $PATH
[/quote24rw21ri]

Looks like a bit of a problem. But it would be not a big problem to make the script work with $DEVICE only, if we can be sure that there is this special "loading" pseudofile somewhere in /proc. Could you please look for files called "loading" under /proc?
[code24rw21ri]find /proc -name loading[/code24rw21ri]
I don't have a recent kernel 2.4 system at hand...

regards
Henning

userxy

18-11-2007 13:02:30

Hi Henning,

as you wrote, I looked for files called "loading" under /proc? but there was nothing !!!

So I decided to reinstall the whole maschin again with the compleat hotplug-Image (from http//linux-hotplug.sourceforge.net/)

But still than it was not running. (mistake of me or the driver ???)

I looked on the download page here and found a new legacy-driver as a few weeks before !?!
rt73-cvs-daily.tar.tar (after "tar" it rt73-cvs-2007111011)

After installing it I just had to change the path-entrie of the .bin-Firmware in firmware-agent and than it was running !!!

Just because of curiosity I installt the original driver (rt73 from the ASUS-CD) and it was running also !!! (looks like they would not use hotplug)

A smale advice for everyone who try it It is very importent to follow the README very carefully !!! oops


But anyway ... I use the legacy-driver.

Do you know if there would be any change to that a later legacy-driver is able for ap-mode (master-mode) ?

Regards and thanks very much for your help !!!
Kurt

Spy84464

18-11-2007 16:02:44

Hello,
There is no plan to ever support master mode with the legacy drivers, rt2x00 will.

Regards,
Romain

userxy

18-11-2007 20:19:29

Hello Romain,

I know that rt2x00 do, but unfortunately IPCOP still runns a 2.4 Kernel ... (

So I have to wait till they change.

Thanks and Regards
Kurt