From owner-freebsd-usb@FreeBSD.ORG Sun Jan 15 22:26:54 2012 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D0E8106566C; Sun, 15 Jan 2012 22:26:54 +0000 (UTC) (envelope-from yehorov@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3FBC68FC0A; Sun, 15 Jan 2012 22:26:54 +0000 (UTC) Received: by qcse1 with SMTP id e1so469036qcs.13 for ; Sun, 15 Jan 2012 14:26:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=9DsIn3FhfNJ/1nydfDSAv+lSKJ+7gAfcr7bUlWLgWwM=; b=Vort5souMNKRN8LicP5axDW0zWzDdec2sq1UD+gvZ4ey2t/3uOF37cPXW5f74aVsYr 0I9KqhFJyYBlP9Hk8GrUfq+79fI1JP03GNhGI9ntrup5lrWw3UBEcaCxQ1ey184s7zX/ KSYTNLisOfUnupf8P3JA/WSXYd9CP8hrRcfd0= MIME-Version: 1.0 Received: by 10.229.102.66 with SMTP id f2mr3390465qco.57.1326666413587; Sun, 15 Jan 2012 14:26:53 -0800 (PST) Received: by 10.224.196.66 with HTTP; Sun, 15 Jan 2012 14:26:53 -0800 (PST) In-Reply-To: <201201141145.05813.hselasky@c2i.net> References: <201201131705.q0DH5Tko030020@red.freebsd.org> <201201132154.01815.hselasky@c2i.net> <201201141145.05813.hselasky@c2i.net> Date: Mon, 16 Jan 2012 00:26:53 +0200 Message-ID: From: Mykhaylo Yehorov To: Hans Petter Selasky Content-Type: multipart/mixed; boundary=002354470e84513e6804b69898ff Cc: freebsd-gnats-submit@freebsd.org, freebsd-usb@freebsd.org Subject: Re: usb/164090: [umodem] [patch] Add sysctl with ucom unit number X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2012 22:26:54 -0000 --002354470e84513e6804b69898ff Content-Type: text/plain; charset=UTF-8 On Sat, Jan 14, 2012 at 12:45, Hans Petter Selasky wrote: > On Saturday 14 January 2012 10:51:07 Mykhaylo Yehorov wrote: >> On Fri, Jan 13, 2012 at 22:54, Hans Petter Selasky wrote: >> > Hi, >> > >> > Could you patch ucom_set_pnpinfo_usb() instead, so that such a sysctl is >> > created for all ucom devices, not only umodem? >> >> I guess it will be necessary to remove a sysctl oid from a parent >> sysctl tree before destroying ucom structures. >> It's would be better to do in ucom_detach() but now there is no a >> pointer to a parent device structure from there. >> >> Now all drivers that use ucom pass a pointer to parent softc structure >> to ucom_attach(). >> Is there any reason for this? >> May be it's would be more useful to pass a pointer to a parent device >> structure. >> >> > Can you explain a bit more how you use this information in your scripts? >> >> I've got a gps receiver and a mobile phone that supported by the umodem >> driver. I can attach its in any order. >> So I use sysctl to generate gpsd and ppp configs with appropriate >> values of serial port. > > Ok, I see. > > And you cannot use the information passed through devd by > ucom_set_pnpinfo_usb()?ucom_detach You are right. It's possible to use ucom_set_pnpinfo_usb(). In the attached patch an ucom sysctl oid will be added to a parent sysctl tree in ucom_set_pnpinfo_usb() and will be removed in ucom_detach(). -- Mykhaylo Yehorov --002354470e84513e6804b69898ff Content-Type: text/plain; charset=US-ASCII; name="ucom-sysctl.diff.txt" Content-Disposition: attachment; filename="ucom-sysctl.diff.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gxgmbdqz0 LS0tIHN5cy9kZXYvdXNiL3NlcmlhbC91c2Jfc2VyaWFsLmgub3JpZwkyMDExLTExLTExIDA2OjIw OjIyLjAwMDAwMDAwMCArMDIwMAorKysgc3lzL2Rldi91c2Ivc2VyaWFsL3VzYl9zZXJpYWwuaA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