From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Midhun A <midhunagni@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Userspace - Kernel Space "Connector" test
Date: Mon, 21 Apr 2008 14:43:01 +0400 [thread overview]
Message-ID: <20080421104301.GA2061@2ka.mipt.ru> (raw)
In-Reply-To: <e1d5030b0804210329j38d3bb8cge62e833088c1e0c@mail.gmail.com>
Hi.
On Mon, Apr 21, 2008 at 03:59:32PM +0530, Midhun A (midhunagni@gmail.com) wrote:
> static void imxmci_check_status(unsigned long data)
> {
> struct imxmci_host *host = (struct imxmci_host *)data;
>
> /*Netlink*/
> struct cn_msg *m;
> char cn_data[32] = "SD/MMC Card Status";
> /*Netlink*/
>
> if( host->pdata->card_present() != host->present ) {
> host->present ^= 1;
> dev_info(mmc_dev(host->mmc), "card %s\n",
> host->present ? "inserted" : "removed");
>
> /*Netlink*/
>
> m = kmalloc(sizeof(*m) + sizeof(cn_data), GFP_ATOMIC);
>
> if (m) {
> printk("Inside if\n");
> memset(m, 0, sizeof(*m) + sizeof(cn_data));
> memcpy(&m->id, &cn_test_id, sizeof(m->id));
> m->seq = cn_test_timer_counter;
> m->len = sizeof(cn_data);
>
> m->len =
> scnprintf(cn_data, sizeof(cn_data), "counter = %u",
> cn_test_timer_counter) + 1;
>
> memcpy(m + 1, data, m->len);
> printk("Copied Message\n");
> cn_netlink_send(m, 0, gfp_any());
> printk("Sent Message\n");
> kfree(m);
What is return value here?
Also, do you register this driver as connector user? If not, you can not
use 0 group number, since it will search only for registered kernel
side, and if there was no registration, it can not obtain address of the
userspace side. You can specify group (7 in your cae) as a parameter
instead.
I suppose userspace was bound to (1<<7) group number or was subscribed
using socket option to 7'th group.
--
Evgeniy Polyakov
next prev parent reply other threads:[~2008-04-21 10:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-26 10:11 Userspace - Kernel Space "Connector" test Midhun A
2008-03-27 14:38 ` Evgeniy Polyakov
2008-04-04 7:01 ` Midhun A
2008-04-21 10:29 ` Midhun A
2008-04-21 10:43 ` Evgeniy Polyakov [this message]
2008-04-23 8:19 ` Midhun A
2008-04-23 8:33 ` Evgeniy Polyakov
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=20080421104301.GA2061@2ka.mipt.ru \
--to=johnpol@2ka.mipt.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=midhunagni@gmail.com \
/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