1 /* Driver for SCM Microsystems USB-ATAPI cable 2 * Header File 3 * 4 * $Id: shuttle_usbat.h,v 1.5 2000/09/17 14:44:52 groovyjava Exp $ 5 * 6 * Current development and maintenance by: 7 * (c) 2000 Robert Baruch (autophile@dol.net) 8 * 9 * See scm.c for more explanation 10 * 11 * This program is free software; you can redistribute it and/or modify it 12 * under the terms of the GNU General Public License as published by the 13 * Free Software Foundation; either version 2, or (at your option) any 14 * later version. 15 * 16 * This program is distributed in the hope that it will be useful, but 17 * WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 * General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License along 22 * with this program; if not, write to the Free Software Foundation, Inc., 23 * 675 Mass Ave, Cambridge, MA 02139, USA. 24 */ 25 26 #ifndef _USB_SHUTTLE_USBAT_H 27 #define _USB_SHUTTLE_USBAT_H 28 29 #define USBAT_EPP_PORT 0x10 30 #define USBAT_EPP_REGISTER 0x30 31 #define USBAT_ATA 0x40 32 #define USBAT_ISA 0x50 33 34 /* SCM User I/O Data registers */ 35 36 #define USBAT_UIO_EPAD 0x80 // Enable Peripheral Control Signals 37 #define USBAT_UIO_CDT 0x40 // Card Detect (Read Only) 38 // CDT = ACKD & !UI1 & !UI0 39 #define USBAT_UIO_1 0x20 // I/O 1 40 #define USBAT_UIO_0 0x10 // I/O 0 41 #define USBAT_UIO_EPP_ATA 0x08 // 1=EPP mode, 0=ATA mode 42 #define USBAT_UIO_UI1 0x04 // Input 1 43 #define USBAT_UIO_UI0 0x02 // Input 0 44 #define USBAT_UIO_INTR_ACK 0x01 // Interrupt (ATA & ISA)/Acknowledge (EPP) 45 46 /* SCM User I/O Enable registers */ 47 48 #define USBAT_UIO_DRVRST 0x80 // Reset Peripheral 49 #define USBAT_UIO_ACKD 0x40 // Enable Card Detect 50 #define USBAT_UIO_OE1 0x20 // I/O 1 set=output/clr=input 51 // If ACKD=1, set OE1 to 1 also. 52 #define USBAT_UIO_OE0 0x10 // I/O 0 set=output/clr=input 53 #define USBAT_UIO_ADPRST 0x01 // Reset SCM chip 54 55 /* USBAT-specific commands */ 56 57 extern int usbat_read(struct us_data *us, unsigned char access, 58 unsigned char reg, unsigned char *content); 59 extern int usbat_write(struct us_data *us, unsigned char access, 60 unsigned char reg, unsigned char content); 61 extern int usbat_read_block(struct us_data *us, unsigned char access, 62 unsigned char reg, unsigned char *content, unsigned short len, 63 int use_sg); 64 extern int usbat_write_block(struct us_data *us, unsigned char access, 65 unsigned char reg, unsigned char *content, unsigned short len, 66 int use_sg, int minutes); 67 extern int usbat_multiple_write(struct us_data *us, unsigned char access, 68 unsigned char *registers, unsigned char *data_out, 69 unsigned short num_registers); 70 extern int usbat_read_user_io(struct us_data *us, unsigned char *data_flags); 71 extern int usbat_write_user_io(struct us_data *us, 72 unsigned char enable_flags, unsigned char data_flags); 73 74 /* HP 8200e stuff */ 75 76 extern int hp8200e_transport(Scsi_Cmnd *srb, struct us_data *us); 77 extern int init_8200e(struct us_data *us); 78 79 #endif 80