Subject: Re: "pinning" USB storage devices ?
To: None <netbsd-help@netbsd.org>
From: Martijn van Buul <martijnb@atlas.ipv6.stack.nl>
List: netbsd-help
Date: 08/15/2005 20:18:50
It occurred to me that dieter Roelants wrote in gmane.os.netbsd.help:
>> What I really want is a hard-wired autoconf entry, something in the
> line of
>> 
>> '
>> umass0 at uhub2 port 5 configuration 1 interface 0
>> umass* at uhub? port ? configuration ? interface ?
>> '
>> 
>> but that fails, because 'uhub2 is orphaned'.
>
> You should also add something like 'uhub2 at usb0' to your config (of
> course adapted to where your uhub2 really is).

Well, I'm currently using

ehci0 at pci2 dev 9 function 2
ehci* at pci? dev ? function ?
ohci* at pci? dev ? function ?
uhci* at pci? dev ? function ?

usb0 at ehci0
usb* at ehci?
usb* at ohci?
usb* at uhci?

uhub0 at usb0
uhub* at usb? 
uhub* at usb? port ? configuration ? interface ?

umass0 at usb0 port 4 configuration 1 interface 0
umass* at usb? port ? configuration ? interface ?

(Yes, I switched port on the disk; the external hub is now last, which 
 probably solved *part* of my problem. The front USB connector is port 1
 though, so it's still an issue)

And that seems to do the job:

NetBSD 3.99.7 (ATLAS) #1: Mon Aug 15 21:44:44 CEST 2005
	martijnb@atlas.ipv6.stack.nl:/usr/src/sys/arch/i386/compile/ATLAS
[...]
ohci0 at pci2 dev 9 function 0: NEC USB Host Controller (rev. 0x43)
ohci0: interrupting at ioapic0 pin 21 (irq 10)
ohci0: OHCI version 1.0
usb1 at ohci0: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 3 ports with 3 removable, self powered
ohci1 at pci2 dev 9 function 1: NEC USB Host Controller (rev. 0x43)
ohci1: interrupting at ioapic0 pin 22 (irq 11)
ohci1: OHCI version 1.0
usb2 at ohci1: USB revision 1.0
uhub2 at usb2
uhub2: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci2 dev 9 function 2: NEC USB Host Controller (rev. 0x04)
ehci0: interrupting at ioapic0 pin 23 (irq 9)
ehci0: EHCI version 1.0
ehci0: companion controllers, 3 ports each: ohci0 ohci1
usb0 at ehci0: USB revision 2.0
uhub0 at usb0
uhub0: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub0: 5 ports with 5 removable, self powered
[...]
uhci0 at pci0 dev 31 function 2: Intel 82801BA USB Controller (rev. 0x05)
uhci0: interrupting at ioapic0 pin 19 (irq 9)
usb3 at uhci0: USB revision 1.0
uhub3 at usb3
uhub3: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
Intel 82801BA SMBus Controller (SMBus serial bus, revision 0x05) at pci0 dev 31 function 3 not configured
uhci1 at pci0 dev 31 function 4: Intel 82801BA USB Controller (rev. 0x05)
uhci1: interrupting at ioapic0 pin 23 (irq 9)
usb4 at uhci1: USB revision 1.0
uhub4 at usb4
uhub4: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub4: 2 ports with 2 removable, self powered
[..]
umass0 at uhub0 port 4 configuration 1 interface 0
umass0: vendor 0x0000 product 0x0000, rev 2.00/0.00, addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, 1 lun per target

If I switch port, it'll boot up as being umass1, so that's good.