Skip to content

Commit

Permalink
Add pci class code for SATA & AHCI, and replace some magic numbers.
Browse files Browse the repository at this point in the history
Signed-off-by: Conke Hu <conke.hu@amd.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Conke Hu authored and Jeff Garzik committed Feb 9, 2007
1 parent 9500618 commit c9f8947
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 4 additions & 4 deletions drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {

/* Generic, PCI class code for AHCI */
{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
0x010601, 0xffffff, board_ahci },
PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci },

{ } /* terminate list */
};
Expand Down Expand Up @@ -1619,11 +1619,11 @@ static void ahci_print_info(struct ata_probe_ent *probe_ent)
speed_s = "?";

pci_read_config_word(pdev, 0x0a, &cc);
if (cc == 0x0101)
if (cc == PCI_CLASS_STORAGE_IDE)
scc_s = "IDE";
else if (cc == 0x0106)
else if (cc == PCI_CLASS_STORAGE_SATA)
scc_s = "SATA";
else if (cc == 0x0104)
else if (cc == PCI_CLASS_STORAGE_RAID)
scc_s = "RAID";
else
scc_s = "unknown";
Expand Down
2 changes: 1 addition & 1 deletion drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ static void __devinit quirk_sb600_sata(struct pci_dev *pdev)
pci_write_config_byte(pdev, 0xa, 6);
pci_write_config_byte(pdev, 0x40, tmp);

pdev->class = 0x010601;
pdev->class = PCI_CLASS_STORAGE_SATA_AHCI;
}
}
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP600_SATA, quirk_sb600_sata);
Expand Down
2 changes: 2 additions & 0 deletions include/linux/pci_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#define PCI_CLASS_STORAGE_FLOPPY 0x0102
#define PCI_CLASS_STORAGE_IPI 0x0103
#define PCI_CLASS_STORAGE_RAID 0x0104
#define PCI_CLASS_STORAGE_SATA 0x0106
#define PCI_CLASS_STORAGE_SATA_AHCI 0x010601
#define PCI_CLASS_STORAGE_SAS 0x0107
#define PCI_CLASS_STORAGE_OTHER 0x0180

Expand Down

0 comments on commit c9f8947

Please sign in to comment.