/*
* Copyright (C) 1996, 1997 Claus-Justus Heine
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
* $Source: /homes/cvs/ftape-stacked/ftape/zftape/zftape-ctl.c,v $
* $Revision: 1.2.6.2 $
* $Date: 1997/11/14 18:07:33 $
*
* This file contains the non-read/write zftape functions
* for the QIC-40/80/3010/3020 floppy-tape driver for Linux.
*/
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/fcntl.h>
#include <linux/zftape.h>
#include <asm/uaccess.h>
#include "../zftape/zftape-init.h"
#include "../zftape/zftape-eof.h"
#include "../zftape/zftape-ctl.h"
#include "../zftape/zftape-write.h"
#include "../zftape/zftape-read.h"
#include "../zftape/zftape-rw.h"
#include "../zftape/zftape-vtbl.h"
/* Global vars.
*/
int zft_write_protected; /* this is when cartridge rdonly or O_RDONLY */
int zft_header_read;
int zft_offline;
unsigned int zft_unit;
int zft_resid;
int zft_mt_compression;
/* Local vars.
*/
static int going_offline;
typedef int (mt_fun)(int *argptr);
typedef int (*mt_funp)(int *argptr);
typedef struct
{
mt_funp function;
unsigned offline : 1; /* op permitted if offline or no_tape */
unsigned write_protected : 1; /* op permitted if write-protected */
unsigned not_formatted : 1; /* op permitted if tape not formatted */
unsigned raw_mode : 1; /* op permitted if zft_mode == 0 */
unsigned need_idle_state : 1; /* need to call def_idle_state */
char *name;
} fun_entry;
static mt_fun mt_dummy, mt_reset, mt_fsr, mt_bsr, mt_rew, mt_offl,<