vpoio.h revision 38061
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 * 2638061Smsmith * $Id: vpoio.h,v 1.1.2.3 1998/06/14 15:37:21 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 4438061Smsmith#define VP0_ENOPORT 9 4538061Smsmith#define VP0_EINITFAILED 10 4638061Smsmith#define VP0_EINTR 12 4738061Smsmith 4838061Smsmith#define VP0_EOTHER 13 4938061Smsmith 5038061Smsmith#define VP0_OPENNINGS 1 5138061Smsmith 5238061Smsmith/* 5338061Smsmith * Data structure used during microsequence execution 5438061Smsmith * when characters are received in nibble mode 5538061Smsmith */ 5638061Smsmithstruct vpo_nibble { 5738061Smsmith char h; /* most significant nibble */ 5838061Smsmith char l; /* less significant nibble */ 5938061Smsmith}; 6038061Smsmith 6138061Smsmithstruct vpoio_data { 6238061Smsmith unsigned short int vpo_unit; 6338061Smsmith 6438061Smsmith struct vpo_nibble vpo_nibble; 6538061Smsmith 6638061Smsmith /* each device must have its own nibble inbyte microsequence */ 6738061Smsmith struct ppb_microseq *vpo_nibble_inbyte_msq; 6838061Smsmith 6938061Smsmith struct ppb_device vpo_dev; 7038061Smsmith}; 7138061Smsmith 7238061Smsmith#define vpoio_set_unit(vpo,unit) ((vpo)->vpo_unit = unit) 7338061Smsmith 7438061Smsmithstruct ppb_device *vpoio_probe(struct ppb_data *ppb, struct vpoio_data *vpo); 7538061Smsmith 7638061Smsmithint vpoio_attach(struct vpoio_data *vpo); 7738061Smsmithint vpoio_detect(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 8438061Smsmith#endif 85