[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

rpms/kernel/devel linux-2.6.12-scsi-advansys-pcitable.patch, 1.2, 1.3



Author: davej

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv16339

Modified Files:
	linux-2.6.12-scsi-advansys-pcitable.patch 
Log Message:
further advansys unfucking.


linux-2.6.12-scsi-advansys-pcitable.patch:
 drivers/scsi/advansys.c              |   82 +++++++++++++++++------------------
 linux-2.6.12/include/linux/pci_ids.h |    3 +
 2 files changed, 44 insertions(+), 41 deletions(-)

Index: linux-2.6.12-scsi-advansys-pcitable.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6.12-scsi-advansys-pcitable.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6.12-scsi-advansys-pcitable.patch	6 Jul 2005 03:10:35 -0000	1.2
+++ linux-2.6.12-scsi-advansys-pcitable.patch	6 Jul 2005 03:39:14 -0000	1.3
@@ -1,29 +1,218 @@
+Remove a lot of duplicate #defines from the advansys driver.
+
+--- linux-2.6.12/include/linux/pci_ids.h~	2005-07-05 23:18:13.000000000 -0400
++++ linux-2.6.12/include/linux/pci_ids.h	2005-07-05 23:30:02.000000000 -0400
+@@ -1101,9 +1101,12 @@
+ #define PCI_DEVICE_ID_NEOMAGIC_MAGICGRAPH_128ZVPLUS   0x0083
+ 
+ #define PCI_VENDOR_ID_ASP		0x10cd
++#define PCI_DEVICE_ID_ASP_1200A		0x1100
+ #define PCI_DEVICE_ID_ASP_ABP940	0x1200
+ #define PCI_DEVICE_ID_ASP_ABP940U	0x1300
+ #define PCI_DEVICE_ID_ASP_ABP940UW	0x2300
++#define PCI_DEVICE_ID_38C0800_REV1	0x2500
++#define PCI_DEVICE_ID_38C1600_REV1	0x2700
+ 
+ #define PCI_VENDOR_ID_MACRONIX		0x10d9
+ #define PCI_DEVICE_ID_MACRONIX_MX98713	0x0512
+
+--- vanilla/drivers/scsi/advansys.c	2005-06-17 15:48:29.000000000 -0400
++++ linux-2.6.12/drivers/scsi/advansys.c	2005-07-05 23:27:48.000000000 -0400
+@@ -889,10 +889,6 @@ typedef unsigned char uchar;
+ #define ASC_PCI_ID2DEV(id)    (((id) >> 11) & 0x1F)
+ #define ASC_PCI_ID2FUNC(id)   (((id) >> 8) & 0x7)
+ #define ASC_PCI_MKID(bus, dev, func) ((((dev) & 0x1F) << 11) | (((func) & 0x7) << 8) | ((bus) & 0xFF))
+-#define ASC_PCI_VENDORID                  0x10CD
+-#define ASC_PCI_DEVICEID_1200A            0x1100
+-#define ASC_PCI_DEVICEID_1200B            0x1200
+-#define ASC_PCI_DEVICEID_ULTRA            0x1300
+ #define ASC_PCI_REVISION_3150             0x02
+ #define ASC_PCI_REVISION_3050             0x03
+ 
+@@ -1493,8 +1489,6 @@ typedef struct asc_dvc_cfg {
+ #define ASC_INIT_STATE_END_INQUIRY   0x0080
+ #define ASC_INIT_RESET_SCSI_DONE     0x0100
+ #define ASC_INIT_STATE_WITHOUT_EEP   0x8000
+-#define ASC_PCI_DEVICE_ID_REV_A      0x1100
+-#define ASC_PCI_DEVICE_ID_REV_B      0x1200
+ #define ASC_BUG_FIX_IF_NOT_DWB       0x0001
+ #define ASC_BUG_FIX_ASYN_USE_SYN     0x0002
+ #define ASYN_SDTR_DATA_FIX_PCI_REV_AB 0x41
+@@ -2101,12 +2095,6 @@ STATIC ASC_DCNT  AscGetMaxDmaCount(ushor
+ #define ADV_NUM_PAGE_CROSSING \
+     ((ADV_SG_TOTAL_MEM_SIZE + (ADV_PAGE_SIZE - 1))/ADV_PAGE_SIZE)
+ 
+-/* a_condor.h */
+-#define ADV_PCI_VENDOR_ID               0x10CD
+-#define ADV_PCI_DEVICE_ID_REV_A         0x2300
+-#define ADV_PCI_DEVID_38C0800_REV1      0x2500
+-#define ADV_PCI_DEVID_38C1600_REV1      0x2700
+-
+ #define ADV_EEP_DVC_CFG_BEGIN           (0x00)
+ #define ADV_EEP_DVC_CFG_END             (0x15)
+ #define ADV_EEP_DVC_CTL_BEGIN           (0x16)  /* location of OEM name */
+@@ -3570,14 +3558,7 @@ typedef struct scsi_cmnd     REQ, *REQP;
+ #define PCI_MAX_SLOT            0x1F
+ #define PCI_MAX_BUS             0xFF
+ #define PCI_IOADDRESS_MASK      0xFFFE
+-#define ASC_PCI_VENDORID        0x10CD
+ #define ASC_PCI_DEVICE_ID_CNT   6       /* PCI Device ID count. */
+-#define ASC_PCI_DEVICE_ID_1100  0x1100
+-#define ASC_PCI_DEVICE_ID_1200  0x1200
+-#define ASC_PCI_DEVICE_ID_1300  0x1300
+-#define ASC_PCI_DEVICE_ID_2300  0x2300  /* ASC-3550 */
+-#define ASC_PCI_DEVICE_ID_2500  0x2500  /* ASC-38C0800 */
+-#define ASC_PCI_DEVICE_ID_2700  0x2700  /* ASC-38C1600 */
+ 
+ #ifndef ADVANSYS_STATS
+ #define ASC_STATS(shp, counter)
+@@ -4331,12 +4312,12 @@ advansys_detect(struct scsi_host_templat
+     struct pci_dev      *pci_devp = NULL;
+     int                 pci_device_id_cnt = 0;
+     unsigned int        pci_device_id[ASC_PCI_DEVICE_ID_CNT] = {
+-                                    ASC_PCI_DEVICE_ID_1100,
+-                                    ASC_PCI_DEVICE_ID_1200,
+-                                    ASC_PCI_DEVICE_ID_1300,
+-                                    ASC_PCI_DEVICE_ID_2300,
+-                                    ASC_PCI_DEVICE_ID_2500,
+-                                    ASC_PCI_DEVICE_ID_2700
++                                    PCI_DEVICE_ID_ASP_1200A,
++                                    PCI_DEVICE_ID_ASP_ABP940,
++                                    PCI_DEVICE_ID_ASP_ABP940U,
++                                    PCI_DEVICE_ID_ASP_ABP940UW,
++                                    PCI_DEVICE_ID_38C0800_REV1,
++                                    PCI_DEVICE_ID_38C1600_REV1
+                         };
+     ADV_PADDR           pci_memory_address;
+ #endif /* CONFIG_PCI */
+@@ -4472,7 +4453,7 @@ advansys_detect(struct scsi_host_templat
+ 
+                     /* Find all PCI cards. */
+                     while (pci_device_id_cnt < ASC_PCI_DEVICE_ID_CNT) {
+-                        if ((pci_devp = pci_find_device(ASC_PCI_VENDORID,
++                        if ((pci_devp = pci_find_device(PCI_VENDOR_ID_ASP,
+                             pci_device_id[pci_device_id_cnt], pci_devp)) ==
+                             NULL) {
+                             pci_device_id_cnt++;
+@@ -4578,9 +4559,9 @@ advansys_detect(struct scsi_host_templat
+              */
+ #ifdef CONFIG_PCI
+             if (asc_bus[bus] == ASC_IS_PCI &&
+-                (pci_devp->device == ASC_PCI_DEVICE_ID_2300 ||
+-                 pci_devp->device == ASC_PCI_DEVICE_ID_2500 ||
+-                 pci_devp->device == ASC_PCI_DEVICE_ID_2700))
++                (pci_devp->device == PCI_DEVICE_ID_ASP_ABP940UW ||
++                 pci_devp->device == PCI_DEVICE_ID_38C0800_REV1 ||
++                 pci_devp->device == PCI_DEVICE_ID_38C1600_REV1))
+             {
+                 boardp->flags |= ASC_IS_WIDE_BOARD;
+             }
+@@ -4603,11 +4584,11 @@ advansys_detect(struct scsi_host_templat
+                 adv_dvc_varp->isr_callback = adv_isr_callback;
+                 adv_dvc_varp->async_callback = adv_async_callback;
+ #ifdef CONFIG_PCI
+-                if (pci_devp->device == ASC_PCI_DEVICE_ID_2300)
++                if (pci_devp->device == PCI_DEVICE_ID_ASP_ABP940UW)
+                 {
+                     ASC_DBG(1, "advansys_detect: ASC-3550\n");
+                     adv_dvc_varp->chip_type = ADV_CHIP_ASC3550;
+-                } else if (pci_devp->device == ASC_PCI_DEVICE_ID_2500)
++                } else if (pci_devp->device == PCI_DEVICE_ID_38C0800_REV1)
+                 {
+                     ASC_DBG(1, "advansys_detect: ASC-38C0800\n");
+                     adv_dvc_varp->chip_type = ADV_CHIP_ASC38C0800;
+@@ -11929,7 +11910,7 @@ AscInitGetConfig(
+         PCIRevisionID = DvcReadPCIConfigByte(asc_dvc,
+                                     AscPCIConfigRevisionIDRegister);
+ 
+-        if (PCIVendorID != ASC_PCI_VENDORID) {
++        if (PCIVendorID != PCI_VENDOR_ID_ASP) {
+             warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE;
+         }
+         prevCmdRegBits = DvcReadPCIConfigByte(asc_dvc,
+@@ -11949,15 +11930,15 @@ AscInitGetConfig(
+                 warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE;
+             }
+         }
+-        if ((PCIDeviceID == ASC_PCI_DEVICEID_1200A) ||
+-            (PCIDeviceID == ASC_PCI_DEVICEID_1200B)) {
++        if ((PCIDeviceID == PCI_DEVICE_ID_ASP_1200A) ||
++            (PCIDeviceID == PCI_DEVICE_ID_ASP_ABP940)) {
+             DvcWritePCIConfigByte(asc_dvc,
+                             AscPCIConfigLatencyTimer, 0x00);
+             if (DvcReadPCIConfigByte(asc_dvc, AscPCIConfigLatencyTimer)
+                 != 0x00) {
+                 warn_code |= ASC_WARN_SET_PCI_CONFIG_SPACE;
+             }
+-        } else if (PCIDeviceID == ASC_PCI_DEVICEID_ULTRA) {
++        } else if (PCIDeviceID == PCI_DEVICE_ID_ASP_ABP940U) {
+             if (DvcReadPCIConfigByte(asc_dvc,
+                                 AscPCIConfigLatencyTimer) < 0x20) {
+                 DvcWritePCIConfigByte(asc_dvc,
+@@ -12044,8 +12025,8 @@ AscInitFromAscDvcVar(
+         AscSetChipCfgMsw(iop_base, cfg_msw);
+         if ((asc_dvc->bus_type & ASC_IS_PCI_ULTRA) == ASC_IS_PCI_ULTRA) {
+         } else {
+-            if ((pci_device_id == ASC_PCI_DEVICE_ID_REV_A) ||
+-                (pci_device_id == ASC_PCI_DEVICE_ID_REV_B)) {
++            if ((pci_device_id == PCI_DEVICE_ID_ASP_1200A) ||
++                (pci_device_id == PCI_DEVICE_ID_ASP_ABP940)) {
+                 asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_IF_NOT_DWB;
+                 asc_dvc->bug_fix_cntl |= ASC_BUG_FIX_ASYN_USE_SYN;
+             }
+@@ -14282,8 +14263,8 @@ Default_38C0800_EEPROM_Config __initdata
+     0,                          /* 55 reserved */
+     0,                          /* 56 cisptr_lsw */
+     0,                          /* 57 cisprt_msw */
+-    ADV_PCI_VENDOR_ID,          /* 58 subsysvid */
+-    ADV_PCI_DEVID_38C0800_REV1, /* 59 subsysid */
++    PCI_VENDOR_ID_ASP,          /* 58 subsysvid */
++    PCI_DEVICE_ID_38C0800_REV1, /* 59 subsysid */
+     0,                          /* 60 reserved */
+     0,                          /* 61 reserved */
+     0,                          /* 62 reserved */
+@@ -14412,8 +14393,8 @@ Default_38C1600_EEPROM_Config __initdata
+     0,                          /* 55 reserved */
+     0,                          /* 56 cisptr_lsw */
+     0,                          /* 57 cisprt_msw */
+-    ADV_PCI_VENDOR_ID,          /* 58 subsysvid */
+-    ADV_PCI_DEVID_38C1600_REV1, /* 59 subsysid */
++    PCI_VENDOR_ID_ASP,          /* 58 subsysvid */
++    PCI_DEVICE_ID_38C1600_REV1, /* 59 subsysid */
+     0,                          /* 60 reserved */
+     0,                          /* 61 reserved */
+     0,                          /* 62 reserved */
+
+
+
+
 The advansys driver needs a lot of TLC. It does all its probing
 for devices in a prehistoric way.  This patch at least allows
 anaconda to recognise that the devices exist.
 
 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=162431
 
+
 --- vanilla/drivers/scsi/advansys.c	2005-06-17 15:48:29.000000000 -0400
-+++ linux-2.6.12/drivers/scsi/advansys.c	2005-07-05 23:09:21.000000000 -0400
-@@ -18232,3 +18232,22 @@
++++ linux-2.6.12/drivers/scsi/advansys.c	2005-07-05 23:27:48.000000000 -0400
+@@ -18232,3 +18213,22 @@ AdvInquiryHandling(
      }
  }
  MODULE_LICENSE("Dual BSD/GPL");
 +
 +/* PCI Devices supported by this driver */
 +static struct pci_device_id advansys_pci_tbl[] __devinitdata = {
-+	{ ADV_PCI_VENDORID, ASC_PCI_DEVICEID_1200A,
++	{ PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A,
 +	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-+	{ ADV_PCI_VENDORID, ASC_PCI_DEVICEID_1200B,
++	{ PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940,
 +	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-+	{ ADV_PCI_VENDORID, ASC_PCI_DEVICEID_ULTRA,
++	{ PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940U,
 +	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-+	{ ADV_PCI_VENDORID, ADV_PCI_DEVICE_ID_REV_A,
++	{ PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940UW,
 +	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-+	{ ADV_PCI_VENDORID, ADV_PCI_DEVID_38C0800_REV1,
++	{ PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_38C0800_REV1,
 +	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-+	{ ADV_PCI_VENDORID, ADV_PCI_DEVID_38C1600_REV1,
++	{ PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_38C1600_REV1,
 +	PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 +	{ }
 +};


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]