From: George Kashperko <george@znau.edu.ua>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>,
"Michael Büsch" <mb@bu3sch.de>,
b43-dev@lists.infradead.org
Subject: Re: [RFC][PATCH] ssb: separate common scanning functions
Date: Fri, 18 Mar 2011 23:18:59 +0200 [thread overview]
Message-ID: <1300483139.15919.42.camel@dev.znau.edu.ua> (raw)
In-Reply-To: <AANLkTimboGmJNdHHbzWdSGf14jenn+yag944A8GBEXtc@mail.gmail.com>
> 2011/3/18 George Kashperko <george@znau.edu.ua>:
> > The clean solution I see here is to have host code apart from
> > backplane-specific processing. The way to accomplish this is obvious as
> > actual host device responsibility is not to switch cores but rather
> > provide mappings into physical address space of the backplane regardless
> > of the target request being made to core, sprom/otp, agent or whatever.
> > This makes much cleaner model than that provided by ssb.
>
> How do you think, what interface would fit for that?
>
> Something like:
> struct host_ops {
> bool (*init)(struct device *dev);
> bool (*exit)(struct device *dev);
> bool (*set_agent_addr)(struct device *dev, u16 addr);
> bool (*set_core_addr)(struct device *dev, u16 addr);
> };
> ?
Well, I see this as following. In generic host life time there are
several states. These states are following:
1. Host just started up, underlying backplane is powered up, we issued
backplane detect/scan. At this point at least some minimal windowed
access is up (if such required), not yet cores/devices are known.
2. Backplane got identified, scanned, individual cores/devices
recognised, buscommon and buscore are registered with kernel to get them
matched with drivers, and then probed and set up.
3. Buscommon and buscore are driven, host can finish with host specific
workarounds, both buscommon and buscore can get their _init entry points
called, we can setup host device irq routine, finally we can expose the
rest cores/devices to kernel.
With that in mind here is my general host ops design pseudo code:
struct host_ops {
/* Init call we should get once both buscommon and buscore drivers are bound (state #3) */
int (*init)(struct bcmb_bus *bus);
/* Regular backplane access ops */
u8 (*read(8|16|32))(struct bcmb_bus *bus, bcmb_addr_t addr);
void (*write(8|16|32))(struct bcmb_bus *bus, bcmb_addr_t addr, u(8|16|32) val);
/* For some theoretically hard-to-set-up before scan hosts we could keep scan_read32 */
u32 scan_read32(struct bcmb_bus *bus, bcmb_addr_t addr);
};
Finally (I'm not yet decided on that - still planning on sertaing
things) I see here a place for one more op - something like
int (*device_fixup)(struct bcmb_bus *bus, u16 ven, u16 id, u8 rev, struct bcmb_device **dev);
This one is supposed to allocate and setup struct bcmb_device at scan
time with optionally extending device list with more devices the host is
confident with (in my code model each core exposes at least 2 devices -
the core agent and the core itself, first one considered as
backplane-private and thus never registered with kernel). Such a fixup
could help to get a clean decision on how to handle host-specific
resourses such as sprom/otp/flash/uarts/etc.
Have nice day,
George
next prev parent reply other threads:[~2011-03-18 21:20 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-18 12:02 [RFC][PATCH] ssb: separate common scanning functions Rafał Miłecki
2011-03-18 13:03 ` George Kashperko
2011-03-18 14:10 ` Rafał Miłecki
2011-03-18 14:50 ` Rafał Miłecki
2011-03-18 15:49 ` George Kashperko
2011-03-18 16:25 ` Rafał Miłecki
2011-03-18 17:13 ` Larry Finger
2011-03-18 18:11 ` George Kashperko
2011-03-18 19:04 ` Rafał Miłecki
2011-03-18 20:01 ` George Kashperko
2011-03-18 21:52 ` Rafał Miłecki
2011-03-18 22:40 ` George Kashperko
2011-03-18 23:06 ` Rafał Miłecki
2011-03-18 23:22 ` George Kashperko
2011-03-18 23:32 ` Rafał Miłecki
2011-03-18 14:59 ` George Kashperko
2011-03-18 15:17 ` Rafał Miłecki
2011-03-18 15:58 ` George Kashperko
2011-03-18 16:04 ` Rafał Miłecki
2011-03-18 20:26 ` Rafał Miłecki
2011-03-18 21:18 ` George Kashperko [this message]
2011-03-18 22:42 ` Rafał Miłecki
2011-03-18 22:50 ` George Kashperko
2011-03-18 13:06 ` Arend van Spriel
2011-03-18 19:49 ` Rafał Miłecki
2011-03-19 8:59 ` Arend van Spriel
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=1300483139.15919.42.camel@dev.znau.edu.ua \
--to=george@znau.edu.ua \
--cc=b43-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mb@bu3sch.de \
--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