diff options
author | Dave Jones <davej@redhat.com> | 2006-08-02 17:11:49 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-08-04 09:28:43 -0400 |
commit | 2672ea86be26353108a72a28910df4dc61cdb5e2 (patch) | |
tree | 206dc3a525dd5a03661f4e55a265b78db1e7e563 /drivers/scsi/advansys.c | |
parent | d67a70aca200f67be42428e74eb3353f20ad1130 (diff) |
[SCSI] advansys pci tweaks.
Remove a lot of duplicate #defines from the advansys driver,
and make them look like PCI IDs as defined elsewhere in the kernel.
Also add a module table so that it automatically gets picked up
by tools relying on modinfo output (like say, distro installers).
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/advansys.c')
-rw-r--r-- | drivers/scsi/advansys.c | 90 |
1 files changed, 49 insertions, 41 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index e32b4ab2f8fb..773f02e3b10b 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -888,10 +888,6 @@ typedef unsigned char uchar; | |||
888 | #define ASC_PCI_ID2DEV(id) (((id) >> 11) & 0x1F) | 888 | #define ASC_PCI_ID2DEV(id) (((id) >> 11) & 0x1F) |
889 | #define ASC_PCI_ID2FUNC(id) (((id) >> 8) & 0x7) | 889 | #define ASC_PCI_ID2FUNC(id) (((id) >> 8) & 0x7) |
890 | #define ASC_PCI_MKID(bus, dev, func) ((((dev) & 0x1F) << 11) | (((func) & 0x7) << 8) | ((bus) & 0xFF)) | 890 | #define ASC_PCI_MKID(bus, dev, func) ((((dev) & 0x1F) << 11) | (((func) & 0x7) << 8) | ((bus) & 0xFF)) |
891 | #define ASC_PCI_VENDORID 0x10CD | ||
892 | #define ASC_PCI_DEVICEID_1200A 0x1100 | ||
893 | #define ASC_PCI_DEVICEID_1200B 0x1200 | ||
894 | #define ASC_PCI_DEVICEID_ULTRA 0x1300 | ||
895 | #define ASC_PCI_REVISION_3150 0x02 | 891 | #define ASC_PCI_REVISION_3150 0x02 |
896 | #define ASC_PCI_REVISION_3050 0x03 | 892 | #define ASC_PCI_REVISION_3050 0x03 |
897 | 893 | ||
@@ -899,6 +895,14 @@ typedef unsigned char uchar; | |||
899 | #define ASC_DVCLIB_CALL_FAILED (0) | 895 | #define ASC_DVCLIB_CALL_FAILED (0) |
900 | #define ASC_DVCLIB_CALL_ERROR (-1) | 896 | #define ASC_DVCLIB_CALL_ERROR (-1) |
901 | 897 | ||
898 | #define PCI_VENDOR_ID_ASP 0x10cd | ||
899 | #define PCI_DEVICE_ID_ASP_1200A 0x1100 | ||
900 | #define PCI_DEVICE_ID_ASP_ABP940 0x1200 | ||
901 | #define PCI_DEVICE_ID_ASP_ABP940U 0x1300 | ||
902 | #define PCI_DEVICE_ID_ASP_ABP940UW 0x2300 | ||
903 | #define PCI_DEVICE_ID_38C0800_REV1 0x2500 | ||
904 | #define PCI_DEVICE_ID_38C1600_REV1 0x2700 | ||
905 | |||
902 | /* | 906 | /* |
903 | * Enable CC_VERY_LONG_SG_LIST to support up to 64K element SG lists. | 907 | * Enable CC_VERY_LONG_SG_LIST to support up to 64K element SG lists. |
904 | * The SRB structure will have to be changed and the ASC_SRB2SCSIQ() | 908 | * The SRB structure will have to be changed and the ASC_SRB2SCSIQ() |
@@ -1492,8 +1496,6 @@ typedef struct asc_dvc_cfg { | |||
1492 | #define ASC_INIT_STATE_END_INQUIRY 0x0080 | 1496 | #define ASC_INIT_STATE_END_INQUIRY 0x0080 |
1493 | #define ASC_INIT_RESET_SCSI_DONE 0x0100 | 1497 | #define ASC_INIT_RESET_SCSI_DONE 0x0100 |
1494 | #define ASC_INIT_STATE_WITHOUT_EEP 0x8000 | 1498 | #define ASC_INIT_STATE_WITHOUT_EEP 0x8000 |
1495 | #define ASC_PCI_DEVICE_ID_REV_A 0x1100 | ||
1496 | #define ASC_PCI_DEVICE_ID_REV_B 0x1200 | ||
1497 | #define ASC_BUG_FIX_IF_NOT_DWB 0x0001 | 1499 | #define ASC_BUG_FIX_IF_NOT_DWB 0x0001 |
1498 | #define ASC_BUG_FIX_ASYN_USE_SYN 0x0002 | 1500 | #define ASC_BUG_FIX_ASYN_USE_SYN 0x0002 |
1499 | #define ASYN_SDTR_DATA_FIX_PCI_REV_AB 0x41 | 1501 | #define ASYN_SDTR_DATA_FIX_PCI_REV_AB 0x41 |
@@ -2100,12 +2102,6 @@ STATIC ASC_DCNT AscGetMaxDmaCount(ushort); | |||
2100 | #define ADV_NUM_PAGE_CROSSING \ | 2102 | #define ADV_NUM_PAGE_CROSSING \ |
2101 | ((ADV_SG_TOTAL_MEM_SIZE + (ADV_PAGE_SIZE - 1))/ADV_PAGE_SIZE) | 2103 | ((ADV_SG_TOTAL_MEM_SIZE + (ADV_PAGE_SIZE - 1))/ADV_PAGE_SIZE) |
2102 | 2104 | ||
2103 | /* a_condor.h */ | ||
2104 | #define ADV_PCI_VENDOR_ID 0x10CD | ||
2105 | #define ADV_PCI_DEVICE_ID_REV_A 0x2300 | ||
2106 | #define ADV_PCI_DEVID_38C0800_REV1 0x2500 | ||
2107 | #define ADV_PCI_DEVID_38C1600_REV1 0x2700 | ||
2108 | |||
2109 | #define ADV_EEP_DVC_CFG_BEGIN (0x00) | 2105 | #define ADV_EEP_DVC_CFG_BEGIN (0x00) |
2110 | #define ADV_EEP_DVC_CFG_END (0x15) | 2106 | #define ADV_EEP_DVC_CFG_END (0x15) |
2111 | #define ADV_EEP_DVC_CTL_BEGIN (0x16) /* location of OEM name */ | 2107 | #define ADV_EEP_DVC_CTL_BEGIN (0x16) /* location of OEM name */ |
@@ -3569,14 +3565,7 @@ typedef struct scsi_cmnd REQ, *REQP; | |||
3569 | #define PCI_MAX_SLOT 0x1F | 3565 | #define PCI_MAX_SLOT 0x1F |
3570 | #define PCI_MAX_BUS 0xFF | 3566 | #define PCI_MAX_BUS 0xFF |
3571 | #define PCI_IOADDRESS_MASK 0xFFFE | 3567 | #define PCI_IOADDRESS_MASK 0xFFFE |
3572 | #define ASC_PCI_VENDORID 0x10CD | ||
3573 | #define ASC_PCI_DEVICE_ID_CNT 6 /* PCI Device ID count. */ | 3568 | #define ASC_PCI_DEVICE_ID_CNT 6 /* PCI Device ID count. */ |
3574 | #define ASC_PCI_DEVICE_ID_1100 0x1100 | ||
3575 | #define ASC_PCI_DEVICE_ID_1200 0x1200 | ||
3576 | #define ASC_PCI_DEVICE_ID_1300 0x1300 | ||
3577 | #define ASC_PCI_DEVICE_ID_2300 0x2300 /* ASC-3550 */ | ||
3578 | #define ASC_PCI_DEVICE_ID_2500 0x2500 /* ASC-38C0800 */ | ||
3579 | #define ASC_PCI_DEVICE_ID_2700 0x2700 /* ASC-38C1600 */ | ||
3580 | 3569 | ||
3581 | #ifndef ADVANSYS_STATS | 3570 | #ifndef ADVANSYS_STATS |
3582 | #define ASC_STATS(shp, counter) | 3571 | #define ASC_STATS(shp, counter) |
@@ -4330,12 +4319,12 @@ advansys_detect(struct scsi_host_template *tpnt) | |||
4330 | struct pci_dev *pci_devp = NULL; | 4319 | struct pci_dev *pci_devp = NULL; |
4331 | int pci_device_id_cnt = 0; | 4320 | int pci_device_id_cnt = 0; |
4332 | unsigned int pci_device_id[ASC_PCI_DEVICE_ID_CNT] = { | 4321 | unsigned int pci_device_id[ASC_PCI_DEVICE_ID_CNT] = { |
4333 | ASC_PCI_DEVICE_ID_1100, | 4322 | PCI_DEVICE_ID_ASP_1200A, |
4334 | ASC_PCI_DEVICE_ID_1200, | 4323 | PCI_DEVICE_ID_ASP_ABP940, |
4335 | ASC_PCI_DEVICE_ID_1300, | 4324 | PCI_DEVICE_ID_ASP_ABP940U, |
4336 | ASC_PCI_DEVICE_ID_2300, | 4325 | PCI_DEVICE_ID_ASP_ABP940UW, |
4337 | ASC_PCI_DEVICE_ID_2500, | 4326 | PCI_DEVICE_ID_38C0800_REV1, |
4338 | ASC_PCI_DEVICE_ID_2700 | 4327 | PCI_DEVICE_ID_38C1600_REV1 |
4339 | }; | 4328 | }; |
4340 | ADV_PADDR pci_memory_address; | 4329 | ADV_PADDR pci_memory_address; |
4341 | #endif /* CONFIG_PCI */ | 4330 | #endif /* CONFIG_PCI */ |
@@ -4471,7 +4460,7 @@ advansys_detect(struct scsi_host_template *tpnt) | |||
4471 | 4460 | ||
4472 | /* Find all PCI cards. */ | 4461 | /* Find all PCI cards. */ |
4473 | while (pci_device_id_cnt < ASC_PCI_DEVICE_ID_CNT) { | 4462 | while (pci_device_id_cnt < ASC_PCI_DEVICE_ID_CNT) { |
4474 | if ((pci_devp = pci_find_device(ASC_PCI_VENDORID, | 4463 | if ((pci_devp = pci_find_device(PCI_VENDOR_ID_ASP, |
4475 | pci_device_id[pci_device_id_cnt], pci_devp)) == | 4464 | pci_device_id[pci_device_id_cnt], pci_devp)) == |
4476 | NULL) { | 4465 | NULL) { |
4477 | pci_device_id_cnt++; | 4466 | pci_device_id_cnt++; |
@@ -4575,9 +4564,9 @@ advansys_detect(struct scsi_host_template *tpnt) | |||
4575 | */ | 4564 | */ |
4576 | #ifdef CONFIG_PCI | 4565 | #ifdef CONFIG_PCI |
4577 | if (asc_bus[bus] == ASC_IS_PCI && | 4566 | if (asc_bus[bus] == ASC_IS_PCI && |
4578 | (pci_devp->device == ASC_PCI_DEVICE_ID_2300 || | 4567 | (pci_devp->device == PCI_DEVICE_ID_ASP_ABP940UW || |
4579 | pci_devp->device == ASC_PCI_DEVICE_ID_2500 || | 4568 | pci_devp->device == PCI_DEVICE_ID_38C0800_REV1 || |
4580 | pci_devp->device == ASC_PCI_DEVICE_ID_2700)) | 4569 | pci_devp->device == PCI_DEVICE_ID_38C1600_REV1)) |
4581 | { | 4570 | { |
4582 | boardp->flags |= ASC_IS_WIDE_BOARD; | 4571 | boardp->flags |= ASC_IS_WIDE_BOARD; |
4583 | } | 4572 | } |
@@ -4600,11 +4589,11 @@ advansys_detect(struct scsi_host_template *tpnt) | |||
4600 | adv_dvc_varp->isr_callback = adv_isr_callback; | 4589 | adv_dvc_varp->isr_callback = adv_isr_callback; |
4601 | adv_dvc_varp->async_callback = adv_async_callback; | 4590 | adv_dvc_varp->async_callback = adv_async_callback; |
4602 | #ifdef CONFIG_PCI | 4591 | #ifdef CONFIG_PCI |
4603 | if (pci_devp->device == ASC_PCI_DEVICE_ID_2300) | 4592 | if (pci_devp->device == PCI_DEVICE_ID_ASP_ABP940UW) |
4604 | { | 4593 | { |
4605 | ASC_DBG(1, "advansys_detect: ASC-3550\n"); | 4594 | ASC_DBG(1, "advansys_detect: ASC-3550\n"); |
4606 | adv_dvc_varp->chip_type = ADV_CHIP_ASC3550; | 4595 | adv_dvc_varp->chip_type = ADV_CHIP_ASC3550; |
4607 | } else if (pci_devp->device == ASC_PCI_DEVICE_ID_2500) | 4596 | } else if (pci_devp->device == PCI_DEVICE_ID_38C0800_REV1) |
4608 | { | 4597 | { |
4609 | ASC_DBG(1, "advansys_detect: ASC-38C0800\n"); | 4598 | ASC_DBG(1, "advansys_detect: ASC-38C0800\n"); |
4610 | adv_dvc_varp->chip_type = ADV_CHIP_ASC38C0800; | 4599 | adv_dvc_varp->chip_type = ADV_CHIP_ASC38C0800; |
@@ -11922,7 +11911,7 @@ AscInitGetConfig( | |||
11922 | PCIRevisionID = DvcReadPCIConfigByte(asc_dvc, | 11911 | PCIRevisionID = DvcReadPCIConfigByte(asc_dvc, |
11923 | AscPCIConfigRevisionIDRegister); | 11912 | AscPCIConfigRevisionIDRegister); |
11924 | 11913 | ||
11925 | if (PCIVendorID != ASC_PCI_VENDORID) { | 11914 | if (PCIVendorID != PCI_VENDOR_ID_ASP) { |
11926 | warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE; | 11915 | warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE; |
11927 | } | 11916 | } |
11928 | prevCmdRegBits = DvcReadPCIConfigByte(asc_dvc, | 11917 | prevCmdRegBits = DvcReadPCIConfigByte(asc_dvc, |
@@ -11942,15 +11931,15 @@ AscInitGetConfig( | |||
11942 | warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE; | 11931 | warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE; |
11943 | } | 11932 | } |
11944 | } | 11933 | } |
11945 | if ((PCIDeviceID == ASC_PCI_DEVICEID_1200A) || | 11934 | if ((PCIDeviceID == PCI_DEVICE_ID_ASP_1200A) || |
11946 | (PCIDeviceID == ASC_PCI_DEVICEID_1200B)) { | 11935 | (PCIDeviceID == PCI_DEVICE_ID_ASP_ABP940)) { |
11947 | DvcWritePCIConfigByte(asc_dvc, | 11936 | DvcWritePCIConfigByte(asc_dvc, |
11948 | AscPCIConfigLatencyTimer, 0x00); | 11937 | AscPCIConfigLatencyTimer, 0x00); |
11949 | if (DvcReadPCIConfigByte(asc_dvc, AscPCIConfigLatencyTimer) | 11938 | if (DvcReadPCIConfigByte(asc_dvc, AscPCIConfigLatencyTimer) |
11950 | != 0x00) { | 11939 | != 0x00) { |
11951 | warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE; | 11940 | warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE; |
11952 | } | 11941 | } |
11953 | } else if (PCIDeviceID == ASC_PCI_DEVICEID_ULTRA) { | 11942 | } else if (PCIDeviceID == PCI_DEVICE_ID_ASP_ABP940U) { |
11954 | if (DvcReadPCIConfigByte(asc_dvc, | 11943 | if (DvcReadPCIConfigByte(asc_dvc, |
11955 | AscPCIConfigLatencyTimer) < 0x20) { | 11944 | AscPCIConfigLatencyTimer) < 0x20) { |
11956 | DvcWritePCIConfigByte(asc_dvc, | 11945 | DvcWritePCIConfigByte(asc_dvc, |
@@ -12037,8 +12026,8 @@ AscInitFromAscDvcVar( | |||
12037 | AscSetChipCfgMsw(iop_base, cfg_msw); | 12026 | AscSetChipCfgMsw(iop_base, cfg_msw); |
12038 | if ((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) == ASC_IS_PCI_ULTRA) { | 12027 | if ((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) == ASC_IS_PCI_ULTRA) { |
12039 | } else { | 12028 | } else { |
12040 | if ((pci_device_id == ASC_PCI_DEVICE_ID_REV_A) || | 12029 | if ((pci_device_id == PCI_DEVICE_ID_ASP_1200A) || |
12041 | (pci_device_id == ASC_PCI_DEVICE_ID_REV_B)) { | 12030 | (pci_device_id == PCI_DEVICE_ID_ASP_ABP940)) { |
12042 | asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_IF_NOT_DWB; | 12031 | asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_IF_NOT_DWB; |
12043 | asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_ASYN_USE_SYN; | 12032 | asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_ASYN_USE_SYN; |
12044 | } | 12033 | } |
@@ -14275,8 +14264,8 @@ Default_38C0800_EEPROM_Config __initdata = { | |||
14275 | 0, /* 55 reserved */ | 14264 | 0, /* 55 reserved */ |
14276 | 0, /* 56 cisptr_lsw */ | 14265 | 0, /* 56 cisptr_lsw */ |
14277 | 0, /* 57 cisprt_msw */ | 14266 | 0, /* 57 cisprt_msw */ |
14278 | ADV_PCI_VENDOR_ID, /* 58 subsysvid */ | 14267 | PCI_VENDOR_ID_ASP, /* 58 subsysvid */ |
14279 | ADV_PCI_DEVID_38C0800_REV1, /* 59 subsysid */ | 14268 | PCI_DEVICE_ID_38C0800_REV1, /* 59 subsysid */ |
14280 | 0, /* 60 reserved */ | 14269 | 0, /* 60 reserved */ |
14281 | 0, /* 61 reserved */ | 14270 | 0, /* 61 reserved */ |
14282 | 0, /* 62 reserved */ | 14271 | 0, /* 62 reserved */ |
@@ -14405,8 +14394,8 @@ Default_38C1600_EEPROM_Config __initdata = { | |||
14405 | 0, /* 55 reserved */ | 14394 | 0, /* 55 reserved */ |
14406 | 0, /* 56 cisptr_lsw */ | 14395 | 0, /* 56 cisptr_lsw */ |
14407 | 0, /* 57 cisprt_msw */ | 14396 | 0, /* 57 cisprt_msw */ |
14408 | ADV_PCI_VENDOR_ID, /* 58 subsysvid */ | 14397 | PCI_VENDOR_ID_ASP, /* 58 subsysvid */ |
14409 | ADV_PCI_DEVID_38C1600_REV1, /* 59 subsysid */ | 14398 | PCI_DEVICE_ID_38C1600_REV1, /* 59 subsysid */ |
14410 | 0, /* 60 reserved */ | 14399 | 0, /* 60 reserved */ |
14411 | 0, /* 61 reserved */ | 14400 | 0, /* 61 reserved */ |
14412 | 0, /* 62 reserved */ | 14401 | 0, /* 62 reserved */ |
@@ -18225,3 +18214,22 @@ AdvInquiryHandling( | |||
18225 | } | 18214 | } |
18226 | } | 18215 | } |
18227 | MODULE_LICENSE("Dual BSD/GPL"); | 18216 | MODULE_LICENSE("Dual BSD/GPL"); |
18217 | |||
18218 | /* PCI Devices supported by this driver */ | ||
18219 | static struct pci_device_id advansys_pci_tbl[] __devinitdata = { | ||
18220 | { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A, | ||
18221 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | ||
18222 | { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940, | ||
18223 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | ||
18224 | { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940U, | ||
18225 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | ||
18226 | { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940UW, | ||
18227 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | ||
18228 | { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_38C0800_REV1, | ||
18229 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | ||
18230 | { PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_38C1600_REV1, | ||
18231 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | ||
18232 | { } | ||
18233 | }; | ||
18234 | MODULE_DEVICE_TABLE(pci, advansys_pci_tbl); | ||
18235 | |||