[lkml]   [2006]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: finding pci_dev from scsi_device
    > isn't it better to do this in the ahci driver itself instead? it for
    > sure will be orders of magnitude easier....


    // 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,

    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2006-06-26 16:45    [W:0.020 / U:6.332 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site