aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-disk.c4
-rw-r--r--drivers/ide/ide-eh.c9
-rw-r--r--drivers/ide/ide-io.c21
-rw-r--r--drivers/ide/ide-probe.c6
-rw-r--r--drivers/ide/ide-taskfile.c2
-rw-r--r--drivers/ide/siimage.c4
-rw-r--r--include/linux/ide.h21
7 files changed, 29 insertions, 38 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index c2438804d3c4..d345f5f23f01 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -428,14 +428,14 @@ static int set_multcount(ide_drive_t *drive, int arg)
428 if (arg < 0 || arg > (drive->id[ATA_ID_MAX_MULTSECT] & 0xff)) 428 if (arg < 0 || arg > (drive->id[ATA_ID_MAX_MULTSECT] & 0xff))
429 return -EINVAL; 429 return -EINVAL;
430 430
431 if (drive->special.b.set_multmode) 431 if (drive->special_flags & IDE_SFLAG_SET_MULTMODE)
432 return -EBUSY; 432 return -EBUSY;
433 433
434 rq = blk_get_request(drive->queue, READ, __GFP_WAIT); 434 rq = blk_get_request(drive->queue, READ, __GFP_WAIT);
435 rq->cmd_type = REQ_TYPE_ATA_TASKFILE; 435 rq->cmd_type = REQ_TYPE_ATA_TASKFILE;
436 436
437 drive->mult_req = arg; 437 drive->mult_req = arg;
438 drive->special.b.set_multmode = 1; 438 drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
439 error = blk_execute_rq(drive->queue, NULL, rq, 0); 439 error = blk_execute_rq(drive->queue, NULL, rq, 0);
440 blk_put_request(rq); 440 blk_put_request(rq);
441 441
diff --git a/drivers/ide/ide-eh.c b/drivers/ide/ide-eh.c
index 5d5fb961b5ce..39d589254d41 100644
--- a/drivers/ide/ide-eh.c
+++ b/drivers/ide/ide-eh.c
@@ -52,7 +52,7 @@ static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq,
52 } 52 }
53 53
54 if ((rq->errors & ERROR_RECAL) == ERROR_RECAL) 54 if ((rq->errors & ERROR_RECAL) == ERROR_RECAL)
55 drive->special.b.recalibrate = 1; 55 drive->special_flags |= IDE_SFLAG_RECALIBRATE;
56 56
57 ++rq->errors; 57 ++rq->errors;
58 58
@@ -268,9 +268,8 @@ static void ide_disk_pre_reset(ide_drive_t *drive)
268{ 268{
269 int legacy = (drive->id[ATA_ID_CFS_ENABLE_2] & 0x0400) ? 0 : 1; 269 int legacy = (drive->id[ATA_ID_CFS_ENABLE_2] & 0x0400) ? 0 : 1;
270 270
271 drive->special.all = 0; 271 drive->special_flags =
272 drive->special.b.set_geometry = legacy; 272 legacy ? (IDE_SFLAG_SET_GEOMETRY | IDE_SFLAG_RECALIBRATE) : 0;
273 drive->special.b.recalibrate = legacy;
274 273
275 drive->mult_count = 0; 274 drive->mult_count = 0;
276 drive->dev_flags &= ~IDE_DFLAG_PARKED; 275 drive->dev_flags &= ~IDE_DFLAG_PARKED;
@@ -280,7 +279,7 @@ static void ide_disk_pre_reset(ide_drive_t *drive)
280 drive->mult_req = 0; 279 drive->mult_req = 0;
281 280
282 if (drive->mult_req != drive->mult_count) 281 if (drive->mult_req != drive->mult_count)
283 drive->special.b.set_multmode = 1; 282 drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
284} 283}
285 284
286static void pre_reset(ide_drive_t *drive) 285static void pre_reset(ide_drive_t *drive)
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 18557683ed5a..644d7b4454a6 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -194,14 +194,14 @@ static void ide_tf_set_setmult_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
194 194
195static ide_startstop_t do_special(ide_drive_t *drive) 195static ide_startstop_t do_special(ide_drive_t *drive)
196{ 196{
197 special_t *s = &drive->special;
198 struct ide_cmd cmd; 197 struct ide_cmd cmd;
199 198
200#ifdef DEBUG 199#ifdef DEBUG
201 printk(KERN_DEBUG "%s: %s: 0x%02x\n", drive->name, __func__, s->all); 200 printk(KERN_DEBUG "%s: %s: 0x%02x\n", drive->name, __func__,
201 drive->special_flags);
202#endif 202#endif
203 if (drive->media != ide_disk) { 203 if (drive->media != ide_disk) {
204 s->all = 0; 204 drive->special_flags = 0;
205 drive->mult_req = 0; 205 drive->mult_req = 0;
206 return ide_stopped; 206 return ide_stopped;
207 } 207 }
@@ -209,14 +209,14 @@ static ide_startstop_t do_special(ide_drive_t *drive)
209 memset(&cmd, 0, sizeof(cmd)); 209 memset(&cmd, 0, sizeof(cmd));
210 cmd.protocol = ATA_PROT_NODATA; 210 cmd.protocol = ATA_PROT_NODATA;
211 211
212 if (s->b.set_geometry) { 212 if (drive->special_flags & IDE_SFLAG_SET_GEOMETRY) {
213 s->b.set_geometry = 0; 213 drive->special_flags &= ~IDE_SFLAG_SET_GEOMETRY;
214 ide_tf_set_specify_cmd(drive, &cmd.tf); 214 ide_tf_set_specify_cmd(drive, &cmd.tf);
215 } else if (s->b.recalibrate) { 215 } else if (drive->special_flags & IDE_SFLAG_RECALIBRATE) {
216 s->b.recalibrate = 0; 216 drive->special_flags &= ~IDE_SFLAG_RECALIBRATE;
217 ide_tf_set_restore_cmd(drive, &cmd.tf); 217 ide_tf_set_restore_cmd(drive, &cmd.tf);
218 } else if (s->b.set_multmode) { 218 } else if (drive->special_flags & IDE_SFLAG_SET_MULTMODE) {
219 s->b.set_multmode = 0; 219 drive->special_flags &= ~IDE_SFLAG_SET_MULTMODE;
220 ide_tf_set_setmult_cmd(drive, &cmd.tf); 220 ide_tf_set_setmult_cmd(drive, &cmd.tf);
221 } else 221 } else
222 BUG(); 222 BUG();
@@ -339,7 +339,8 @@ static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq)
339 printk(KERN_ERR "%s: drive not ready for command\n", drive->name); 339 printk(KERN_ERR "%s: drive not ready for command\n", drive->name);
340 return startstop; 340 return startstop;
341 } 341 }
342 if (!drive->special.all) { 342
343 if (drive->special_flags == 0) {
343 struct ide_driver *drv; 344 struct ide_driver *drv;
344 345
345 /* 346 /*
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index b609a581df44..727a67109ff0 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -97,7 +97,7 @@ static void ide_disk_init_mult_count(ide_drive_t *drive)
97 drive->mult_req = id[ATA_ID_MULTSECT] & 0xff; 97 drive->mult_req = id[ATA_ID_MULTSECT] & 0xff;
98 98
99 if (drive->mult_req) 99 if (drive->mult_req)
100 drive->special.b.set_multmode = 1; 100 drive->special_flags |= IDE_SFLAG_SET_MULTMODE;
101 } 101 }
102} 102}
103 103
@@ -1138,8 +1138,8 @@ static void ide_port_init_devices_data(ide_hwif_t *hwif)
1138 drive->hwif = hwif; 1138 drive->hwif = hwif;
1139 drive->ready_stat = ATA_DRDY; 1139 drive->ready_stat = ATA_DRDY;
1140 drive->bad_wstat = BAD_W_STAT; 1140 drive->bad_wstat = BAD_W_STAT;
1141 drive->special.b.recalibrate = 1; 1141 drive->special_flags = IDE_SFLAG_RECALIBRATE |
1142 drive->special.b.set_geometry = 1; 1142 IDE_SFLAG_SET_GEOMETRY;
1143 drive->name[0] = 'h'; 1143 drive->name[0] = 'h';
1144 drive->name[1] = 'd'; 1144 drive->name[1] = 'd';
1145 drive->name[2] = 'a' + j; 1145 drive->name[2] = 'a' + j;
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index f400eb4d4aff..8cab3c26acda 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -166,7 +166,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
166 if (!OK_STAT(stat, ATA_DRDY, BAD_STAT)) { 166 if (!OK_STAT(stat, ATA_DRDY, BAD_STAT)) {
167 if (custom && tf->command == ATA_CMD_SET_MULTI) { 167 if (custom && tf->command == ATA_CMD_SET_MULTI) {
168 drive->mult_req = drive->mult_count = 0; 168 drive->mult_req = drive->mult_count = 0;
169 drive->special.b.recalibrate = 1; 169 drive->special_flags |= IDE_SFLAG_RECALIBRATE;
170 (void)ide_dump_status(drive, __func__, stat); 170 (void)ide_dump_status(drive, __func__, stat);
171 return ide_stopped; 171 return ide_stopped;
172 } else if (custom && tf->command == ATA_CMD_INIT_DEV_PARAMS) { 172 } else if (custom && tf->command == ATA_CMD_INIT_DEV_PARAMS) {
diff --git a/drivers/ide/siimage.c b/drivers/ide/siimage.c
index e4973cd1fba9..bd82d228608c 100644
--- a/drivers/ide/siimage.c
+++ b/drivers/ide/siimage.c
@@ -451,8 +451,8 @@ static int sil_sata_reset_poll(ide_drive_t *drive)
451static void sil_sata_pre_reset(ide_drive_t *drive) 451static void sil_sata_pre_reset(ide_drive_t *drive)
452{ 452{
453 if (drive->media == ide_disk) { 453 if (drive->media == ide_disk) {
454 drive->special.b.set_geometry = 0; 454 drive->special_flags &=
455 drive->special.b.recalibrate = 0; 455 ~(IDE_SFLAG_SET_GEOMETRY | IDE_SFLAG_RECALIBRATE);
456 } 456 }
457} 457}
458 458
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 34c128f0a33c..fc61328a4cdb 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -218,21 +218,12 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
218 218
219/* 219/*
220 * Special Driver Flags 220 * Special Driver Flags
221 *
222 * set_geometry : respecify drive geometry
223 * recalibrate : seek to cyl 0
224 * set_multmode : set multmode count
225 * reserved : unused
226 */ 221 */
227typedef union { 222enum {
228 unsigned all : 8; 223 IDE_SFLAG_SET_GEOMETRY = (1 << 0),
229 struct { 224 IDE_SFLAG_RECALIBRATE = (1 << 1),
230 unsigned set_geometry : 1; 225 IDE_SFLAG_SET_MULTMODE = (1 << 2),
231 unsigned recalibrate : 1; 226};
232 unsigned set_multmode : 1;
233 unsigned reserved : 5;
234 } b;
235} special_t;
236 227
237/* 228/*
238 * Status returned from various ide_ functions 229 * Status returned from various ide_ functions
@@ -530,7 +521,7 @@ struct ide_drive_s {
530 unsigned long sleep; /* sleep until this time */ 521 unsigned long sleep; /* sleep until this time */
531 unsigned long timeout; /* max time to wait for irq */ 522 unsigned long timeout; /* max time to wait for irq */
532 523
533 special_t special; /* special action flags */ 524 u8 special_flags; /* special action flags */
534 525
535 u8 select; /* basic drive/head select reg value */ 526 u8 select; /* basic drive/head select reg value */
536 u8 retry_pio; /* retrying dma capable host in pio */ 527 u8 retry_pio; /* retrying dma capable host in pio */