scd.c (58345) | scd.c (58934) |
---|---|
1/*- 2 * Copyright (c) 1995 Mikael Hybsch 3 * All rights reserved. 4 * 5 * Portions of this file are copied from mcd.c 6 * which has the following copyrights: 7 * 8 * Copyright 1993 by Holger Veit (data part) --- 27 unchanged lines hidden (view full) --- 36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 39 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 * 41 */ 42 43 | 1/*- 2 * Copyright (c) 1995 Mikael Hybsch 3 * All rights reserved. 4 * 5 * Portions of this file are copied from mcd.c 6 * which has the following copyrights: 7 * 8 * Copyright 1993 by Holger Veit (data part) --- 27 unchanged lines hidden (view full) --- 36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 39 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 * 41 */ 42 43 |
44/* $FreeBSD: head/sys/dev/scd/scd.c 58345 2000-03-20 10:44:49Z phk $ */ | 44/* $FreeBSD: head/sys/dev/scd/scd.c 58934 2000-04-02 15:24:56Z phk $ */ |
45 46/* Please send any comments to micke@dynas.se */ 47 48#define SCD_DEBUG 0 49 50#include "scd.h" 51#include <sys/param.h> 52#include <sys/systm.h> --- 267 unchanged lines hidden (view full) --- 320 321 XDEBUG(2, ("scd%d: DEBUG: strategy: block=%ld, bcount=%ld\n", 322 unit, (long)bp->b_blkno, bp->b_bcount)); 323 324 if (unit >= NSCD || bp->b_blkno < 0 || (bp->b_bcount % SCDBLKSIZE)) { 325 printf("scd%d: strategy failure: blkno = %ld, bcount = %ld\n", 326 unit, (long)bp->b_blkno, bp->b_bcount); 327 bp->b_error = EINVAL; | 45 46/* Please send any comments to micke@dynas.se */ 47 48#define SCD_DEBUG 0 49 50#include "scd.h" 51#include <sys/param.h> 52#include <sys/systm.h> --- 267 unchanged lines hidden (view full) --- 320 321 XDEBUG(2, ("scd%d: DEBUG: strategy: block=%ld, bcount=%ld\n", 322 unit, (long)bp->b_blkno, bp->b_bcount)); 323 324 if (unit >= NSCD || bp->b_blkno < 0 || (bp->b_bcount % SCDBLKSIZE)) { 325 printf("scd%d: strategy failure: blkno = %ld, bcount = %ld\n", 326 unit, (long)bp->b_blkno, bp->b_bcount); 327 bp->b_error = EINVAL; |
328 bp->b_flags |= B_ERROR; | 328 bp->b_ioflags |= BIO_ERROR; |
329 goto bad; 330 } 331 332 /* if device invalidated (e.g. media change, door open), error */ 333 if (!(cd->flags & SCDVALID)) { 334 printf("scd%d: media changed\n", unit); 335 bp->b_error = EIO; 336 goto bad; --- 25 unchanged lines hidden (view full) --- 362 bufqdisksort(&cd->head, bp); 363 splx(s); 364 365 /* now check whether we can perform processing */ 366 scd_start(unit); 367 return; 368 369bad: | 329 goto bad; 330 } 331 332 /* if device invalidated (e.g. media change, door open), error */ 333 if (!(cd->flags & SCDVALID)) { 334 printf("scd%d: media changed\n", unit); 335 bp->b_error = EIO; 336 goto bad; --- 25 unchanged lines hidden (view full) --- 362 bufqdisksort(&cd->head, bp); 363 splx(s); 364 365 /* now check whether we can perform processing */ 366 scd_start(unit); 367 return; 368 369bad: |
370 bp->b_flags |= B_ERROR; | 370 bp->b_ioflags |= BIO_ERROR; |
371done: 372 bp->b_resid = bp->b_bcount; 373 biodone(bp); 374 return; 375} 376 377static void 378scd_start(int unit) --- 659 unchanged lines hidden (view full) --- 1038 if (mbx->retry-- > 0) { 1039 printf("scd%d: retrying ...\n",unit); 1040 state = SCD_S_BEGIN1; 1041 goto loop; 1042 } 1043harderr: 1044 /* invalidate the buffer */ 1045 bp->b_error = EIO; | 371done: 372 bp->b_resid = bp->b_bcount; 373 biodone(bp); 374 return; 375} 376 377static void 378scd_start(int unit) --- 659 unchanged lines hidden (view full) --- 1038 if (mbx->retry-- > 0) { 1039 printf("scd%d: retrying ...\n",unit); 1040 state = SCD_S_BEGIN1; 1041 goto loop; 1042 } 1043harderr: 1044 /* invalidate the buffer */ 1045 bp->b_error = EIO; |
1046 bp->b_flags |= B_ERROR; | 1046 bp->b_ioflags |= BIO_ERROR; |
1047 bp->b_resid = bp->b_bcount; 1048 biodone(bp); 1049 1050 cd->flags &= ~SCDMBXBSY; 1051 scd_start(mbx->unit); 1052 return; 1053 1054changed: --- 498 unchanged lines hidden --- | 1047 bp->b_resid = bp->b_bcount; 1048 biodone(bp); 1049 1050 cd->flags &= ~SCDMBXBSY; 1051 scd_start(mbx->unit); 1052 return; 1053 1054changed: --- 498 unchanged lines hidden --- |