summaryrefslogtreecommitdiff
path: root/linux/src
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-12 14:18:55 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-12 14:20:36 +0100
commitdccf8be4b40ede12941ff347781fbff9330b2280 (patch)
treec6866751cce9e7c6fffbc822a0fa2e0274be2db5 /linux/src
parent57694037a02dda29bd678dc3b8531bd437682ba7 (diff)
Pass ide and hd kernel options to ide driver
* linux/dev/drivers/block/genhd.c: Include <linux/hdreg.h> and <alloca.h> (device_setup): Look for ide and hd options, and call ide_setup with them. * linux/src/drivers/block/ide.c (ide_setup) [MACH]: Parse hd[0-7] instead of hd[a-h].
Diffstat (limited to 'linux/src')
-rw-r--r--linux/src/drivers/block/ide.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/linux/src/drivers/block/ide.c b/linux/src/drivers/block/ide.c
index 9b9ecc2..7b639f7 100644
--- a/linux/src/drivers/block/ide.c
+++ b/linux/src/drivers/block/ide.c
@@ -3152,7 +3152,11 @@ void ide_setup (char *s)
ide_hwif_t *hwif;
ide_drive_t *drive;
unsigned int hw, unit;
+#ifdef MACH
+ const char max_drive = '0' + ((MAX_HWIFS * MAX_DRIVES) - 1);
+#else
const char max_drive = 'a' + ((MAX_HWIFS * MAX_DRIVES) - 1);
+#endif
const char max_hwif = '0' + (MAX_HWIFS - 1);
printk("ide_setup: %s", s);
@@ -3161,11 +3165,19 @@ void ide_setup (char *s)
/*
* Look for drive options: "hdx="
*/
+#ifdef MACH
+ if (s[0] == 'h' && s[1] == 'd' && s[2] >= '0' && s[2] <= max_drive) {
+#else
if (s[0] == 'h' && s[1] == 'd' && s[2] >= 'a' && s[2] <= max_drive) {
+#endif
const char *hd_words[] = {"none", "noprobe", "nowerr", "cdrom",
"serialize", "autotune", "noautotune",
"slow", "ide-scsi", NULL};
+#ifdef MACH
+ unit = s[2] - '0';
+#else
unit = s[2] - 'a';
+#endif
hw = unit / MAX_DRIVES;
unit = unit % MAX_DRIVES;
hwif = &ide_hwifs[hw];