Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
osst.c File Reference
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/mtio.h>
#include <linux/ioctl.h>
#include <linux/fcntl.h>
#include <linux/spinlock.h>
#include <linux/vmalloc.h>
#include <linux/blkdev.h>
#include <linux/moduleparam.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <asm/dma.h>
#include <scsi/scsi.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_driver.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_ioctl.h>
#include "st.h"
#include "osst.h"
#include "osst_options.h"
#include "osst_detect.h"

Go to the source code of this file.

Data Structures

struct  osst_dev_parm
 

Macros

#define OSST_FW_NEED_POLL_MIN   10601 /*(107A)*/
 
#define OSST_FW_NEED_POLL_MAX   10704 /*(108D)*/
 
#define OSST_FW_NEED_POLL(x, d)   ((x) >= OSST_FW_NEED_POLL_MIN && (x) <= OSST_FW_NEED_POLL_MAX && d->host->this_id != 7)
 
#define DEBUG   0
 
#define OSST_DEB_MSG   KERN_NOTICE
 
#define ST_KILOBYTE   1024
 
#define OSST_BUFFER_SIZE   (OSST_BUFFER_BLOCKS * ST_KILOBYTE)
 
#define OSST_WRITE_THRESHOLD   (OSST_WRITE_THRESHOLD_BLOCKS * ST_KILOBYTE)
 
#define MAX_RETRIES   0
 
#define NO_TAPE   NOT_READY
 
#define OSST_WAIT_POSITION_COMPLETE   (HZ > 200 ? HZ / 200 : 1)
 
#define OSST_WAIT_WRITE_COMPLETE   (HZ / 12)
 
#define OSST_WAIT_LONG_WRITE_COMPLETE   (HZ / 2)
 
#define OSST_TIMEOUT   (200 * HZ)
 
#define OSST_LONG_TIMEOUT   (1800 * HZ)
 
#define TAPE_NR(x)   (iminor(x) & ~(-1 << ST_MODE_SHIFT))
 
#define TAPE_MODE(x)   ((iminor(x) & ST_MODE_MASK) >> ST_MODE_SHIFT)
 
#define TAPE_REWIND(x)   ((iminor(x) & 0x80) == 0)
 
#define TAPE_IS_RAW(x)   (TAPE_MODE(x) & (ST_NBR_MODES >> 1))
 
#define SET_DENS_AND_BLK   0x10001
 
#define OSST_POLL_PER_SEC   10
 
#define OSST_FRAME_SHIFT   6
 
#define OSST_SECTOR_SHIFT   9
 
#define OSST_SECTOR_MASK   0x03F
 

Functions

 __setup ("osst=", osst_setup)
 
 DEVICE_ATTR (ADR_rev, S_IRUGO, osst_adr_rev_show, NULL)
 
 DEVICE_ATTR (media_version, S_IRUGO, osst_linux_media_version_show, NULL)
 
 DEVICE_ATTR (capacity, S_IRUGO, osst_capacity_show, NULL)
 
 DEVICE_ATTR (BOT_frame, S_IRUGO, osst_first_data_ppos_show, NULL)
 
 DEVICE_ATTR (EOD_frame, S_IRUGO, osst_eod_frame_ppos_show, NULL)
 
 DEVICE_ATTR (file_count, S_IRUGO, osst_filemark_cnt_show, NULL)
 
 module_init (init_osst)
 
 module_exit (exit_osst)
 

Macro Definition Documentation

#define DEBUG   0

Definition at line 60 of file osst.c.

#define MAX_RETRIES   0

Definition at line 131 of file osst.c.

#define NO_TAPE   NOT_READY

Definition at line 133 of file osst.c.

#define OSST_BUFFER_SIZE   (OSST_BUFFER_BLOCKS * ST_KILOBYTE)

Definition at line 114 of file osst.c.

#define OSST_DEB_MSG   KERN_NOTICE

Definition at line 65 of file osst.c.

#define OSST_FRAME_SHIFT   6

Definition at line 1370 of file osst.c.

#define OSST_FW_NEED_POLL (   x,
  d 
)    ((x) >= OSST_FW_NEED_POLL_MIN && (x) <= OSST_FW_NEED_POLL_MAX && d->host->this_id != 7)

Definition at line 32 of file osst.c.

#define OSST_FW_NEED_POLL_MAX   10704 /*(108D)*/

Definition at line 31 of file osst.c.

#define OSST_FW_NEED_POLL_MIN   10601 /*(107A)*/

Definition at line 30 of file osst.c.

#define OSST_LONG_TIMEOUT   (1800 * HZ)

Definition at line 140 of file osst.c.

#define OSST_POLL_PER_SEC   10

Definition at line 914 of file osst.c.

#define OSST_SECTOR_MASK   0x03F

Definition at line 1372 of file osst.c.

#define OSST_SECTOR_SHIFT   9

Definition at line 1371 of file osst.c.

#define OSST_TIMEOUT   (200 * HZ)

Definition at line 139 of file osst.c.

#define OSST_WAIT_LONG_WRITE_COMPLETE   (HZ / 2)

Definition at line 137 of file osst.c.

#define OSST_WAIT_POSITION_COMPLETE   (HZ > 200 ? HZ / 200 : 1)

Definition at line 135 of file osst.c.

#define OSST_WAIT_WRITE_COMPLETE   (HZ / 12)

Definition at line 136 of file osst.c.

#define OSST_WRITE_THRESHOLD   (OSST_WRITE_THRESHOLD_BLOCKS * ST_KILOBYTE)

Definition at line 115 of file osst.c.

#define SET_DENS_AND_BLK   0x10001

Definition at line 149 of file osst.c.

#define ST_KILOBYTE   1024

Definition at line 75 of file osst.c.

#define TAPE_IS_RAW (   x)    (TAPE_MODE(x) & (ST_NBR_MODES >> 1))

Definition at line 145 of file osst.c.

#define TAPE_MODE (   x)    ((iminor(x) & ST_MODE_MASK) >> ST_MODE_SHIFT)

Definition at line 143 of file osst.c.

#define TAPE_NR (   x)    (iminor(x) & ~(-1 << ST_MODE_SHIFT))

Definition at line 142 of file osst.c.

#define TAPE_REWIND (   x)    ((iminor(x) & 0x80) == 0)

Definition at line 144 of file osst.c.

Function Documentation

__setup ( )
DEVICE_ATTR ( ADR_rev  ,
S_IRUGO  ,
osst_adr_rev_show  ,
NULL   
)
DEVICE_ATTR ( media_version  ,
S_IRUGO  ,
osst_linux_media_version_show  ,
NULL   
)
DEVICE_ATTR ( capacity  ,
S_IRUGO  ,
osst_capacity_show  ,
NULL   
)
DEVICE_ATTR ( BOT_frame  ,
S_IRUGO  ,
osst_first_data_ppos_show  ,
NULL   
)
DEVICE_ATTR ( EOD_frame  ,
S_IRUGO  ,
osst_eod_frame_ppos_show  ,
NULL   
)
DEVICE_ATTR ( file_count  ,
S_IRUGO  ,
osst_filemark_cnt_show  ,
NULL   
)
module_exit ( exit_osst  )
module_init ( init_osst  )