aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-tape.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:36 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:36 -0400
commit97100fc816badbbc162644cfde7ad39ae9211fb4 (patch)
tree904faf5453c2dea32fa3fde5fda230118f3effda /drivers/ide/ide-tape.c
parentbe3c096ebdbe3c828aacb5473751a22840753eff (diff)
ide: add device flags
Add 'unsigned long dev_flags' to ide_drive_t and convert bitfields to IDE_DFLAG_* flags. While at it: - IDE_DFLAG_ADDRESSING -> IDE_DFLAG_LBA48 - fixup some comments - remove needless g->flags zeroing from ide*_probe() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r--drivers/ide/ide-tape.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 2c235401aad1..103f9f161716 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -826,12 +826,13 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
826 */ 826 */
827 stat = hwif->tp_ops->read_status(hwif); 827 stat = hwif->tp_ops->read_status(hwif);
828 828
829 if (!drive->dsc_overlap && !(rq->cmd[13] & REQ_IDETAPE_PC2)) 829 if ((drive->dev_flags & IDE_DFLAG_DSC_OVERLAP) == 0 &&
830 (rq->cmd[13] & REQ_IDETAPE_PC2) == 0)
830 set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags); 831 set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags);
831 832
832 if (drive->post_reset == 1) { 833 if (drive->dev_flags & IDE_DFLAG_POST_RESET) {
833 set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags); 834 set_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags);
834 drive->post_reset = 0; 835 drive->dev_flags &= ~IDE_DFLAG_POST_RESET;
835 } 836 }
836 837
837 if (!test_and_clear_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags) && 838 if (!test_and_clear_bit(IDE_AFLAG_IGNORE_DSC, &drive->atapi_flags) &&
@@ -1354,7 +1355,7 @@ static int idetape_init_read(ide_drive_t *drive)
1354 * No point in issuing this if DSC overlap isn't supported, some 1355 * No point in issuing this if DSC overlap isn't supported, some
1355 * drives (Seagate STT3401A) will return an error. 1356 * drives (Seagate STT3401A) will return an error.
1356 */ 1357 */
1357 if (drive->dsc_overlap) { 1358 if (drive->dev_flags & IDE_DFLAG_DSC_OVERLAP) {
1358 bytes_read = idetape_queue_rw_tail(drive, 1359 bytes_read = idetape_queue_rw_tail(drive,
1359 REQ_IDETAPE_READ, 0, 1360 REQ_IDETAPE_READ, 0,
1360 tape->merge_bh); 1361 tape->merge_bh);
@@ -1630,7 +1631,7 @@ static ssize_t idetape_chrdev_write(struct file *file, const char __user *buf,
1630 * point in issuing this if DSC overlap isn't supported, some 1631 * point in issuing this if DSC overlap isn't supported, some
1631 * drives (Seagate STT3401A) will return an error. 1632 * drives (Seagate STT3401A) will return an error.
1632 */ 1633 */
1633 if (drive->dsc_overlap) { 1634 if (drive->dev_flags & IDE_DFLAG_DSC_OVERLAP) {
1634 ssize_t retval = idetape_queue_rw_tail(drive, 1635 ssize_t retval = idetape_queue_rw_tail(drive,
1635 REQ_IDETAPE_WRITE, 0, 1636 REQ_IDETAPE_WRITE, 0,
1636 tape->merge_bh); 1637 tape->merge_bh);
@@ -2145,7 +2146,7 @@ static int divf_tdsc(ide_drive_t *drive) { return HZ; }
2145static int divf_buffer(ide_drive_t *drive) { return 2; } 2146static int divf_buffer(ide_drive_t *drive) { return 2; }
2146static int divf_buffer_size(ide_drive_t *drive) { return 1024; } 2147static int divf_buffer_size(ide_drive_t *drive) { return 1024; }
2147 2148
2148ide_devset_rw_field(dsc_overlap, dsc_overlap); 2149ide_devset_rw_flag(dsc_overlap, IDE_DFLAG_DSC_OVERLAP);
2149 2150
2150ide_tape_devset_rw_field(debug_mask, debug_mask); 2151ide_tape_devset_rw_field(debug_mask, debug_mask);
2151ide_tape_devset_rw_field(tdsc, best_dsc_rw_freq); 2152ide_tape_devset_rw_field(tdsc, best_dsc_rw_freq);
@@ -2192,15 +2193,19 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
2192 drive->pc_io_buffers = ide_tape_io_buffers; 2193 drive->pc_io_buffers = ide_tape_io_buffers;
2193 2194
2194 spin_lock_init(&tape->lock); 2195 spin_lock_init(&tape->lock);
2195 drive->dsc_overlap = 1; 2196
2197 drive->dev_flags |= IDE_DFLAG_DSC_OVERLAP;
2198
2196 if (drive->hwif->host_flags & IDE_HFLAG_NO_DSC) { 2199 if (drive->hwif->host_flags & IDE_HFLAG_NO_DSC) {
2197 printk(KERN_INFO "ide-tape: %s: disabling DSC overlap\n", 2200 printk(KERN_INFO "ide-tape: %s: disabling DSC overlap\n",
2198 tape->name); 2201 tape->name);
2199 drive->dsc_overlap = 0; 2202 drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
2200 } 2203 }
2204
2201 /* Seagate Travan drives do not support DSC overlap. */ 2205 /* Seagate Travan drives do not support DSC overlap. */
2202 if (strstr((char *)&drive->id[ATA_ID_PROD], "Seagate STT3401")) 2206 if (strstr((char *)&drive->id[ATA_ID_PROD], "Seagate STT3401"))
2203 drive->dsc_overlap = 0; 2207 drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
2208
2204 tape->minor = minor; 2209 tape->minor = minor;
2205 tape->name[0] = 'h'; 2210 tape->name[0] = 'h';
2206 tape->name[1] = 't'; 2211 tape->name[1] = 't';
@@ -2247,7 +2252,7 @@ static void idetape_setup(ide_drive_t *drive, idetape_tape_t *tape, int minor)
2247 (*(u16 *)&tape->caps[16] * 512) / tape->buffer_size, 2252 (*(u16 *)&tape->caps[16] * 512) / tape->buffer_size,
2248 tape->buffer_size / 1024, 2253 tape->buffer_size / 1024,
2249 tape->best_dsc_rw_freq * 1000 / HZ, 2254 tape->best_dsc_rw_freq * 1000 / HZ,
2250 drive->using_dma ? ", DMA":""); 2255 (drive->dev_flags & IDE_DFLAG_USING_DMA) ? ", DMA" : "");
2251 2256
2252 ide_proc_register_driver(drive, tape->driver); 2257 ide_proc_register_driver(drive, tape->driver);
2253} 2258}
@@ -2271,7 +2276,7 @@ static void ide_tape_release(struct kref *kref)
2271 2276
2272 BUG_ON(tape->merge_bh_size); 2277 BUG_ON(tape->merge_bh_size);
2273 2278
2274 drive->dsc_overlap = 0; 2279 drive->dev_flags &= ~IDE_DFLAG_DSC_OVERLAP;
2275 drive->driver_data = NULL; 2280 drive->driver_data = NULL;
2276 device_destroy(idetape_sysfs_class, MKDEV(IDETAPE_MAJOR, tape->minor)); 2281 device_destroy(idetape_sysfs_class, MKDEV(IDETAPE_MAJOR, tape->minor));
2277 device_destroy(idetape_sysfs_class, 2282 device_destroy(idetape_sysfs_class,
@@ -2386,7 +2391,8 @@ static int ide_tape_probe(ide_drive_t *drive)
2386 if (drive->media != ide_tape) 2391 if (drive->media != ide_tape)
2387 goto failed; 2392 goto failed;
2388 2393
2389 if (drive->id_read == 1 && !ide_check_atapi_device(drive, DRV_NAME)) { 2394 if ((drive->dev_flags & IDE_DFLAG_ID_READ) &&
2395 ide_check_atapi_device(drive, DRV_NAME) == 0) {
2390 printk(KERN_ERR "ide-tape: %s: not supported by this version of" 2396 printk(KERN_ERR "ide-tape: %s: not supported by this version of"
2391 " the driver\n", drive->name); 2397 " the driver\n", drive->name);
2392 goto failed; 2398 goto failed;