hcf
Still Fresh
After tooling around with USBSerial for awhile, I got really tired of still having to restart my Wiz to transfer files. Something had to be done. I was surprised to see what was wrong...after reading all the stories about the g_ether module having problems, I thought it would be a much more significant issue!
Anyway.
As usual, step 1 involves fetching some software (the g_ether.ko on the Wiz will not help you, you will need the one I compiled with source changes);
http://www.mercenary.net/OpenWiz/USBNetwork-1.1.0.tar.bz2
Step 2, untar it onto the SD card.
Unmount the SD flash safely and return the Wiz to the menu.
Step 3, run the "NetworkUp.gpe" script from the Launcher.
The NetworkUp.gpe script will configure the usb0 interface with '10.0.0.2/24'. I guess I didn't have to use a /24 but it is easier to type on the host side slightly.
Step 4, now on the host side, check 'dmesg', and then configure the host side of the interface so the two can speak (automating this step depends largely on host OS and is up to you):
At this stage, the Wiz is attached to the host by networking. What network applications to build, install, or configure, and how to use them, is a howto for another day.
Note that again while the LF1000 device is in use, the Wiz cannot be used as a block device to mount the SD or NAND devices. To remove the g_ether module and restore these functions while the Wiz is running, simply run the NetworkDown.gpe script included in the same directory. This will take the Wiz off network. You may also safely simply restart the Wiz.
RELEASE NOTES
There is a known problem with using this kernel module on GPH firmware 1.1.0-255 which has been circulating separately from the 1.1.0-222 available from GPH's website and the openhandhelds.org archive. The problem is that 'insmod' segfaults before it can load the network gadget module into the kernel. There is no known workaround. Hopefully this flaw in the 1.1.0-255 firmware will be corrected before final release.
Here is the patch showing changes I made to the gadget ethernet sources, for those who are wondering what it took. It was surprisingly trivial, as I think you may agree:
Edit: I forgot to mention one other minor change. When configuring linux-2.6.24-pollux to build the g_ether kernel module, the default is to build the module with the NDIS additional module (intended for some kind of Windows compatibility). I had no intention of using this service, I'm not even familiar with it, and so selected 'no' to simplify the driver. I do not know if this affects the g_ether module's success above (if it is required), but it will mean the driver presents one configuration (for the subset/bulk driver) instead of two (bulk/cdc and NDIS).
Edit 2: Decided my tasteless joke at the expense of others was a tasteless joke at the expense of others, and not nearly as funny as I thought.
Edit 4: Documenting edit 3: s/ether.c/ether.ko/ (describing module installed on Wiz), s/SDRAM/SD card/ (correcting finger macro)
Edit 5: Added RELEASE NOTES to document known problem(s).
Anyway.
As usual, step 1 involves fetching some software (the g_ether.ko on the Wiz will not help you, you will need the one I compiled with source changes);
http://www.mercenary.net/OpenWiz/USBNetwork-1.1.0.tar.bz2
Step 2, untar it onto the SD card.
Code:
cd /media/disk # or wherever
tar xzf ~/Desktop/USBNetwork-1.1.0.tar.gz # or wherever
Unmount the SD flash safely and return the Wiz to the menu.
Step 3, run the "NetworkUp.gpe" script from the Launcher.
The NetworkUp.gpe script will configure the usb0 interface with '10.0.0.2/24'. I guess I didn't have to use a /24 but it is easier to type on the host side slightly.
Step 4, now on the host side, check 'dmesg', and then configure the host side of the interface so the two can speak (automating this step depends largely on host OS and is up to you):
Code:
usb 5-2: new full speed USB device using ohci_hcd and address 18
usb 5-2: not running at top speed; connect to a high speed hub
usb 5-2: new device found, idVendor=049f, idProduct=505a
usb 5-2: new device strings: Mfr=1, Product=2, SerialNumber=0
usb 5-2: Product: OpenWiz Ethernet
usb 5-2: Manufacturer: Linux 2.6.24/lf1000_udc
usb 5-2: configuration #1 chosen from 1 choice
usb 5-2: unsupported MDLM descriptors
usb0: register 'cdc_subset' at usb-0000:00:13.4-2, Linux Device, 76:63:3c:8b:35:72
# ifconfig usb0 inet 10.0.0.1 netmask 255.255.255.0
# ping 10.0.0.2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=4.69 ms
64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.986 ms
64 bytes from 10.0.0.2: icmp_seq=3 ttl=64 time=0.959 ms
At this stage, the Wiz is attached to the host by networking. What network applications to build, install, or configure, and how to use them, is a howto for another day.
Note that again while the LF1000 device is in use, the Wiz cannot be used as a block device to mount the SD or NAND devices. To remove the g_ether module and restore these functions while the Wiz is running, simply run the NetworkDown.gpe script included in the same directory. This will take the Wiz off network. You may also safely simply restart the Wiz.
RELEASE NOTES
There is a known problem with using this kernel module on GPH firmware 1.1.0-255 which has been circulating separately from the 1.1.0-222 available from GPH's website and the openhandhelds.org archive. The problem is that 'insmod' segfaults before it can load the network gadget module into the kernel. There is no known workaround. Hopefully this flaw in the 1.1.0-255 firmware will be corrected before final release.
Here is the patch showing changes I made to the gadget ethernet sources, for those who are wondering what it took. It was surprisingly trivial, as I think you may agree:
Code:
*** drivers/usb/gadget/ether.c.old 2009-04-30 05:35:10.000000000 -0700
--- drivers/usb/gadget/ether.c 2009-11-18 16:57:31.000000000 -0800
***************
*** 67,74 ****
* needlessly complex.
*/
! #define DRIVER_DESC "Ethernet Gadget"
! #define DRIVER_VERSION "May Day 2005"
static const char shortname [] = "ether";
static const char driver_desc [] = DRIVER_DESC;
--- 67,74 ----
* needlessly complex.
*/
! #define DRIVER_DESC "OpenWiz Ethernet"
! #define DRIVER_VERSION "HCF 0"
static const char shortname [] = "ether";
static const char driver_desc [] = DRIVER_DESC;
***************
*** 287,292 ****
--- 287,295 ----
#define DEV_CONFIG_CDC
#endif
+ #ifdef CONFIG_USB_GADGET_LF1000
+ #define DEV_CONFIG_SUBSET
+ #endif
/*-------------------------------------------------------------------------*/
Edit: I forgot to mention one other minor change. When configuring linux-2.6.24-pollux to build the g_ether kernel module, the default is to build the module with the NDIS additional module (intended for some kind of Windows compatibility). I had no intention of using this service, I'm not even familiar with it, and so selected 'no' to simplify the driver. I do not know if this affects the g_ether module's success above (if it is required), but it will mean the driver presents one configuration (for the subset/bulk driver) instead of two (bulk/cdc and NDIS).
Edit 2: Decided my tasteless joke at the expense of others was a tasteless joke at the expense of others, and not nearly as funny as I thought.
Edit 4: Documenting edit 3: s/ether.c/ether.ko/ (describing module installed on Wiz), s/SDRAM/SD card/ (correcting finger macro)
Edit 5: Added RELEASE NOTES to document known problem(s).