From: Daniel Ng <daniel.ng1234-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: linux-embedded-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: 2.6.27- Sending uevent from a driver
Date: Tue, 30 Jun 2009 18:30:43 +1000 [thread overview]
Message-ID: <547eba1b0906300130r6b704e9ft408c63d2c1e6f4a@mail.gmail.com> (raw)
Hi,
I'm trying to send a uevent from my USB Gadget Serial driver using:
kobject_uevent(&cdev->gadget->dev.kobj, KOBJ_ONLINE);
However, the uevent gets filtered out with the error message:
"filter function caused the event to drop!"
-from kobject_uevent.c line 124
The filter function used is dev_uevent_filter() from core.c.
The dev_uevent_filter() filters out the uevent because the following test fails:
if (ktype == &device_ktype)
This is because my driver's (struct bus_type *) gadget.dev.bus is NULL.
So I tried the following in my driver's probe() function:
the_controller->gadget.dev.bus = &of_platform_bus_type;
But this results in a crash.
Here are my questions:
1) I am trying to communicate to a Userspace prgoram that the Gadget
Serial driver has connected to a TTY device, so the Userspace program
can know when to start I/O with the TTY device.
To achieve this, I want to send a uevent from for example f_acm.c,
just after it calls gserial_connect() in acm_set_alt(). I'm hoping
that I can use libudev (via netlink sockets) to catch this uevent, and
hence send a notification to a socket that the Userspace program is
listening on. Does this all look like a sensible thing to do?
2) Is there a 'proper' way to assign the bus type as above? Perhaps I
need to call some sort of init function instead, so that the crash can
be avoided.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next reply other threads:[~2009-06-30 8:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 8:30 Daniel Ng [this message]
2009-06-30 14:14 ` 2.6.27- Sending uevent from a driver Alan Stern
2009-06-30 15:41 ` Greg KH
[not found] ` <20090630154110.GD16038-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2009-07-02 4:39 ` Daniel Ng
[not found] ` <547eba1b0907012139l6b406191p1fc1bdbe3ebc0737-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-02 10:11 ` Alan Cox
[not found] ` <20090702111107.08332a4b-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2009-07-03 15:36 ` Jamie Lokier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=547eba1b0906300130r6b704e9ft408c63d2c1e6f4a@mail.gmail.com \
--to=daniel.ng1234-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-embedded-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).