On 23/05/16(Mon) 15:37, Gerhard Roth wrote:
> I have this stuff around quite a while now, but since patrick@ asked
> me repeatedly, I think it is time to share this now.
>
> This is a patch that adds support for the "Mobile Broadband Interface
> Model" (MBIM) from http://www.usb.org/. It allows to attach UMTS/LTE
> USB devices as a network interface.
That's great!
> I'm not asking for OKs at this time, but hope that some people will
> give it test. I tested with two different Sierra Wireless modules
> (EM8805, MC8305) and each one behaved a little bit different.
>
> In order to configure the network interface, this is what you do:
>
> # ifconfig mbim0 pin 1234 apn internet.t-mobile
I'd like to bikeshed early, we're trying to prefix all new USB driver
name with 'u'. So I'd suggest a rename when this goes in tree.
> # ifconfig mbim0 inet 0.0.0.1 0.0.0.2
> # route delete default
> # route add -ifp mbim0 default 0.0.0.2
> # ifconfig mbim0 up
>
> The mbim interface is a point-to-point type interface and will
> update the default route, once it is registered in the network.
Can't you insert the route later instead of updating it?
> [...] uhub.c may be needed: some modules appear at the usb bus just
> to detach themselves again and then reappear shortly after.
Do you know why? On which controller?
> Index: sys/dev/usb/uhub.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/usb/uhub.c,v
> retrieving revision 1.88
> diff -u -p -u -p -r1.88 uhub.c
> --- sys/dev/usb/uhub.c 29 Nov 2015 16:30:48 -0000 1.88
> +++ sys/dev/usb/uhub.c 23 May 2016 09:50:08 -0000
> @@ -523,7 +523,9 @@ uhub_port_connect(struct uhub_softc *sc,
> {
> struct usbd_port *up = &sc->sc_hub->hub->ports[port-1];
> int speed;
> + int retry = 1;
>
> +again:
> /* We have a connect status change, handle it. */
> usbd_clear_port_feature(sc->sc_hub, port, UHF_C_PORT_CONNECTION);
>
> @@ -613,6 +615,11 @@ uhub_port_connect(struct uhub_softc *sc,
> * some other serious problem. Since we cannot leave
> * at 0 we have to disable the port instead.
> */
> + if (retry--) {
> + printf("%s: port %d: retrying\n", DEVNAME(sc), port);
> + goto again;
> + }
> +
> printf("%s: device problem, disabling port %d\n", DEVNAME(sc),
> port);
> usbd_clear_port_feature(sc->sc_hub, port, UHF_PORT_ENABLE);