Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
pt.c File Reference
#include <linux/types.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/mtio.h>
#include <linux/device.h>
#include <linux/sched.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include "paride.h"

Go to the source code of this file.

Data Structures

struct  pt_unit
 

Macros

#define PT_VERSION   "1.04"
 
#define PT_MAJOR   96
 
#define PT_NAME   "pt"
 
#define PT_UNITS   4
 
#define D_PRT   0
 
#define D_PRO   1
 
#define D_UNI   2
 
#define D_MOD   3
 
#define D_SLV   4
 
#define D_DLY   5
 
#define DU   (*drives[unit])
 
#define PT_MAX_RETRIES   5
 
#define PT_TMO   3000 /* interrupt timeout in jiffies */
 
#define PT_SPIN_DEL   50 /* spin delay in micro-seconds */
 
#define PT_RESET_TMO   30 /* 30 seconds */
 
#define PT_READY_TMO   60 /* 60 seconds */
 
#define PT_REWIND_TMO   1200 /* 20 minutes */
 
#define PT_SPIN   ((1000000/(HZ*PT_SPIN_DEL))*PT_TMO)
 
#define STAT_ERR   0x00001
 
#define STAT_INDEX   0x00002
 
#define STAT_ECC   0x00004
 
#define STAT_DRQ   0x00008
 
#define STAT_SEEK   0x00010
 
#define STAT_WRERR   0x00020
 
#define STAT_READY   0x00040
 
#define STAT_BUSY   0x00080
 
#define STAT_SENSE   0x1f000
 
#define ATAPI_TEST_READY   0x00
 
#define ATAPI_REWIND   0x01
 
#define ATAPI_REQ_SENSE   0x03
 
#define ATAPI_READ_6   0x08
 
#define ATAPI_WRITE_6   0x0a
 
#define ATAPI_WFM   0x10
 
#define ATAPI_IDENTIFY   0x12
 
#define ATAPI_MODE_SENSE   0x1a
 
#define ATAPI_LOG_SENSE   0x4d
 
#define PT_MEDIA   1
 
#define PT_WRITE_OK   2
 
#define PT_REWIND   4
 
#define PT_WRITING   8
 
#define PT_READING   16
 
#define PT_EOF   32
 
#define PT_NAMELEN   8
 
#define PT_BUFSIZE   16384
 
#define DBMSG(msg)   ((verbose>1)?(msg):NULL)
 

Functions

 module_param (verbose, bool, 0)
 
 module_param (major, int, 0)
 
 module_param (name, charp, 0)
 
 module_param_array (drive0, int, NULL, 0)
 
 module_param_array (drive1, int, NULL, 0)
 
 module_param_array (drive2, int, NULL, 0)
 
 module_param_array (drive3, int, NULL, 0)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define ATAPI_IDENTIFY   0x12

Definition at line 190 of file pt.c.

#define ATAPI_LOG_SENSE   0x4d

Definition at line 192 of file pt.c.

#define ATAPI_MODE_SENSE   0x1a

Definition at line 191 of file pt.c.

#define ATAPI_READ_6   0x08

Definition at line 187 of file pt.c.

#define ATAPI_REQ_SENSE   0x03

Definition at line 186 of file pt.c.

#define ATAPI_REWIND   0x01

Definition at line 185 of file pt.c.

#define ATAPI_TEST_READY   0x00

Definition at line 184 of file pt.c.

#define ATAPI_WFM   0x10

Definition at line 189 of file pt.c.

#define ATAPI_WRITE_6   0x0a

Definition at line 188 of file pt.c.

#define D_DLY   5

Definition at line 137 of file pt.c.

#define D_MOD   3

Definition at line 135 of file pt.c.

#define D_PRO   1

Definition at line 133 of file pt.c.

#define D_PRT   0

Definition at line 132 of file pt.c.

#define D_SLV   4

Definition at line 136 of file pt.c.

#define D_UNI   2

Definition at line 134 of file pt.c.

#define DBMSG (   msg)    ((verbose>1)?(msg):NULL)

Definition at line 448 of file pt.c.

#define DU   (*drives[unit])

Definition at line 139 of file pt.c.

#define PT_BUFSIZE   16384

Definition at line 214 of file pt.c.

#define PT_EOF   32

Definition at line 211 of file pt.c.

#define PT_MAJOR   96

Definition at line 108 of file pt.c.

#define PT_MAX_RETRIES   5

Definition at line 165 of file pt.c.

#define PT_MEDIA   1

Definition at line 206 of file pt.c.

#define PT_NAME   "pt"

Definition at line 109 of file pt.c.

#define PT_NAMELEN   8

Definition at line 213 of file pt.c.

#define PT_READING   16

Definition at line 210 of file pt.c.

#define PT_READY_TMO   60 /* 60 seconds */

Definition at line 169 of file pt.c.

#define PT_RESET_TMO   30 /* 30 seconds */

Definition at line 168 of file pt.c.

#define PT_REWIND   4

Definition at line 208 of file pt.c.

#define PT_REWIND_TMO   1200 /* 20 minutes */

Definition at line 170 of file pt.c.

#define PT_SPIN   ((1000000/(HZ*PT_SPIN_DEL))*PT_TMO)

Definition at line 172 of file pt.c.

#define PT_SPIN_DEL   50 /* spin delay in micro-seconds */

Definition at line 167 of file pt.c.

#define PT_TMO   3000 /* interrupt timeout in jiffies */

Definition at line 166 of file pt.c.

#define PT_UNITS   4

Definition at line 110 of file pt.c.

#define PT_VERSION   "1.04"

Definition at line 107 of file pt.c.

#define PT_WRITE_OK   2

Definition at line 207 of file pt.c.

#define PT_WRITING   8

Definition at line 209 of file pt.c.

#define STAT_BUSY   0x00080

Definition at line 181 of file pt.c.

#define STAT_DRQ   0x00008

Definition at line 177 of file pt.c.

#define STAT_ECC   0x00004

Definition at line 176 of file pt.c.

#define STAT_ERR   0x00001

Definition at line 174 of file pt.c.

#define STAT_INDEX   0x00002

Definition at line 175 of file pt.c.

#define STAT_READY   0x00040

Definition at line 180 of file pt.c.

#define STAT_SEEK   0x00010

Definition at line 178 of file pt.c.

#define STAT_SENSE   0x1f000

Definition at line 182 of file pt.c.

#define STAT_WRERR   0x00020

Definition at line 179 of file pt.c.

Function Documentation

MODULE_LICENSE ( "GPL"  )
module_param ( verbose  ,
bool  ,
 
)
module_param ( major  ,
int  ,
 
)
module_param ( name  ,
charp  ,
 
)
module_param_array ( drive0  ,
int  ,
NULL  ,
 
)
module_param_array ( drive1  ,
int  ,
NULL  ,
 
)
module_param_array ( drive2  ,
int  ,
NULL  ,
 
)
module_param_array ( drive3  ,
int  ,
NULL  ,
 
)