Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Jan 2012 22:30:18 GMT
From:      Mykhaylo Yehorov <yehorov@gmail.com>
To:        freebsd-usb@FreeBSD.org
Subject:   Re: usb/164090: [umodem] [patch] Add sysctl with ucom unit number
Message-ID:  <201201152230.q0FMUIPT020391@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR usb/164090; it has been noted by GNATS.

From: Mykhaylo Yehorov <yehorov@gmail.com>
To: Hans Petter Selasky <hselasky@c2i.net>
Cc: freebsd-usb@freebsd.org, freebsd-gnats-submit@freebsd.org
Subject: Re: usb/164090: [umodem] [patch] Add sysctl with ucom unit number
Date: Mon, 16 Jan 2012 00:26:53 +0200

 --002354470e84513e6804b69898ff
 Content-Type: text/plain; charset=UTF-8
 
 On Sat, Jan 14, 2012 at 12:45, Hans Petter Selasky <hselasky@c2i.net> wrote:
 > On Saturday 14 January 2012 10:51:07 Mykhaylo Yehorov wrote:
 >> On Fri, Jan 13, 2012 at 22:54, Hans Petter Selasky <hselasky@c2i.net> 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
 OjIyLjAwMDAwMDAwMCArMDIwMAorKysgc3lzL2Rldi91c2Ivc2VyaWFsL3VzYl9zZXJpYWwuaAky
 MDEyLTAxLTE0IDIyOjU5OjIzLjAwMDAwMDAwMCArMDIwMApAQCAtNzAsNiArNzAsNyBAQAogI2lu
 Y2x1ZGUgPHN5cy90dHkuaD4KICNpbmNsdWRlIDxzeXMvc2VyaWFsLmg+CiAjaW5jbHVkZSA8c3lz
 L2ZjbnRsLmg+CisjaW5jbHVkZSA8c3lzL3N5c2N0bC5oPgogCiAvKiBNb2R1bGUgaW50ZXJmYWNl
 IHJlbGF0ZWQgbWFjcm9zICovCiAjZGVmaW5lCVVDT01fTU9EVkVSCTEKQEAgLTEzNCw2ICsxMzUs
 NyBAQAogCXN0cnVjdCB1c2JfcHJvY2VzcyBzY190cTsKIAl1aW50MzJfdCBzY191bml0OwogCXVp
 bnQzMl90IHNjX3N1YnVuaXRzOworCXN0cnVjdCBzeXNjdGxfb2lkICpzY19zeXNjdGxfZGV2X3Vj
 b207CiB9OwogCiBzdHJ1Y3QgdWNvbV9zb2Z0YyB7Ci0tLSBzeXMvZGV2L3VzYi9zZXJpYWwvdXNi
 X3NlcmlhbC5jLm9yaWcJMjAxMS0xMS0xMSAwNjoyMDoyMi4wMDAwMDAwMDAgKzAyMDAKKysrIHN5
 cy9kZXYvdXNiL3NlcmlhbC91c2Jfc2VyaWFsLmMJMjAxMi0wMS0xNCAyMzowMToxNS4wMDA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LTEsICJB
 dHRhY2hlZCB1Y29tIHVuaXQgbnVtYmVyIik7CiB9CiAKIHN0YXRpYyB2b2lkCg==
 --002354470e84513e6804b69898ff--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201152230.q0FMUIPT020391>