1998-11-05 22:47:20 +03:00
|
|
|
/* $NetBSD: mscp_subr.c,v 1.10 1998/11/05 19:47:20 ragge Exp $ */
|
1996-07-02 00:41:30 +04:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
|
|
|
|
* Copyright (c) 1988 Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This code is derived from software contributed to Berkeley by
|
|
|
|
* Chris Torek.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
* 3. All advertising materials mentioning features or use of this software
|
|
|
|
* must display the following acknowledgement:
|
|
|
|
* This product includes software developed by the University of
|
|
|
|
* California, Berkeley and its contributors.
|
|
|
|
* 4. Neither the name of the University nor the names of its contributors
|
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* @(#)mscp.c 7.5 (Berkeley) 12/16/90
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* MSCP generic driver routines
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/device.h>
|
1996-07-11 03:35:58 +04:00
|
|
|
#include <sys/buf.h>
|
1997-01-11 14:20:31 +03:00
|
|
|
#include <sys/systm.h>
|
|
|
|
#include <sys/proc.h>
|
1996-07-02 00:41:30 +04:00
|
|
|
|
|
|
|
#include <machine/sid.h>
|
|
|
|
|
|
|
|
#include <vax/mscp/mscp.h>
|
|
|
|
#include <vax/mscp/mscpreg.h>
|
|
|
|
#include <vax/mscp/mscpvar.h>
|
|
|
|
|
|
|
|
#include "ra.h"
|
1996-07-11 03:35:58 +04:00
|
|
|
#include "mt.h"
|
1996-07-02 00:41:30 +04:00
|
|
|
|
1998-02-08 17:03:45 +03:00
|
|
|
#define b_forw b_hash.le_next
|
1996-07-02 00:41:30 +04:00
|
|
|
|
1998-01-24 17:16:11 +03:00
|
|
|
int mscp_match __P((struct device *, struct cfdata *, void *));
|
1996-07-02 00:41:30 +04:00
|
|
|
void mscp_attach __P((struct device *, struct device *, void *));
|
1998-02-08 17:03:45 +03:00
|
|
|
void mscp_start __P((struct mscp_softc *));
|
1996-07-02 00:41:30 +04:00
|
|
|
int mscp_init __P((struct mscp_softc *));
|
|
|
|
void mscp_initds __P((struct mscp_softc *));
|
|
|
|
int mscp_waitstep __P((struct mscp_softc *, int, int));
|
|
|
|
|
|
|
|
struct cfattach mscpbus_ca = {
|
|
|
|
sizeof(struct mscp_softc), mscp_match, mscp_attach
|
|
|
|
};
|
|
|
|
|
|
|
|
struct mscp slavereply;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This function is for delay during init. Some MSCP clone card (Dilog)
|
|
|
|
* can't handle fast read from its registers, and therefore need
|
|
|
|
* a delay between them.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define DELAYTEN 1000
|
|
|
|
int
|
|
|
|
mscp_waitstep(mi, mask, result)
|
|
|
|
struct mscp_softc *mi;
|
|
|
|
int mask, result;
|
|
|
|
{
|
|
|
|
int status = 1;
|
|
|
|
|
|
|
|
if ((*mi->mi_sa & mask) != result) {
|
|
|
|
volatile int count = 0;
|
|
|
|
while ((*mi->mi_sa & mask) != result) {
|
|
|
|
DELAY(10000);
|
|
|
|
count += 1;
|
|
|
|
if (count > DELAYTEN)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (count > DELAYTEN)
|
|
|
|
status = 0;
|
|
|
|
}
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
mscp_match(parent, match, aux)
|
|
|
|
struct device *parent;
|
1998-01-24 17:16:11 +03:00
|
|
|
struct cfdata *match;
|
|
|
|
void *aux;
|
1996-07-02 00:41:30 +04:00
|
|
|
{
|
|
|
|
struct mscp_attach_args *ma = aux;
|
|
|
|
|
1998-02-08 17:03:45 +03:00
|
|
|
#if NRA || NRX
|
1996-07-02 00:41:30 +04:00
|
|
|
if (ma->ma_type & MSCPBUS_DISK)
|
|
|
|
return 1;
|
|
|
|
#endif
|
|
|
|
#if NMT
|
|
|
|
if (ma->ma_type & MSCPBUS_TAPE)
|
|
|
|
return 1;
|
|
|
|
#endif
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
void
|
|
|
|
mscp_attach(parent, self, aux)
|
|
|
|
struct device *parent, *self;
|
|
|
|
void *aux;
|
|
|
|
{
|
|
|
|
struct mscp_attach_args *ma = aux;
|
|
|
|
struct mscp_softc *mi = (void *)self;
|
1998-02-08 17:03:45 +03:00
|
|
|
volatile struct mscp *mp;
|
1996-07-02 00:41:30 +04:00
|
|
|
volatile int i;
|
|
|
|
int timeout, next = 0;
|
|
|
|
|
|
|
|
mi->mi_mc = ma->ma_mc;
|
|
|
|
mi->mi_me = NULL;
|
|
|
|
mi->mi_type = ma->ma_type;
|
|
|
|
mi->mi_uuda = ma->ma_uuda;
|
|
|
|
mi->mi_uda = ma->ma_uda;
|
|
|
|
mi->mi_ip = ma->ma_ip;
|
|
|
|
mi->mi_sa = ma->ma_sa;
|
|
|
|
mi->mi_sw = ma->ma_sw;
|
|
|
|
mi->mi_ivec = ma->ma_ivec;
|
1996-07-11 23:33:50 +04:00
|
|
|
mi->mi_adapnr = ma->ma_adapnr;
|
|
|
|
mi->mi_ctlrnr = ma->ma_ctlrnr;
|
1996-07-02 00:41:30 +04:00
|
|
|
*ma->ma_softc = mi;
|
|
|
|
/*
|
|
|
|
* Go out to init the bus, so that we can give commands
|
|
|
|
* to its devices.
|
|
|
|
*/
|
1998-02-08 17:03:45 +03:00
|
|
|
mi->mi_cmd.mri_size = NCMD;
|
|
|
|
mi->mi_cmd.mri_desc = mi->mi_uda->mp_ca.ca_cmddsc;
|
|
|
|
mi->mi_cmd.mri_ring = mi->mi_uda->mp_cmd;
|
|
|
|
mi->mi_rsp.mri_size = NRSP;
|
|
|
|
mi->mi_rsp.mri_desc = mi->mi_uda->mp_ca.ca_rspdsc;
|
|
|
|
mi->mi_rsp.mri_ring = mi->mi_uda->mp_rsp;
|
1996-07-02 00:41:30 +04:00
|
|
|
mi->mi_actf = (void *)&mi->mi_actf; /* Circular wait queue */
|
|
|
|
mi->mi_actb = (void *)&mi->mi_actf;
|
|
|
|
|
|
|
|
if (mscp_init(mi)) {
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("%s: can't init, controller hung\n",
|
1996-07-02 00:41:30 +04:00
|
|
|
mi->mi_dev.dv_xname);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if NRA
|
|
|
|
if (ma->ma_type & MSCPBUS_DISK) {
|
|
|
|
extern struct mscp_device ra_device;
|
|
|
|
|
|
|
|
mi->mi_me = &ra_device;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#if NMT
|
|
|
|
if (ma->ma_type & MSCPBUS_TAPE) {
|
|
|
|
extern struct mscp_device mt_device;
|
|
|
|
|
|
|
|
mi->mi_me = &mt_device;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
/*
|
|
|
|
* Go out and search for sub-units on this MSCP bus,
|
|
|
|
* and call config_found for each found.
|
|
|
|
*/
|
|
|
|
findunit:
|
|
|
|
mp = mscp_getcp(mi, MSCP_DONTWAIT);
|
|
|
|
if (mp == NULL)
|
|
|
|
panic("mscpattach: no packets");
|
|
|
|
mp->mscp_opcode = M_OP_GETUNITST;
|
|
|
|
mp->mscp_unit = next;
|
|
|
|
mp->mscp_modifier = M_GUM_NEXTUNIT;
|
|
|
|
*mp->mscp_addr |= MSCP_OWN | MSCP_INT;
|
|
|
|
slavereply.mscp_opcode = 0;
|
|
|
|
|
|
|
|
i = *mi->mi_ip; /* Kick off polling */
|
|
|
|
mp = &slavereply;
|
|
|
|
timeout = 1000;
|
|
|
|
while (timeout-- > 0) {
|
|
|
|
DELAY(10000);
|
|
|
|
if (mp->mscp_opcode)
|
|
|
|
goto gotit;
|
|
|
|
}
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("%s: no response to Get Unit Status request\n",
|
1996-07-02 00:41:30 +04:00
|
|
|
mi->mi_dev.dv_xname);
|
|
|
|
return;
|
|
|
|
|
|
|
|
gotit: /*
|
|
|
|
* Got a slave response. If the unit is there, use it.
|
|
|
|
*/
|
|
|
|
switch (mp->mscp_status & M_ST_MASK) {
|
|
|
|
|
1998-02-08 17:03:45 +03:00
|
|
|
case M_ST_SUCCESS: /* worked */
|
|
|
|
case M_ST_AVAILABLE: /* found another drive */
|
|
|
|
break; /* use it */
|
1996-07-02 00:41:30 +04:00
|
|
|
|
|
|
|
case M_ST_OFFLINE:
|
|
|
|
/*
|
|
|
|
* Figure out why it is off line. It may be because
|
1998-02-08 17:03:45 +03:00
|
|
|
* it is nonexistent, or because it is spun down, or
|
|
|
|
* for some other reason.
|
|
|
|
*/
|
|
|
|
switch (mp->mscp_status & ~M_ST_MASK) {
|
|
|
|
|
|
|
|
case M_OFFLINE_UNKNOWN:
|
|
|
|
/*
|
|
|
|
* No such drive, and there are none with
|
|
|
|
* higher unit numbers either, if we are
|
|
|
|
* using M_GUM_NEXTUNIT.
|
|
|
|
*/
|
1996-07-11 03:35:58 +04:00
|
|
|
mi->mi_ierr = 3;
|
1998-02-08 17:03:45 +03:00
|
|
|
return;
|
|
|
|
|
|
|
|
case M_OFFLINE_UNMOUNTED:
|
|
|
|
/*
|
|
|
|
* The drive is not spun up. Use it anyway.
|
|
|
|
*
|
|
|
|
* N.B.: this seems to be a common occurrance
|
|
|
|
* after a power failure. The first attempt
|
|
|
|
* to bring it on line seems to spin it up
|
|
|
|
* (and thus takes several minutes). Perhaps
|
|
|
|
* we should note here that the on-line may
|
|
|
|
* take longer than usual.
|
|
|
|
*/
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/*
|
|
|
|
* In service, or something else equally unusable.
|
|
|
|
*/
|
|
|
|
printf("%s: unit %d off line: ", mi->mi_dev.dv_xname,
|
|
|
|
mp->mscp_unit);
|
|
|
|
mscp_printevent((struct mscp *)mp);
|
1996-07-02 00:41:30 +04:00
|
|
|
next++;
|
1998-02-08 17:03:45 +03:00
|
|
|
goto findunit;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
printf("%s: unable to get unit status: ", mi->mi_dev.dv_xname);
|
|
|
|
mscp_printevent((struct mscp *)mp);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* If we get a lower number, we have circulated around all
|
1996-07-02 00:41:30 +04:00
|
|
|
* devices and are finished, otherwise try to find next unit.
|
1996-07-11 03:35:58 +04:00
|
|
|
* We shouldn't ever get this, it's a workaround.
|
1998-02-08 17:03:45 +03:00
|
|
|
*/
|
|
|
|
if (mp->mscp_unit < next)
|
|
|
|
return;
|
1996-07-02 00:41:30 +04:00
|
|
|
|
|
|
|
next = mp->mscp_unit + 1;
|
|
|
|
goto findunit;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The ctlr gets initialised, normally after boot but may also be
|
|
|
|
* done if the ctlr gets in an unknown state. Returns 1 if init
|
|
|
|
* fails, 0 otherwise.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
mscp_init(mi)
|
|
|
|
struct mscp_softc *mi;
|
|
|
|
{
|
|
|
|
struct mscp *mp;
|
|
|
|
volatile int i;
|
|
|
|
int status, count;
|
1997-01-11 14:20:31 +03:00
|
|
|
unsigned int j = 0;
|
1996-07-02 00:41:30 +04:00
|
|
|
|
1998-02-08 17:03:45 +03:00
|
|
|
/*
|
|
|
|
* While we are thinking about it, reset the next command
|
|
|
|
* and response indicies.
|
|
|
|
*/
|
1996-07-02 00:41:30 +04:00
|
|
|
mi->mi_cmd.mri_next = 0;
|
|
|
|
mi->mi_rsp.mri_next = 0;
|
|
|
|
|
|
|
|
mi->mi_flags |= MSC_IGNOREINTR;
|
1997-01-11 14:20:31 +03:00
|
|
|
|
|
|
|
if ((mi->mi_type & MSCPBUS_KDB) == 0)
|
1998-02-08 17:03:45 +03:00
|
|
|
*mi->mi_ip = 0; /* Kick off */
|
1997-01-11 14:20:31 +03:00
|
|
|
|
1996-07-02 00:41:30 +04:00
|
|
|
status = mscp_waitstep(mi, MP_STEP1, MP_STEP1);/* Wait to it wakes up */
|
|
|
|
if (status == 0)
|
|
|
|
return 1; /* Init failed */
|
|
|
|
if (*mi->mi_sa & MP_ERR) {
|
|
|
|
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* step1 */
|
|
|
|
*mi->mi_sw = MP_ERR | (NCMDL2 << 11) | (NRSPL2 << 8) |
|
|
|
|
MP_IE | (mi->mi_ivec >> 2);
|
|
|
|
status = mscp_waitstep(mi, STEP1MASK, STEP1GOOD);
|
|
|
|
if (status == 0) {
|
|
|
|
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* step2 */
|
|
|
|
*mi->mi_sw = (int)&mi->mi_uuda->mp_ca.ca_rspdsc[0] |
|
1997-01-11 14:20:31 +03:00
|
|
|
(vax_cputype == VAX_780 || vax_cputype == VAX_8600 ? MP_PI : 0);
|
1996-07-02 00:41:30 +04:00
|
|
|
status = mscp_waitstep(mi, STEP2MASK, STEP2GOOD(mi->mi_ivec >> 2));
|
1998-02-08 17:03:45 +03:00
|
|
|
if (status == 0) {
|
|
|
|
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
|
|
|
|
return 1;
|
|
|
|
}
|
1996-07-02 00:41:30 +04:00
|
|
|
|
|
|
|
/* step3 */
|
|
|
|
*mi->mi_sw = ((int)&mi->mi_uuda->mp_ca.ca_rspdsc[0]) >> 16;
|
|
|
|
status = mscp_waitstep(mi, STEP3MASK, STEP3GOOD);
|
1998-02-08 17:03:45 +03:00
|
|
|
if (status == 0) {
|
|
|
|
(*mi->mi_mc->mc_saerror)(mi->mi_dev.dv_parent, 0);
|
|
|
|
return 1;
|
|
|
|
}
|
1996-07-02 00:41:30 +04:00
|
|
|
i = *mi->mi_sa & 0377;
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(": version %d model %d\n", i & 15, i >> 4);
|
1996-07-02 00:41:30 +04:00
|
|
|
|
1998-02-08 17:03:45 +03:00
|
|
|
#define BURST 4 /* XXX */
|
1996-07-02 00:41:30 +04:00
|
|
|
if (mi->mi_type & MSCPBUS_UDA) {
|
|
|
|
*mi->mi_sw = MP_GO | (BURST - 1) << 2;
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("%s: DMA burst size set to %d\n",
|
1996-07-02 00:41:30 +04:00
|
|
|
mi->mi_dev.dv_xname, BURST);
|
|
|
|
}
|
1996-07-11 03:35:58 +04:00
|
|
|
*mi->mi_sw = MP_GO;
|
1996-07-02 00:41:30 +04:00
|
|
|
|
|
|
|
mscp_initds(mi);
|
|
|
|
mi->mi_flags &= ~MSC_IGNOREINTR;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Set up all necessary info in the bus softc struct, get a
|
|
|
|
* mscp packet and set characteristics for this controller.
|
|
|
|
*/
|
|
|
|
mi->mi_credits = MSCP_MINCREDITS + 1;
|
|
|
|
mp = mscp_getcp(mi, MSCP_DONTWAIT);
|
1996-07-11 03:35:58 +04:00
|
|
|
|
1996-07-02 00:41:30 +04:00
|
|
|
mi->mi_credits = 0;
|
|
|
|
mp->mscp_opcode = M_OP_SETCTLRC;
|
1996-07-11 03:35:58 +04:00
|
|
|
mp->mscp_unit = mp->mscp_modifier = mp->mscp_flags =
|
|
|
|
mp->mscp_sccc.sccc_version = mp->mscp_sccc.sccc_hosttimo =
|
|
|
|
mp->mscp_sccc.sccc_time = mp->mscp_sccc.sccc_time1 =
|
|
|
|
mp->mscp_sccc.sccc_errlgfl = 0;
|
1996-07-02 00:41:30 +04:00
|
|
|
mp->mscp_sccc.sccc_ctlrflags = M_CF_ATTN | M_CF_MISC | M_CF_THIS;
|
|
|
|
*mp->mscp_addr |= MSCP_OWN | MSCP_INT;
|
|
|
|
i = *mi->mi_ip;
|
|
|
|
|
1998-02-08 17:03:45 +03:00
|
|
|
count = 0;
|
|
|
|
while (count < DELAYTEN) {
|
1998-11-05 22:47:20 +03:00
|
|
|
if (((volatile int)mi->mi_flags & MSC_READY) != 0)
|
1998-02-08 17:03:45 +03:00
|
|
|
break;
|
1996-07-11 03:35:58 +04:00
|
|
|
if ((j = *mi->mi_sa) & MP_ERR)
|
|
|
|
goto out;
|
1998-02-08 17:03:45 +03:00
|
|
|
DELAY(10000);
|
|
|
|
count += 1;
|
|
|
|
}
|
1996-07-02 00:41:30 +04:00
|
|
|
if (count == DELAYTEN) {
|
1996-07-11 03:35:58 +04:00
|
|
|
out:
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("%s: couldn't set ctlr characteristics, sa=%x\n",
|
1996-07-11 03:35:58 +04:00
|
|
|
mi->mi_dev.dv_xname, j);
|
1996-07-02 00:41:30 +04:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialise the various data structures that control the mscp protocol.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
mscp_initds(mi)
|
|
|
|
struct mscp_softc *mi;
|
|
|
|
{
|
|
|
|
struct mscp_pack *uud = mi->mi_uuda;
|
|
|
|
struct mscp_pack *ud = mi->mi_uda;
|
|
|
|
struct mscp *mp;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0, mp = ud->mp_rsp; i < NRSP; i++, mp++) {
|
|
|
|
ud->mp_ca.ca_rspdsc[i] = MSCP_OWN | MSCP_INT |
|
|
|
|
(long)&uud->mp_rsp[i].mscp_cmdref;
|
|
|
|
mp->mscp_addr = &ud->mp_ca.ca_rspdsc[i];
|
|
|
|
mp->mscp_msglen = MSCP_MSGLEN;
|
|
|
|
}
|
|
|
|
for (i = 0, mp = ud->mp_cmd; i < NCMD; i++, mp++) {
|
|
|
|
ud->mp_ca.ca_cmddsc[i] = MSCP_INT |
|
|
|
|
(long)&uud->mp_cmd[i].mscp_cmdref;
|
|
|
|
mp->mscp_addr = &ud->mp_ca.ca_cmddsc[i];
|
|
|
|
mp->mscp_msglen = MSCP_MSGLEN;
|
1996-07-11 03:35:58 +04:00
|
|
|
if (mi->mi_type & MSCPBUS_TAPE)
|
|
|
|
mp->mscp_vcid = 1;
|
1996-07-02 00:41:30 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
mscp_intr(mi)
|
|
|
|
struct mscp_softc *mi;
|
|
|
|
{
|
|
|
|
struct mscp_pack *ud = mi->mi_uda;
|
|
|
|
|
|
|
|
if (mi->mi_flags & MSC_IGNOREINTR)
|
|
|
|
return;
|
1998-02-08 17:03:45 +03:00
|
|
|
/*
|
|
|
|
* Check for response and command ring transitions.
|
|
|
|
*/
|
|
|
|
if (ud->mp_ca.ca_rspint) {
|
|
|
|
ud->mp_ca.ca_rspint = 0;
|
|
|
|
mscp_dorsp(mi);
|
|
|
|
}
|
|
|
|
if (ud->mp_ca.ca_cmdint) {
|
|
|
|
ud->mp_ca.ca_cmdint = 0;
|
|
|
|
MSCP_DOCMD(mi);
|
|
|
|
}
|
1997-01-11 14:20:31 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* If there are any not-yet-handled requeset, try them now.
|
|
|
|
* XXX - We handles them (erroneous) in last-in first-handled order.
|
|
|
|
* Must we fix this???
|
|
|
|
*/
|
|
|
|
while (mi->mi_w) {
|
|
|
|
struct buf *bp = mi->mi_w;
|
|
|
|
|
|
|
|
mi->mi_w = (void *)bp->b_actb;
|
|
|
|
mscp_strategy(bp, (struct device *)mi);
|
|
|
|
if (mi->mi_w == bp)
|
|
|
|
break;
|
|
|
|
}
|
1996-07-02 00:41:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
mscp_print(aux, name)
|
|
|
|
void *aux;
|
1997-01-11 14:20:31 +03:00
|
|
|
const char *name;
|
1996-07-02 00:41:30 +04:00
|
|
|
{
|
1998-02-08 17:03:45 +03:00
|
|
|
struct drive_attach_args *da = aux;
|
|
|
|
struct mscp *mp = da->da_mp;
|
|
|
|
int type = mp->mscp_guse.guse_mediaid;
|
|
|
|
|
|
|
|
if (name) {
|
|
|
|
printf("%c%c", MSCP_MID_CHAR(2, type), MSCP_MID_CHAR(1, type));
|
|
|
|
if (MSCP_MID_ECH(0, type))
|
|
|
|
printf("%c", MSCP_MID_CHAR(0, type));
|
|
|
|
printf("%d at %s drive %d", MSCP_MID_NUM(type), name,
|
|
|
|
mp->mscp_unit);
|
|
|
|
}
|
1996-07-02 00:41:30 +04:00
|
|
|
return UNCONF;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* common strategy routine for all types of MSCP devices.
|
|
|
|
* bp is the current buf, dp is the drive queue.
|
|
|
|
*/
|
|
|
|
void
|
1997-01-11 14:20:31 +03:00
|
|
|
mscp_strategy(bp, usc)
|
|
|
|
struct buf *bp;
|
1996-07-02 00:41:30 +04:00
|
|
|
struct device *usc;
|
|
|
|
{
|
|
|
|
struct mscp_softc *mi = (void *)usc;
|
|
|
|
struct mscp *mp;
|
1997-01-11 14:20:31 +03:00
|
|
|
int s = spl6();
|
1996-07-02 00:41:30 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Ok; we are ready to try to start a xfer. Get a MSCP packet
|
|
|
|
* and try to start...
|
|
|
|
*/
|
|
|
|
if ((mp = mscp_getcp(mi, MSCP_DONTWAIT)) == NULL) {
|
|
|
|
if (mi->mi_credits > MSCP_MINCREDITS)
|
1997-01-11 14:20:31 +03:00
|
|
|
printf("%s: command ring too small\n",
|
1996-07-02 00:41:30 +04:00
|
|
|
mi->mi_dev.dv_parent->dv_xname);
|
1997-01-11 14:20:31 +03:00
|
|
|
/*
|
|
|
|
* By some (strange) reason we didn't get a MSCP packet.
|
|
|
|
* Put it on queue and wait for free packets.
|
|
|
|
*/
|
|
|
|
(void *)bp->b_actb = mi->mi_w;
|
|
|
|
mi->mi_w = bp;
|
|
|
|
splx(s);
|
|
|
|
return;
|
1996-07-02 00:41:30 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
1997-01-11 14:20:31 +03:00
|
|
|
* Set up the MSCP packet and ask the ctlr to start.
|
1996-07-02 00:41:30 +04:00
|
|
|
*/
|
|
|
|
mp->mscp_opcode = (bp->b_flags & B_READ) ? M_OP_READ : M_OP_WRITE;
|
|
|
|
(*mi->mi_me->me_fillin)(bp, mp);
|
1997-01-11 14:20:31 +03:00
|
|
|
(void *)bp->b_actb = mp; /* b_actb is unused, save mscp packet here */
|
|
|
|
(*mi->mi_mc->mc_go)(mi->mi_dev.dv_parent, bp);
|
1996-07-02 00:41:30 +04:00
|
|
|
splx(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
1997-01-11 14:20:31 +03:00
|
|
|
mscp_dgo(mi, buffer, info, bp)
|
1996-07-02 00:41:30 +04:00
|
|
|
struct mscp_softc *mi;
|
|
|
|
long buffer, info;
|
1997-01-11 14:20:31 +03:00
|
|
|
struct buf *bp;
|
1996-07-02 00:41:30 +04:00
|
|
|
{
|
|
|
|
volatile int i;
|
|
|
|
struct mscp *mp;
|
|
|
|
|
1998-02-08 17:03:45 +03:00
|
|
|
/*
|
|
|
|
* Fill in the MSCP packet and move the buffer to the I/O wait queue.
|
|
|
|
*/
|
1997-01-11 14:20:31 +03:00
|
|
|
mp = (void *)bp->b_actb;
|
1996-07-02 00:41:30 +04:00
|
|
|
|
1997-01-11 14:20:31 +03:00
|
|
|
mp->mscp_seq.seq_buffer = buffer;
|
1996-07-02 00:41:30 +04:00
|
|
|
|
1996-07-11 03:35:58 +04:00
|
|
|
_insque(&bp->b_actf, &mi->mi_actf);
|
1996-07-02 00:41:30 +04:00
|
|
|
|
|
|
|
bp->b_resid = info;
|
|
|
|
mp->mscp_cmdref = (long) bp;
|
|
|
|
*mp->mscp_addr |= MSCP_OWN | MSCP_INT;
|
1997-01-11 14:20:31 +03:00
|
|
|
|
1996-07-02 00:41:30 +04:00
|
|
|
i = *mi->mi_ip;
|
|
|
|
}
|
|
|
|
|
1997-01-11 14:20:31 +03:00
|
|
|
#ifdef DIAGNOSTIC
|
1996-07-02 00:41:30 +04:00
|
|
|
/*
|
|
|
|
* Dump the entire contents of an MSCP packet in hex. Mainly useful
|
|
|
|
* for debugging....
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
mscp_hexdump(mp)
|
|
|
|
register struct mscp *mp;
|
|
|
|
{
|
|
|
|
register long *p = (long *) mp;
|
|
|
|
register int i = mp->mscp_msglen;
|
|
|
|
|
|
|
|
if (i > 256) /* sanity */
|
|
|
|
i = 256;
|
|
|
|
i /= sizeof (*p); /* ASSUMES MULTIPLE OF sizeof(long) */
|
|
|
|
while (--i >= 0)
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("0x%x ", (int)*p++);
|
|
|
|
printf("\n");
|
1996-07-02 00:41:30 +04:00
|
|
|
}
|
1997-01-11 14:20:31 +03:00
|
|
|
#endif
|
1996-07-02 00:41:30 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* MSCP error reporting
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Messages for the various subcodes.
|
|
|
|
*/
|
|
|
|
static char unknown_msg[] = "unknown subcode";
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Success (0)
|
|
|
|
*/
|
|
|
|
static char *succ_msgs[] = {
|
|
|
|
"normal", /* 0 */
|
|
|
|
"spin down ignored", /* 1 = Spin-Down Ignored */
|
|
|
|
"still connected", /* 2 = Still Connected */
|
|
|
|
unknown_msg,
|
|
|
|
"dup. unit #", /* 4 = Duplicate Unit Number */
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
"already online", /* 8 = Already Online */
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
"still online", /* 16 = Still Online */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Invalid Command (1)
|
|
|
|
*/
|
|
|
|
static char *icmd_msgs[] = {
|
|
|
|
"invalid msg length", /* 0 = Invalid Message Length */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Command Aborted (2)
|
|
|
|
*/
|
|
|
|
/* none known */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Unit Offline (3)
|
|
|
|
*/
|
|
|
|
static char *offl_msgs[] = {
|
|
|
|
"unknown drive", /* 0 = Unknown, or online to other ctlr */
|
|
|
|
"not mounted", /* 1 = Unmounted, or RUN/STOP at STOP */
|
|
|
|
"inoperative", /* 2 = Unit Inoperative */
|
|
|
|
unknown_msg,
|
|
|
|
"duplicate", /* 4 = Duplicate Unit Number */
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
"in diagnosis", /* 8 = Disabled by FS or diagnostic */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Unit Available (4)
|
|
|
|
*/
|
|
|
|
/* none known */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Media Format Error (5)
|
|
|
|
*/
|
|
|
|
static char *media_fmt_msgs[] = {
|
|
|
|
"fct unread - edc", /* 0 = FCT unreadable */
|
|
|
|
"invalid sector header",/* 1 = Invalid Sector Header */
|
|
|
|
"not 512 sectors", /* 2 = Not 512 Byte Sectors */
|
|
|
|
"not formatted", /* 3 = Not Formatted */
|
|
|
|
"fct ecc", /* 4 = FCT ECC */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Write Protected (6)
|
|
|
|
* N.B.: Code 6 subcodes are 7 bits higher than other subcodes
|
|
|
|
* (i.e., bits 12-15).
|
|
|
|
*/
|
|
|
|
static char *wrprot_msgs[] = {
|
|
|
|
unknown_msg,
|
|
|
|
"software", /* 1 = Software Write Protect */
|
|
|
|
"hardware", /* 2 = Hardware Write Protect */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Compare Error (7)
|
|
|
|
*/
|
|
|
|
/* none known */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Data Error (8)
|
|
|
|
*/
|
|
|
|
static char *data_msgs[] = {
|
|
|
|
"forced error", /* 0 = Forced Error (software) */
|
|
|
|
unknown_msg,
|
|
|
|
"header compare", /* 2 = Header Compare Error */
|
|
|
|
"sync timeout", /* 3 = Sync Timeout Error */
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
unknown_msg,
|
|
|
|
"uncorrectable ecc", /* 7 = Uncorrectable ECC */
|
|
|
|
"1 symbol ecc", /* 8 = 1 bit ECC */
|
|
|
|
"2 symbol ecc", /* 9 = 2 bit ECC */
|
|
|
|
"3 symbol ecc", /* 10 = 3 bit ECC */
|
|
|
|
"4 symbol ecc", /* 11 = 4 bit ECC */
|
|
|
|
"5 symbol ecc", /* 12 = 5 bit ECC */
|
|
|
|
"6 symbol ecc", /* 13 = 6 bit ECC */
|
|
|
|
"7 symbol ecc", /* 14 = 7 bit ECC */
|
|
|
|
"8 symbol ecc", /* 15 = 8 bit ECC */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Host Buffer Access Error (9)
|
|
|
|
*/
|
|
|
|
static char *host_buffer_msgs[] = {
|
|
|
|
unknown_msg,
|
|
|
|
"odd xfer addr", /* 1 = Odd Transfer Address */
|
|
|
|
"odd xfer count", /* 2 = Odd Transfer Count */
|
|
|
|
"non-exist. memory", /* 3 = Non-Existent Memory */
|
|
|
|
"memory parity", /* 4 = Memory Parity Error */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Controller Error (10)
|
|
|
|
*/
|
|
|
|
static char *cntlr_msgs[] = {
|
|
|
|
unknown_msg,
|
|
|
|
"serdes overrun", /* 1 = Serialiser/Deserialiser Overrun */
|
|
|
|
"edc", /* 2 = Error Detection Code? */
|
|
|
|
"inconsistant internal data struct",/* 3 = Internal Error */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Subcodes for Drive Error (11)
|
|
|
|
*/
|
|
|
|
static char *drive_msgs[] = {
|
|
|
|
unknown_msg,
|
|
|
|
"sdi command timeout", /* 1 = SDI Command Timeout */
|
|
|
|
"ctlr detected protocol",/* 2 = Controller Detected Protocol Error */
|
|
|
|
"positioner", /* 3 = Positioner Error */
|
|
|
|
"lost rd/wr ready", /* 4 = Lost R/W Ready Error */
|
|
|
|
"drive clock dropout", /* 5 = Lost Drive Clock */
|
|
|
|
"lost recvr ready", /* 6 = Lost Receiver Ready */
|
1998-02-08 17:03:45 +03:00
|
|
|
"drive detected error", /* 7 = Drive Error */
|
1996-07-02 00:41:30 +04:00
|
|
|
"ctlr detected pulse or parity",/* 8 = Pulse or Parity Error */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The following table correlates message codes with the
|
|
|
|
* decoding strings.
|
|
|
|
*/
|
|
|
|
struct code_decode {
|
|
|
|
char *cdc_msg;
|
|
|
|
int cdc_nsubcodes;
|
|
|
|
char **cdc_submsgs;
|
|
|
|
} code_decode[] = {
|
1998-02-08 17:03:45 +03:00
|
|
|
#define SC(m) sizeof (m) / sizeof (m[0]), m
|
1996-07-02 00:41:30 +04:00
|
|
|
{"success", SC(succ_msgs)},
|
|
|
|
{"invalid command", SC(icmd_msgs)},
|
|
|
|
{"command aborted", 0, 0},
|
|
|
|
{"unit offline", SC(offl_msgs)},
|
|
|
|
{"unit available", 0, 0},
|
|
|
|
{"media format error", SC(media_fmt_msgs)},
|
|
|
|
{"write protected", SC(wrprot_msgs)},
|
|
|
|
{"compare error", 0, 0},
|
|
|
|
{"data error", SC(data_msgs)},
|
|
|
|
{"host buffer access error", SC(host_buffer_msgs)},
|
|
|
|
{"controller error", SC(cntlr_msgs)},
|
|
|
|
{"drive error", SC(drive_msgs)},
|
|
|
|
#undef SC
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Print the decoded error event from an MSCP error datagram.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
mscp_printevent(mp)
|
|
|
|
struct mscp *mp;
|
|
|
|
{
|
|
|
|
register int event = mp->mscp_event;
|
|
|
|
register struct code_decode *cdc;
|
|
|
|
int c, sc;
|
|
|
|
char *cm, *scm;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The code is the lower six bits of the event number (aka
|
|
|
|
* status). If that is 6 (write protect), the subcode is in
|
|
|
|
* bits 12-15; otherwise, it is in bits 5-11.
|
|
|
|
* I WONDER WHAT THE OTHER BITS ARE FOR. IT SURE WOULD BE
|
|
|
|
* NICE IF DEC SOLD DOCUMENTATION FOR THEIR OWN CONTROLLERS.
|
|
|
|
*/
|
|
|
|
c = event & M_ST_MASK;
|
|
|
|
sc = (c != 6 ? event >> 5 : event >> 12) & 0x7ff;
|
|
|
|
if (c >= sizeof code_decode / sizeof code_decode[0])
|
|
|
|
cm = "- unknown code", scm = "??";
|
|
|
|
else {
|
|
|
|
cdc = &code_decode[c];
|
|
|
|
cm = cdc->cdc_msg;
|
|
|
|
if (sc >= cdc->cdc_nsubcodes)
|
|
|
|
scm = unknown_msg;
|
|
|
|
else
|
|
|
|
scm = cdc->cdc_submsgs[sc];
|
|
|
|
}
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(" %s (%s) (code %d, subcode %d)\n", cm, scm, c, sc);
|
1996-07-02 00:41:30 +04:00
|
|
|
}
|
|
|
|
|
1996-07-11 03:35:58 +04:00
|
|
|
static char *codemsg[16] = {
|
|
|
|
"lbn", "code 1", "code 2", "code 3",
|
|
|
|
"code 4", "code 5", "rbn", "code 7",
|
|
|
|
"code 8", "code 9", "code 10", "code 11",
|
|
|
|
"code 12", "code 13", "code 14", "code 15"
|
|
|
|
};
|
1996-07-02 00:41:30 +04:00
|
|
|
/*
|
|
|
|
* Print the code and logical block number for an error packet.
|
|
|
|
* THIS IS PROBABLY PECULIAR TO DISK DRIVES. IT SURE WOULD BE
|
|
|
|
* NICE IF DEC SOLD DOCUMENTATION FOR THEIR OWN CONTROLLERS.
|
|
|
|
*/
|
1996-07-11 03:35:58 +04:00
|
|
|
int
|
|
|
|
mscp_decodeerror(name, mp, mi)
|
1996-07-02 00:41:30 +04:00
|
|
|
char *name;
|
|
|
|
register struct mscp *mp;
|
1996-07-11 03:35:58 +04:00
|
|
|
struct mscp_softc *mi;
|
1996-07-02 00:41:30 +04:00
|
|
|
{
|
1996-07-11 03:35:58 +04:00
|
|
|
int issoft;
|
|
|
|
/*
|
|
|
|
* We will get three sdi errors of type 11 after autoconfig
|
|
|
|
* is finished; depending of searching for non-existing units.
|
|
|
|
* How can we avoid this???
|
|
|
|
*/
|
|
|
|
if (((mp->mscp_event & M_ST_MASK) == 11) && (mi->mi_ierr++ < 3))
|
|
|
|
return 1;
|
1996-07-02 00:41:30 +04:00
|
|
|
/*
|
|
|
|
* For bad blocks, mp->mscp_erd.erd_hdr identifies a code and
|
|
|
|
* the logical block number. Code 0 is a regular block; code 6
|
|
|
|
* is a replacement block. The remaining codes are currently
|
|
|
|
* undefined. The code is in the upper four bits of the header
|
|
|
|
* (bits 0-27 are the lbn).
|
|
|
|
*/
|
1996-07-11 03:35:58 +04:00
|
|
|
issoft = mp->mscp_flags & (M_LF_SUCC | M_LF_CONT);
|
1996-07-02 00:41:30 +04:00
|
|
|
#define BADCODE(h) (codemsg[(unsigned)(h) >> 28])
|
|
|
|
#define BADLBN(h) ((h) & 0xfffffff)
|
|
|
|
|
1996-10-13 07:29:05 +04:00
|
|
|
printf("%s: drive %d %s error datagram%s:", name, mp->mscp_unit,
|
1996-07-02 00:41:30 +04:00
|
|
|
issoft ? "soft" : "hard",
|
|
|
|
mp->mscp_flags & M_LF_CONT ? " (continuing)" : "");
|
|
|
|
switch (mp->mscp_format & 0377) {
|
|
|
|
|
|
|
|
case M_FM_CTLRERR: /* controller error */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case M_FM_BUSADDR: /* host memory access error */
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(" memory addr 0x%x:", (int)mp->mscp_erd.erd_busaddr);
|
1996-07-02 00:41:30 +04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case M_FM_DISKTRN:
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(" unit %d: level %d retry %d, %s %d:",
|
1996-07-02 00:41:30 +04:00
|
|
|
mp->mscp_unit,
|
|
|
|
mp->mscp_erd.erd_level, mp->mscp_erd.erd_retry,
|
|
|
|
BADCODE(mp->mscp_erd.erd_hdr),
|
|
|
|
(int)BADLBN(mp->mscp_erd.erd_hdr));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case M_FM_SDI:
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(" unit %d: %s %d:", mp->mscp_unit,
|
1996-07-02 00:41:30 +04:00
|
|
|
BADCODE(mp->mscp_erd.erd_hdr),
|
|
|
|
(int)BADLBN(mp->mscp_erd.erd_hdr));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case M_FM_SMLDSK:
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(" unit %d: small disk error, cyl %d:",
|
1996-07-02 00:41:30 +04:00
|
|
|
mp->mscp_unit, mp->mscp_erd.erd_sdecyl);
|
|
|
|
break;
|
|
|
|
|
1996-07-11 03:35:58 +04:00
|
|
|
case M_FM_TAPETRN:
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(" unit %d: tape transfer error, grp 0x%x event 0%o:",
|
1996-07-11 03:35:58 +04:00
|
|
|
mp->mscp_unit, mp->mscp_erd.erd_sdecyl, mp->mscp_event);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case M_FM_STIERR:
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(" unit %d: STI error, event 0%o:", mp->mscp_unit,
|
1996-07-11 03:35:58 +04:00
|
|
|
mp->mscp_event);
|
|
|
|
break;
|
|
|
|
|
1996-07-02 00:41:30 +04:00
|
|
|
default:
|
1996-10-13 07:29:05 +04:00
|
|
|
printf(" unit %d: unknown error, format 0x%x:",
|
1996-07-02 00:41:30 +04:00
|
|
|
mp->mscp_unit, mp->mscp_format);
|
|
|
|
}
|
|
|
|
mscp_printevent(mp);
|
1996-07-11 03:35:58 +04:00
|
|
|
return 0;
|
1996-07-02 00:41:30 +04:00
|
|
|
#undef BADCODE
|
|
|
|
#undef BADLBN
|
|
|
|
}
|