On Wed, 2012-02-15 at 14:41 +0000, Toby Gray wrote: > On 15/02/12 01:14, Alexey Orishko wrote: > > I have a few Ellisys traces for multifunctional devices connected to > > Ubuntu/Intel and > > embedded Linux host/MIPS. AltSet=1 for NCM data interface was set in approx. > > 110-130 ms after SetAddress. Both notifications are received within 400 ms after > > SetInterface(AltSet=1), which falls in "a few seconds" period stated above. > > I assume that the Ubuntu system had the network-manager daemon running? > If so then the network-manager daemon will be bringing the usb* > interface up almost as soon as it's notified of it existing. You probably mean modem-manager; when the device appears if it's not blacklisted for probing, modem-manager will attempt to determine if the device is a modem, and what air interfaces it supports (GSM/UMTS, CDMA1x, EVDO, etc). But MM won't "bring the interface up" until it's told to by NetworkManager or something else. If it's immediately dialed, that may be because you've defined a network connection to autoconnect. NM listens to ModemManager for 3G modems; if MM isn't running, NM will mistakenly assume control over 3G WWAN interfaces that don't set DEVTYPE=wwan. But that's a bug in the kernel drivers, since known WWAN modems should be setting DEVTYPE=wwan. If MM *is* running, NM will ignore the WWAN interface until modem-manager recognizes the device. Dan > I assume that the MIPS embedded Linux host system had a user-space tool > running similar functionality such as a udevd rule which runs a dhcp > client on the interface when it appears. Was this the case? > > If the interface was still down in both of these situations then I must > have misunderstood when the dev->interrupt URB is submitted, and > therefore when usbnet_open is called. > > > However, if you have 3G modem, it will take 1-2 minutes before user space > > application can setup a data call and driver get these notifications. > > Makes sense, however the device I'm using doesn't appear to be using the > NCM connection for access to the device modem. The device appears to > only ever send one NetworkConnection notification and it only sends it > if the host is trying to read from the interrupt endpoint in the first > few seconds of setting the interface to altsetting 1. I've confirmed > this using LeCroy USB traces. > > >> The way I'm currently working around this issue is to add a cdc_ncm_reset to > >> the cdc_ncm_info and moving the setting of the data interface alternate > >> setting (and related code) from cdc_ncm_bind to cdc_ncm_reset. Does this > >> seem the sensible solution? > > NCM driver doesn't read notifications directly, but via callback from > > intr_complete. > > Initialization is done in usbnet right after bind call, so I'm not > > sure that proposed > > change solves the real problem. > > It's true that the dev->interrupt URB is created by usbnet after the > bind call, but my understanding was it was only submitted (and therefore > you only start to see IN tokens on the USB bus) when usbnet_open was called? > > I'm going to post the patch series to the mailing list as it will > hopefully better explain what I'm trying to achieve. > > Regards, > > Toby > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html