Caanoo / WIZ We *need* Gadget_Eth On The Wiz.


torpor

hack hack hack, the little machines fight back
Joined
Oct 21, 2005
Messages
2,475
Location
vienna, austria
Website
w1xer.at
It is extremely tiresome, dare I say fatiguing, to have to debug my new WIZ apps through redirected I/O to an SD card that I have to mount/remount every time just to find out what my app is doing.

We *NEED* gadget_eth.

If anyone has the ability to compile this module using the kernel sources, and if they have the sources (I hear someone on here may have them), please put gadget_eth to the top of the priority list. If you need help with building it or testing it or something, PM me (or find me in #wizdev on EFNet, torpor) and I will do everything I can to help. I'm *really* sick of having to use stderr.txt/stdout.txt to find out whats going on with my apps, and this is only after having had the WIZ for a week.
 
I agree with you but it just simply doesn't work. Looks like the USB peripheral was just hacked together to work as file storage and nothing else.

http://www.gp32x.de/board/index.php?/topic/48606-where-is-the-kernel-source-for-firmware-1-1-0/page__view__findpost__p__740320
 
Last edited by a moderator:
gadget_eth was in the pre-release firmware for pre-release Wiz's, but it never worked. The gadget file support was extremely broken too and only worked about 10% of the time, and only on full speed USB (not high speed). In the end, gadget_eth was dropped and then seemed to put all there efforts into the file support. It's certainly just thrown together however, GPH seem to have no understanding of the actual code.

Even if you compile it yourself however, it still doesn't work! I've no idea why.
 
Well I for one would like to try to fix this issue. It can't be that hard, and it doesn't seem like there are any -hardware- reasons for it not to work (or else gadget_fs wouldn't work either) .. so I guess I'm going to be bugging Orkie for the latest kernel sources so that I can make a compatible module ..
 
You can compile linux-2.6.24-pollux-090105-wiz.tar.gz to make g_ether.ko module. But when I tried, though it was successfully loaded, I could not make a connection.

After compiling the kernel code, two modules are generated: g_ether.ko and lf1000_udc.ko

Here is the output.

Code:
root@wiz:~# insmod lf1000_udc.ko
Using lf1000_udc.ko
lf1000_udc: version 03 Jul 2007
lf1000_udc_probe: base addr = f0018000

root@wiz:~# insmod g_ether.ko
Using g_ether.ko
ether gadget: using random self ethernet address
ether gadget: using random host ethernet address
usb0: Ethernet Gadget, version: May Day 2005
usb0: using lf1000_udc, OUT ep2-bulk IN ep1-bulk
usb0: MAC 12:5a:88:30:a4:63
usb0: HOST MAC 1a:d5:c3:4c:2e:74
usb0: RNDIS ready

root@wiz:~# lsmod
Module                  Size  Used by    Not tainted
g_ether 23756 0 - Live 0xbf00d000
lf1000_udc 16200 1 g_ether, Live 0xbf008000
rtc_pollux_m41t80 7408 0 - Live 0xbf005000
rtc_core 14840 1 rtc_pollux_m41t80, Live 0xbf000000

root@wiz:~# ifconfig usb0 10.0.0.1 netmask 255.255.255.0
root@wiz:~# ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B) 

usb0      Link encap:Ethernet  HWaddr 12:5A:88:30:A4:63
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
But when I plug in the wiz to my computer, no network connection is made.

On Linux,

Code:
barosl@akiyama:~$ lsusb
Bus 001 Device 005: ID 0525:a4a2 Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget

barosl@akiyama:~$ dmesg
[ 7529.524020] usb 1-2: new high speed USB device using ehci_hcd and address 5
[ 7529.656350] usb 1-2: config 2 interface 0 altsetting 0 has an invalid endpoint with address 0x0, skipping
[ 7529.656594] usb 1-2: config 1 has 0 interfaces, different from the descriptor's value: 1
[ 7529.657327] usb 1-2: configuration #1 chosen from 2 choices
I heard that usb0-related messages must be followed after the message. But there is no usb0 device, so I can't "ifconfig usb0" on the host computer.

And on Windows, the device manager displays 'This device cannot start. (Code 10)' with the question mark.

Can you solve the problem?
 
[ 7529.524020] usb 1-2: new high speed USB device using ehci_hcd and address 5
[ 7529.656350] usb 1-2: config 2 interface 0 altsetting 0 has an invalid endpoint with address 0x0, skipping
[ 7529.656594] usb 1-2: config 1 has 0 interfaces, different from the descriptor's value: 1
[ 7529.657327] usb 1-2: configuration #1 chosen from 2 choices

This just looks like there is something not quite right with the endpoint descriptor in ether.c ..

I will spend a little time looking at this tonight when I get home - can't have access to the code here at work, alas - but I think we're pretty close. If all that is happening is a descriptor problem, then we can probably fix that fast. Looks to me like we might be dealing with someone making a change to the ether code and not knowing what they were doing - in the meantime if you wanna compare it with the stock ether.c from mainline linux code, this might answer the question pretty fast. Maybe they were trying to hack things up so that g_ether and g_fs could co-exist? That might be one reason for trying to crowbar the descriptors ..

BTW, if we can meet tonight on #wizdev, we probably can fix this faster than using the boards for msgs .. I'll be on as soon as I get a chance to get my hack on at home ..
 
With the help of notaz, now I can see what is printed on Wiz while connected to PC.

Code:
usb0: high speed config #1: 100 mA, Ethernet Gadget, using CDC Ethernet
Unknown USB request: ERR: -22
Unknown USB request: ERR: -22
Unknown USB request: ERR: -22
Unknown USB request: ERR: -22
Unknown USB request: ERR: -22
Unknown USB request: ERR: -22
Any ideas?
 
The descriptor is simply invalid. Please compare the GPH-provided ether.c source with a stable one from a known kernel release. I heard they tried to hack things up and may not have finished the work/backed it out.
 
Back
Top