1 #ifndef _FTAPE_H 2 #define _FTAPE_H 3 4 /* 5 * Copyright (C) 1994-1995 Bas Laarhoven. 6 7 This program is free software; you can redistribute it and/or modify 8 it under the terms of the GNU General Public License as published by 9 the Free Software Foundation; either version 2, or (at your option) 10 any later version. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program; see the file COPYING. If not, write to 19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 20 21 * 22 $Source: /home/bas/distr/ftape-2.03b/RCS/ftape.h,v $ 23 $Author: bas $ 24 * 25 $Revision: 1.18 $ 26 $Date: 1995/05/06 16:11:53 $ 27 $State: Beta $ 28 * 29 * This file contains global definitions, typedefs and macro's 30 * for the QIC-40/80 floppy-tape driver for Linux. 31 */ 32 33 #include <linux/sched.h> 34 #include <linux/mm.h> 35 36 #define SECTOR(x) (x+1) /* sector offset into real sector */ 37 #define SECTOR_SIZE (1024) 38 #define SECTORS_PER_SEGMENT (32) 39 #define BUFF_SIZE (SECTORS_PER_SEGMENT * SECTOR_SIZE) 40 #define FTAPE_UNIT (ftape_unit & 3) 41 #define RQM_DELAY (12) 42 #define MILLISECOND (1) 43 #define SECOND (1000) 44 #define FOREVER (-1) 45 #ifndef HZ 46 # error "HZ undefined." 47 #endif 48 #define MSPT (SECOND / HZ) /* milliseconds per tick */ 49 50 /* This defines the number of retries that the driver will allow 51 * before giving up (and letting a higher level handle the error). 52 */ 53 #ifdef TESTING 54 # define SOFT_RETRIES 1 /* number of low level retries */ 55 # define RETRIES_ON_ECC_ERROR 3 /* ecc error when correcting segment */ 56 #else 57 # define SOFT_RETRIES 6 /* number of low level retries (triple) */ 58 # define RETRIES_ON_ECC_ERROR 3 /* ecc error when correcting segment */ 59 #endif 60 /* some useful macro's 61 */ 62 #define ABS(a) ((a) < 0 ? -(a) : (a)) 63 #define NR_ITEMS(x) (sizeof(x)/ sizeof(*x)) 64 65 typedef unsigned char byte; 66 67 extern int ftape_init(void); 68 69 #endif 70