Page 1 of 11 123 ... LastLast
Results 1 to 15 of 161

Thread: USB device support for Series2 / 3.1.x @ kernel 2.4.4

  1. #1
    Join Date
    Jan 2002
    Posts
    1,777

    USB device support for Series2 / 3.1.x @ kernel 2.4.4

    Update 2004/10/07:

    This release has been deprecated in favor of Jamie's 2.4.27 backport, which now supports kernel versions 2.4.4, 2.4.18, and 2.4.20. Though this thread is still a legit place for discussing and supporting both versions, I recommend:

    - explicitly stating which release of the drivers you are using in support posts
    - using, testing, extending, and updating the new 2.4.27 backport instead of this one

    --- original post follows ---

    Enclosed please find several device drivers intended for use with the 2.4.4-TiVo MIPS kernel. The binary versions in modules/ were compiled with gcc-3.2 and linked with binutils-2.13. I used a slightly modified version of the cross compiler build script from [1] to produce the toolchain. gcc-3.0 should also work. Don't forget to update the pointer in Rules.mk to your 2.4.4-TiVo source tree, and make sure everything is in place (configuration, include/asm symlink, etc.).

    usbcore.o, hcd.o: These are usb "core" modules backported from 2.4.20. You *must* not use any of the old 2.4.4 USB modules in conjunction with anything in this package if you want to avoid kernel panics. hcd.o is not needed for usb-ohci.o since it is an "old style" host controller driver.

    usb-ohci.o: This is the USB 1.1 OHCI driver backported from 2.4.20. It may be loaded concurrently with ehci-hcd.o in order to support USB 1.1 devices.

    ehci-hcd.o: This is the USB 2.0 EHCI driver backported from 2.4.20. It depends on hcd.o. You may load this alone (skipping the OHCI driver) if you only have USB 2.0 devices connected. I would recommend loading it prior to usb-ohci.o to make sure your 2.0 devices attach to the fast bridge, but it may be smart enough to do this on its own.

    at76c50*.o: This is the Atmel 76c503 USB WLAN driver from [2]. A few patches were applied for improved error handling and to fix a few endian issues. Overall this is rather clean code - I discovered it after nearly going blind from debugging the official Atmel driver from sf.net. This driver has been tested with a generic at76c503-rfmd NIC and that cheapo Gigafast NIC that seems to go on sale every few weeks (it is an at76c503 with a 3861 Intersil radio). iwconfig is not supported (see below) so you'll need to find a different way to set your parameters. WEP has not been tested but it's useless anyway. usbdfu.o and at76c503.o are "core" modules; at76c50[35]-*.o specifies the characteristics of your adapter. If you don't know what hardware you have, check [3].

    ax8817x.o: This is the driver that TiVo developed for ax8817x USB 2.0 network adapters, slightly modified to use the new 2.4.20 devreq structure instead of the one from 2.4.18 (TiVo software 4.0). I tested it on D-Link DUB-E100 adapters; supposedly it is compatible with a handful of different brands - look at ax8817x_id_table[] in the source code. Running in USB 2.0 mode, I have seen upload rates of about 3.7 megabytes/sec and download rates of about 5.0 megabytes/sec over TCP on a 100BaseTX switched network. In USB 1.1 mode it seems to max out around 700-800 kilobytes/sec.

    kaweth.o: This is the Kawasaki KL5KUSB101 ethernet driver from the 2.4.20 kernel tree. I tested it (slightly) with a 3C19250 NIC.

    pegasus.o: This is the Pegasus ethernet driver from the 2.4.20 kernel tree. I tested it (slightly) with a Linksys USB100TX. Note that the link light may be off for no apparent reason on this device.

    (continued in next post due to 5000 char limit)
    Last edited by alldeadhomiez; 10-07-2004 at 09:38 PM.

  2. #2
    Join Date
    Jan 2002
    Posts
    1,777
    (continued)

    Things that don't suck:

    DS1) Everything compiles. Everything works (at least on my box).

    DS2) No changes are necessary to the kernel.org source files in this build setup - which makes it easy to try it out with future versions of the Linux USB code. This is a big plus because it seems like the codebase is rewritten from scratch every few weeks, fixing one or two bugs and introducing a dozen more.

    DS3) The USB 2.0 code gives us *fast* transfers. This should be nice for extraction fans.

    DS4) The ax8817x driver in this package does not lock up the adapter when your packet payload is an exact multiple of 64 bytes. This is because the 2.4.20 USB code supports USB_ZERO_PACKET, and the 2.4.4 USB code does not.

    Things that suck:

    S1) Nothing has been tested much. If you find a bug, please submit a patch.

    S2) There is a problem that may involve truncated packets in the EHCI driver. I have patched host/usb.c to fix the most obvious symptom (grep for 'WRONG WRONG WRONG WRONG WRONG') but this is definitely not a correct solution. I tried the EHCI driver from 2.4.21-rc3 and it was even worse; that driver sends bad requests to the USB chipset and starts generating nasty protocol errors. This may have something to do with the fact that I was commenting out calls to the pci driver that didn't exist in 2.4.4 (and that I do not understand at all).

    S3) It would be nice to write a kernel module that re-enables wireless ioctls so that iwconfig works normally. (grep for CONFIG_NET_RADIO in the kernel tree and take a look at the code that gets lopped out when it is undefined.)

    S4) These drivers generate a bunch of unaligned accesses (especially the pegasus driver). This happens because gcc does stupid things like accessing an unaligned 32-bit word in a packed structure with a single "lw" opcode. If you know of a way to override this behavior ON MIPS (no, not on i960) let me know. I was hoping that gcc-3.2 would fix the problem but it did not.

    S5) We need a secure way to encrypt traffic to the TiVo for use on wireless networks, since tivoftpd, tnlited, and tivoweb are all wide open. Anyone want to build FREES/WAN for 2.4.4-TiVo? CIPE looks like another possibility, although the use of (albeit encrypted) CRC32s as a MAC leads me to question their design process.

    References:

    [1] http://tivoutils.sourceforge.net/

    [2] http://innominate.org/kurth/at76c503/

    [3] http://atmelwlandriver.sourceforge.net/usbtable.html

  3. #3
    Join Date
    Mar 2003
    Posts
    102
    this is awesome news. I'm gonna run out tomorrow and pick up a dub-e100 or linksys usb200m and try this out asap. I assume all I need to do is insmod usbcore.o, hcd.o, ehci-hcd.o, and ax8817x.o (in that order) and I should be in business. _really_ awesome news.

  4. #4
    Join Date
    Mar 2003
    Posts
    102
    Today I bought a Linksys USB200M adapter from CompUSA (on sale for $19.99 till 5/31). loaded the new modules and it worked like a charm. Now I can stream using mplayer without any blips. I am seeing transfer rates of about 7 megabits/sec, whereas before I was only getting about 4 megabits/sec. I also tried raw ftp and that gave me about 8 Mbps. this is really great.

    alldeadhomiez, thanks so much for your work on providing these modules. how did you measure your bandwidth of 3.7 - 5.0 megabytes/sec? Since both the Dlink and Linksys use the same chip, I wouldn't expect that to be the difference.

  5. #5
    Join Date
    Jan 2002
    Posts
    1,777
    Originally posted by citivolus
    alldeadhomiez, thanks so much for your work on providing these modules. how did you measure your bandwidth of 3.7 - 5.0 megabytes/sec? Since both the Dlink and Linksys use the same chip, I wouldn't expect that to be the difference.
    I used netcat to read from /dev/zero on one side, and write to /dev/null on the other side. This measured something close to the maximum transfer rate between a user-mode process on the Tivo and a user-mode process on the PC in an application-agnostic manner.

    It may be worthwhile to experiment with read() vs. mmap() for sending data straight from the disk. Also note that the tivo software probably slows the system down a lot due to disk access scheduling and its own overhead.

  6. #6
    Join Date
    May 2003
    Posts
    25
    So for my E-100 to get up and running I need to use the modules that you have graciously compile for MIPS. How do I need to setup the files like you mentioned in your original post. An example of the setup would be awesome. I think I am just missing something.

    Chaz

  7. #7
    Join Date
    May 2003
    Posts
    3

    Wireless config question

    alldeadhomiez,

    Thanks much for making so much progress on the wireless and 2.0 drivers for the 3.1 software. I hate to pester, but I am still having difficulty configuring my wireless USB adapter with your drivers.

    I have a Linksys WUSB11 v2.6 which is AT76C503A 3861. I set up the following environment variables in my hackinit:

    WIRELESS=yes
    WIRELESS_ESSID=xxxx
    WIRELESS_CHANNEL=xx
    WIRELESS_MODE=Managed
    WIRELESS_RATE=Auto

    I then also load the following drivers:

    insmod /var/hack/lib/usbcore.o
    insmod /var/hack/lib/usb-ohci.o
    insmod /var/hack/lib/usbdfu.o
    insmod /var/hack/lib/at76c503.o
    insmod /var/hack/lib/at76c503-i3861.o netdev_name=eth0

    When I try to run:

    ifconfig eth0 192.168.1.xxx broadcast 192.168.1.255 netmask 255.255.255.0

    I get the following error:

    SIOCSIFADDR: No such device
    eth0: unknown interface.
    SIOCSIFBRDADDR: No such device
    eth0: unknown interface.

    I have also tried running the ifconfig using the wlan0 device as the driver page mentions.

    Anyhow, I'd really love to get the tivo on the wireless network without having to use a cheesy and overpriced bridge. If you have any advice or information, please let me/us know!

    Thanks again!

  8. #8
    Join Date
    Jan 2002
    Posts
    1,777

    Re: Wireless config question

    Originally posted by pmaxx
    alldeadhomiez,

    I have a Linksys WUSB11 v2.6 which is AT76C503A 3861. I set up the following environment variables in my hackinit:

    WIRELESS=yes
    WIRELESS_ESSID=xxxx
    WIRELESS_CHANNEL=xx
    WIRELESS_MODE=Managed
    WIRELESS_RATE=Auto
    I have no reason to believe that anything looks at these variables.


    I get the following error:

    SIOCSIFADDR: No such device
    eth0: unknown interface.
    SIOCSIFBRDADDR: No such device
    eth0: unknown interface.

    I have also tried running the ifconfig using the wlan0 device as the driver page mentions.
    It doesn't recognize your device and is apparently not creating the network interface.

    I believe when I tried a WUSB11 (which I no longer have access to) it had an RFMD radio, not a 3861. It may be worth trying the at76c503-rfmd driver unless you have opened the device to verify your chipset. It seems like the WUSB11 may come in both varieties.

    If that does not fix it you will need to post the kernel messages generated after the usb modules have been loaded. If you don't have dmesg see if the tivo dumps them in /var/log somewhere. (dmesg is installed if/when you put the Debian Linux userspace on the tivo.)

  9. #9
    Join Date
    May 2003
    Posts
    25
    Don't forget to update the pointer in Rules.mk to your 2.4.4-TiVo source tree, and make sure everything is in place (configuration, include/asm symlink, etc.).
    Can someone post an example of this setup. I am still trying to ge the E-100 working on my HDVR2 and so far no luck.

    Chaz

  10. #10
    Join Date
    May 2003
    Location
    Chicago Burbs
    Posts
    160
    Can someone post an example of this setup. I am still trying to ge the E-100 working on my HDVR2 and so far no luck.

    Chaz
    --------------------------------------------------------------------
    I just got it working with the Linksys USB200M. The same setup
    should work for the E-100.

    Here is my hackinit, (Had to add sleep before ifconfig to get it to work)

    #!/bin/bash
    date>>/var/hack/hackinit.log
    PATH=/var/hack/bin:/sbin:/bin:/tivobin:/tvbin:.
    TIVO_ROOT=
    MFS_DEVICE=/dev/hda10
    IGNOREEOF=1000
    export PATH TIVO_ROOT MFS_DEVICE IGNOREEOF

    /bin/bash</dev/ttyS2&>/dev/ttyS2&

    #insmod /diag/usbcore.o
    #insmod /diag/usb-ohci.o
    #insmod /diag/pegasus.o
    insmod /var/hack/lib/usbcore.o
    insmod /var/hack/lib/hcd.o
    insmod /var/hack/lib/ehci-hcd.o
    insmod /var/hack/lib/ax8817x.o

    sleep 15

    ifconfig eth0 172.16.1.35 broadcast 172.16.1.250 netmask 255.255.0.0
    tnlited 23 /bin/bash -login &
    tivoftpd

    mount -o remount,rw /

    #replace rc.sysinit with modified copy
    rm -rf /etc/rc.d/rc.sysinit
    cp /var/hack/rc.sysinit /etc/rc.d/rc.sysinit

    # Disable scramble
    /var/hack/etc/kmem 800b23b4 00001021

    /var/hack/tivoweb-tcl/tyhttpd 2000 4 >> /dev/null &

  11. #11
    Join Date
    May 2003
    Posts
    25
    thanks, awesome.

    What is that disable scramble stuff.

    Chaz

  12. #12
    Join Date
    Jun 2001
    Posts
    3,108
    Originally posted by chazman
    thanks, awesome.

    What is that disable scramble stuff.

    Chaz
    its the s2 dtivo equivilent of noscramble, allows for extraction. if you need more info, search for kmem, then check out the extraction forum
    Step one: search button!
    Silly Wabbit, guides are for kids

  13. #13
    Join Date
    May 2003
    Posts
    3

    Got wireless working!

    Hey everyone,

    Just wanted to let anyone who might be interested know that thanks to the help of a couple of PMs from alldeadhomiez, I finally got a Linksys WUSB11 ver 2.6 wireless USB NIC running on my HDVR2. I have a managed/infrastructure wireless network setup (rather than ad-hoc).

    I have not figured out how to get iwconfig working on the Tivo to configure wireless parameters, but I did discover that the at76c503 driver code sets up default parameters. If you modify the source and then recompile with your settings, you can make a driver that defaults to your own wireless network's settings. To help, here are the relevent lines of code to change:

    All changes are to at76c503.c

    For setting up a managed mode network:
    line 2959: dev->iw_mode = IW_MODE_INFRA;
    line 885: bss.bss_type = INFRASTRUCTURE_MODE;
    (not sure if this is necessary but I used it)

    For setting up an adhoc network:
    line 2959: dev->iw_mode = IW_MODE_ADHOC;

    For both managed mode and ad-hoc:

    line 166: #define DEF_ESSID "<your ess id>";
    line 167: #define DEF_ESSID_LEN <number of chars in essid>

    it should automatically scan for your channel based on the ESSID, but if not, modify:

    line 168: #define DEF_CHANNEL <channel number>

    Recompile all the drivers, and insmod usbcore.o, usb-ohci.o, at76c503.o, and whichever module corresponds to your specific usb device (for the WUSB11 it is at76c503-rfmd.o). Also, when you insmod the last driver (the one specific to your device) it defines the device name as wlan0. If you want to make it something else you have to set a parameter on the insmod command like this: netdev_name=eth0

    It took me a long time to get the cross compiler working properly, but it eventually worked with binutils 1.3, gcc 3.0, glibc 2.2.3, and the Tivo 3.1/3.2 kernel source. I used the build_mips_x_compiler.sh script from link [1] in alldeadhomiez post.

    Hope this helps!

  14. #14
    Join Date
    Jan 2002
    Posts
    1,777

    Another nifty change

    Add this to backports.h:

    Code:
    #define CONFIG_HOTPLUG
    static char hotplug_path[] = "/sbin/hotplug";
    and /sbin/hotplug (which can be a shell script) will be run every time something changes on the bus. This can be used to invoke ifconfig to bring up the new interface. If you want to start detecting what device got attached it might get a bit tricky (usbdevfs seems broken?) but an ifconfig on a nonexistent interface is harmless. My /sbin/hotplug looks something like:

    Code:
    #!/bin/bash
    
    sleep 10
    /sbin/ifconfig eth0 192.168.0.2 up
    /sbin/iwconfig wlan0 192.168.1.2 up
    
    exit 0
    Also, we should be able to get iwconfig to work by rebuilding the 2.4.4-TiVo kernel with CONFIG_NET_RADIO and using MuscleNerd's monte to boot it. Although many wireless ioctls are not currently supported by the at76c503 driver, the important ones seem to work okay. (I don't think you can set the channel number but that has not been a problem for me yet.)

  15. #15
    Join Date
    Apr 2003
    Posts
    62

    little problem

    guys,

    thanks for posting the drivers for usb 2.0. i just got linksys usb200m adapter and loaded the drivers. so far max speed i got was 920 on downloads from hdvr2. i was using mfstream module from tivoweb. i'm running USB 2.0 drivers and for some reason not seeing the speeds that alldeadhomiez posted. am i doing something wrong. in comparsion i have sony t60 on the same switch as hdvr2 with turbonet card. i'm able to get 1.4 megabits getting shows from Sony. Any ideas?


    thanks


    alex

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •