vpoio.h revision 39134
138061Smsmith/*- 238061Smsmith * Copyright (c) 1998 Nicolas Souchu 338061Smsmith * All rights reserved. 438061Smsmith * 538061Smsmith * Redistribution and use in source and binary forms, with or without 638061Smsmith * modification, are permitted provided that the following conditions 738061Smsmith * are met: 838061Smsmith * 1. Redistributions of source code must retain the above copyright 938061Smsmith * notice, this list of conditions and the following disclaimer. 1038061Smsmith * 2. Redistributions in binary form must reproduce the above copyright 1138061Smsmith * notice, this list of conditions and the following disclaimer in the 1238061Smsmith * documentation and/or other materials provided with the distribution. 1338061Smsmith * 1438061Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1538061Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1638061Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1738061Smsmith * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1838061Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1938061Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2038061Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2138061Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2238061Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2338061Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2438061Smsmith * SUCH DAMAGE. 2538061Smsmith * 2639134Snsouch * $Id: vpoio.h,v 1.1.2.2 1998/06/14 14:37:43 son Exp $ 2738061Smsmith * 2838061Smsmith */ 2938061Smsmith#ifndef __VP0IO_H 3038061Smsmith#define __VP0IO_H 3138061Smsmith 3238061Smsmith/* 3338061Smsmith * The ZIP drive cannot act as an initiator. 3438061Smsmith */ 3538061Smsmith#define VP0_INITIATOR 0x7 3638061Smsmith 3738061Smsmith#define VP0_ESELECT_TIMEOUT 1 3838061Smsmith#define VP0_ECMD_TIMEOUT 2 3938061Smsmith#define VP0_ECONNECT 3 4038061Smsmith#define VP0_ESTATUS_TIMEOUT 4 4138061Smsmith#define VP0_EDATA_OVERFLOW 5 4238061Smsmith#define VP0_EDISCONNECT 6 4338061Smsmith#define VP0_EPPDATA_TIMEOUT 7 4439134Snsouch#define VP0_ENEGOCIATE 8 4538061Smsmith#define VP0_ENOPORT 9 4638061Smsmith#define VP0_EINITFAILED 10 4738061Smsmith#define VP0_EINTR 12 4838061Smsmith 4938061Smsmith#define VP0_EOTHER 13 5038061Smsmith 5138061Smsmith#define VP0_OPENNINGS 1 5238061Smsmith 5338061Smsmith/* 5438061Smsmith * Data structure used during microsequence execution 5538061Smsmith * when characters are received in nibble mode 5638061Smsmith */ 5738061Smsmithstruct vpo_nibble { 5838061Smsmith char h; /* most significant nibble */ 5938061Smsmith char l; /* less significant nibble */ 6038061Smsmith}; 6138061Smsmith 6238061Smsmithstruct vpoio_data { 6338061Smsmith unsigned short int vpo_unit; 6438061Smsmith 6538061Smsmith struct vpo_nibble vpo_nibble; 6638061Smsmith 6738061Smsmith /* each device must have its own nibble inbyte microsequence */ 6838061Smsmith struct ppb_microseq *vpo_nibble_inbyte_msq; 6938061Smsmith 7038061Smsmith struct ppb_device vpo_dev; 7138061Smsmith}; 7238061Smsmith 7338061Smsmith#define vpoio_set_unit(vpo,unit) ((vpo)->vpo_unit = unit) 7438061Smsmith 7538061Smsmithstruct ppb_device *vpoio_probe(struct ppb_data *ppb, struct vpoio_data *vpo); 7638061Smsmith 7738061Smsmithint vpoio_attach(struct vpoio_data *vpo); 7838061Smsmithint vpoio_reset_bus(struct vpoio_data *vpo); 7938061Smsmith 8038061Smsmithint vpoio_do_scsi(struct vpoio_data *vpo, int host, int target, char *command, 8138061Smsmith int clen, char *buffer, int blen, int *result, int *count, 8238061Smsmith int *ret); 8338061Smsmith 8439134Snsouchstruct ppb_device *imm_probe(struct ppb_data *ppb, struct vpoio_data *vpo); 8539134Snsouch 8639134Snsouchint imm_attach(struct vpoio_data *vpo); 8739134Snsouchint imm_reset_bus(struct vpoio_data *vpo); 8839134Snsouch 8939134Snsouchint imm_do_scsi(struct vpoio_data *vpo, int host, int target, char *command, 9039134Snsouch int clen, char *buffer, int blen, int *result, int *count, 9139134Snsouch int *ret); 9239134Snsouch 9338061Smsmith#endif 94