Re: [linux-usb-devel] PATCH: wusb: basic device infrastructure modifications [take 3]

2006-08-24 Thread Greg KH
On Thu, Aug 24, 2006 at 01:58:48PM -0700, I?aky P?rez-Gonz?lez wrote: > > Okay, got feedback from everybody and rehashed it to current gregkh's queue. > > wusb: basic device infrastructure modifications [take 3] > > This patch does a bunch of small modifications to the USB core so that WUSB > d

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-24 Thread Alan Stern
On Thu, 24 Aug 2006, Iñaky Pérez-González wrote: > > That's not so easy either. The fact is, hdev_to_hub() _isn't_ safe unless > > you possess some extra prior knowledge. > > which priori knowledge? I had assumed that as long as it has registered, > we were safe. It's not enough for it to be re

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-24 Thread Iñaky Pérez-González
On Thursday 24 August 2006 11:17, Alan Stern wrote: > On Thu, 24 Aug 2006, Perez-Gonzalez, Inaky wrote: > > Nothing that exporting something like a safe_hdev_to_hub() to the > > host API cannot do. > > That's not so easy either. The fact is, hdev_to_hub() _isn't_ safe unless > you possess some ex

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-24 Thread Alan Stern
On Thu, 24 Aug 2006, Perez-Gonzalez, Inaky wrote: > >This won't be easy. For one thing, hcd_root_hub_lock is private to > hcd.c > >and hdev_to_hub is private to hub.c. > > Nothing that exporting something like a safe_hdev_to_hub() to the > host API cannot do. That's not so easy either. The fac

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-24 Thread Perez-Gonzalez, Inaky
>From: Alan Stern [mailto:[EMAIL PROTECTED] > >> I was thinking about something like the following in my hc_probe(): >> >> ... > >This won't be easy. For one thing, hcd_root_hub_lock is private to hcd.c >and hdev_to_hub is private to hub.c. Nothing that exporting something like a safe_hdev_to_hub

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-24 Thread Alan Stern
On Wed, 23 Aug 2006, Iñaky Pérez-González wrote: > I was thinking about something like the following in my hc_probe(): > > ... > usb_add_hcd(hcd); > if (wait_event_timeout(&wq, hcd->rh_registered != 0, TIMEOUT) == 0) { > result = -ETIMEDOUT; > goto error...; > } > spin_lock_irqsave (&

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-23 Thread Iñaky Pérez-González
On Wednesday 23 August 2006 19:23, Alan Stern wrote: > On Wed, 23 Aug 2006, Iñaky Pérez-González wrote: > > Ok, I am officially dumb: hdev_to_hub(). Dah! > > > > I'll change the code tomorrow to set a flag variable in struct usb_hub > > and leave port-status unmodified. > > > > Thanks for the nudge

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-23 Thread Alan Stern
On Wed, 23 Aug 2006, Iñaky Pérez-González wrote: > Ok, I am officially dumb: hdev_to_hub(). Dah! > > I'll change the code tomorrow to set a flag variable in struct usb_hub > and leave port-status unmodified. > > Thanks for the nudge, Alan Just remember my warning. You'll get an oops if you try

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-23 Thread David Brownell
On Wednesday 23 August 2006 2:27 pm, Greg KH wrote: > What happens in 4 years when they come out with a use for that bit? Unlikely, but that's the reason to avoid using bits at the low end; they seem to count up not down. - Dave pgppSAnqTO2zJ.pgp Description: PGP signature ---

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-23 Thread Iñaky Pérez-González
On Wednesday 23 August 2006 15:10, Alan Stern wrote: > > It isn't trivial, but it's also not impossible. There are a couple of > places where the kernel does it. For example, look at > usb_hcd_resume_root_hub() in hcd.c, which calls usb_resume_root_hub() in > hub.c. Or look at usb_hc_died() in h

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-23 Thread Alan Stern
On Wed, 23 Aug 2006, Iñaky Pérez-González wrote: > I am not happy at all with that approach, I know it could be a future > maintenance mess. And I would have much more preferred to set a bit in > struct usb_hub. > > But as I said above, going from struct usb_hcd to it's root hub > 'struct usb_

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-23 Thread Iñaky Pérez-González
On Wednesday 23 August 2006 14:27, Greg KH wrote: > On Wed, Aug 23, 2006 at 12:57:48PM -0700, I?aky P?rez-Gonz?lez wrote: > > 2. Introduce USB_PORT_STAT_WIRELESS; we take one of the reserved bits > >in the USB port status (bit 15) to report that we are a wireless > >(fake port). > > > >

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-23 Thread Greg KH
On Wed, Aug 23, 2006 at 12:57:48PM -0700, I?aky P?rez-Gonz?lez wrote: > > 2. Introduce USB_PORT_STAT_WIRELESS; we take one of the reserved bits >in the USB port status (bit 15) to report that we are a wireless >(fake port). > >Yes, bad bad, it is taken by the spec. The rationale for d

Re: [linux-usb-devel] PATCH: WUSB basic device infrastructure modifications

2006-08-23 Thread Iñaky Pérez-González
Ok, repost changing the reserved bit to 15 from 5 and after trying to use a 'struct hub'->wireless bit (rationale below). This is against's gregkh's quilt tree. WUSB: basic device infrastructure modifications This patch does a bunch of small modifications to the USB core so that WUSB devices are