Forgot to mention:
MFC:2 weeks
On 5 Nov 2010, at 20:12, Nick Hibma wrote:
> Author: n_hibma
> Date: Fri Nov 5 19:12:48 2010
> New Revision: 214843
> URL: http://svn.freebsd.org/changeset/base/214843
>
> Log:
> Implement ucom_set_pnpinfo_usb() providing ttyname and port number
> information through devd. My E220 now produces the notification (1 line):
>
> +u3g0 at bus=1 hubaddr=1 port=0 devaddr=2 interface=0 \
> vendor=0x12d1 product=0x1003 devclass=0x00 devsubclass=0x00 \
> sernum="" release=0x intclass=0xff intsubclass=0xff \
> ttyname=U0 ttyports=2 on uhub0
>
> Note: serial/ufoma and net/uhso still provide port number and tty name
> (uhso only) information through sysctls, which should now be removed.
>
> Reviewed by: hpselasky
>
> Modified:
> head/sys/dev/usb/net/uhso.c
> head/sys/dev/usb/serial/u3g.c
> head/sys/dev/usb/serial/uark.c
> head/sys/dev/usb/serial/ubsa.c
> head/sys/dev/usb/serial/ubser.c
> head/sys/dev/usb/serial/uchcom.c
> head/sys/dev/usb/serial/ucycom.c
> head/sys/dev/usb/serial/ufoma.c
> head/sys/dev/usb/serial/uftdi.c
> head/sys/dev/usb/serial/ugensa.c
> head/sys/dev/usb/serial/uipaq.c
> head/sys/dev/usb/serial/umct.c
> head/sys/dev/usb/serial/umodem.c
> head/sys/dev/usb/serial/umoscom.c
> head/sys/dev/usb/serial/uplcom.c
> head/sys/dev/usb/serial/usb_serial.c
> head/sys/dev/usb/serial/usb_serial.h
> head/sys/dev/usb/serial/uslcom.c
> head/sys/dev/usb/serial/uvisor.c
> head/sys/dev/usb/serial/uvscom.c
>
> Modified: head/sys/dev/usb/net/uhso.c
> ==
> --- head/sys/dev/usb/net/uhso.c Fri Nov 5 18:24:50 2010
> (r214842)
> +++ head/sys/dev/usb/net/uhso.c Fri Nov 5 19:12:48 2010
> (r214843)
> @@ -902,6 +902,7 @@ uhso_probe_iface(struct uhso_softc *sc,
> device_printf(sc->sc_dev, "ucom_attach
> failed\n");
> return (ENXIO);
> }
> + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev);
>
> mtx_lock(&sc->sc_mtx);
> usbd_transfer_start(sc->sc_xfer[UHSO_MUX_ENDPT_INTR]);
> @@ -920,6 +921,7 @@ uhso_probe_iface(struct uhso_softc *sc,
> device_printf(sc->sc_dev, "ucom_attach failed\n");
> return (ENXIO);
> }
> + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, sc->sc_dev);
> }
> else {
> UHSO_DPRINTF(0, "Unknown type %x\n", type);
>
> Modified: head/sys/dev/usb/serial/u3g.c
> ==
> --- head/sys/dev/usb/serial/u3g.c Fri Nov 5 18:24:50 2010
> (r214842)
> +++ head/sys/dev/usb/serial/u3g.c Fri Nov 5 19:12:48 2010
> (r214843)
> @@ -818,8 +818,10 @@ u3g_attach(device_t dev)
> DPRINTF("ucom_attach failed\n");
> goto detach;
> }
> + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> device_printf(dev, "Found %u port%s.\n", sc->sc_numports,
> sc->sc_numports > 1 ? "s":"");
> +
> return (0);
>
> detach:
>
> Modified: head/sys/dev/usb/serial/uark.c
> ==
> --- head/sys/dev/usb/serial/uark.cFri Nov 5 18:24:50 2010
> (r214842)
> +++ head/sys/dev/usb/serial/uark.cFri Nov 5 19:12:48 2010
> (r214843)
> @@ -227,6 +227,8 @@ uark_attach(device_t dev)
> DPRINTF("ucom_attach failed\n");
> goto detach;
> }
> + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> return (0); /* success */
>
> detach:
>
> Modified: head/sys/dev/usb/serial/ubsa.c
> ==
> --- head/sys/dev/usb/serial/ubsa.cFri Nov 5 18:24:50 2010
> (r214842)
> +++ head/sys/dev/usb/serial/ubsa.cFri Nov 5 19:12:48 2010
> (r214843)
> @@ -331,6 +331,8 @@ ubsa_attach(device_t dev)
> DPRINTF("ucom_attach failed\n");
> goto detach;
> }
> + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
> +
> return (0);
>
> detach:
>
> Modified: head/sys/dev/usb/serial/ubser.c
> ==
> --- head/sys/dev/usb/serial/ubser.c Fri Nov 5 18:24:50 2010
> (r214842)
> +++ head/sys/dev/usb/serial/ubser.c Fri Nov 5 19:12:48 2010
> (r214843)
> @@ -296,6 +296,7 @@ ubser_attach(device_t dev)
> if (error) {
> goto detach;
> }
> + ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev);
>
> mtx_lock(&sc->sc_mtx);
> usbd_xfer_set_stall(sc->sc_xfer[UBSER_BULK_DT_WR]);
>
> Modified: head/sys/dev/usb/serial/uchcom.c
> ==
> --- head/