From: "Arend van Spriel" <arend@broadcom.com>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: How to create library module with callbacks?
Date: Fri, 14 Oct 2011 16:43:34 +0200 [thread overview]
Message-ID: <4E984A96.9080804@broadcom.com> (raw)
In-Reply-To: <CACna6ryphLSrh5vtOEDXek7s9DGxWKSSgQB-KJVLyzfmBCP3KA@mail.gmail.com>
On 10/14/2011 03:21 PM, Rafał Miłecki wrote:
> I want to create module library, which will handle PHY operations on
> Broadcom card. For most of the time, I'm going to call library
> functions from b43.
>
> However, there are places where I need to call some (b43) driver
> function from library module.
>
> How can I handle that? Should I pass some functions pointers to the
> library? Is that going to work? Or is there a better approach?
>
> P.S.
> I'm asking at linux-wireless, it's not wireless related however. I
> think question is quite simple for C hackers and there is no need to
> hit LKML.
>
Hi Rafał,
It should be no different as normal drivers do. In your case I would say
b43 registers itself with phylib module and provides phylib_ops. It
could also provide the bcma_device for the 80211 core so the phylib can
use bcma directly. Whether or not phylib is still a library module when
doing so can be argued. As it does not provide a system function by
itself I tend to say it is.
I would suggest to look into mac80211 to see how it deals with the
callbacks it does into the device drivers.
Gr. AvS
prev parent reply other threads:[~2011-10-14 14:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-14 13:21 How to create library module with callbacks? Rafał Miłecki
2011-10-14 14:42 ` Pavel Roskin
2011-10-14 14:43 ` Arend van Spriel [this message]
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=4E984A96.9080804@broadcom.com \
--to=arend@broadcom.com \
--cc=linux-wireless@vger.kernel.org \
--cc=zajec5@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;
as well as URLs for NNTP newsgroup(s).