floppy.c File Reference

#include "floppy.h"
#include <timers.h>
#include <ibm/diskparm.h>
#include <minix/sysutil.h>
#include <minix/syslib.h>

Include dependency graph for floppy.c:

Go to the source code of this file.

Data Structures

struct  density
struct  test_order
struct  floppy

Defines

#define DOR   0x3F2
#define FDC_STATUS   0x3F4
#define FDC_DATA   0x3F5
#define FDC_RATE   0x3F7
#define DMA_ADDR   0x004
#define DMA_TOP   0x081
#define DMA_COUNT   0x005
#define DMA_FLIPFLOP   0x00C
#define DMA_MODE   0x00B
#define DMA_INIT   0x00A
#define DMA_RESET_VAL   0x006
#define DMA_ADDR_MASK   0xFFFFFF
#define ST0   0x00
#define ST1   0x01
#define ST2   0x02
#define ST3   0x00
#define ST_CYL   0x03
#define ST_HEAD   0x04
#define ST_SEC   0x05
#define ST_PCN   0x01
#define CTL_BUSY   0x10
#define DIRECTION   0x40
#define MASTER   0x80
#define MOTOR_SHIFT   4
#define ENABLE_INT   0x0C
#define ST0_BITS_TRANS   0xD8
#define TRANS_ST0   0x00
#define ST0_BITS_SEEK   0xF8
#define SEEK_ST0   0x20
#define BAD_SECTOR   0x05
#define WRITE_PROTECT   0x02
#define BAD_CYL   0x1F
#define ST3_FAULT   0x80
#define ST3_WR_PROTECT   0x40
#define ST3_READY   0x20
#define FDC_SEEK   0x0F
#define FDC_READ   0xE6
#define FDC_WRITE   0xC5
#define FDC_SENSE   0x08
#define FDC_RECALIBRATE   0x07
#define FDC_SPECIFY   0x03
#define FDC_READ_ID   0x4A
#define FDC_FORMAT   0x4D
#define DMA_READ   0x46
#define DMA_WRITE   0x4A
#define HC_SIZE   2880
#define NR_HEADS   0x02
#define MAX_SECTORS   18
#define DTL   0xFF
#define SPEC2   0x02
#define MOTOR_OFF   (3*HZ)
#define WAKEUP   (2*HZ)
#define ERR_SEEK   (-1)
#define ERR_TRANSFER   (-2)
#define ERR_STATUS   (-3)
#define ERR_READ_ID   (-4)
#define ERR_RECALIBRATE   (-5)
#define ERR_DRIVE   (-6)
#define ERR_WR_PROTECT   (-7)
#define ERR_TIMEOUT   (-8)
#define err_no_retry(err)   ((err) <= ERR_WR_PROTECT)
#define DEV_TYPE_BITS   0x7C
#define DEV_TYPE_SHIFT   2
#define FORMAT_DEV_BIT   0x80
#define MAX_ERRORS   6
#define MAX_RESULTS   7
#define NR_DRIVES   2
#define DIVISOR   128
#define SECTOR_SIZE_CODE   2
#define TIMEOUT_MICROS   500000L
#define TIMEOUT_TICKS   30
#define NT   7
#define UNCALIBRATED   0
#define CALIBRATED   1
#define BASE_SECTOR   1
#define NO_SECTOR   (-1)
#define NO_CYL   (-1)
#define NO_DENS   100
#define BSY_IDLE   0
#define BSY_IO   1
#define BSY_WAKEN   2
#define b(d)   (1 << (d))

Functions

FORWARD _PROTOTYPE (void f_expire_tmrs,(struct driver *dp, message *m_ptr))
FORWARD _PROTOTYPE (void f_set_timer,(timer_t *tp, clock_t delta, tmr_func_t watchdog))
FORWARD _PROTOTYPE (void stop_motor,(timer_t *tp))
FORWARD _PROTOTYPE (struct device *f_prepare,(int device))
FORWARD _PROTOTYPE (char *f_name,(void))
FORWARD _PROTOTYPE (void f_cleanup,(void))
FORWARD _PROTOTYPE (int f_transfer,(int proc_nr, int opcode, off_t position, iovec_t *iov, unsigned nr_req))
FORWARD _PROTOTYPE (int dma_setup,(int opcode))
FORWARD _PROTOTYPE (int seek,(void))
FORWARD _PROTOTYPE (int fdc_command,(u8_t *cmd, int len))
FORWARD _PROTOTYPE (void fdc_out,(int val))
FORWARD _PROTOTYPE (int f_do_open,(struct driver *dp, message *m_ptr))
FORWARD _PROTOTYPE (int test_read,(int density))
FORWARD _PROTOTYPE (void f_geometry,(struct partition *entry))
PUBLIC void main ()
PRIVATE void f_expire_tmrs (struct driver *dp, message *m_ptr)
PRIVATE void f_set_timer (timer_t *tp, clock_t delta, tmr_func_t watchdog)
PRIVATE struct devicef_prepare (int device)
PRIVATE char * f_name ()
PRIVATE void f_cleanup ()
PRIVATE int f_transfer (int proc_nr, int opcode, off_t position, iovec_t *iov, unsigned nr_req)
PRIVATE int dma_setup (int opcode)
PRIVATE void start_motor ()
PRIVATE void stop_motor (timer_t *tp)
PRIVATE void floppy_stop (struct driver *dp, message *m_ptr)
PRIVATE int seek ()
PRIVATE int fdc_transfer (int opcode)
PRIVATE int fdc_results ()
PRIVATE int fdc_command (u8_t *cmd, int len)
PRIVATE void fdc_out (int val)
PRIVATE int recalibrate ()
PRIVATE void f_reset ()
PRIVATE int f_intr_wait ()
PRIVATE void f_timeout (timer_t *tp)
PRIVATE int read_id ()
PRIVATE int f_do_open (struct driver *dp, message *m_ptr)
PRIVATE int test_read (int density)
PRIVATE void f_geometry (struct partition *entry)

Variables

PRIVATE struct density fdensity [NT]
PRIVATE int irq_hook_id
PRIVATE int motor_status
PRIVATE int need_reset
PRIVATE unsigned f_drive
PRIVATE unsigned f_device
PRIVATE struct floppyf_fp
PRIVATE struct densityf_dp
PRIVATE struct densityprev_dp
PRIVATE unsigned f_sectors
PRIVATE u16_t f_busy
PRIVATE struct devicef_dv
PRIVATE struct disk_parameter_s fmt_param
PRIVATE u8_t f_results [MAX_RESULTS]
PRIVATE timer_t f_tmr_timeout
PRIVATE timer_tf_timers
PRIVATE clock_t f_next_timeout
PRIVATE struct driver f_dtab


Define Documentation

#define b d   )     (1 << (d))
 

Definition at line 187 of file floppy.c.

Referenced by _log(), _wrf(), _wsr(), add_z_1(), add_z_2(), alloc_bit(), alloc_inode(), alloc_zone(), aohand(), ask_kbuf(), askerr(), bit_count(), buf_mod(), buf_tmod(), clear_zone(), common_open(), do_rdlink(), dump_dir(), dump_file(), ee_wds(), ee_wen(), eeprom_addrsize(), eeprom_read(), encrypt(), enter_dir(), errsbm(), ether_hostton(), ether_ntohost(), f_describe(), f_kbuffer(), f_listbufs(), f_repline(), f_retsup(), f_savefiles(), f_selbuffer(), f_selxbuffer(), f_skmac(), f_vkmac(), fatal(), fgetln(), find_buf(), find_file(), free_inode(), from_cu(), get_block(), get_ee_word(), getlab(), getn(), gzgets(), handle_req(), imhand(), incr_link(), incr_size(), inet_ntoa(), iwritfile(), kill_buf(), lerr(), log(), lookup(), ltraverse(), mahand(), main(), make_buf(), make_mode(), make_win(), match(), mdel(), mihand(), mmhand(), mtrans(), new_block(), panic(), print_fs(), proxy(), r_vir2abs(), read_ahead(), read_map(), read_more(), read_standards(), regc(), rijndael_cfb1_decrypt(), rijndael_cfb1_encrypt(), rijndael_Decrypt(), rijndael_Encrypt(), rijndael_makekey(), rw_chunk(), rw_inode(), saveworld(), scan_keyboard(), search_dir(), sel_mbuf(), sel_nbuf(), ser_putc(), set_ee_word(), set_fn(), size_device(), test02(), test05(), test06(), test10(), test11(), test19b(), test19e(), timing_dmp(), tqhand(), u_r_file(), unlk_buf(), warn(), we_init(), write_map(), and zeroblock_range().

#define BAD_CYL   0x1F
 

Definition at line 77 of file floppy.c.

#define BAD_SECTOR   0x05
 

Definition at line 73 of file floppy.c.

#define BASE_SECTOR   1
 

Definition at line 136 of file floppy.c.

Referenced by fdc_transfer(), and read_id().

#define BSY_IDLE   0
 

Definition at line 140 of file floppy.c.

Referenced by f_intr_wait(), f_reset(), seek(), and start_motor().

#define BSY_IO   1
 

Definition at line 141 of file floppy.c.

Referenced by f_intr_wait(), f_reset(), f_timeout(), fdc_command(), seek(), and start_motor().

#define BSY_WAKEN   2
 

Definition at line 142 of file floppy.c.

Referenced by f_intr_wait(), and f_timeout().

#define CALIBRATED   1
 

Definition at line 135 of file floppy.c.

Referenced by recalibrate().

#define CTL_BUSY   0x10
 

Definition at line 58 of file floppy.c.

Referenced by fdc_results().

#define DEV_TYPE_BITS   0x7C
 

Definition at line 121 of file floppy.c.

Referenced by f_do_open(), and f_prepare().

#define DEV_TYPE_SHIFT   2
 

Definition at line 122 of file floppy.c.

Referenced by f_do_open(), f_prepare(), and test_read().

#define DIRECTION   0x40
 

Definition at line 59 of file floppy.c.

Referenced by fdc_out(), and fdc_results().

#define DIVISOR   128
 

Definition at line 129 of file floppy.c.

#define DMA_ADDR   0x004
 

Definition at line 36 of file floppy.c.

Referenced by dma_setup().

#define DMA_ADDR_MASK   0xFFFFFF
 

Definition at line 44 of file floppy.c.

Referenced by dma_setup().

#define DMA_COUNT   0x005
 

Definition at line 38 of file floppy.c.

Referenced by dma_setup().

#define DMA_FLIPFLOP   0x00C
 

Definition at line 39 of file floppy.c.

Referenced by dma_setup().

#define DMA_INIT   0x00A
 

Definition at line 41 of file floppy.c.

Referenced by dma_setup().

#define DMA_MODE   0x00B
 

Definition at line 40 of file floppy.c.

Referenced by dma_setup().

#define DMA_READ   0x46
 

Definition at line 95 of file floppy.c.

Referenced by dma_setup().

#define DMA_RESET_VAL   0x006
 

Definition at line 42 of file floppy.c.

Referenced by dma_setup().

#define DMA_TOP   0x081
 

Definition at line 37 of file floppy.c.

Referenced by dma_setup().

#define DMA_WRITE   0x4A
 

Definition at line 96 of file floppy.c.

Referenced by dma_setup().

#define DOR   0x3F2
 

Definition at line 32 of file floppy.c.

Referenced by f_reset(), floppy_stop(), start_motor(), and stop_motor().

#define DTL   0xFF
 

Definition at line 102 of file floppy.c.

Referenced by fdc_transfer().

#define ENABLE_INT   0x0C
 

Definition at line 64 of file floppy.c.

Referenced by f_reset(), floppy_stop(), start_motor(), and stop_motor().

#define ERR_DRIVE   (-6)
 

Definition at line 113 of file floppy.c.

Referenced by fdc_command().

#define err_no_retry err   )     ((err) <= ERR_WR_PROTECT)
 

Definition at line 118 of file floppy.c.

#define ERR_READ_ID   (-4)
 

Definition at line 111 of file floppy.c.

Referenced by read_id().

#define ERR_RECALIBRATE   (-5)
 

Definition at line 112 of file floppy.c.

Referenced by recalibrate().

#define ERR_SEEK   (-1)
 

Definition at line 108 of file floppy.c.

Referenced by recalibrate(), and seek().

#define ERR_STATUS   (-3)
 

Definition at line 110 of file floppy.c.

Referenced by fdc_results().

#define ERR_TIMEOUT   (-8)
 

Definition at line 115 of file floppy.c.

Referenced by f_intr_wait(), fdc_transfer(), read_id(), recalibrate(), and seek().

#define ERR_TRANSFER   (-2)
 

Definition at line 109 of file floppy.c.

Referenced by fdc_transfer().

#define ERR_WR_PROTECT   (-7)
 

Definition at line 114 of file floppy.c.

Referenced by fdc_transfer().

#define FDC_DATA   0x3F5
 

Definition at line 34 of file floppy.c.

Referenced by fdc_out(), and fdc_results().

#define FDC_FORMAT   0x4D
 

Definition at line 92 of file floppy.c.

Referenced by fdc_transfer().

#define FDC_RATE   0x3F7
 

Definition at line 35 of file floppy.c.

#define FDC_READ   0xE6
 

Definition at line 86 of file floppy.c.

Referenced by fdc_transfer().

#define FDC_READ_ID   0x4A
 

Definition at line 91 of file floppy.c.

Referenced by read_id().

#define FDC_RECALIBRATE   0x07
 

Definition at line 89 of file floppy.c.

Referenced by recalibrate().

#define FDC_SEEK   0x0F
 

Definition at line 85 of file floppy.c.

Referenced by seek().

#define FDC_SENSE   0x08
 

Definition at line 88 of file floppy.c.

Referenced by f_reset(), recalibrate(), and seek().

#define FDC_SPECIFY   0x03
 

Definition at line 90 of file floppy.c.

#define FDC_STATUS   0x3F4
 

Definition at line 33 of file floppy.c.

Referenced by fdc_out(), and fdc_results().

#define FDC_WRITE   0xC5
 

Definition at line 87 of file floppy.c.

Referenced by fdc_transfer().

#define FORMAT_DEV_BIT   0x80
 

Definition at line 123 of file floppy.c.

Referenced by f_do_open(), f_prepare(), f_transfer(), fdc_transfer(), and seek().

#define HC_SIZE   2880
 

Definition at line 99 of file floppy.c.

#define MASTER   0x80
 

Definition at line 60 of file floppy.c.

Referenced by fdc_out(), and fdc_results().

#define MAX_ERRORS   6
 

Definition at line 126 of file floppy.c.

#define MAX_RESULTS   7
 

Definition at line 127 of file floppy.c.

Referenced by fdc_results().

#define MAX_SECTORS   18
 

Definition at line 101 of file floppy.c.

#define MOTOR_OFF   (3*HZ)
 

Definition at line 104 of file floppy.c.

Referenced by f_cleanup().

#define MOTOR_SHIFT   4
 

Definition at line 63 of file floppy.c.

Referenced by start_motor(), and stop_motor().

#define NO_CYL   (-1)
 

Definition at line 138 of file floppy.c.

Referenced by main(), and recalibrate().

#define NO_DENS   100
 

Definition at line 139 of file floppy.c.

Referenced by f_do_open(), and main().

#define NO_SECTOR   (-1)
 

Definition at line 137 of file floppy.c.

Referenced by f_cleanup(), recalibrate(), seek(), and start_motor().

#define NR_DRIVES   2
 

Definition at line 128 of file floppy.c.

Referenced by f_prepare(), and main().

#define NR_HEADS   0x02
 

Definition at line 100 of file floppy.c.

#define NT   7
 

Definition at line 133 of file floppy.c.

Referenced by f_do_open(), and f_prepare().

#define SECTOR_SIZE_CODE   2
 

Definition at line 130 of file floppy.c.

Referenced by fdc_transfer().

#define SEEK_ST0   0x20
 

Definition at line 70 of file floppy.c.

Referenced by recalibrate(), and seek().

#define SPEC2   0x02
 

Definition at line 103 of file floppy.c.

#define ST0   0x00
 

Definition at line 47 of file floppy.c.

Referenced by fdc_transfer(), read_id(), recalibrate(), and seek().

#define ST0_BITS_SEEK   0xF8
 

Definition at line 69 of file floppy.c.

Referenced by recalibrate(), and seek().

#define ST0_BITS_TRANS   0xD8
 

Definition at line 67 of file floppy.c.

Referenced by fdc_transfer(), and read_id().

#define ST1   0x01
 

Definition at line 48 of file floppy.c.

Referenced by fdc_transfer(), read_id(), and seek().

#define ST2   0x02
 

Definition at line 49 of file floppy.c.

Referenced by fdc_transfer(), and read_id().

#define ST3   0x00
 

Definition at line 50 of file floppy.c.

#define ST3_FAULT   0x80
 

Definition at line 80 of file floppy.c.

#define ST3_READY   0x20
 

Definition at line 82 of file floppy.c.

#define ST3_WR_PROTECT   0x40
 

Definition at line 81 of file floppy.c.

#define ST_CYL   0x03
 

Definition at line 51 of file floppy.c.

Referenced by fdc_transfer().

#define ST_HEAD   0x04
 

Definition at line 52 of file floppy.c.

Referenced by fdc_transfer().

#define ST_PCN   0x01
 

Definition at line 54 of file floppy.c.

Referenced by recalibrate().

#define ST_SEC   0x05
 

Definition at line 53 of file floppy.c.

Referenced by fdc_transfer(), and read_id().

#define TIMEOUT_MICROS   500000L
 

Definition at line 131 of file floppy.c.

#define TIMEOUT_TICKS   30
 

Definition at line 132 of file floppy.c.

Referenced by fdc_out(), and fdc_results().

#define TRANS_ST0   0x00
 

Definition at line 68 of file floppy.c.

Referenced by fdc_transfer(), and read_id().

#define UNCALIBRATED   0
 

Definition at line 134 of file floppy.c.

Referenced by fdc_transfer(), read_id(), and seek().

#define WAKEUP   (2*HZ)
 

Definition at line 105 of file floppy.c.

#define WRITE_PROTECT   0x02
 

Definition at line 74 of file floppy.c.

Referenced by fdc_transfer().


Function Documentation

FORWARD _PROTOTYPE void  f_geometry,
(struct partition *entry
 

FORWARD _PROTOTYPE int  test_read,
(int density
 

FORWARD _PROTOTYPE int  f_do_open,
(struct driver *dp, message *m_ptr) 
 

FORWARD _PROTOTYPE void  fdc_out,
(int val
 

FORWARD _PROTOTYPE int  fdc_command,
(u8_t *cmd, int len) 
 

FORWARD _PROTOTYPE int  seek,
(void) 
 

FORWARD _PROTOTYPE int  dma_setup,
(int opcode
 

FORWARD _PROTOTYPE int  f_transfer,
(int proc_nr, int opcode, off_t position, iovec_t *iov, unsigned nr_req
 

FORWARD _PROTOTYPE void  f_cleanup,
(void) 
 

FORWARD _PROTOTYPE char *  f_name,
(void) 
 

FORWARD _PROTOTYPE struct device f_prepare,
(int device
 

FORWARD _PROTOTYPE void  stop_motor,
(timer_t *tp
 

FORWARD _PROTOTYPE void  f_set_timer,
(timer_t *tp, clock_t delta, tmr_func_t watchdog) 
 

FORWARD _PROTOTYPE void  f_expire_tmrs,
(struct driver *dp, message *m_ptr) 
 

PRIVATE int dma_setup int  opcode  ) 
 

Definition at line 634 of file floppy.c.

References DEV_SCATTER, DMA_ADDR, DMA_ADDR_MASK, DMA_COUNT, DMA_FLIPFLOP, DMA_INIT, DMA_MODE, DMA_READ, DMA_RESET_VAL, DMA_TOP, DMA_WRITE, EIO, NO_NUM, OK, panic, pv_set, report(), s, sys_voutb(), and tmp_phys.

PRIVATE void f_cleanup  ) 
 

Definition at line 420 of file floppy.c.

References f_drive, f_fp, f_set_timer(), MOTOR_OFF, NO_SECTOR, and tmr_arg.

PRIVATE int f_do_open struct driver dp,
message m_ptr
 

Definition at line 1189 of file floppy.c.

References DEV_TYPE_BITS, DEV_TYPE_SHIFT, EIO, ENXIO, f_device, f_drive, f_fp, f_prepare(), FORMAT_DEV_BIT, if(), MINOR_fd0p0, motor_status, NIL_DEV, NO_DENS, NT, OK, test_read(), and top.

PRIVATE void f_expire_tmrs struct driver dp,
message m_ptr
 

Definition at line 321 of file floppy.c.

References f_next_timeout, f_timers, getuptime(), now, OK, panic, s, sys_setalarm(), timer::tmr_exp_time, TMR_NEVER, and tmrs_exptimers().

Referenced by f_intr_wait(), f_reset(), seek(), and start_motor().

PRIVATE void f_geometry struct partition entry  ) 
 

Definition at line 1280 of file floppy.c.

References density::cyls, f_dp, f_sectors, and NR_HEADS.

PRIVATE int f_intr_wait  ) 
 

Definition at line 1104 of file floppy.c.

References ANY, BSY_IDLE, BSY_IO, BSY_WAKEN, DEV_PING, ERR_TIMEOUT, f_busy, f_expire_tmrs(), message::m_source, message::m_type, need_reset, notify, OK, receive, SYN_ALARM, and TRUE.

Referenced by fdc_transfer(), read_id(), recalibrate(), and seek().

PRIVATE char* f_name  ) 
 

Definition at line 408 of file floppy.c.

References f_drive.

PRIVATE struct device* f_prepare int  device  ) 
 

Definition at line 380 of file floppy.c.

References density::cyls, DEV_TYPE_BITS, DEV_TYPE_SHIFT, f_device, f_dp, f_drive, f_dv, f_fp, f_sectors, fdensity, FORMAT_DEV_BIT, MINOR_fd0p0, mul64u(), NIL_DEV, NR_DRIVES, NR_HEADS, NT, density::secpt, and SECTOR_SIZE.

Referenced by f_do_open(), and test_read().

PRIVATE void f_reset  ) 
 

Definition at line 1036 of file floppy.c.

References ANY, BSY_IDLE, BSY_IO, DEV_PING, DOR, ENABLE_INT, f_busy, f_expire_tmrs(), FALSE, fdc_command(), fdc_out(), fdc_results(), FDC_SENSE, i, message::m_source, message::m_type, motor_status, need_reset, notify, OK, panic, pv_set, receive, s, SYN_ALARM, and sys_voutb().

PRIVATE void f_set_timer timer_t tp,
clock_t  delta,
tmr_func_t  watchdog
 

Definition at line 351 of file floppy.c.

References f_next_timeout, f_timers, getuptime(), now, OK, panic, s, sys_setalarm(), timer::tmr_exp_time, and tmrs_settimer().

Referenced by f_cleanup(), fdc_command(), seek(), and start_motor().

PRIVATE void f_timeout timer_t tp  ) 
 

Definition at line 1140 of file floppy.c.

References BSY_IO, BSY_WAKEN, and f_busy.

PRIVATE int f_transfer int  proc_nr,
int  opcode,
off_t  position,
iovec_t iov,
unsigned  nr_req
 

Definition at line 433 of file floppy.c.

References add64ul(), chunk, count, cv64ul(), DEV_SCATTER, div64u(), device::dv_base, device::dv_size, EINVAL, EIO, errors, f_device, f_dp, f_dv, f_fp, f_sectors, fmt_param, FORMAT_DEV_BIT, fp, if(), iovec_t::iov_addr, iovec_t::iov_size, MAX_SECTORS, nbytes, NR_HEADS, OK, panic, r, s, sector, SECTOR_MASK, SECTOR_SIZE, SELF, density::steps, and sys_datacopy.

Referenced by test_read().

PRIVATE int fdc_command u8_t cmd,
int  len
 

Definition at line 937 of file floppy.c.

References BSY_IO, ERR_DRIVE, f_busy, f_set_timer(), f_tmr_timeout, fdc_out(), need_reset, OK, and WAKEUP.

Referenced by f_reset(), fdc_transfer(), read_id(), recalibrate(), and seek().

PRIVATE void fdc_out int  val  ) 
 

Definition at line 961 of file floppy.c.

References DIRECTION, FDC_DATA, FDC_STATUS, getuptime(), MASTER, need_reset, OK, panic, printf, s, status, sys_inb, sys_outb, t1, TIMEOUT_TICKS, and TRUE.

Referenced by f_reset(), fdc_command(), recalibrate(), and seek().

PRIVATE int fdc_results  ) 
 

Definition at line 886 of file floppy.c.

References CTL_BUSY, DIRECTION, ERR_STATUS, f_results, FDC_DATA, FDC_STATUS, getuptime(), irq_hook_id, MASTER, MAX_RESULTS, need_reset, OK, panic, printf, s, status, sys_inb, sys_irqenable, t1, TIMEOUT_TICKS, and TRUE.

Referenced by f_reset(), fdc_transfer(), read_id(), recalibrate(), and seek().

PRIVATE int fdc_transfer int  opcode  ) 
 

Definition at line 813 of file floppy.c.

References BASE_SECTOR, DEV_SCATTER, DTL, ERR_TIMEOUT, ERR_TRANSFER, ERR_WR_PROTECT, f_device, f_dp, f_drive, f_fp, f_intr_wait(), f_name, f_results, f_sectors, fdc_command(), FDC_FORMAT, FDC_READ, fdc_results(), FDC_WRITE, disk_parameter_s::fill_byte_for_format, fmt_param, FORMAT_DEV_BIT, fp, density::gap, disk_parameter_s::gap_length_for_format, motor_status, NR_HEADS, OK, printf, s, SECTOR_SIZE_CODE, disk_parameter_s::sector_size_code, disk_parameter_s::sectors_per_cylinder, ST0, ST0_BITS_TRANS, ST1, ST2, ST_CYL, ST_HEAD, ST_SEC, TRANS_ST0, UNCALIBRATED, and WRITE_PROTECT.

PRIVATE void floppy_stop struct driver dp,
message m_ptr
 

Definition at line 741 of file floppy.c.

References DOR, ENABLE_INT, exit(), OK, panic, s, sigismember, SIGTERM, and sys_outb.

PUBLIC void main void   ) 
 

Definition at line 289 of file floppy.c.

References f_next_timeout, f_tmr_timeout, fp, NO_CYL, NO_DENS, NR_DRIVES, s, tmr_inittimer, and TMR_NEVER.

PRIVATE int read_id  ) 
 

Definition at line 1156 of file floppy.c.

References BASE_SECTOR, ERR_READ_ID, ERR_TIMEOUT, f_drive, f_fp, f_intr_wait(), f_results, fdc_command(), FDC_READ_ID, fdc_results(), fp, motor_status, OK, result, ST0, ST0_BITS_TRANS, ST1, ST2, ST_SEC, TRANS_ST0, and UNCALIBRATED.

PRIVATE int recalibrate  ) 
 

Definition at line 994 of file floppy.c.

References CALIBRATED, ERR_RECALIBRATE, ERR_SEEK, ERR_TIMEOUT, f_drive, f_fp, f_intr_wait(), f_results, fdc_command(), fdc_out(), FDC_RECALIBRATE, fdc_results(), FDC_SENSE, fp, need_reset, NO_CYL, NO_SECTOR, OK, SEEK_ST0, ST0, ST0_BITS_SEEK, ST_PCN, and TRUE.

Referenced by seek().

PRIVATE int seek  ) 
 

Definition at line 756 of file floppy.c.

References ANY, BSY_IDLE, BSY_IO, DEV_PING, ERR_SEEK, ERR_TIMEOUT, f_busy, f_device, f_drive, f_expire_tmrs(), f_fp, f_intr_wait(), f_results, f_set_timer(), f_tmr_timeout, fdc_command(), fdc_out(), fdc_results(), FDC_SEEK, FDC_SENSE, FORMAT_DEV_BIT, fp, HZ, message::m_source, message::m_type, NO_SECTOR, notify, OK, recalibrate(), receive, SEEK_ST0, ST0, ST0_BITS_SEEK, ST1, SYN_ALARM, and UNCALIBRATED.

PRIVATE void start_motor  ) 
 

Definition at line 679 of file floppy.c.

References ANY, BSY_IDLE, BSY_IO, DEV_PING, DOR, ENABLE_INT, f_busy, f_dp, f_drive, f_expire_tmrs(), f_fp, f_set_timer(), f_tmr_timeout, message::m_source, message::m_type, MOTOR_SHIFT, motor_status, NO_SECTOR, notify, OK, panic, receive, s, density::start, SYN_ALARM, and sys_outb.

PRIVATE void stop_motor timer_t tp  ) 
 

Definition at line 726 of file floppy.c.

References DOR, ENABLE_INT, MOTOR_SHIFT, motor_status, OK, panic, s, sys_outb, and tmr_arg.

PRIVATE int test_read int  density  ) 
 

Definition at line 1250 of file floppy.c.

References DEV_GATHER, DEV_TYPE_SHIFT, EIO, f_dp, f_drive, f_dtab, f_fp, f_prepare(), f_transfer(), iovec_t::iov_addr, iovec_t::iov_size, OK, P_FLOPPY, partition(), position, result, SECTOR_SHIFT, SELF, and density::test.

Referenced by f_do_open().


Variable Documentation

PRIVATE u16_t f_busy
 

Definition at line 228 of file floppy.c.

Referenced by f_intr_wait(), f_reset(), f_timeout(), fdc_command(), seek(), and start_motor().

PRIVATE unsigned f_device
 

Definition at line 223 of file floppy.c.

Referenced by f_do_open(), f_prepare(), f_transfer(), fdc_transfer(), and seek().

PRIVATE struct density* f_dp
 

Definition at line 225 of file floppy.c.

Referenced by f_geometry(), f_prepare(), f_transfer(), fdc_transfer(), start_motor(), and test_read().

PRIVATE unsigned f_drive
 

Definition at line 222 of file floppy.c.

Referenced by f_cleanup(), f_do_open(), f_name(), f_prepare(), fdc_transfer(), read_id(), recalibrate(), seek(), start_motor(), and test_read().

PRIVATE struct driver f_dtab
 

Initial value:

Definition at line 269 of file floppy.c.

Referenced by test_read().

PRIVATE struct device* f_dv
 

Definition at line 229 of file floppy.c.

Referenced by f_prepare(), and f_transfer().

PRIVATE struct floppy* f_fp
 

Definition at line 224 of file floppy.c.

PRIVATE clock_t f_next_timeout
 

Definition at line 240 of file floppy.c.

Referenced by f_expire_tmrs(), f_set_timer(), and main().

PRIVATE u8_t f_results[MAX_RESULTS]
 

Definition at line 231 of file floppy.c.

Referenced by fdc_results(), fdc_transfer(), read_id(), recalibrate(), and seek().

PRIVATE unsigned f_sectors
 

Definition at line 227 of file floppy.c.

Referenced by f_geometry(), f_prepare(), f_transfer(), and fdc_transfer().

PRIVATE timer_t* f_timers
 

Definition at line 239 of file floppy.c.

Referenced by f_expire_tmrs(), and f_set_timer().

PRIVATE timer_t f_tmr_timeout
 

Definition at line 238 of file floppy.c.

Referenced by fdc_command(), main(), seek(), and start_motor().

PRIVATE struct density fdensity[NT]
 

Referenced by f_prepare().

PRIVATE struct disk_parameter_s fmt_param
 

Definition at line 230 of file floppy.c.

Referenced by f_transfer(), and fdc_transfer().

PRIVATE int irq_hook_id
 

Definition at line 219 of file floppy.c.

Referenced by do_initialize(), do_irqctl(), do_printer_output(), fdc_results(), and main().

PRIVATE int motor_status
 

Definition at line 220 of file floppy.c.

Referenced by f_do_open(), f_reset(), fdc_transfer(), read_id(), start_motor(), and stop_motor().

PRIVATE int need_reset
 

Definition at line 221 of file floppy.c.

Referenced by f_intr_wait(), f_reset(), fdc_command(), fdc_out(), fdc_results(), and recalibrate().

PRIVATE struct density* prev_dp
 

Definition at line 226 of file floppy.c.


Generated on Fri Apr 14 23:08:54 2006 for minix by  doxygen 1.4.6