mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
From: Jim Babb <babb@sedhps01.mdc.com>
Date: Mon, 14 Feb 94 15:57:14 CST This adds a copyright to the fdc.h file and fixes a bug in re-tries during writes on a heavily loaded system.
This commit is contained in:
parent
01c28e0655
commit
a60eff2770
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=1161
6 changed files with 103 additions and 14 deletions
|
@ -35,7 +35,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $from: fd.c,v 1.18 1993/12/21 05:09:21 ache Exp $
|
||||
* $Id:$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -389,7 +389,7 @@ void fdstrategy(struct buf *bp)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
if ((fdu >= (NFD+NFT)) || (bp->b_blkno < 0)) {
|
||||
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
|
||||
printf("fdstrat: fdu = %d, blkno = %d, bcount = %d\n",
|
||||
fdu, bp->b_blkno, bp->b_bcount);
|
||||
pg("fd:error in fdstrategy");
|
||||
|
@ -1174,7 +1174,10 @@ fdioctl (dev, cmd, addr, flag, p)
|
|||
int error;
|
||||
|
||||
#if NFT > 0
|
||||
if (fd_data[FDUNIT(minor(dev))].fdc->flags & FDC_TAPE_BUSY)
|
||||
int type = FDTYPE(minor(dev));
|
||||
|
||||
/* check for a tape ioctl */
|
||||
if (type & F_TAPE_TYPE)
|
||||
return ftioctl(dev, cmd, addr, flag, p);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $from: fd.c,v 1.18 1993/12/21 05:09:21 ache Exp $
|
||||
* $Id:$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -389,7 +389,7 @@ void fdstrategy(struct buf *bp)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
if ((fdu >= (NFD+NFT)) || (bp->b_blkno < 0)) {
|
||||
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
|
||||
printf("fdstrat: fdu = %d, blkno = %d, bcount = %d\n",
|
||||
fdu, bp->b_blkno, bp->b_bcount);
|
||||
pg("fd:error in fdstrategy");
|
||||
|
@ -1174,7 +1174,10 @@ fdioctl (dev, cmd, addr, flag, p)
|
|||
int error;
|
||||
|
||||
#if NFT > 0
|
||||
if (fd_data[FDUNIT(minor(dev))].fdc->flags & FDC_TAPE_BUSY)
|
||||
int type = FDTYPE(minor(dev));
|
||||
|
||||
/* check for a tape ioctl */
|
||||
if (type & F_TAPE_TYPE)
|
||||
return ftioctl(dev, cmd, addr, flag, p);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,3 +1,40 @@
|
|||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id:$
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/***********************************************************************\
|
||||
* Per controller structure. *
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ft.c - QIC-40/80 floppy tape driver
|
||||
* $Id:$
|
||||
*
|
||||
*
|
||||
* 01/26/94 v0.3b - Jim Babb
|
||||
* Got rid of the hard coded device selection. Moved (some of) the
|
||||
|
@ -910,7 +912,7 @@ void async_read(ftu_t ftu, int from)
|
|||
#endif
|
||||
|
||||
/* Check for errors */
|
||||
if ((rddta[0] & 0xc0) == 0x40) {
|
||||
if ((rddta[0] & 0xc0) != 0x00) {
|
||||
if (rddta[1] & 0x04) {
|
||||
/* Probably wrong position */
|
||||
ft->lastpos = ft->xblk;
|
||||
|
@ -1020,16 +1022,16 @@ void async_write(ftu_t ftu, int from)
|
|||
#endif
|
||||
|
||||
/* Check for errors */
|
||||
if ((rddta[0] & 0xc0) == 0x40) {
|
||||
if ((rddta[0] & 0xc0) != 0x00) {
|
||||
if (rddta[1] & 0x04) {
|
||||
/* Probably wrong position */
|
||||
ft->lastpos = ft->xblk;
|
||||
ard_state = 0;
|
||||
awr_state = 0;
|
||||
goto restate;
|
||||
} else if (retries < 5) {
|
||||
/* Something happened -- try again */
|
||||
ft->lastpos = ft->xblk;
|
||||
ard_state = 0;
|
||||
awr_state = 0;
|
||||
retries++;
|
||||
goto restate;
|
||||
} else {
|
||||
|
@ -1695,8 +1697,12 @@ int qic_status(ftu_t ftu, int cmd, int nbits)
|
|||
int ftopen(dev_t dev, int arg2) {
|
||||
ftu_t ftu = FDUNIT(minor(dev));
|
||||
int type = FDTYPE(minor(dev));
|
||||
fdc_p fdc = ft_data[ftu].fdc;
|
||||
fdc_p fdc;
|
||||
|
||||
/* check bounds */
|
||||
if (ftu >= NFT)
|
||||
return(ENXIO);
|
||||
fdc = ft_data[ftu].fdc;
|
||||
/* check for controller already busy with tape */
|
||||
if (fdc->flags & FDC_TAPE_BUSY)
|
||||
return(EBUSY);
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $from: fd.c,v 1.18 1993/12/21 05:09:21 ache Exp $
|
||||
* $Id:$
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -389,7 +389,7 @@ void fdstrategy(struct buf *bp)
|
|||
return;
|
||||
}
|
||||
#endif
|
||||
if ((fdu >= (NFD+NFT)) || (bp->b_blkno < 0)) {
|
||||
if ((fdu >= NFD) || (bp->b_blkno < 0)) {
|
||||
printf("fdstrat: fdu = %d, blkno = %d, bcount = %d\n",
|
||||
fdu, bp->b_blkno, bp->b_bcount);
|
||||
pg("fd:error in fdstrategy");
|
||||
|
@ -1174,7 +1174,10 @@ fdioctl (dev, cmd, addr, flag, p)
|
|||
int error;
|
||||
|
||||
#if NFT > 0
|
||||
if (fd_data[FDUNIT(minor(dev))].fdc->flags & FDC_TAPE_BUSY)
|
||||
int type = FDTYPE(minor(dev));
|
||||
|
||||
/* check for a tape ioctl */
|
||||
if (type & F_TAPE_TYPE)
|
||||
return ftioctl(dev, cmd, addr, flag, p);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,3 +1,40 @@
|
|||
/*-
|
||||
* Copyright (c) 1990 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
|
||||
* $Id:$
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/***********************************************************************\
|
||||
* Per controller structure. *
|
||||
|
|
Loading…
Reference in a new issue