From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: reinelt@eunet.at,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Multi-function PCI devices
Date: Sat, 07 Apr 2001 17:58:20 -0400 [thread overview]
Message-ID: <3ACF8D7C.608B48D2@mandrakesoft.com> (raw)
In-Reply-To: <3ACECA8F.FEC9439@eunet.at> <200104072134.OAA11307@penguin.transmeta.com>
Linus Torvalds wrote:
> It only means that you should probably approach it as being a special
> "invisible PCI bridge", and basically have a specific driver for that
> chip that acts as a _bridge_ driver.
>
> Writing a bridge driver is not that hard: your init routine will
> instantiate the devices behind the bridge (ie you would allocate two
> "struct pci_device" structures and you would add them to behind the
> "bridge", and you would make _those_ look like real serial and parallell
> devices.
>
> See for example drivers/pcmcia/cardbus.c: cb_alloc() for how to create a
> new "pci_dev" (see the "for i = 0; i < fn ; i++)" loop: it creates the
> devices for each subfunction found behind the cardbus bridge. It really
> boils down to "dev = kmalloc(); initialize_dev(dev); pci_insert_dev(dev,
> bus);").
Cool :) Creative and interesting solution.
IMHO that's a slippery slope... If you do this as a solution for
multifunction devices, you also have to consider even more stupid
hardware which exports one PCI function, but multiple BARs for different
purposes...
Another problem, which I have yet to think much about, is doing a
reverse mapping after what you just describe: how does one figure out
that a bridge+devices is really a single hardware device? Answering
that question is interesting for NICs as well, because 4-port NICs often
appear as four devices behind a bridge. Some operations, such as
sharing an EEPROM across four ports, or setting a special flag if you
are quad-port hardware, require that knowledge. [ugly hacks exist now
to get around our lack of such knowledge]
Jeff
--
Jeff Garzik | Sam: "Mind if I drive?"
Building 1024 | Max: "Not if you don't mind me clawing at the dash
MandrakeSoft | and shrieking like a cheerleader."
prev parent reply other threads:[~2001-04-07 21:58 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-07 8:06 Multi-function PCI devices Michael Reinelt
2001-04-07 8:57 ` Jeff Garzik
2001-04-07 10:14 ` Tim Waugh
2001-04-07 18:42 ` PATCH for Broken PCI Multi-IO in 2.4.3 (serial+parport) Gunther Mayer
2001-04-07 18:53 ` Jeff Garzik
2001-04-07 19:06 ` Tim Waugh
2001-04-07 20:24 ` Gunther Mayer
2001-04-07 22:26 ` Jeff Garzik
2001-04-08 20:45 ` Martin Mares
2001-04-19 16:33 ` [patch, take 1] parport_serial (was Re: PATCH for Broken PCI Multi-IO in 2.4.3 (serial+parport)) Tim Waugh
2001-04-07 19:03 ` PATCH for Broken PCI Multi-IO in 2.4.3 (serial+parport) Tim Waugh
2001-04-07 16:22 ` Gérard Roudier
2001-04-07 20:47 ` Gunther Mayer
2001-04-07 19:23 ` Jeff Garzik
2001-04-07 19:31 ` Tim Waugh
2001-04-07 20:21 ` Gunther Mayer
2001-04-07 21:45 ` Tim Waugh
2001-04-07 22:29 ` Jeff Garzik
2001-04-07 20:31 ` Gunther Mayer
2001-04-07 21:52 ` Jeff Garzik
2001-04-07 11:33 ` Multi-function PCI devices Michael Reinelt
2001-04-07 12:16 ` Tim Waugh
2001-04-07 14:06 ` Michael Reinelt
2001-04-07 13:18 ` Gérard Roudier
2001-04-07 18:36 ` Michael Reinelt
2001-04-07 18:44 ` Jeff Garzik
2001-04-08 11:38 ` Michael Reinelt
2001-04-13 22:51 ` Jeff Garzik
2001-04-14 0:34 ` Michael Reinelt
2001-04-07 17:23 ` Jeff Garzik
2001-04-07 19:08 ` Tim Waugh
2001-04-07 19:31 ` Jeff Garzik
2001-04-08 10:25 ` Kai Henningsen
2001-04-09 13:15 ` Henning P. Schmiedehausen
2001-04-07 9:04 ` Gérard Roudier
2001-04-07 13:24 ` Brian Gerst
2001-04-07 14:03 ` Michael Reinelt
2001-04-07 13:01 ` Gérard Roudier
2001-04-07 19:14 ` Tim Waugh
2001-04-07 17:26 ` Jeff Garzik
2001-04-07 19:00 ` Tim Waugh
2001-04-07 19:40 ` Jeff Garzik
2001-04-07 19:52 ` Tim Waugh
2001-04-08 12:05 ` Michael Reinelt
2001-04-08 12:41 ` Tim Waugh
2001-04-07 21:34 ` Linus Torvalds
[not found] ` <200104072134.OAA11307@penguin.transmeta.com>
2001-04-07 21:58 ` Jeff Garzik [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=3ACF8D7C.608B48D2@mandrakesoft.com \
--to=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=reinelt@eunet.at \
--cc=torvalds@transmeta.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