mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Rosmanith <kernel@wildsau.enemy.org>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: finding pci_dev from scsi_device
Date: Mon, 26 Jun 2006 16:37:08 +0200 (MET DST)	[thread overview]
Message-ID: <200606261437.k5QEb8vr013461@wildsau.enemy.org> (raw)
In-Reply-To: <1151332173.3185.46.camel@laptopd505.fenrus.org>

> isn't it better to do this in the ahci driver itself instead? it for
> sure will be orders of magnitude easier....

drivers/scsi/ahci.c:

// XXX added herp
static int ahci_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg) {
...

For some reason, I have to use an ioctl to reconfigure the controller.
This means that I don't have the "struct pci_dev *pdev" from ahci_init_one
and ahci_remove_one.

I could store a pointer to pci_dev by extending "struct ahci_host_priv",
but before doing this, I'm trying to figure out if there's a "correct"
way of finding a pci_dev from a scsi_device.

>From the scsi_device, I know I can get a "struct ata_port", from there
a "struct Scsi_Host", a "struct ata_host_set" and even a generic
"struct device *".

Now all that's missing is a pointer to "struct pci_dev". Is there a function
to enumerate all "struct device", in that case I could compare
"struct pci_dev -> dev", if the pointers match, I've found it.

kind regards,
h.rosmanith



  parent reply	other threads:[~2006-06-26 14:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26 13:55 Herbert Rosmanith
2006-06-26 14:13 ` Arjan van de Ven
2006-06-26 14:15   ` Herbert Rosmanith
2006-06-26 14:29     ` Arjan van de Ven
2006-06-26 14:24       ` Herbert Rosmanith
2006-06-26 14:41         ` Arjan van de Ven
2006-06-26 14:47           ` Herbert Rosmanith
2006-06-26 14:54           ` Herbert Rosmanith
2006-06-26 14:37       ` Herbert Rosmanith [this message]
2006-06-26 14:42         ` Herbert Rosmanith

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=200606261437.k5QEb8vr013461@wildsau.enemy.org \
    --to=kernel@wildsau.enemy.org \
    --cc=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®