linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cciss updates for 2.6 [7 of 11]
@ 2004-02-05  0:16 mikem
  0 siblings, 0 replies; only message in thread
From: mikem @ 2004-02-05  0:16 UTC (permalink / raw)
  To: akpm, axboe; +Cc: linux-kernel

Patch 7 of 11. Please apply in order.
This patch replaces reading directly form PCI config space where possible.
Most of what we need is in the pdev struct.
This is in 2.4.
--------------------------------------------------------------------------------------
diff -burN lx261-p006/drivers/block/cciss.c lx261/drivers/block/cciss.c
--- lx261-p006/drivers/block/cciss.c	2004-01-22 15:20:16.000000000 -0600
+++ lx261/drivers/block/cciss.c	2004-01-22 15:36:17.000000000 -0600
@@ -2121,9 +2121,8 @@

 static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
 {
-	ushort vendor_id, device_id, command;
-	unchar cache_line_size, latency_timer;
-	unchar irq, revision;
+	ushort subsystem_vendor_id, subsystem_device_id, command;
+	unchar irq = pdev->irq;
 	__u32 board_id, scratchpad = 0;
 	__u64 cfg_offset;
 	__u32 cfg_base_addr;
@@ -2150,17 +2149,10 @@
 		return(-1);
 	}

-	vendor_id = pdev->vendor;
-	device_id = pdev->device;
-	irq = pdev->irq;
-
-	(void) pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
-	(void) pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE,
-						&cache_line_size);
-	(void) pci_read_config_byte(pdev, PCI_LATENCY_TIMER,
-						&latency_timer);
-	(void) pci_read_config_dword(pdev, PCI_SUBSYSTEM_VENDOR_ID,
-						&board_id);
+	subsystem_vendor_id = pdev->subsystem_vendor;
+	subsystem_device_id = pdev->subsystem_device;
+	board_id = (((__u32) (subsystem_device_id << 16) & 0xffff0000) |
+					subsystem_vendor_id);

 	/* search for our IO range so we can protect it */
 	for(i=0; i<DEVICE_COUNT_RESOURCE; i++)
@@ -2188,15 +2180,8 @@
 	}

 #ifdef CCISS_DEBUG
-	printk("vendor_id = %x\n", vendor_id);
-	printk("device_id = %x\n", device_id);
 	printk("command = %x\n", command);
-	for(i=0; i<6; i++)
-		printk("addr[%d] = %x\n", i, pci_resource_start(pdev, i);
-	printk("revision = %x\n", revision);
 	printk("irq = %x\n", irq);
-	printk("cache_line_size = %x\n", cache_line_size);
-	printk("latency_timer = %x\n", latency_timer);
 	printk("board_id = %x\n", board_id);
 #endif /* CCISS_DEBUG */


Thanks,
mikem
mike.miller@hp.com


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-02-05  0:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-05  0:16 cciss updates for 2.6 [7 of 11] mikem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).