Date: Fri, 13 Jan 2012 17:05:29 GMT From: Mykhaylo Yehorov <yehorov@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: usb/164090: [umodem] [patch] Add sysctl with ucom unit number Message-ID: <201201131705.q0DH5Tko030020@red.freebsd.org> Resent-Message-ID: <201201131710.q0DHA8cc002139@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 164090 >Category: usb >Synopsis: [umodem] [patch] Add sysctl with ucom unit number >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Jan 13 17:10:08 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Mykhaylo Yehorov >Release: FreeBSD 9.0-RELEASE >Organization: >Environment: FreeBSD atom.lan29.local 9.0-RELEASE FreeBSD 9.0-RELEASE #7: Fri Jan 13 15:18:21 EET 2012 mika@atom.lan29.local:/usr/obj/usr/src/sys/MINI_KVA384 i386 >Description: Now there is no easy way to determine which tty device file is used by an umodem device. With the following patch the umodem driver will create sysctl node dev.umodem.X.ucom. This sysctl will be helpful in devd scripts. >How-To-Repeat: >Fix: Patch attached with submission follows: --- orig/sys/dev/usb/serial/umodem.c 2011-11-11 06:20:22.000000000 +0200 +++ sys/dev/usb/serial/umodem.c 2012-01-03 13:06:14.371630639 +0200 @@ -169,6 +169,8 @@ uint8_t sc_cm_over_data; uint8_t sc_cm_cap; /* CM capabilities */ uint8_t sc_acm_cap; /* ACM capabilities */ + + int ucom_unit; }; static device_probe_t umodem_probe; @@ -412,6 +414,13 @@ } ucom_set_pnpinfo_usb(&sc->sc_super_ucom, dev); + sc->ucom_unit = sc->sc_super_ucom.sc_unit; + + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "ucom", CTLFLAG_RD, + &sc->ucom_unit, -1, "Attached ucom unit number"); + return (0); detach: >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201131705.q0DH5Tko030020>