Linux PARISC architecture development
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Greg KH <greg@kroah.com>
Cc: linux-pci@atrey.karlin.mff.cuni.cz,
	parisc-linux@parisc-linux.org, Matthew Wilcox <matthew@wil.cx>
Subject: [parisc-linux] Re: How to determine whether a device is PCI or not
Date: Sat, 30 Oct 2004 16:40:07 +0100	[thread overview]
Message-ID: <20041030154007.GI8958@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <20041030023718.GA1099@kroah.com>

On Fri, Oct 29, 2004 at 07:37:18PM -0700, Greg KH wrote:
> Ick, no.  Devices do not "show" their type, you have to explicitly know
> what type they are in order to use them.
> 
> Why are you wanting to know this?  What are you trying to do with a
> generic struct device * where you don't know exactly what type it is?

In order to communicate with PA-RISC firmware, you have to know the path
to a device.  It's typically represented as something like [10/8/4/5/0].
This device can be PCI, GSC or EISA.  There's some moderately arcane
rules for turning a device into a path that you really don't care about,
but we need the devfn for PCI devices and the hw_path for GSC devices.

So what we want to do is, given a struct device, determine its path;
and given a path, turn it into a struct device.  The device model lets
us do this quite nicely -- much better than having duplicated routines
for starting with a pci_dev or a parisc_device.

If you prefer to keep this out of linux/pci.h, that's fine, we can keep
it private to arch/parisc.  I thought this might be something other
architectures might want to use (maybe for openfirmware?)

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

  reply	other threads:[~2004-10-30 15:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20041027121955.GH3450@parcelfarce.linux.theplanet.co.uk>
     [not found] ` <416174800000772D@mail-4-bnl.tiscali.it>
     [not found]   ` <20041027141522.GK3450@parcelfarce.linux.theplanet.co.uk>
2004-10-30  2:37     ` [parisc-linux] Re: How to determine whether a device is PCI or not Greg KH
2004-10-30 15:40       ` Matthew Wilcox [this message]
     [not found]         ` <20041030154822.GA9036@kroah.com>
2004-10-30 16:46           ` Matt Domsch

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=20041030154007.GI8958@parcelfarce.linux.theplanet.co.uk \
    --to=matthew@wil.cx \
    --cc=greg@kroah.com \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=parisc-linux@parisc-linux.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