diff options
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 0b22933e258c..1a28b2e7bbb1 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -180,7 +180,6 @@ typedef struct ide_floppy_obj { | |||
180 | */ | 180 | */ |
181 | #define IDEFLOPPY_DRQ_INTERRUPT 0 /* DRQ interrupt device */ | 181 | #define IDEFLOPPY_DRQ_INTERRUPT 0 /* DRQ interrupt device */ |
182 | #define IDEFLOPPY_MEDIA_CHANGED 1 /* Media may have changed */ | 182 | #define IDEFLOPPY_MEDIA_CHANGED 1 /* Media may have changed */ |
183 | #define IDEFLOPPY_USE_READ12 2 /* Use READ12/WRITE12 or READ10/WRITE10 */ | ||
184 | #define IDEFLOPPY_FORMAT_IN_PROGRESS 3 /* Format in progress */ | 183 | #define IDEFLOPPY_FORMAT_IN_PROGRESS 3 /* Format in progress */ |
185 | #define IDEFLOPPY_CLIK_DRIVE 4 /* Avoid commands not supported in Clik drive */ | 184 | #define IDEFLOPPY_CLIK_DRIVE 4 /* Avoid commands not supported in Clik drive */ |
186 | #define IDEFLOPPY_ZIP_DRIVE 5 /* Requires BH algorithm for packets */ | 185 | #define IDEFLOPPY_ZIP_DRIVE 5 /* Requires BH algorithm for packets */ |
@@ -888,25 +887,22 @@ static void idefloppy_create_test_unit_ready_cmd(idefloppy_pc_t *pc) | |||
888 | pc->c[0] = GPCMD_TEST_UNIT_READY; | 887 | pc->c[0] = GPCMD_TEST_UNIT_READY; |
889 | } | 888 | } |
890 | 889 | ||
891 | static void idefloppy_create_rw_cmd (idefloppy_floppy_t *floppy, idefloppy_pc_t *pc, struct request *rq, unsigned long sector) | 890 | static void idefloppy_create_rw_cmd(idefloppy_floppy_t *floppy, |
891 | idefloppy_pc_t *pc, struct request *rq, | ||
892 | unsigned long sector) | ||
892 | { | 893 | { |
893 | int block = sector / floppy->bs_factor; | 894 | int block = sector / floppy->bs_factor; |
894 | int blocks = rq->nr_sectors / floppy->bs_factor; | 895 | int blocks = rq->nr_sectors / floppy->bs_factor; |
895 | int cmd = rq_data_dir(rq); | 896 | int cmd = rq_data_dir(rq); |
896 | 897 | ||
897 | debug_log("create_rw1%d_cmd: block == %d, blocks == %d\n", | 898 | debug_log("create_rw10_cmd: block == %d, blocks == %d\n", |
898 | 2 * test_bit (IDEFLOPPY_USE_READ12, &floppy->flags), | ||
899 | block, blocks); | 899 | block, blocks); |
900 | 900 | ||
901 | idefloppy_init_pc(pc); | 901 | idefloppy_init_pc(pc); |
902 | if (test_bit(IDEFLOPPY_USE_READ12, &floppy->flags)) { | 902 | pc->c[0] = cmd == READ ? GPCMD_READ_10 : GPCMD_WRITE_10; |
903 | pc->c[0] = cmd == READ ? GPCMD_READ_12 : GPCMD_WRITE_12; | 903 | put_unaligned(cpu_to_be16(blocks), (unsigned short *)&pc->c[7]); |
904 | put_unaligned(cpu_to_be32(blocks), (unsigned int *) &pc->c[6]); | ||
905 | } else { | ||
906 | pc->c[0] = cmd == READ ? GPCMD_READ_10 : GPCMD_WRITE_10; | ||
907 | put_unaligned(cpu_to_be16(blocks), (unsigned short *)&pc->c[7]); | ||
908 | } | ||
909 | put_unaligned(cpu_to_be32(block), (unsigned int *) &pc->c[2]); | 904 | put_unaligned(cpu_to_be32(block), (unsigned int *) &pc->c[2]); |
905 | |||
910 | pc->callback = &idefloppy_rw_callback; | 906 | pc->callback = &idefloppy_rw_callback; |
911 | pc->rq = rq; | 907 | pc->rq = rq; |
912 | pc->b_count = cmd == READ ? 0 : rq->bio->bi_size; | 908 | pc->b_count = cmd == READ ? 0 : rq->bio->bi_size; |