Lines Matching refs:raw_cmd

407 static struct floppy_raw_cmd *raw_cmd, default_raw_cmd;  variable
910 raw_cmd = NULL; in unlock_fdc()
1073 if (raw_cmd->length == 0) { in setup_DMA()
1076 raw_cmd->fullcmd, raw_cmd->cmd_count, false); in setup_DMA()
1081 if (((unsigned long)raw_cmd->kernel_data) % 512) { in setup_DMA()
1082 pr_info("non aligned address: %p\n", raw_cmd->kernel_data); in setup_DMA()
1090 if (fd_dma_setup(raw_cmd->kernel_data, raw_cmd->length, in setup_DMA()
1091 (raw_cmd->flags & FD_RAW_READ) ? in setup_DMA()
1102 fd_cacheflush(raw_cmd->kernel_data, raw_cmd->length); in setup_DMA()
1103 fd_set_dma_mode((raw_cmd->flags & FD_RAW_READ) ? in setup_DMA()
1105 fd_set_dma_addr(raw_cmd->kernel_data); in setup_DMA()
1106 fd_set_dma_count(raw_cmd->length); in setup_DMA()
1213 if (raw_cmd->rate & 0x40) { in perpendicular_mode()
1214 switch (raw_cmd->rate & 3) { in perpendicular_mode()
1300 switch (raw_cmd->rate & 0x03) { in fdc_specify()
1370 if ((raw_cmd->rate & 3) == fdc_state[current_fdc].dtr) in fdc_dtr()
1374 fdc_outb(raw_cmd->rate & 3, current_fdc, FD_DCR); in fdc_dtr()
1381 fdc_state[current_fdc].dtr = raw_cmd->rate & 3; in fdc_dtr()
1493 flags = raw_cmd->flags; in setup_rw_floppy()
1520 for (i = 0; i < raw_cmd->cmd_count; i++) in setup_rw_floppy()
1521 r |= output_byte(current_fdc, raw_cmd->fullcmd[i]); in setup_rw_floppy()
1606 disk_change(current_drive) && (raw_cmd->flags & FD_RAW_NEED_DISK)) { in seek_floppy()
1621 (raw_cmd->flags & FD_RAW_NEED_DISK) && in seek_floppy()
1622 …(drive_state[current_drive].track <= NO_TRACK || drive_state[current_drive].track == raw_cmd->trac… in seek_floppy()
1625 if (raw_cmd->track) in seek_floppy()
1626 track = raw_cmd->track - 1; in seek_floppy()
1631 raw_cmd->flags |= FD_RAW_NEED_SEEK; in seek_floppy()
1637 if (raw_cmd->track != drive_state[current_drive].track && in seek_floppy()
1638 (raw_cmd->flags & FD_RAW_NEED_SEEK)) in seek_floppy()
1639 track = raw_cmd->track; in seek_floppy()
1908 if (!(raw_cmd->flags & FD_RAW_NO_MOTOR)) { in start_motor()
1942 if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && in floppy_ready()
1948 if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) { in floppy_ready()
1950 fd_chose_dma_mode(raw_cmd->kernel_data, raw_cmd->length); in floppy_ready()
1955 if (raw_cmd->flags & (FD_RAW_NEED_SEEK | FD_RAW_NEED_DISK)) { in floppy_ready()
1960 if ((raw_cmd->flags & FD_RAW_READ) || in floppy_ready()
1961 (raw_cmd->flags & FD_RAW_WRITE)) in floppy_ready()
2152 raw_cmd = &default_raw_cmd; in setup_format_params()
2153 raw_cmd->track = track; in setup_format_params()
2155 raw_cmd->flags = (FD_RAW_WRITE | FD_RAW_INTR | FD_RAW_SPIN | in setup_format_params()
2157 raw_cmd->rate = _floppy->rate & 0x43; in setup_format_params()
2158 raw_cmd->cmd_count = NR_F; in setup_format_params()
2159 raw_cmd->cmd[COMMAND] = FM_MODE(_floppy, FD_FORMAT); in setup_format_params()
2160 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, format_req.head); in setup_format_params()
2161 raw_cmd->cmd[F_SIZECODE] = FD_SIZECODE(_floppy); in setup_format_params()
2162 raw_cmd->cmd[F_SECT_PER_TRACK] = _floppy->sect << 2 >> raw_cmd->cmd[F_SIZECODE]; in setup_format_params()
2163 raw_cmd->cmd[F_GAP] = _floppy->fmt_gap; in setup_format_params()
2164 raw_cmd->cmd[F_FILL] = FD_FILL_BYTE; in setup_format_params()
2166 raw_cmd->kernel_data = floppy_track_buffer; in setup_format_params()
2167 raw_cmd->length = 4 * raw_cmd->cmd[F_SECT_PER_TRACK]; in setup_format_params()
2169 if (!raw_cmd->cmd[F_SECT_PER_TRACK]) in setup_format_params()
2173 head_shift = (raw_cmd->cmd[F_SECT_PER_TRACK] + 5) / 6; in setup_format_params()
2180 % raw_cmd->cmd[F_SECT_PER_TRACK]; in setup_format_params()
2188 for (count = 0; count < raw_cmd->cmd[F_SECT_PER_TRACK]; ++count) { in setup_format_params()
2192 here[count].size = raw_cmd->cmd[F_SIZECODE]; in setup_format_params()
2195 for (count = 1; count <= raw_cmd->cmd[F_SECT_PER_TRACK]; ++count) { in setup_format_params()
2197 n = (n + il) % raw_cmd->cmd[F_SECT_PER_TRACK]; in setup_format_params()
2200 if (n >= raw_cmd->cmd[F_SECT_PER_TRACK]) { in setup_format_params()
2201 n -= raw_cmd->cmd[F_SECT_PER_TRACK]; in setup_format_params()
2208 for (count = 0; count < raw_cmd->cmd[F_SECT_PER_TRACK]; count++) in setup_format_params()
2336 ssize = DIV_ROUND_UP(1 << raw_cmd->cmd[SIZECODE], 4); in rw_interrupt()
2343 if (raw_cmd->cmd[COMMAND] & 0x80) in rw_interrupt()
2348 nr_sectors = (((reply_buffer[R_TRACK] - raw_cmd->cmd[TRACK]) * heads + in rw_interrupt()
2349 reply_buffer[R_HEAD] - raw_cmd->cmd[HEAD]) * raw_cmd->cmd[SECT_PER_TRACK] + in rw_interrupt()
2350 reply_buffer[R_SECTOR] - raw_cmd->cmd[SECTOR] + eoc) << raw_cmd->cmd[SIZECODE] >> 2; in rw_interrupt()
2357 raw_cmd->cmd[SECTOR]); in rw_interrupt()
2359 raw_cmd->cmd[HEAD]); in rw_interrupt()
2361 raw_cmd->cmd[TRACK]); in rw_interrupt()
2364 raw_cmd->cmd[SECT_PER_TRACK], fsector_t, ssize); in rw_interrupt()
2402 if (CT(raw_cmd->cmd[COMMAND]) != FD_READ) { in rw_interrupt()
2406 buffer_track = raw_cmd->track; in rw_interrupt()
2442 if (current_count_sectors <= 0 && CT(raw_cmd->cmd[COMMAND]) == FD_WRITE && in copy_buffer()
2448 if (remaining > blk_rq_bytes(current_req) && CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in copy_buffer()
2481 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) in copy_buffer()
2483 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) in copy_buffer()
2488 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) in copy_buffer()
2515 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in virtualdmabug_workaround()
2516 raw_cmd->cmd[COMMAND] &= ~0x80; /* switch off multiple track mode */ in virtualdmabug_workaround()
2518 hard_sectors = raw_cmd->length >> (7 + raw_cmd->cmd[SIZECODE]); in virtualdmabug_workaround()
2519 end_sector = raw_cmd->cmd[SECTOR] + hard_sectors - 1; in virtualdmabug_workaround()
2520 if (end_sector > raw_cmd->cmd[SECT_PER_TRACK]) { in virtualdmabug_workaround()
2522 end_sector, raw_cmd->cmd[SECT_PER_TRACK]); in virtualdmabug_workaround()
2525 raw_cmd->cmd[SECT_PER_TRACK] = end_sector; in virtualdmabug_workaround()
2554 raw_cmd = &default_raw_cmd; in make_raw_rw_request()
2555 raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_SEEK; in make_raw_rw_request()
2556 raw_cmd->cmd_count = NR_RW; in make_raw_rw_request()
2558 raw_cmd->flags |= FD_RAW_READ; in make_raw_rw_request()
2559 raw_cmd->cmd[COMMAND] = FM_MODE(_floppy, FD_READ); in make_raw_rw_request()
2561 raw_cmd->flags |= FD_RAW_WRITE; in make_raw_rw_request()
2562 raw_cmd->cmd[COMMAND] = FM_MODE(_floppy, FD_WRITE); in make_raw_rw_request()
2570 raw_cmd->cmd[TRACK] = (int)blk_rq_pos(current_req) / max_sector; in make_raw_rw_request()
2572 if (_floppy->track && raw_cmd->cmd[TRACK] >= _floppy->track) { in make_raw_rw_request()
2579 raw_cmd->cmd[HEAD] = fsector_t / _floppy->sect; in make_raw_rw_request()
2587 if ((_floppy->rate & FD_2M) && (!raw_cmd->cmd[TRACK]) && (!raw_cmd->cmd[HEAD])) { in make_raw_rw_request()
2595 raw_cmd->cmd[SIZECODE] = 2; in make_raw_rw_request()
2597 raw_cmd->cmd[SIZECODE] = FD_SIZECODE(_floppy); in make_raw_rw_request()
2598 raw_cmd->rate = _floppy->rate & 0x43; in make_raw_rw_request()
2600 (raw_cmd->cmd[TRACK] || raw_cmd->cmd[HEAD]) && raw_cmd->rate == 2) in make_raw_rw_request()
2601 raw_cmd->rate = 1; in make_raw_rw_request()
2603 if (raw_cmd->cmd[SIZECODE]) in make_raw_rw_request()
2604 raw_cmd->cmd[SIZECODE2] = 0xff; in make_raw_rw_request()
2606 raw_cmd->cmd[SIZECODE2] = 0x80; in make_raw_rw_request()
2607 raw_cmd->track = raw_cmd->cmd[TRACK] << STRETCH(_floppy); in make_raw_rw_request()
2608 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, raw_cmd->cmd[HEAD]); in make_raw_rw_request()
2609 raw_cmd->cmd[GAP] = _floppy->gap; in make_raw_rw_request()
2610 ssize = DIV_ROUND_UP(1 << raw_cmd->cmd[SIZECODE], 4); in make_raw_rw_request()
2611 raw_cmd->cmd[SECT_PER_TRACK] = _floppy->sect << 2 >> raw_cmd->cmd[SIZECODE]; in make_raw_rw_request()
2612 raw_cmd->cmd[SECTOR] = ((fsector_t % _floppy->sect) << 2 >> raw_cmd->cmd[SIZECODE]) + in make_raw_rw_request()
2620 raw_cmd->cmd[SECT_PER_TRACK]++; in make_raw_rw_request()
2622 raw_cmd->cmd[SECTOR]--; in make_raw_rw_request()
2627 raw_cmd->cmd[SIZECODE]--; in make_raw_rw_request()
2630 raw_cmd->cmd[SECTOR]++; in make_raw_rw_request()
2631 raw_cmd->cmd[SECT_PER_TRACK]++; in make_raw_rw_request()
2634 max_sector = raw_cmd->cmd[HEAD] * _floppy->sect + tracksize; in make_raw_rw_request()
2635 } else if (!raw_cmd->cmd[TRACK] && !raw_cmd->cmd[HEAD] && !(_floppy->rate & FD_2M) && probing) { in make_raw_rw_request()
2637 } else if (!raw_cmd->cmd[HEAD] && CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in make_raw_rw_request()
2645 if ((raw_cmd->track == buffer_track) && in make_raw_rw_request()
2649 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) { in make_raw_rw_request()
2654 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in make_raw_rw_request()
2663 raw_cmd->flags &= ~FD_RAW_WRITE; in make_raw_rw_request()
2664 raw_cmd->flags |= FD_RAW_READ; in make_raw_rw_request()
2665 raw_cmd->cmd[COMMAND] = FM_MODE(_floppy, FD_READ); in make_raw_rw_request()
2668 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) in make_raw_rw_request()
2672 if (buffer_track != raw_cmd->track || /* bad track */ in make_raw_rw_request()
2676 ((CT(raw_cmd->cmd[COMMAND]) == FD_READ || in make_raw_rw_request()
2685 raw_cmd->kernel_data = floppy_track_buffer + in make_raw_rw_request()
2688 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in make_raw_rw_request()
2695 buffer_track = raw_cmd->track; in make_raw_rw_request()
2705 raw_cmd->length = in_sector_offset + current_count_sectors; in make_raw_rw_request()
2706 raw_cmd->length = ((raw_cmd->length - 1) | (ssize - 1)) + 1; in make_raw_rw_request()
2707 raw_cmd->length <<= 9; in make_raw_rw_request()
2708 if ((raw_cmd->length < current_count_sectors << 9) || in make_raw_rw_request()
2709 (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE && in make_raw_rw_request()
2710 (aligned_sector_t + (raw_cmd->length >> 9) > buffer_max || in make_raw_rw_request()
2712 raw_cmd->length % (128 << raw_cmd->cmd[SIZECODE]) || in make_raw_rw_request()
2713 raw_cmd->length <= 0 || current_count_sectors <= 0) { in make_raw_rw_request()
2715 raw_cmd->length, current_count_sectors); in make_raw_rw_request()
2717 (int)((raw_cmd->kernel_data - in make_raw_rw_request()
2722 pr_info("ssize=%x SIZECODE=%d\n", ssize, raw_cmd->cmd[SIZECODE]); in make_raw_rw_request()
2724 raw_cmd->cmd[COMMAND], raw_cmd->cmd[SECTOR], in make_raw_rw_request()
2725 raw_cmd->cmd[HEAD], raw_cmd->cmd[TRACK]); in make_raw_rw_request()
2733 if (raw_cmd->kernel_data < floppy_track_buffer || in make_raw_rw_request()
2735 raw_cmd->length < 0 || in make_raw_rw_request()
2736 raw_cmd->kernel_data + raw_cmd->length > in make_raw_rw_request()
2740 fsector_t, buffer_min, raw_cmd->length >> 9); in make_raw_rw_request()
2743 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) in make_raw_rw_request()
2745 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) in make_raw_rw_request()
2749 if (raw_cmd->length == 0) { in make_raw_rw_request()
2799 raw_cmd = &default_raw_cmd; in redo_fd_request()
2800 raw_cmd->flags = 0; in redo_fd_request()
2896 raw_cmd = &default_raw_cmd; in poll_drive()
2897 raw_cmd->flags = flag; in poll_drive()
2898 raw_cmd->track = 0; in poll_drive()
2899 raw_cmd->cmd_count = 0; in poll_drive()
2991 raw_cmd->flags |= FD_RAW_FAILURE; in raw_cmd_done()
2992 raw_cmd->flags |= FD_RAW_HARDFAILURE; in raw_cmd_done()
2994 raw_cmd->reply_count = inr; in raw_cmd_done()
2995 if (raw_cmd->reply_count > FD_RAW_REPLY_SIZE) in raw_cmd_done()
2996 raw_cmd->reply_count = 0; in raw_cmd_done()
2997 memcpy(raw_cmd->reply, reply_buffer, raw_cmd->reply_count); in raw_cmd_done()
2999 if (raw_cmd->flags & (FD_RAW_READ | FD_RAW_WRITE)) { in raw_cmd_done()
3002 raw_cmd->length = fd_get_dma_residue(); in raw_cmd_done()
3006 if ((raw_cmd->flags & FD_RAW_SOFTFAILURE) && in raw_cmd_done()
3007 (!raw_cmd->reply_count || (raw_cmd->reply[0] & 0xc0))) in raw_cmd_done()
3008 raw_cmd->flags |= FD_RAW_FAILURE; in raw_cmd_done()
3011 raw_cmd->flags |= FD_RAW_DISK_CHANGE; in raw_cmd_done()
3013 raw_cmd->flags &= ~FD_RAW_DISK_CHANGE; in raw_cmd_done()
3014 if (raw_cmd->flags & FD_RAW_NO_MOTOR_AFTER) in raw_cmd_done()
3017 if (raw_cmd->next && in raw_cmd_done()
3018 (!(raw_cmd->flags & FD_RAW_FAILURE) || in raw_cmd_done()
3019 !(raw_cmd->flags & FD_RAW_STOP_IF_FAILURE)) && in raw_cmd_done()
3020 ((raw_cmd->flags & FD_RAW_FAILURE) || in raw_cmd_done()
3021 !(raw_cmd->flags & FD_RAW_STOP_IF_SUCCESS))) { in raw_cmd_done()
3022 raw_cmd = raw_cmd->next; in raw_cmd_done()
3168 raw_cmd = my_raw_cmd; in raw_cmd_ioctl()
4586 raw_cmd = NULL; in do_floppy_init()