lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20070703155815.16391674@the-village.bc.nu>
Date:	Tue, 3 Jul 2007 15:58:15 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	jeff@...zik.org, linux-ide@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] libata-sff: Kiss ATA_PRIMARY_* goodbye

We've been setting the PCI resources correctly in the PCI layer for some
time so remove this special casing. 

Signed-off-by: Alan Cox <alan@...hat.com>

diff -u --new-file --exclude-from /usr/src/exclude --recursive linux.vanilla-2.6.22-rc6-mm1/drivers/ata/libata-sff.c linux-2.6.22-rc6-mm1/drivers/ata/libata-sff.c
--- linux.vanilla-2.6.22-rc6-mm1/drivers/ata/libata-sff.c	2007-07-02 20:48:49.000000000 +0100
+++ linux-2.6.22-rc6-mm1/drivers/ata/libata-sff.c	2007-07-03 13:15:48.000000000 +0100
@@ -774,16 +774,13 @@
 				struct ata_legacy_devres *legacy_dr)
 {
 	struct ata_host *host = ap->host;
+	struct device *gdev = host->dev;
+	struct pci_dev *pdev = to_pci_dev(gdev);
 	int port_no = ap->port_no;
 	unsigned long cmd_port, ctl_port;
 
-	if (port_no == 0) {
-		cmd_port = ATA_PRIMARY_CMD;
-		ctl_port = ATA_PRIMARY_CTL;
-	} else {
-		cmd_port = ATA_SECONDARY_CMD;
-		ctl_port = ATA_SECONDARY_CTL;
-	}
+	cmd_port = pci_resource_start(pdev, port_no * 2);
+	ctl_port = pci_resource_start(pdev, port_no * 2 + 1);
 
 	/* request cmd_port */
 	if (request_region(cmd_port, 8, "libata"))
diff -u --new-file --exclude-from /usr/src/exclude --recursive linux.vanilla-2.6.22-rc6-mm1/include/asm-generic/libata-portmap.h linux-2.6.22-rc6-mm1/include/asm-generic/libata-portmap.h
--- linux.vanilla-2.6.22-rc6-mm1/include/asm-generic/libata-portmap.h	2007-07-02 20:47:33.000000000 +0100
+++ linux-2.6.22-rc6-mm1/include/asm-generic/libata-portmap.h	2007-07-03 13:16:13.000000000 +0100
@@ -1,12 +1,7 @@
 #ifndef __ASM_GENERIC_LIBATA_PORTMAP_H
 #define __ASM_GENERIC_LIBATA_PORTMAP_H
 
-#define ATA_PRIMARY_CMD		0x1F0
-#define ATA_PRIMARY_CTL		0x3F6
 #define ATA_PRIMARY_IRQ(dev)	14
-
-#define ATA_SECONDARY_CMD	0x170
-#define ATA_SECONDARY_CTL	0x376
 #define ATA_SECONDARY_IRQ(dev)	15
 
 #endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ