scd.c (37389) | scd.c (37618) |
---|---|
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/* $Id: scd.c,v 1.38 1998/06/08 09:47:36 bde Exp $ */ | 44/* $Id: scd.c,v 1.39 1998/07/04 22:30:17 julian Exp $ */ |
45 46/* Please send any comments to micke@dynas.se */ 47 48#define SCD_DEBUG 0 49 50#include "scd.h" 51#if NSCD > 0 52#include "opt_devfs.h" --- 276 unchanged lines hidden (view full) --- 329scdstrategy(struct buf *bp) 330{ 331 struct scd_data *cd; 332 int s; 333 int unit = scd_unit(bp->b_dev); 334 335 cd = scd_data + unit; 336 | 45 46/* Please send any comments to micke@dynas.se */ 47 48#define SCD_DEBUG 0 49 50#include "scd.h" 51#if NSCD > 0 52#include "opt_devfs.h" --- 276 unchanged lines hidden (view full) --- 329scdstrategy(struct buf *bp) 330{ 331 struct scd_data *cd; 332 int s; 333 int unit = scd_unit(bp->b_dev); 334 335 cd = scd_data + unit; 336 |
337 XDEBUG(2, ("scd%d: DEBUG: strategy: block=%ld, bcount=%ld\n", unit, bp->b_blkno, bp->b_bcount)); | 337 XDEBUG(2, ("scd%d: DEBUG: strategy: block=%ld, bcount=%ld\n", 338 unit, (long)bp->b_blkno, bp->b_bcount)); |
338 339 if (unit >= NSCD || bp->b_blkno < 0 || (bp->b_bcount % SCDBLKSIZE)) { 340 printf("scd%d: strategy failure: blkno = %ld, bcount = %ld\n", | 339 340 if (unit >= NSCD || bp->b_blkno < 0 || (bp->b_bcount % SCDBLKSIZE)) { 341 printf("scd%d: strategy failure: blkno = %ld, bcount = %ld\n", |
341 unit, bp->b_blkno, bp->b_bcount); | 342 unit, (long)bp->b_blkno, bp->b_bcount); |
342 bp->b_error = EINVAL; 343 bp->b_flags |= B_ERROR; 344 goto bad; 345 } 346 347 /* if device invalidated (e.g. media change, door open), error */ 348 if (!(cd->flags & SCDVALID)) { 349 printf("scd%d: media changed\n", unit); --- 82 unchanged lines hidden (view full) --- 432{ 433 struct scd_data *cd; 434 int unit,part; 435 436 unit = scd_unit(dev); 437 part = scd_part(dev); 438 cd = scd_data + unit; 439 | 343 bp->b_error = EINVAL; 344 bp->b_flags |= B_ERROR; 345 goto bad; 346 } 347 348 /* if device invalidated (e.g. media change, door open), error */ 349 if (!(cd->flags & SCDVALID)) { 350 printf("scd%d: media changed\n", unit); --- 82 unchanged lines hidden (view full) --- 433{ 434 struct scd_data *cd; 435 int unit,part; 436 437 unit = scd_unit(dev); 438 part = scd_part(dev); 439 cd = scd_data + unit; 440 |
440 XDEBUG(1, ("scd%d: ioctl: cmd=0x%x\n", unit, cmd)); | 441 XDEBUG(1, ("scd%d: ioctl: cmd=0x%lx\n", unit, cmd)); |
441 442 if (!(cd->flags & SCDVALID)) 443 return EIO; 444 445 switch (cmd) { 446 case DIOCSBAD: 447 return EINVAL; 448 case DIOCGDINFO: --- 46 unchanged lines hidden (view full) --- 495 return 0; 496 case CDIOCCLRDEBUG: 497#ifdef SCD_DEBUG 498 scd_debuglevel = 0; 499 500#endif 501 return 0; 502 default: | 442 443 if (!(cd->flags & SCDVALID)) 444 return EIO; 445 446 switch (cmd) { 447 case DIOCSBAD: 448 return EINVAL; 449 case DIOCGDINFO: --- 46 unchanged lines hidden (view full) --- 496 return 0; 497 case CDIOCCLRDEBUG: 498#ifdef SCD_DEBUG 499 scd_debuglevel = 0; 500 501#endif 502 return 0; 503 default: |
503 printf("scd%d: unsupported ioctl (cmd=0x%x)\n", unit, cmd); | 504 printf("scd%d: unsupported ioctl (cmd=0x%lx)\n", unit, cmd); |
504 return ENOTTY; 505 } 506} 507 508/*************************************************************** 509 * lower level of driver starts here 510 **************************************************************/ 511 --- 1073 unchanged lines hidden --- | 505 return ENOTTY; 506 } 507} 508 509/*************************************************************** 510 * lower level of driver starts here 511 **************************************************************/ 512 --- 1073 unchanged lines hidden --- |