Commit 19710d25d50ae0be05eebe4231ed8918b1092d82

Authored by Bartlomiej Zolnierkiewicz
1 parent c094ea0774

ide: add "flagged" taskfile flags to struct ide_taskfile (v2)

* Add ->ftf_flags field to struct ide_taskfile
  and convert flags for TASKFILE ioctl to use it.

* Rename "flagged" taskfile flags:
  - IDE_TFLAG_FLAGGED -> IDE_FTFLAG_FLAGGED
  - IDE_TFLAG_FLAGGED_SET_IN_FLAGS -> IDE_FTFLAG_SET_IN_FLAGS
  - IDE_TFLAG_{OUT,IN}_DATA -> IDE_FTFLAG_{OUT,IN}_DATA

v2:
* Remember to fully update ide-h8300.c, scc_pata.c and tx493{8,9}ide.c
  (thanks to Stephen Rothwell for noticing).

There should be no functional changes caused by this patch.

Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Showing 9 changed files with 60 additions and 56 deletions Side-by-side Diff

drivers/ide/at91_ide.c
... ... @@ -192,10 +192,10 @@
192 192 struct ide_taskfile *tf = &task->tf;
193 193 u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
194 194  
195   - if (task->tf_flags & IDE_TFLAG_FLAGGED)
  195 + if (task->tf_flags & IDE_FTFLAG_FLAGGED)
196 196 HIHI = 0xFF;
197 197  
198   - if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
  198 + if (task->tf_flags & IDE_FTFLAG_OUT_DATA) {
199 199 u16 data = (tf->hob_data << 8) | tf->data;
200 200  
201 201 at91_ide_output_data(drive, NULL, &data, 2);
... ... @@ -233,7 +233,7 @@
233 233 struct ide_io_ports *io_ports = &hwif->io_ports;
234 234 struct ide_taskfile *tf = &task->tf;
235 235  
236   - if (task->tf_flags & IDE_TFLAG_IN_DATA) {
  236 + if (task->tf_flags & IDE_FTFLAG_IN_DATA) {
237 237 u16 data;
238 238  
239 239 at91_ide_input_data(drive, NULL, &data, 2);
drivers/ide/ide-h8300.c
... ... @@ -51,10 +51,10 @@
51 51 struct ide_taskfile *tf = &task->tf;
52 52 u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
53 53  
54   - if (task->tf_flags & IDE_TFLAG_FLAGGED)
  54 + if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
55 55 HIHI = 0xFF;
56 56  
57   - if (task->tf_flags & IDE_TFLAG_OUT_DATA)
  57 + if (task->ftf_flags & IDE_FTFLAG_OUT_DATA)
58 58 mm_outw((tf->hob_data << 8) | tf->data, io_ports->data_addr);
59 59  
60 60 if (task->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
... ... @@ -90,7 +90,7 @@
90 90 struct ide_io_ports *io_ports = &hwif->io_ports;
91 91 struct ide_taskfile *tf = &task->tf;
92 92  
93   - if (task->tf_flags & IDE_TFLAG_IN_DATA) {
  93 + if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
94 94 u16 data = mm_inw(io_ports->data_addr);
95 95  
96 96 tf->data = data & 0xff;
drivers/ide/ide-io-std.c
... ... @@ -96,10 +96,10 @@
96 96 else
97 97 tf_outb = ide_outb;
98 98  
99   - if (task->tf_flags & IDE_TFLAG_FLAGGED)
  99 + if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
100 100 HIHI = 0xFF;
101 101  
102   - if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
  102 + if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
103 103 u16 data = (tf->hob_data << 8) | tf->data;
104 104  
105 105 if (mmio)
... ... @@ -153,7 +153,7 @@
153 153 tf_inb = ide_inb;
154 154 }
155 155  
156   - if (task->tf_flags & IDE_TFLAG_IN_DATA) {
  156 + if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
157 157 u16 data;
158 158  
159 159 if (mmio)
drivers/ide/ide-taskfile.c
... ... @@ -73,8 +73,8 @@
73 73 }
74 74 }
75 75  
76   - if (task->tf_flags & IDE_TFLAG_FLAGGED)
77   - task->tf_flags |= IDE_TFLAG_FLAGGED_SET_IN_FLAGS;
  76 + if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
  77 + task->ftf_flags |= IDE_FTFLAG_SET_IN_FLAGS;
78 78  
79 79 memcpy(&hwif->task, task, sizeof(*task));
80 80  
81 81  
... ... @@ -551,10 +551,10 @@
551 551 args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_IN_HOB);
552 552  
553 553 if (req_task->out_flags.all) {
554   - args.tf_flags |= IDE_TFLAG_FLAGGED;
  554 + args.ftf_flags |= IDE_FTFLAG_FLAGGED;
555 555  
556 556 if (req_task->out_flags.b.data)
557   - args.tf_flags |= IDE_TFLAG_OUT_DATA;
  557 + args.ftf_flags |= IDE_FTFLAG_OUT_DATA;
558 558  
559 559 if (req_task->out_flags.b.nsector_hob)
560 560 args.tf_flags |= IDE_TFLAG_OUT_HOB_NSECT;
... ... @@ -582,7 +582,7 @@
582 582 }
583 583  
584 584 if (req_task->in_flags.b.data)
585   - args.tf_flags |= IDE_TFLAG_IN_DATA;
  585 + args.ftf_flags |= IDE_FTFLAG_IN_DATA;
586 586  
587 587 switch(req_task->data_phase) {
588 588 case TASKFILE_MULTI_OUT:
... ... @@ -647,7 +647,7 @@
647 647 memcpy(req_task->hob_ports, &args.tf_array[0], HDIO_DRIVE_HOB_HDR_SIZE - 2);
648 648 memcpy(req_task->io_ports, &args.tf_array[6], HDIO_DRIVE_TASK_HDR_SIZE);
649 649  
650   - if ((args.tf_flags & IDE_TFLAG_FLAGGED_SET_IN_FLAGS) &&
  650 + if ((args.ftf_flags & IDE_FTFLAG_SET_IN_FLAGS) &&
651 651 req_task->in_flags.all == 0) {
652 652 req_task->in_flags.all = IDE_TASKFILE_STD_IN_FLAGS;
653 653 if (drive->dev_flags & IDE_DFLAG_LBA48)
drivers/ide/ns87415.c
... ... @@ -66,7 +66,7 @@
66 66 struct ide_io_ports *io_ports = &drive->hwif->io_ports;
67 67 struct ide_taskfile *tf = &task->tf;
68 68  
69   - if (task->tf_flags & IDE_TFLAG_IN_DATA) {
  69 + if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
70 70 u16 data = inw(io_ports->data_addr);
71 71  
72 72 tf->data = data & 0xff;
drivers/ide/scc_pata.c
... ... @@ -672,10 +672,10 @@
672 672 struct ide_taskfile *tf = &task->tf;
673 673 u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
674 674  
675   - if (task->tf_flags & IDE_TFLAG_FLAGGED)
  675 + if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
676 676 HIHI = 0xFF;
677 677  
678   - if (task->tf_flags & IDE_TFLAG_OUT_DATA)
  678 + if (task->ftf_flags & IDE_FTFLAG_OUT_DATA)
679 679 out_be32((void *)io_ports->data_addr,
680 680 (tf->hob_data << 8) | tf->data);
681 681  
... ... @@ -711,7 +711,7 @@
711 711 struct ide_io_ports *io_ports = &drive->hwif->io_ports;
712 712 struct ide_taskfile *tf = &task->tf;
713 713  
714   - if (task->tf_flags & IDE_TFLAG_IN_DATA) {
  714 + if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
715 715 u16 data = (u16)in_be32((void *)io_ports->data_addr);
716 716  
717 717 tf->data = data & 0xff;
drivers/ide/tx4938ide.c
... ... @@ -89,10 +89,10 @@
89 89 struct ide_taskfile *tf = &task->tf;
90 90 u8 HIHI = task->tf_flags & IDE_TFLAG_LBA48 ? 0xE0 : 0xEF;
91 91  
92   - if (task->tf_flags & IDE_TFLAG_FLAGGED)
  92 + if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
93 93 HIHI = 0xFF;
94 94  
95   - if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
  95 + if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
96 96 u16 data = (tf->hob_data << 8) | tf->data;
97 97  
98 98 /* no endian swap */
... ... @@ -132,7 +132,7 @@
132 132 struct ide_io_ports *io_ports = &hwif->io_ports;
133 133 struct ide_taskfile *tf = &task->tf;
134 134  
135   - if (task->tf_flags & IDE_TFLAG_IN_DATA) {
  135 + if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
136 136 u16 data;
137 137  
138 138 /* no endian swap */
drivers/ide/tx4939ide.c
... ... @@ -474,10 +474,10 @@
474 474 struct ide_taskfile *tf = &task->tf;
475 475 u8 HIHI = task->tf_flags & IDE_TFLAG_LBA48 ? 0xE0 : 0xEF;
476 476  
477   - if (task->tf_flags & IDE_TFLAG_FLAGGED)
  477 + if (task->ftf_flags & IDE_FTFLAG_FLAGGED)
478 478 HIHI = 0xFF;
479 479  
480   - if (task->tf_flags & IDE_TFLAG_OUT_DATA) {
  480 + if (task->ftf_flags & IDE_FTFLAG_OUT_DATA) {
481 481 u16 data = (tf->hob_data << 8) | tf->data;
482 482  
483 483 /* no endian swap */
... ... @@ -519,7 +519,7 @@
519 519 struct ide_io_ports *io_ports = &hwif->io_ports;
520 520 struct ide_taskfile *tf = &task->tf;
521 521  
522   - if (task->tf_flags & IDE_TFLAG_IN_DATA) {
  522 + if (task->ftf_flags & IDE_FTFLAG_IN_DATA) {
523 523 u16 data;
524 524  
525 525 /* no endian swap */
... ... @@ -234,56 +234,52 @@
234 234  
235 235 enum {
236 236 IDE_TFLAG_LBA48 = (1 << 0),
237   - IDE_TFLAG_FLAGGED = (1 << 2),
238   - IDE_TFLAG_OUT_DATA = (1 << 3),
239   - IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4),
240   - IDE_TFLAG_OUT_HOB_NSECT = (1 << 5),
241   - IDE_TFLAG_OUT_HOB_LBAL = (1 << 6),
242   - IDE_TFLAG_OUT_HOB_LBAM = (1 << 7),
243   - IDE_TFLAG_OUT_HOB_LBAH = (1 << 8),
  237 + IDE_TFLAG_OUT_HOB_FEATURE = (1 << 1),
  238 + IDE_TFLAG_OUT_HOB_NSECT = (1 << 2),
  239 + IDE_TFLAG_OUT_HOB_LBAL = (1 << 3),
  240 + IDE_TFLAG_OUT_HOB_LBAM = (1 << 4),
  241 + IDE_TFLAG_OUT_HOB_LBAH = (1 << 5),
244 242 IDE_TFLAG_OUT_HOB = IDE_TFLAG_OUT_HOB_FEATURE |
245 243 IDE_TFLAG_OUT_HOB_NSECT |
246 244 IDE_TFLAG_OUT_HOB_LBAL |
247 245 IDE_TFLAG_OUT_HOB_LBAM |
248 246 IDE_TFLAG_OUT_HOB_LBAH,
249   - IDE_TFLAG_OUT_FEATURE = (1 << 9),
250   - IDE_TFLAG_OUT_NSECT = (1 << 10),
251   - IDE_TFLAG_OUT_LBAL = (1 << 11),
252   - IDE_TFLAG_OUT_LBAM = (1 << 12),
253   - IDE_TFLAG_OUT_LBAH = (1 << 13),
  247 + IDE_TFLAG_OUT_FEATURE = (1 << 6),
  248 + IDE_TFLAG_OUT_NSECT = (1 << 7),
  249 + IDE_TFLAG_OUT_LBAL = (1 << 8),
  250 + IDE_TFLAG_OUT_LBAM = (1 << 9),
  251 + IDE_TFLAG_OUT_LBAH = (1 << 10),
254 252 IDE_TFLAG_OUT_TF = IDE_TFLAG_OUT_FEATURE |
255 253 IDE_TFLAG_OUT_NSECT |
256 254 IDE_TFLAG_OUT_LBAL |
257 255 IDE_TFLAG_OUT_LBAM |
258 256 IDE_TFLAG_OUT_LBAH,
259   - IDE_TFLAG_OUT_DEVICE = (1 << 14),
260   - IDE_TFLAG_WRITE = (1 << 15),
261   - IDE_TFLAG_FLAGGED_SET_IN_FLAGS = (1 << 16),
262   - IDE_TFLAG_IN_DATA = (1 << 17),
263   - IDE_TFLAG_CUSTOM_HANDLER = (1 << 18),
264   - IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 19),
265   - IDE_TFLAG_IN_HOB_FEATURE = (1 << 20),
266   - IDE_TFLAG_IN_HOB_NSECT = (1 << 21),
267   - IDE_TFLAG_IN_HOB_LBAL = (1 << 22),
268   - IDE_TFLAG_IN_HOB_LBAM = (1 << 23),
269   - IDE_TFLAG_IN_HOB_LBAH = (1 << 24),
  257 + IDE_TFLAG_OUT_DEVICE = (1 << 11),
  258 + IDE_TFLAG_WRITE = (1 << 12),
  259 + IDE_TFLAG_CUSTOM_HANDLER = (1 << 13),
  260 + IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 14),
  261 + IDE_TFLAG_IN_HOB_FEATURE = (1 << 15),
  262 + IDE_TFLAG_IN_HOB_NSECT = (1 << 16),
  263 + IDE_TFLAG_IN_HOB_LBAL = (1 << 17),
  264 + IDE_TFLAG_IN_HOB_LBAM = (1 << 18),
  265 + IDE_TFLAG_IN_HOB_LBAH = (1 << 19),
270 266 IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL |
271 267 IDE_TFLAG_IN_HOB_LBAM |
272 268 IDE_TFLAG_IN_HOB_LBAH,
273 269 IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE |
274 270 IDE_TFLAG_IN_HOB_NSECT |
275 271 IDE_TFLAG_IN_HOB_LBA,
276   - IDE_TFLAG_IN_FEATURE = (1 << 1),
277   - IDE_TFLAG_IN_NSECT = (1 << 25),
278   - IDE_TFLAG_IN_LBAL = (1 << 26),
279   - IDE_TFLAG_IN_LBAM = (1 << 27),
280   - IDE_TFLAG_IN_LBAH = (1 << 28),
  272 + IDE_TFLAG_IN_FEATURE = (1 << 20),
  273 + IDE_TFLAG_IN_NSECT = (1 << 21),
  274 + IDE_TFLAG_IN_LBAL = (1 << 22),
  275 + IDE_TFLAG_IN_LBAM = (1 << 23),
  276 + IDE_TFLAG_IN_LBAH = (1 << 24),
281 277 IDE_TFLAG_IN_LBA = IDE_TFLAG_IN_LBAL |
282 278 IDE_TFLAG_IN_LBAM |
283 279 IDE_TFLAG_IN_LBAH,
284 280 IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT |
285 281 IDE_TFLAG_IN_LBA,
286   - IDE_TFLAG_IN_DEVICE = (1 << 29),
  282 + IDE_TFLAG_IN_DEVICE = (1 << 25),
287 283 IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB |
288 284 IDE_TFLAG_IN_HOB,
289 285 IDE_TFLAG_TF = IDE_TFLAG_OUT_TF |
290 286  
291 287  
... ... @@ -291,11 +287,18 @@
291 287 IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE |
292 288 IDE_TFLAG_IN_DEVICE,
293 289 /* force 16-bit I/O operations */
294   - IDE_TFLAG_IO_16BIT = (1 << 30),
  290 + IDE_TFLAG_IO_16BIT = (1 << 26),
295 291 /* ide_task_t was allocated using kmalloc() */
296   - IDE_TFLAG_DYN = (1 << 31),
  292 + IDE_TFLAG_DYN = (1 << 27),
297 293 };
298 294  
  295 +enum {
  296 + IDE_FTFLAG_FLAGGED = (1 << 0),
  297 + IDE_FTFLAG_SET_IN_FLAGS = (1 << 1),
  298 + IDE_FTFLAG_OUT_DATA = (1 << 2),
  299 + IDE_FTFLAG_IN_DATA = (1 << 3),
  300 +};
  301 +
299 302 struct ide_taskfile {
300 303 u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */
301 304  
... ... @@ -330,6 +333,7 @@
330 333 struct ide_taskfile tf;
331 334 u8 tf_array[14];
332 335 };
  336 + u8 ftf_flags; /* for TASKFILE ioctl */
333 337 u32 tf_flags;
334 338 int data_phase;
335 339 struct request *rq; /* copy of request */