Lines Matching refs:raw_cmd

407 static struct floppy_raw_cmd *raw_cmd, default_raw_cmd;  variable
911 raw_cmd = NULL; in unlock_fdc()
1070 if (raw_cmd->length == 0) { in setup_DMA()
1073 raw_cmd->fullcmd, raw_cmd->cmd_count, false); in setup_DMA()
1078 if (((unsigned long)raw_cmd->kernel_data) % 512) { in setup_DMA()
1079 pr_info("non aligned address: %p\n", raw_cmd->kernel_data); in setup_DMA()
1087 if (fd_dma_setup(raw_cmd->kernel_data, raw_cmd->length, in setup_DMA()
1088 (raw_cmd->flags & FD_RAW_READ) ? in setup_DMA()
1099 fd_cacheflush(raw_cmd->kernel_data, raw_cmd->length); in setup_DMA()
1100 fd_set_dma_mode((raw_cmd->flags & FD_RAW_READ) ? in setup_DMA()
1102 fd_set_dma_addr(raw_cmd->kernel_data); in setup_DMA()
1103 fd_set_dma_count(raw_cmd->length); in setup_DMA()
1210 if (raw_cmd->rate & 0x40) { in perpendicular_mode()
1211 switch (raw_cmd->rate & 3) { in perpendicular_mode()
1297 switch (raw_cmd->rate & 0x03) { in fdc_specify()
1367 if ((raw_cmd->rate & 3) == fdc_state[current_fdc].dtr) in fdc_dtr()
1371 fdc_outb(raw_cmd->rate & 3, current_fdc, FD_DCR); in fdc_dtr()
1378 fdc_state[current_fdc].dtr = raw_cmd->rate & 3; in fdc_dtr()
1490 flags = raw_cmd->flags; in setup_rw_floppy()
1517 for (i = 0; i < raw_cmd->cmd_count; i++) in setup_rw_floppy()
1518 r |= output_byte(current_fdc, raw_cmd->fullcmd[i]); in setup_rw_floppy()
1603 disk_change(current_drive) && (raw_cmd->flags & FD_RAW_NEED_DISK)) { in seek_floppy()
1618 (raw_cmd->flags & FD_RAW_NEED_DISK) && in seek_floppy()
1619 …(drive_state[current_drive].track <= NO_TRACK || drive_state[current_drive].track == raw_cmd->trac… in seek_floppy()
1622 if (raw_cmd->track) in seek_floppy()
1623 track = raw_cmd->track - 1; in seek_floppy()
1628 raw_cmd->flags |= FD_RAW_NEED_SEEK; in seek_floppy()
1634 if (raw_cmd->track != drive_state[current_drive].track && in seek_floppy()
1635 (raw_cmd->flags & FD_RAW_NEED_SEEK)) in seek_floppy()
1636 track = raw_cmd->track; in seek_floppy()
1905 if (!(raw_cmd->flags & FD_RAW_NO_MOTOR)) { in start_motor()
1939 if (!(raw_cmd->flags & FD_RAW_NO_MOTOR) && in floppy_ready()
1945 if ((raw_cmd->flags & FD_RAW_READ) || (raw_cmd->flags & FD_RAW_WRITE)) { in floppy_ready()
1947 fd_chose_dma_mode(raw_cmd->kernel_data, raw_cmd->length); in floppy_ready()
1952 if (raw_cmd->flags & (FD_RAW_NEED_SEEK | FD_RAW_NEED_DISK)) { in floppy_ready()
1957 if ((raw_cmd->flags & FD_RAW_READ) || in floppy_ready()
1958 (raw_cmd->flags & FD_RAW_WRITE)) in floppy_ready()
2149 raw_cmd = &default_raw_cmd; in setup_format_params()
2150 raw_cmd->track = track; in setup_format_params()
2152 raw_cmd->flags = (FD_RAW_WRITE | FD_RAW_INTR | FD_RAW_SPIN | in setup_format_params()
2154 raw_cmd->rate = _floppy->rate & 0x43; in setup_format_params()
2155 raw_cmd->cmd_count = NR_F; in setup_format_params()
2156 raw_cmd->cmd[COMMAND] = FM_MODE(_floppy, FD_FORMAT); in setup_format_params()
2157 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, format_req.head); in setup_format_params()
2158 raw_cmd->cmd[F_SIZECODE] = FD_SIZECODE(_floppy); in setup_format_params()
2159 raw_cmd->cmd[F_SECT_PER_TRACK] = _floppy->sect << 2 >> raw_cmd->cmd[F_SIZECODE]; in setup_format_params()
2160 raw_cmd->cmd[F_GAP] = _floppy->fmt_gap; in setup_format_params()
2161 raw_cmd->cmd[F_FILL] = FD_FILL_BYTE; in setup_format_params()
2163 raw_cmd->kernel_data = floppy_track_buffer; in setup_format_params()
2164 raw_cmd->length = 4 * raw_cmd->cmd[F_SECT_PER_TRACK]; in setup_format_params()
2166 if (!raw_cmd->cmd[F_SECT_PER_TRACK]) in setup_format_params()
2170 head_shift = (raw_cmd->cmd[F_SECT_PER_TRACK] + 5) / 6; in setup_format_params()
2177 % raw_cmd->cmd[F_SECT_PER_TRACK]; in setup_format_params()
2185 for (count = 0; count < raw_cmd->cmd[F_SECT_PER_TRACK]; ++count) { in setup_format_params()
2189 here[count].size = raw_cmd->cmd[F_SIZECODE]; in setup_format_params()
2192 for (count = 1; count <= raw_cmd->cmd[F_SECT_PER_TRACK]; ++count) { in setup_format_params()
2194 n = (n + il) % raw_cmd->cmd[F_SECT_PER_TRACK]; in setup_format_params()
2197 if (n >= raw_cmd->cmd[F_SECT_PER_TRACK]) { in setup_format_params()
2198 n -= raw_cmd->cmd[F_SECT_PER_TRACK]; in setup_format_params()
2205 for (count = 0; count < raw_cmd->cmd[F_SECT_PER_TRACK]; count++) in setup_format_params()
2333 ssize = DIV_ROUND_UP(1 << raw_cmd->cmd[SIZECODE], 4); in rw_interrupt()
2340 if (raw_cmd->cmd[COMMAND] & 0x80) in rw_interrupt()
2345 nr_sectors = (((reply_buffer[R_TRACK] - raw_cmd->cmd[TRACK]) * heads + in rw_interrupt()
2346 reply_buffer[R_HEAD] - raw_cmd->cmd[HEAD]) * raw_cmd->cmd[SECT_PER_TRACK] + in rw_interrupt()
2347 reply_buffer[R_SECTOR] - raw_cmd->cmd[SECTOR] + eoc) << raw_cmd->cmd[SIZECODE] >> 2; in rw_interrupt()
2354 raw_cmd->cmd[SECTOR]); in rw_interrupt()
2356 raw_cmd->cmd[HEAD]); in rw_interrupt()
2358 raw_cmd->cmd[TRACK]); in rw_interrupt()
2361 raw_cmd->cmd[SECT_PER_TRACK], fsector_t, ssize); in rw_interrupt()
2399 if (CT(raw_cmd->cmd[COMMAND]) != FD_READ) { in rw_interrupt()
2403 buffer_track = raw_cmd->track; in rw_interrupt()
2439 if (current_count_sectors <= 0 && CT(raw_cmd->cmd[COMMAND]) == FD_WRITE && in copy_buffer()
2445 if (remaining > blk_rq_bytes(current_req) && CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in copy_buffer()
2478 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) in copy_buffer()
2480 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) in copy_buffer()
2485 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) in copy_buffer()
2512 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in virtualdmabug_workaround()
2513 raw_cmd->cmd[COMMAND] &= ~0x80; /* switch off multiple track mode */ in virtualdmabug_workaround()
2515 hard_sectors = raw_cmd->length >> (7 + raw_cmd->cmd[SIZECODE]); in virtualdmabug_workaround()
2516 end_sector = raw_cmd->cmd[SECTOR] + hard_sectors - 1; in virtualdmabug_workaround()
2517 if (end_sector > raw_cmd->cmd[SECT_PER_TRACK]) { in virtualdmabug_workaround()
2519 end_sector, raw_cmd->cmd[SECT_PER_TRACK]); in virtualdmabug_workaround()
2522 raw_cmd->cmd[SECT_PER_TRACK] = end_sector; in virtualdmabug_workaround()
2551 raw_cmd = &default_raw_cmd; in make_raw_rw_request()
2552 raw_cmd->flags = FD_RAW_SPIN | FD_RAW_NEED_DISK | FD_RAW_NEED_SEEK; in make_raw_rw_request()
2553 raw_cmd->cmd_count = NR_RW; in make_raw_rw_request()
2555 raw_cmd->flags |= FD_RAW_READ; in make_raw_rw_request()
2556 raw_cmd->cmd[COMMAND] = FM_MODE(_floppy, FD_READ); in make_raw_rw_request()
2558 raw_cmd->flags |= FD_RAW_WRITE; in make_raw_rw_request()
2559 raw_cmd->cmd[COMMAND] = FM_MODE(_floppy, FD_WRITE); in make_raw_rw_request()
2567 raw_cmd->cmd[TRACK] = (int)blk_rq_pos(current_req) / max_sector; in make_raw_rw_request()
2569 if (_floppy->track && raw_cmd->cmd[TRACK] >= _floppy->track) { in make_raw_rw_request()
2576 raw_cmd->cmd[HEAD] = fsector_t / _floppy->sect; in make_raw_rw_request()
2584 if ((_floppy->rate & FD_2M) && (!raw_cmd->cmd[TRACK]) && (!raw_cmd->cmd[HEAD])) { in make_raw_rw_request()
2592 raw_cmd->cmd[SIZECODE] = 2; in make_raw_rw_request()
2594 raw_cmd->cmd[SIZECODE] = FD_SIZECODE(_floppy); in make_raw_rw_request()
2595 raw_cmd->rate = _floppy->rate & 0x43; in make_raw_rw_request()
2597 (raw_cmd->cmd[TRACK] || raw_cmd->cmd[HEAD]) && raw_cmd->rate == 2) in make_raw_rw_request()
2598 raw_cmd->rate = 1; in make_raw_rw_request()
2600 if (raw_cmd->cmd[SIZECODE]) in make_raw_rw_request()
2601 raw_cmd->cmd[SIZECODE2] = 0xff; in make_raw_rw_request()
2603 raw_cmd->cmd[SIZECODE2] = 0x80; in make_raw_rw_request()
2604 raw_cmd->track = raw_cmd->cmd[TRACK] << STRETCH(_floppy); in make_raw_rw_request()
2605 raw_cmd->cmd[DR_SELECT] = UNIT(current_drive) + PH_HEAD(_floppy, raw_cmd->cmd[HEAD]); in make_raw_rw_request()
2606 raw_cmd->cmd[GAP] = _floppy->gap; in make_raw_rw_request()
2607 ssize = DIV_ROUND_UP(1 << raw_cmd->cmd[SIZECODE], 4); in make_raw_rw_request()
2608 raw_cmd->cmd[SECT_PER_TRACK] = _floppy->sect << 2 >> raw_cmd->cmd[SIZECODE]; in make_raw_rw_request()
2609 raw_cmd->cmd[SECTOR] = ((fsector_t % _floppy->sect) << 2 >> raw_cmd->cmd[SIZECODE]) + in make_raw_rw_request()
2617 raw_cmd->cmd[SECT_PER_TRACK]++; in make_raw_rw_request()
2619 raw_cmd->cmd[SECTOR]--; in make_raw_rw_request()
2624 raw_cmd->cmd[SIZECODE]--; in make_raw_rw_request()
2627 raw_cmd->cmd[SECTOR]++; in make_raw_rw_request()
2628 raw_cmd->cmd[SECT_PER_TRACK]++; in make_raw_rw_request()
2631 max_sector = raw_cmd->cmd[HEAD] * _floppy->sect + tracksize; in make_raw_rw_request()
2632 } else if (!raw_cmd->cmd[TRACK] && !raw_cmd->cmd[HEAD] && !(_floppy->rate & FD_2M) && probing) { in make_raw_rw_request()
2634 } else if (!raw_cmd->cmd[HEAD] && CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in make_raw_rw_request()
2642 if ((raw_cmd->track == buffer_track) && in make_raw_rw_request()
2646 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) { in make_raw_rw_request()
2651 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in make_raw_rw_request()
2660 raw_cmd->flags &= ~FD_RAW_WRITE; in make_raw_rw_request()
2661 raw_cmd->flags |= FD_RAW_READ; in make_raw_rw_request()
2662 raw_cmd->cmd[COMMAND] = FM_MODE(_floppy, FD_READ); in make_raw_rw_request()
2665 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) in make_raw_rw_request()
2669 if (buffer_track != raw_cmd->track || /* bad track */ in make_raw_rw_request()
2673 ((CT(raw_cmd->cmd[COMMAND]) == FD_READ || in make_raw_rw_request()
2682 raw_cmd->kernel_data = floppy_track_buffer + in make_raw_rw_request()
2685 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) { in make_raw_rw_request()
2692 buffer_track = raw_cmd->track; in make_raw_rw_request()
2702 raw_cmd->length = in_sector_offset + current_count_sectors; in make_raw_rw_request()
2703 raw_cmd->length = ((raw_cmd->length - 1) | (ssize - 1)) + 1; in make_raw_rw_request()
2704 raw_cmd->length <<= 9; in make_raw_rw_request()
2705 if ((raw_cmd->length < current_count_sectors << 9) || in make_raw_rw_request()
2706 (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE && in make_raw_rw_request()
2707 (aligned_sector_t + (raw_cmd->length >> 9) > buffer_max || in make_raw_rw_request()
2709 raw_cmd->length % (128 << raw_cmd->cmd[SIZECODE]) || in make_raw_rw_request()
2710 raw_cmd->length <= 0 || current_count_sectors <= 0) { in make_raw_rw_request()
2712 raw_cmd->length, current_count_sectors); in make_raw_rw_request()
2714 (int)((raw_cmd->kernel_data - in make_raw_rw_request()
2719 pr_info("ssize=%x SIZECODE=%d\n", ssize, raw_cmd->cmd[SIZECODE]); in make_raw_rw_request()
2721 raw_cmd->cmd[COMMAND], raw_cmd->cmd[SECTOR], in make_raw_rw_request()
2722 raw_cmd->cmd[HEAD], raw_cmd->cmd[TRACK]); in make_raw_rw_request()
2730 if (raw_cmd->kernel_data < floppy_track_buffer || in make_raw_rw_request()
2732 raw_cmd->length < 0 || in make_raw_rw_request()
2733 raw_cmd->kernel_data + raw_cmd->length > in make_raw_rw_request()
2737 fsector_t, buffer_min, raw_cmd->length >> 9); in make_raw_rw_request()
2740 if (CT(raw_cmd->cmd[COMMAND]) == FD_READ) in make_raw_rw_request()
2742 if (CT(raw_cmd->cmd[COMMAND]) == FD_WRITE) in make_raw_rw_request()
2746 if (raw_cmd->length == 0) { in make_raw_rw_request()
2797 raw_cmd = &default_raw_cmd; in redo_fd_request()
2798 raw_cmd->flags = 0; in redo_fd_request()
2894 raw_cmd = &default_raw_cmd; in poll_drive()
2895 raw_cmd->flags = flag; in poll_drive()
2896 raw_cmd->track = 0; in poll_drive()
2897 raw_cmd->cmd_count = 0; in poll_drive()
2989 raw_cmd->flags |= FD_RAW_FAILURE; in raw_cmd_done()
2990 raw_cmd->flags |= FD_RAW_HARDFAILURE; in raw_cmd_done()
2992 raw_cmd->reply_count = inr; in raw_cmd_done()
2993 if (raw_cmd->reply_count > FD_RAW_REPLY_SIZE) in raw_cmd_done()
2994 raw_cmd->reply_count = 0; in raw_cmd_done()
2995 memcpy(raw_cmd->reply, reply_buffer, raw_cmd->reply_count); in raw_cmd_done()
2997 if (raw_cmd->flags & (FD_RAW_READ | FD_RAW_WRITE)) { in raw_cmd_done()
3000 raw_cmd->length = fd_get_dma_residue(); in raw_cmd_done()
3004 if ((raw_cmd->flags & FD_RAW_SOFTFAILURE) && in raw_cmd_done()
3005 (!raw_cmd->reply_count || (raw_cmd->reply[0] & 0xc0))) in raw_cmd_done()
3006 raw_cmd->flags |= FD_RAW_FAILURE; in raw_cmd_done()
3009 raw_cmd->flags |= FD_RAW_DISK_CHANGE; in raw_cmd_done()
3011 raw_cmd->flags &= ~FD_RAW_DISK_CHANGE; in raw_cmd_done()
3012 if (raw_cmd->flags & FD_RAW_NO_MOTOR_AFTER) in raw_cmd_done()
3015 if (raw_cmd->next && in raw_cmd_done()
3016 (!(raw_cmd->flags & FD_RAW_FAILURE) || in raw_cmd_done()
3017 !(raw_cmd->flags & FD_RAW_STOP_IF_FAILURE)) && in raw_cmd_done()
3018 ((raw_cmd->flags & FD_RAW_FAILURE) || in raw_cmd_done()
3019 !(raw_cmd->flags & FD_RAW_STOP_IF_SUCCESS))) { in raw_cmd_done()
3020 raw_cmd = raw_cmd->next; in raw_cmd_done()
3166 raw_cmd = my_raw_cmd; in raw_cmd_ioctl()
4579 raw_cmd = NULL; in do_floppy_init()