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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1309358377-8537-26-git-send-email-kys@microsoft.com>
Date:	Wed, 29 Jun 2011 07:39:23 -0700
From:	"K. Y. Srinivasan" <kys@...rosoft.com>
To:	gregkh@...e.de, linux-kernel@...r.kernel.org,
	devel@...uxdriverproject.org, virtualization@...ts.osdl.org
Cc:	"K. Y. Srinivasan" <kys@...rosoft.com>,
	Haiyang Zhang <haiyangz@...rosoft.com>,
	Abhishek Kane <v-abkane@...rosoft.com>,
	Hank Janssen <hjanssen@...rosoft.com>
Subject: [PATCH 26/40] Staging: hv: storvsc: Handle probing IDE devices

Add code is storvsc_probe() to handle IDE devices. We currently boot
off of the first IDE disk. The emulated HBA assigned to manage the IDE
disks will be owned by this (boot) device. Subsequent IDE devices that
may be discovered will be managed by this HBA.

Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.com>
Signed-off-by: Abhishek Kane <v-abkane@...rosoft.com>
Signed-off-by: Hank Janssen <hjanssen@...rosoft.com>
---
 drivers/staging/hv/storvsc_drv.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index 898a311..c0d6e16 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -79,7 +79,7 @@ static void storvsc_get_ide_info(struct hv_device *dev, int *target, int *path)
 	dev->dev_instance.data[1] << 8  | dev->dev_instance.data[0];
 }
 
-int storvsc_ide_probe(struct hv_device *dev)
+static int storvsc_ide_probe(struct hv_device *dev)
 {
 	struct storvsc_device_info dev_info;
 	int target, path, channel;
@@ -713,6 +713,15 @@ static int storvsc_probe(struct hv_device *device)
 	struct Scsi_Host *host;
 	struct hv_host_device *host_dev;
 	struct storvsc_device_info device_info;
+	bool dev_is_ide;
+	int path, target;
+
+	if (!strcmp(device->device_type, "hv_block")) {
+		dev_is_ide = true;
+		if (storvsc_host)
+			return storvsc_ide_probe(device);
+	} else
+		dev_is_ide = false;
 
 	host = scsi_host_alloc(&scsi_driver,
 			       sizeof(struct hv_host_device));
@@ -751,8 +760,15 @@ static int storvsc_probe(struct hv_device *device)
 	 * This stor device owns the HBA; capture that state.
 	 */
 	((struct storvsc_device *)device->ext)->hba_owner = true;
-	host_dev->path = device_info.path_id;
-	host_dev->target = device_info.target_id;
+
+	if (dev_is_ide) {
+		storvsc_get_ide_info(device, &target, &path);
+		host_dev->path = path;
+		host_dev->target = target;
+	} else {
+		host_dev->path = device_info.path_id;
+		host_dev->target = device_info.target_id;
+	}
 
 	/* max # of devices per target */
 	host->max_lun = STORVSC_MAX_LUNS_PER_TARGET;
@@ -772,6 +788,7 @@ static int storvsc_probe(struct hv_device *device)
 		return -ENODEV;
 	}
 	scsi_scan_host(host);
+	storvsc_host = host;
 	return ret;
 }
 
-- 
1.7.4.1

--
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