Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
swim3.c File Reference
#include <linux/stddef.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/fd.h>
#include <linux/ioctl.h>
#include <linux/blkdev.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <asm/io.h>
#include <asm/dbdma.h>
#include <asm/prom.h>
#include <asm/uaccess.h>
#include <asm/mediabay.h>
#include <asm/machdep.h>
#include <asm/pmac_feature.h>

Go to the source code of this file.

Data Structures

struct  swim3
 
struct  floppy_state
 

Macros

#define MAX_FLOPPIES   2
 
#define REG(x)   unsigned char x; char x ## _pad[15];
 
#define control_bic   control
 
#define control_bis   status
 
#define CA_MASK   7
 
#define LSTRB   8
 
#define DO_SEEK   0x80
 
#define FORMAT   0x40
 
#define SELECT   0x20
 
#define WRITE_SECTORS   0x10
 
#define DO_ACTION   0x08
 
#define DRIVE2_ENABLE   0x04
 
#define DRIVE_ENABLE   0x02
 
#define INTR_ENABLE   0x01
 
#define FIFO_1BYTE   0x80
 
#define FIFO_2BYTE   0x40
 
#define ERROR   0x20
 
#define DATA   0x08
 
#define RDDATA   0x04
 
#define INTR_PENDING   0x02
 
#define MARK_BYTE   0x01
 
#define ERROR_INTR   0x20
 
#define DATA_CHANGED   0x10
 
#define TRANSFER_DONE   0x08
 
#define SEEN_SECTOR   0x04
 
#define SEEK_DONE   0x02
 
#define TIMER_DONE   0x01
 
#define ERR_DATA_CRC   0x80
 
#define ERR_ADDR_CRC   0x40
 
#define ERR_OVERRUN   0x04
 
#define ERR_UNDERRUN   0x01
 
#define S_SW_RESET   0x80
 
#define S_GCR_WRITE   0x40
 
#define S_IBM_DRIVE   0x20
 
#define S_TEST_MODE   0x10
 
#define S_FCLK_DIV2   0x08
 
#define S_GCR   0x04
 
#define S_COPY_PROT   0x02
 
#define S_INV_WDATA   0x01
 
#define SEEK_POSITIVE   0
 
#define SEEK_NEGATIVE   4
 
#define STEP   1
 
#define MOTOR_ON   2
 
#define MOTOR_OFF   6
 
#define INDEX   3
 
#define EJECT   7
 
#define SETMFM   9
 
#define SETGCR   13
 
#define STEP_DIR   0
 
#define STEPPING   1
 
#define MOTOR_ON   2
 
#define RELAX   3 /* also eject in progress */
 
#define READ_DATA_0   4
 
#define TWOMEG_DRIVE   5
 
#define SINGLE_SIDED   6 /* drive or diskette is 4MB type? */
 
#define DRIVE_PRESENT   7
 
#define DISK_IN   8
 
#define WRITE_PROT   9
 
#define TRACK_ZERO   10
 
#define TACHO   11
 
#define READ_DATA_1   12
 
#define MFM_MODE   13
 
#define SEEK_COMPLETE   14
 
#define ONEMEG_MEDIA   15
 
#define DATA_ESCAPE   0x99
 
#define GCR_SYNC_EXC   0x3f
 
#define GCR_SYNC_CONV   0x80
 
#define GCR_FIRST_MARK   0xd5
 
#define GCR_SECOND_MARK   0xaa
 
#define GCR_ADDR_MARK   "\xd5\xaa\x00"
 
#define GCR_DATA_MARK   "\xd5\xaa\x0b"
 
#define GCR_SLIP_BYTE   "\x27\xaa"
 
#define GCR_SELF_SYNC   "\x3f\xbf\x1e\x34\x3c\x3f"
 
#define DATA_99   "\x99\x99"
 
#define MFM_ADDR_MARK   "\x99\xa1\x99\xa1\x99\xa1\x99\xfe"
 
#define MFM_INDEX_MARK   "\x99\xc2\x99\xc2\x99\xc2\x99\xfc"
 
#define MFM_GAP_LEN   12
 
#define swim3_err(fmt, arg...)   dev_err(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg)
 
#define swim3_warn(fmt, arg...)   dev_warn(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg)
 
#define swim3_info(fmt, arg...)   dev_info(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg)
 
#define swim3_dbg(fmt, arg...)   do { } while(0)
 

Enumerations

enum  swim_state {
  idle, locating, seeking, settling,
  do_transfer, jogging, available, revalidating,
  ejecting
}
 

Functions

int swim3_init (void)
 

Macro Definition Documentation

#define CA_MASK   7

Definition at line 87 of file swim3.c.

#define control_bic   control

Definition at line 83 of file swim3.c.

#define control_bis   status

Definition at line 84 of file swim3.c.

#define DATA   0x08

Definition at line 104 of file swim3.c.

#define DATA_99   "\x99\x99"

Definition at line 173 of file swim3.c.

#define DATA_CHANGED   0x10

Definition at line 111 of file swim3.c.

#define DATA_ESCAPE   0x99

Definition at line 163 of file swim3.c.

#define DISK_IN   8

Definition at line 153 of file swim3.c.

#define DO_ACTION   0x08

Definition at line 95 of file swim3.c.

#define DO_SEEK   0x80

Definition at line 91 of file swim3.c.

#define DRIVE2_ENABLE   0x04

Definition at line 96 of file swim3.c.

#define DRIVE_ENABLE   0x02

Definition at line 97 of file swim3.c.

#define DRIVE_PRESENT   7

Definition at line 152 of file swim3.c.

#define EJECT   7

Definition at line 140 of file swim3.c.

#define ERR_ADDR_CRC   0x40

Definition at line 119 of file swim3.c.

#define ERR_DATA_CRC   0x80

Definition at line 118 of file swim3.c.

#define ERR_OVERRUN   0x04

Definition at line 120 of file swim3.c.

#define ERR_UNDERRUN   0x01

Definition at line 121 of file swim3.c.

#define ERROR   0x20

Definition at line 103 of file swim3.c.

#define ERROR_INTR   0x20

Definition at line 110 of file swim3.c.

#define FIFO_1BYTE   0x80

Definition at line 101 of file swim3.c.

#define FIFO_2BYTE   0x40

Definition at line 102 of file swim3.c.

#define FORMAT   0x40

Definition at line 92 of file swim3.c.

#define GCR_ADDR_MARK   "\xd5\xaa\x00"

Definition at line 168 of file swim3.c.

#define GCR_DATA_MARK   "\xd5\xaa\x0b"

Definition at line 169 of file swim3.c.

#define GCR_FIRST_MARK   0xd5

Definition at line 166 of file swim3.c.

#define GCR_SECOND_MARK   0xaa

Definition at line 167 of file swim3.c.

#define GCR_SELF_SYNC   "\x3f\xbf\x1e\x34\x3c\x3f"

Definition at line 171 of file swim3.c.

#define GCR_SLIP_BYTE   "\x27\xaa"

Definition at line 170 of file swim3.c.

#define GCR_SYNC_CONV   0x80

Definition at line 165 of file swim3.c.

#define GCR_SYNC_EXC   0x3f

Definition at line 164 of file swim3.c.

#define INDEX   3

Definition at line 139 of file swim3.c.

#define INTR_ENABLE   0x01

Definition at line 98 of file swim3.c.

#define INTR_PENDING   0x02

Definition at line 106 of file swim3.c.

#define LSTRB   8

Definition at line 88 of file swim3.c.

#define MARK_BYTE   0x01

Definition at line 107 of file swim3.c.

#define MAX_FLOPPIES   2

Definition at line 41 of file swim3.c.

#define MFM_ADDR_MARK   "\x99\xa1\x99\xa1\x99\xa1\x99\xfe"

Definition at line 174 of file swim3.c.

#define MFM_GAP_LEN   12

Definition at line 176 of file swim3.c.

#define MFM_INDEX_MARK   "\x99\xc2\x99\xc2\x99\xc2\x99\xfc"

Definition at line 175 of file swim3.c.

#define MFM_MODE   13

Definition at line 158 of file swim3.c.

#define MOTOR_OFF   6

Definition at line 138 of file swim3.c.

#define MOTOR_ON   2

Definition at line 147 of file swim3.c.

#define MOTOR_ON   2

Definition at line 147 of file swim3.c.

#define ONEMEG_MEDIA   15

Definition at line 160 of file swim3.c.

#define RDDATA   0x04

Definition at line 105 of file swim3.c.

#define READ_DATA_0   4

Definition at line 149 of file swim3.c.

#define READ_DATA_1   12

Definition at line 157 of file swim3.c.

#define REG (   x)    unsigned char x; char x ## _pad[15];

Definition at line 58 of file swim3.c.

#define RELAX   3 /* also eject in progress */

Definition at line 148 of file swim3.c.

#define S_COPY_PROT   0x02

Definition at line 130 of file swim3.c.

#define S_FCLK_DIV2   0x08

Definition at line 128 of file swim3.c.

#define S_GCR   0x04

Definition at line 129 of file swim3.c.

#define S_GCR_WRITE   0x40

Definition at line 125 of file swim3.c.

#define S_IBM_DRIVE   0x20

Definition at line 126 of file swim3.c.

#define S_INV_WDATA   0x01

Definition at line 131 of file swim3.c.

#define S_SW_RESET   0x80

Definition at line 124 of file swim3.c.

#define S_TEST_MODE   0x10

Definition at line 127 of file swim3.c.

#define SEEK_COMPLETE   14

Definition at line 159 of file swim3.c.

#define SEEK_DONE   0x02

Definition at line 114 of file swim3.c.

#define SEEK_NEGATIVE   4

Definition at line 135 of file swim3.c.

#define SEEK_POSITIVE   0

Definition at line 134 of file swim3.c.

#define SEEN_SECTOR   0x04

Definition at line 113 of file swim3.c.

#define SELECT   0x20

Definition at line 93 of file swim3.c.

#define SETGCR   13

Definition at line 142 of file swim3.c.

#define SETMFM   9

Definition at line 141 of file swim3.c.

#define SINGLE_SIDED   6 /* drive or diskette is 4MB type? */

Definition at line 151 of file swim3.c.

#define STEP   1

Definition at line 136 of file swim3.c.

#define STEP_DIR   0

Definition at line 145 of file swim3.c.

#define STEPPING   1

Definition at line 146 of file swim3.c.

#define swim3_dbg (   fmt,
  arg... 
)    do { } while(0)

Definition at line 217 of file swim3.c.

#define swim3_err (   fmt,
  arg... 
)    dev_err(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg)

Definition at line 210 of file swim3.c.

#define swim3_info (   fmt,
  arg... 
)    dev_info(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg)

Definition at line 212 of file swim3.c.

#define swim3_warn (   fmt,
  arg... 
)    dev_warn(&fs->mdev->ofdev.dev, "[fd%d] " fmt, fs->index, arg)

Definition at line 211 of file swim3.c.

#define TACHO   11

Definition at line 156 of file swim3.c.

#define TIMER_DONE   0x01

Definition at line 115 of file swim3.c.

#define TRACK_ZERO   10

Definition at line 155 of file swim3.c.

#define TRANSFER_DONE   0x08

Definition at line 112 of file swim3.c.

#define TWOMEG_DRIVE   5

Definition at line 150 of file swim3.c.

#define WRITE_PROT   9

Definition at line 154 of file swim3.c.

#define WRITE_SECTORS   0x10

Definition at line 94 of file swim3.c.

Enumeration Type Documentation

enum swim_state
Enumerator:
idle 
locating 
seeking 
settling 
do_transfer 
jogging 
available 
revalidating 
ejecting 

Definition at line 46 of file swim3.c.

Function Documentation

int swim3_init ( void  )

Definition at line 1272 of file swim3.c.