Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
floppy.c File Reference
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/workqueue.h>
#include <linux/fdreg.h>
#include <linux/fd.h>
#include <linux/hdreg.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/bio.h>
#include <linux/string.h>
#include <linux/jiffies.h>
#include <linux/fcntl.h>
#include <linux/delay.h>
#include <linux/mc146818rtc.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/mod_devicetable.h>
#include <linux/mutex.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#include <linux/async.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/floppy.h>
#include <linux/blkdev.h>
#include <linux/blkpg.h>
#include <linux/cdrom.h>
#include <linux/completion.h>

Go to the source code of this file.

Data Structures

struct  cont_t
 
struct  output_log
 
struct  param_table
 
struct  io_region
 

Macros

#define REALLY_SLOW_IO
 
#define DEBUGT   2
 
#define DPRINT(format, args...)   pr_info("floppy%d: " format, current_drive, ##args)
 
#define DCL_DEBUG   /* debug disk change line */
 
#define debug_dcl(test, fmt, args...)   do { if ((test) & FD_DEBUG) DPRINT(fmt, ##args); } while (0)
 
#define FDPATCHES
 
#define K_64   0x10000 /* 64KB */
 
#define fd_get_dma_residue()   get_dma_residue(FLOPPY_DMA)
 
#define fd_dma_mem_free(addr, size)   free_pages(addr, get_order(size))
 
#define fd_dma_mem_alloc(size)   __get_dma_pages(GFP_KERNEL, get_order(size))
 
#define ITYPE(x)   (((x) >> 2) & 0x1f)
 
#define TOMINOR(x)   ((x & 3) | ((x & 4) << 5))
 
#define UNIT(x)   ((x) & 0x03) /* drive on fdc */
 
#define FDC(x)   (((x) & 0x04) >> 2) /* fdc of drive */
 
#define REVDRIVE(fdc, unit)   ((unit) + ((fdc) << 2))
 
#define DP   (&drive_params[current_drive])
 
#define DRS   (&drive_state[current_drive])
 
#define DRWE   (&write_errors[current_drive])
 
#define FDCS   (&fdc_state[fdc])
 
#define UDP   (&drive_params[drive])
 
#define UDRS   (&drive_state[drive])
 
#define UDRWE   (&write_errors[drive])
 
#define UFDCS   (&fdc_state[FDC(drive)])
 
#define PH_HEAD(floppy, head)   (((((floppy)->stretch & 2) >> 1) ^ head) << 2)
 
#define STRETCH(floppy)   ((floppy)->stretch & FD_STRETCH)
 
#define COMMAND   (raw_cmd->cmd[0])
 
#define DR_SELECT   (raw_cmd->cmd[1])
 
#define TRACK   (raw_cmd->cmd[2])
 
#define HEAD   (raw_cmd->cmd[3])
 
#define SECTOR   (raw_cmd->cmd[4])
 
#define SIZECODE   (raw_cmd->cmd[5])
 
#define SECT_PER_TRACK   (raw_cmd->cmd[6])
 
#define GAP   (raw_cmd->cmd[7])
 
#define SIZECODE2   (raw_cmd->cmd[8])
 
#define NR_RW   9
 
#define F_SIZECODE   (raw_cmd->cmd[2])
 
#define F_SECT_PER_TRACK   (raw_cmd->cmd[3])
 
#define F_GAP   (raw_cmd->cmd[4])
 
#define F_FILL   (raw_cmd->cmd[5])
 
#define NR_F   6
 
#define MAX_DISK_SIZE   4 /* 3984 */
 
#define MAX_REPLIES   16
 
#define ST0   (reply_buffer[0])
 
#define ST1   (reply_buffer[1])
 
#define ST2   (reply_buffer[2])
 
#define ST3   (reply_buffer[0]) /* result of GETSTATUS */
 
#define R_TRACK   (reply_buffer[3])
 
#define R_HEAD   (reply_buffer[4])
 
#define R_SECTOR   (reply_buffer[5])
 
#define R_SIZECODE   (reply_buffer[6])
 
#define SEL_DLY   (2 * HZ / 100)
 
#define SECTSIZE   (_FD_SECTSIZE(*floppy))
 
#define FD_COMMAND_NONE   -1
 
#define FD_COMMAND_ERROR   2
 
#define FD_COMMAND_OKAY   3
 
#define NO_TRACK   -1
 
#define NEED_1_RECAL   -2
 
#define NEED_2_RECAL   -3
 
#define OLOGSIZE   20
 
#define current_reqD   -1
 
#define MAXTIMEOUT   -2
 
#define INFBOUND(a, b)   (a) = max_t(int, a, b)
 
#define SUPBOUND(a, b)   (a) = min_t(int, a, b)
 
#define MORE_OUTPUT   -2
 
#define NOMINAL_DTR   500
 
#define FM_MODE(x, y)   ((y) & ~(((x)->rate & 0x80) >> 1))
 
#define CT(x)   ((x) | 0xc0)
 
#define ARRAY_END(X)   (&((X)[ARRAY_SIZE(X)]))
 

Typedefs

typedef void(* done_f )(int)
 

Functions

irqreturn_t floppy_interrupt (int irq, void *dev_id)
 
 __setup ("floppy=", floppy_setup)
 

Macro Definition Documentation

#define ARRAY_END (   X)    (&((X)[ARRAY_SIZE(X)]))

Definition at line 4385 of file floppy.c.

#define COMMAND   (raw_cmd->cmd[0])

Definition at line 317 of file floppy.c.

#define CT (   x)    ((x) | 0xc0)

Definition at line 2072 of file floppy.c.

#define current_reqD   -1

Definition at line 666 of file floppy.c.

#define DCL_DEBUG   /* debug disk change line */

Definition at line 156 of file floppy.c.

#define debug_dcl (   test,
  fmt,
  args... 
)    do { if ((test) & FD_DEBUG) DPRINT(fmt, ##args); } while (0)

Definition at line 158 of file floppy.c.

#define DEBUGT   2

Definition at line 151 of file floppy.c.

#define DP   (&drive_params[current_drive])

Definition at line 303 of file floppy.c.

#define DPRINT (   format,
  args... 
)    pr_info("floppy%d: " format, current_drive, ##args)

Definition at line 153 of file floppy.c.

#define DR_SELECT   (raw_cmd->cmd[1])

Definition at line 318 of file floppy.c.

#define DRS   (&drive_state[current_drive])

Definition at line 304 of file floppy.c.

#define DRWE   (&write_errors[current_drive])

Definition at line 305 of file floppy.c.

#define F_FILL   (raw_cmd->cmd[5])

Definition at line 332 of file floppy.c.

#define F_GAP   (raw_cmd->cmd[4])

Definition at line 331 of file floppy.c.

#define F_SECT_PER_TRACK   (raw_cmd->cmd[3])

Definition at line 330 of file floppy.c.

#define F_SIZECODE   (raw_cmd->cmd[2])

Definition at line 329 of file floppy.c.

#define FD_COMMAND_ERROR   2

Definition at line 510 of file floppy.c.

#define FD_COMMAND_NONE   -1

Definition at line 509 of file floppy.c.

#define FD_COMMAND_OKAY   3

Definition at line 511 of file floppy.c.

#define fd_dma_mem_alloc (   size)    __get_dma_pages(GFP_KERNEL, get_order(size))

Definition at line 274 of file floppy.c.

#define fd_dma_mem_free (   addr,
  size 
)    free_pages(addr, get_order(size))

Definition at line 270 of file floppy.c.

#define fd_get_dma_residue (   void)    get_dma_residue(FLOPPY_DMA)

Definition at line 264 of file floppy.c.

#define FDC (   x)    (((x) & 0x04) >> 2) /* fdc of drive */

Definition at line 299 of file floppy.c.

#define FDCS   (&fdc_state[fdc])

Definition at line 306 of file floppy.c.

#define FDPATCHES

Definition at line 173 of file floppy.c.

#define FM_MODE (   x,
  y 
)    ((y) & ~(((x)->rate & 0x80) >> 1))

Definition at line 2071 of file floppy.c.

#define GAP   (raw_cmd->cmd[7])

Definition at line 324 of file floppy.c.

#define HEAD   (raw_cmd->cmd[3])

Definition at line 320 of file floppy.c.

#define INFBOUND (   a,
  b 
)    (a) = max_t(int, a, b)

Definition at line 697 of file floppy.c.

#define ITYPE (   x)    (((x) >> 2) & 0x1f)

Definition at line 296 of file floppy.c.

#define K_64   0x10000 /* 64KB */

Definition at line 236 of file floppy.c.

#define MAX_DISK_SIZE   4 /* 3984 */

Definition at line 340 of file floppy.c.

#define MAX_REPLIES   16

Definition at line 345 of file floppy.c.

#define MAXTIMEOUT   -2

Definition at line 667 of file floppy.c.

#define MORE_OUTPUT   -2

Definition at line 1150 of file floppy.c.

#define NEED_1_RECAL   -2

Definition at line 577 of file floppy.c.

#define NEED_2_RECAL   -3

Definition at line 578 of file floppy.c.

#define NO_TRACK   -1

Definition at line 576 of file floppy.c.

#define NOMINAL_DTR   500

Definition at line 1221 of file floppy.c.

#define NR_F   6

Definition at line 333 of file floppy.c.

#define NR_RW   9

Definition at line 326 of file floppy.c.

#define OLOGSIZE   20

Definition at line 650 of file floppy.c.

#define PH_HEAD (   floppy,
  head 
)    (((((floppy)->stretch & 2) >> 1) ^ head) << 2)

Definition at line 313 of file floppy.c.

#define R_HEAD   (reply_buffer[4])

Definition at line 353 of file floppy.c.

#define R_SECTOR   (reply_buffer[5])

Definition at line 354 of file floppy.c.

#define R_SIZECODE   (reply_buffer[6])

Definition at line 355 of file floppy.c.

#define R_TRACK   (reply_buffer[3])

Definition at line 352 of file floppy.c.

#define REALLY_SLOW_IO

Definition at line 149 of file floppy.c.

#define REVDRIVE (   fdc,
  unit 
)    ((unit) + ((fdc) << 2))

Definition at line 301 of file floppy.c.

#define SECT_PER_TRACK   (raw_cmd->cmd[6])

Definition at line 323 of file floppy.c.

#define SECTOR   (raw_cmd->cmd[4])

Definition at line 321 of file floppy.c.

#define SECTSIZE   (_FD_SECTSIZE(*floppy))

Definition at line 486 of file floppy.c.

#define SEL_DLY   (2 * HZ / 100)

Definition at line 357 of file floppy.c.

#define SIZECODE   (raw_cmd->cmd[5])

Definition at line 322 of file floppy.c.

#define SIZECODE2   (raw_cmd->cmd[8])

Definition at line 325 of file floppy.c.

#define ST0   (reply_buffer[0])

Definition at line 348 of file floppy.c.

#define ST1   (reply_buffer[1])

Definition at line 349 of file floppy.c.

#define ST2   (reply_buffer[2])

Definition at line 350 of file floppy.c.

#define ST3   (reply_buffer[0]) /* result of GETSTATUS */

Definition at line 351 of file floppy.c.

#define STRETCH (   floppy)    ((floppy)->stretch & FD_STRETCH)

Definition at line 314 of file floppy.c.

#define SUPBOUND (   a,
  b 
)    (a) = min_t(int, a, b)

Definition at line 698 of file floppy.c.

#define TOMINOR (   x)    ((x & 3) | ((x & 4) << 5))

Definition at line 297 of file floppy.c.

#define TRACK   (raw_cmd->cmd[2])

Definition at line 319 of file floppy.c.

#define UDP   (&drive_params[drive])

Definition at line 308 of file floppy.c.

#define UDRS   (&drive_state[drive])

Definition at line 309 of file floppy.c.

#define UDRWE   (&write_errors[drive])

Definition at line 310 of file floppy.c.

#define UFDCS   (&fdc_state[FDC(drive)])

Definition at line 311 of file floppy.c.

#define UNIT (   x)    ((x) & 0x03) /* drive on fdc */

Definition at line 298 of file floppy.c.

Typedef Documentation

typedef void(* done_f)(int)

Definition at line 540 of file floppy.c.

Function Documentation

__setup ( )
irqreturn_t floppy_interrupt ( int  irq,
void dev_id 
)

Definition at line 1658 of file floppy.c.

Variable Documentation

const char* name

Definition at line 364 of file floppy.c.

Definition at line 363 of file floppy.c.