# hotplug, usb, and Handspring Visor

## mattmunz

Hi all,

  Inspired by the various PDA guides, I'm trying to get my handspring visor (USB) to sync.  After reading the following post, I got the impression that I need hotplug to make this all work.

https://forums.gentoo.org/viewtopic.php?t=1579

  During boot, I see a lot of successful USB messages, followed by 

hotplug script /etc/hotplug/usb.rc failed at start

  Here is the part of the script that results in the error (returns 1).

  if [ -d /proc/bus/usb ]; then

        # If we see there are no busses, we "failed" and

        # can report so even if we're partially nonmodular.

        COUNT=`ls /proc/bus/usb | wc -l`

        if [ $COUNT -le 2 ]; then

            umount /proc/bus/usb

            rmmod usbcore >/dev/null 2>&1

            return 1

        fi

  Any ideas?  Do I even need hotplug?  When I try to sync in JPilot, I get the following error.  

pi_bind: No such file or directory

  Any advice would be greatly appreciated.

  - Matt

----------

## krt

what usb messages are you seeing?

the two main parts from my kernels .config, which hotplug I'm using, and the relevant parts of my devfsd.conf follow:

```

#

# General setup

#

CONFIG_NET=y

CONFIG_PCI=y

# CONFIG_PCI_GOBIOS is not set

# CONFIG_PCI_GODIRECT is not set

CONFIG_PCI_GOANY=y

CONFIG_PCI_BIOS=y

CONFIG_PCI_DIRECT=y

# CONFIG_ISA is not set

# CONFIG_SCx200 is not set

CONFIG_PCI_NAMES=y

# CONFIG_EISA is not set

# CONFIG_MCA is not set

CONFIG_HOTPLUG=y

```

```

#

# USB support

#

CONFIG_USB=y

# CONFIG_USB_DEBUG is not set

CONFIG_USB_DEVICEFS=y

# CONFIG_USB_BANDWIDTH is not set

# CONFIG_USB_EHCI_HCD is not set

CONFIG_USB_UHCI_ALT=y

# CONFIG_USB_OHCI is not set

# CONFIG_USB_AUDIO is not set

# CONFIG_USB_EMI26 is not set

# CONFIG_USB_BLUETOOTH is not set

# CONFIG_USB_MIDI is not set

CONFIG_USB_STORAGE=y

# CONFIG_USB_STORAGE_DEBUG is not set

# CONFIG_USB_STORAGE_DATAFAB is not set

# CONFIG_USB_STORAGE_FREECOM is not set

# CONFIG_USB_STORAGE_ISD200 is not set

# CONFIG_USB_STORAGE_DPCM is not set

# CONFIG_USB_STORAGE_HP8200e is not set

# CONFIG_USB_STORAGE_SDDR09 is not set

# CONFIG_USB_STORAGE_SDDR55 is not set

# CONFIG_USB_STORAGE_JUMPSHOT is not set

# CONFIG_USB_ACM is not set

CONFIG_USB_PRINTER=m

CONFIG_USB_HID=y

CONFIG_USB_HIDINPUT=y

CONFIG_USB_HIDDEV=y

# CONFIG_USB_AIPTEK is not set

# CONFIG_USB_WACOM is not set

# CONFIG_USB_POWERMATE is not set

# CONFIG_USB_DC2XX is not set

# CONFIG_USB_MDC800 is not set

# CONFIG_USB_SCANNER is not set

# CONFIG_USB_MICROTEK is not set

# CONFIG_USB_HPUSBSCSI is not set

CONFIG_USB_IBMCAM=y

# CONFIG_USB_KONICAWC is not set

# CONFIG_USB_OV511 is not set

# CONFIG_USB_PWC is not set

# CONFIG_USB_SE401 is not set

# CONFIG_USB_STV680 is not set

# CONFIG_USB_VICAM is not set

# CONFIG_USB_DSBR is not set

# CONFIG_USB_DABUSB is not set

# CONFIG_USB_PEGASUS is not set

# CONFIG_USB_RTL8150 is not set

# CONFIG_USB_KAWETH is not set

# CONFIG_USB_CATC is not set

# CONFIG_USB_CDCETHER is not set

# CONFIG_USB_USBNET is not set

# CONFIG_USB_USS720 is not set

 

#

# USB Serial Converter support

#

CONFIG_USB_SERIAL=y

# CONFIG_USB_SERIAL_DEBUG is not set

# CONFIG_USB_SERIAL_GENERIC is not set

# CONFIG_USB_SERIAL_BELKIN is not set

# CONFIG_USB_SERIAL_WHITEHEAT is not set

# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set

# CONFIG_USB_SERIAL_EMPEG is not set

# CONFIG_USB_SERIAL_FTDI_SIO is not set

CONFIG_USB_SERIAL_VISOR=y

# CONFIG_USB_SERIAL_IPAQ is not set

# CONFIG_USB_SERIAL_IR is not set

# CONFIG_USB_SERIAL_EDGEPORT is not set

# CONFIG_USB_SERIAL_EDGEPORT_TI is not set

# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set

# CONFIG_USB_SERIAL_KEYSPAN is not set

# CONFIG_USB_SERIAL_MCT_U232 is not set

# CONFIG_USB_SERIAL_KLSI is not set

# CONFIG_USB_SERIAL_KOBIL_SCT is not set

# CONFIG_USB_SERIAL_PL2303 is not set

# CONFIG_USB_SERIAL_CYBERJACK is not set

# CONFIG_USB_SERIAL_XIRCOM is not set

# CONFIG_USB_SERIAL_OMNINET is not set

# CONFIG_USB_RIO500 is not set

# CONFIG_USB_AUERSWALD is not set

# CONFIG_USB_TIGL is not set

# CONFIG_USB_BRLVGER is not set

# CONFIG_USB_LCD is not set

```

*  sys-apps/hotplug

      Latest version available: 20020401-r1

      Latest version installed: 20020401-r1

      Size of downloaded files: 43 kB

      Homepage:    http://linux-hotplug.sourceforge.net

      Description: USB and PCI hotplug scripts

```

# end of my devfsd.conf

# Create /dev/visor for the treo

LOOKUP      ^visor$      CFUNCTION GLOBAL mksymlink usb/tts/1 treo

REGISTER    ^usb/tts/1$  CFUNCTION GLOBAL mksymlink $devname treo

UNREGISTER  ^usb/tts/1$  CFUNCTION GLOBAL unlink treo

# This is done to have non root user sync with the USB visor

# user must be in group wheel

REGISTER        usb/tts/.*       PERMISSIONS root.wheel 660

```

----------

## flickerfly

I'm not sure what krt was getting at, maybe the same thing.  If so I'm going to try to make it more succinct.

Make sure your compile your kernel w/ the following options:

    *      USB support (CONFIG_USB)

    *      The preliminary USB Device Filesystem (CONFIG_USB_DEVICEFS)

    *      The appropriate controller - UHCI, or OHCI (CONFIG_USB_UHCI, or CONFIG_USB_OHCI)

    *      USB Serial Converter support (CONFIG_USB_SERIAL)

    *      USB Handspring Visor Driver (CONFIG_USB_SERIAL_VISOR) (serial converter's sub-option) 

(This list is cut & paste from: http://www.vanderbijlfamily.com/~rvbijl/visor/howto/kernel.html)

I just got my visor to work with that change.  I also used to get the pi_bind error in jpilot.  Now I have to figure out how to get sylpheed-claws to integrate w/ jpilot.

----------

## mattmunz

Flickerfly,

  I believe that I compiled all of those as modules, and they appear to show up at boot.

krt,

Here's a dmesg snippet

```

matt@munz matt $ dmesg | grep -e "usb\|uhci\|hid\|visor\|hotplug"

usb.c: registered new driver hub

uhci.c: USB Universal Host Controller Interface driver v1.1

uhci.c: USB UHCI at I/O 0xa400, IRQ 5

usb.c: new USB bus registered, assigned bus number 1

uhci.c: USB UHCI at I/O 0xa000, IRQ 5

usb.c: new USB bus registered, assigned bus number 2

uhci.c: USB UHCI at I/O 0x9800, IRQ 5

usb.c: new USB bus registered, assigned bus number 3

usb.c: registered new driver hid

hid-core.c: v1.8.1 Andreas Gal, Vojtech Pavlik <vojtech@suse.cz>

hid-core.c: USB HID support drivers

uhci.c: USB Universal Host Controller Interface driver v1.1

 <3>usb.c: unable to get major 180 for usb devices

usb.c: registered new driver usbdevfs

usb.c: registered new driver hub

usb.c: registered new driver serial

usbserial.c: USB Serial Driver core v1.4

usbserial.c: USB Serial support registered for Handspring Visor / Palm 4.0 / Clié 4.x

usbserial.c: USB Serial support registered for Sony Clié 3.5

visor.c: USB HandSpring Visor, Palm m50x, Sony Clié driver v1.6

```

I wonder about the "unable to get major 180" line.  There appears to be some sort of error directly preceeding it (included below).  Any ideas?

```

kernel BUG at slab.c:816!

invalid operand: 0000

CPU:    0

EIP:    0010:[<c0140d7a>]    Not tainted

EFLAGS: 00010246

eax: 00000000   ebx: c1a26f38   ecx: c1a89778   edx: c1a89684

esi: c1a8967e   edi: d093ab84   ebp: 00000000   esp: cf35fec8

ds: 0018   es: 0018   ss: 0018

Process modprobe (pid: 2191, stackpage=cf35f000)

Stack: c1a26dd8 00000000 000000f4 c1a26df8 00000018 00000000 c1a26dd8 fffffffc

       0000001c fffffff4 00000000 00000000 d0933000 d0935ad4 d093ab76 0000003c

       00000020 00020000 00000000 00000000 ffffffea c0120fd4 d0933060 08086460

Call Trace:    [<d0935ad4>] [<d093ab76>] [<c0120fd4>] [<d0933060>] [<d0933060>]

  [<c01078cb>]

Code: 0f 0b 30 03 3a dd 30 c0 8b 01 89 ca 89 c1 0f 18 00 81 fa 8c

 <3>usb.c: unable to get major 180 for usb devices

```

Thanks again for your help so far.

----------

## mattmunz

krt,

  My .config is different.  Mostly, I'm compiling modules.  Also, I am missing  the following from your .config.

```

CONFIG_USB_STORAGE=y

CONFIG_USB_PRINTER=m

CONFIG_USB_HIDINPUT=y

CONFIG_USB_HIDDEV=y

CONFIG_USB_IBMCAM=y

 
```

I am not using a printer, and I assume ibmcam is a camera, which I also do not have.  What about the others?  Are any required?

I am also missing all of the lines from devfsd.conf.  BTW, I'm using a visor pro, not a treo, as you appear to be.  Does it make a difference?

What do the lines in devfsd.conf do?

Thanks again for all the help.

  - Matt

----------

## mattmunz

This is what I get from modprobe.  Any ideas?  Where can I go from here?

```

root@munz linux # modprobe usb-uhci

/lib/modules/2.4.20-gentoo-r1/kernel/drivers/usb/usb-uhci.o: init_module: No such device

Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters.

      You may find more information in syslog or the output from dmesg

/lib/modules/2.4.20-gentoo-r1/kernel/drivers/usb/usb-uhci.o: insmod /lib/modules/2.4.20-gentoo-r1/kernel/drivers/usb/usb-uhci.o failed

/lib/modules/2.4.20-gentoo-r1/kernel/drivers/usb/usb-uhci.o: insmod usb-uhci failed

```

----------

## flickerfly

Is it possible that you are using the wrong USB controller?  

The options are :

EHCI HCD (USB 2.0) support (EXPERIMENTAL) 

UHCI (Intel PIIX4, VIA, ...) support

UHCI Alternate Driver (JE) support

OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support 

I'm using OHCI cause I have a stupid SiS based motherboard.

----------

## mattmunz

Flickerfly,

I've tried all the modules at this point.  I think that usb-uhci is the right one, especially given the following.

```

munz root # pcimodules

usb-uhci

8139too

```

Any other ideas?  I'm fine with digging around in the code, if that's what I have to do...  Where should I look?  How are these problems usually debugged?

  - Matt

----------

## flickerfly

 *mattmunz wrote:*   

> I've tried all the modules at this point.  I think that usb-uhci is the right one, especially given the following.
> 
> ```
> 
> munz root # pcimodules
> ...

 

Have you looked at the lsmod commands output?  That will show all modules, not just pci ones.  Here's my out put:

```
Module                  Size  Used by    Tainted: P  

*visor                   9608   0 

*usbserial              17980   0  [visor]

au8830                141924   1 

soundcore               3908   5  [au8830]

ide-cd                 30244   0  (autoclean)

*usb-ohci               17384   0  (unused)

8139too                14984   1 

mii                     2496   0  [8139too]

sr_mod                 14232   0 

cdrom                  29152   0  [ide-cd sr_mod]

sg                     28044   0  (unused)

ide-scsi                8816   0 

scsi_mod               86644   3  [sr_mod sg ide-scsi]
```

The ones with a "*" are needed for the port.

If none of the kernel modules work you might also check your BIOS first.  It may be disabled there.

Try the command:

```
more /proc/pci |grep USB
```

 for output.

Mine is:

```

    USB Controller: Silicon Integrated Systems [SiS] 7001 (rev 7).

    USB Controller: Silicon Integrated Systems [SiS] 7001 (#2) (rev 7)
```

This will see if any USB controllers are being detected by the kernel.  If you get nothing, try removing the grep command and looking for yourself for the controller.

Are any other USB devices working.  (Due to your symptoms I'm thinking probably not, but doesn't hurt to ask.)

(My wife's looking for my attention so I need to split.  Hope this helps.)

----------

