From: Al B. <alb...@st...> - 2006-12-15 21:19:56
|
Quoting Alan Stern <st...@ro...>: > > Mister Greg, how to change configuration _inside_ the driver? Device > > was made to be > > working on second usb config after one reconnect/device change, i've > > lost whole day > > trying to make something with that. After all, usb_set_configuration(= ) > > isn't even > > EXPORT()ED at all ! The current driver depends on a hot plug script to change configurations. See the comments at the top of the file. That is not an ideal situation at all. If 2.6.19 again has a way for the driver to change its configura= tion that would be great. -- Al > > It isn't exported because, generally speaking, drivers can't use it. I= f > your driver called usb_set_configuration() from within its probe routin= e, > it would hang. That's because usb_set_configuration would unregister t= he > interface being probed by your driver, so it would try to call your > driver's disconnect routine, but first it would have to wait for the pr= obe > to finish -- deadlock. > > There is an exported routine drivers can use in the rare cases where th= ey > do need to change configurations. It's called > usb_driver_set_configuration(), and it is present in 2.6.19. > > Alan Stern > > |