| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: fd.c,v 1.96 2010/03/16 12:53:17 he Exp $ */ | | 1 | /* $NetBSD: fd.c,v 1.97 2010/08/08 18:24:34 chs Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998, 2003, 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 2003, 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Charles M. Hannum. | | 8 | * by Charles M. Hannum. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -71,27 +71,27 @@ | | | @@ -71,27 +71,27 @@ |
71 | * use ..." clause: | | 71 | * use ..." clause: |
72 | * | | 72 | * |
73 | * Copyright (c) 1993, 1994 by | | 73 | * Copyright (c) 1993, 1994 by |
74 | * jc@irbs.UUCP (John Capo) | | 74 | * jc@irbs.UUCP (John Capo) |
75 | * vak@zebub.msk.su (Serge Vakulenko) | | 75 | * vak@zebub.msk.su (Serge Vakulenko) |
76 | * ache@astral.msk.su (Andrew A. Chernov) | | 76 | * ache@astral.msk.su (Andrew A. Chernov) |
77 | * | | 77 | * |
78 | * Copyright (c) 1993, 1994, 1995 by | | 78 | * Copyright (c) 1993, 1994, 1995 by |
79 | * joerg_wunsch@uriah.sax.de (Joerg Wunsch) | | 79 | * joerg_wunsch@uriah.sax.de (Joerg Wunsch) |
80 | * dufault@hda.com (Peter Dufault) | | 80 | * dufault@hda.com (Peter Dufault) |
81 | */ | | 81 | */ |
82 | | | 82 | |
83 | #include <sys/cdefs.h> | | 83 | #include <sys/cdefs.h> |
84 | __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.96 2010/03/16 12:53:17 he Exp $"); | | 84 | __KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.97 2010/08/08 18:24:34 chs Exp $"); |
85 | | | 85 | |
86 | #include "rnd.h" | | 86 | #include "rnd.h" |
87 | #include "opt_ddb.h" | | 87 | #include "opt_ddb.h" |
88 | | | 88 | |
89 | /* | | 89 | /* |
90 | * XXX This driver should be properly MI'd some day, but this allows us | | 90 | * XXX This driver should be properly MI'd some day, but this allows us |
91 | * XXX to eliminate a lot of code duplication for now. | | 91 | * XXX to eliminate a lot of code duplication for now. |
92 | */ | | 92 | */ |
93 | #if !defined(alpha) && !defined(algor) && !defined(atari) && \ | | 93 | #if !defined(alpha) && !defined(algor) && !defined(atari) && \ |
94 | !defined(bebox) && !defined(evbmips) && !defined(i386) && \ | | 94 | !defined(bebox) && !defined(evbmips) && !defined(i386) && \ |
95 | !defined(prep) && !defined(sandpoint) && !defined(x86_64) && \ | | 95 | !defined(prep) && !defined(sandpoint) && !defined(x86_64) && \ |
96 | !defined(mvmeppc) && !defined(ofppc) | | 96 | !defined(mvmeppc) && !defined(ofppc) |
97 | #error platform not supported by this driver, yet | | 97 | #error platform not supported by this driver, yet |
| @@ -1615,27 +1615,27 @@ fdformat(dev_t dev, struct ne7_fd_formb | | | @@ -1615,27 +1615,27 @@ fdformat(dev_t dev, struct ne7_fd_formb |
1615 | bp->b_proc = l->l_proc; | | 1615 | bp->b_proc = l->l_proc; |
1616 | bp->b_dev = dev; | | 1616 | bp->b_dev = dev; |
1617 | | | 1617 | |
1618 | /* | | 1618 | /* |
1619 | * calculate a fake blkno, so fdstrategy() would initiate a | | 1619 | * calculate a fake blkno, so fdstrategy() would initiate a |
1620 | * seek to the requested cylinder | | 1620 | * seek to the requested cylinder |
1621 | */ | | 1621 | */ |
1622 | bp->b_blkno = (finfo->cyl * (type->sectrac * type->heads) | | 1622 | bp->b_blkno = (finfo->cyl * (type->sectrac * type->heads) |
1623 | + finfo->head * type->sectrac) * FDC_BSIZE / DEV_BSIZE; | | 1623 | + finfo->head * type->sectrac) * FDC_BSIZE / DEV_BSIZE; |
1624 | | | 1624 | |
1625 | bp->b_bcount = sizeof(struct fd_idfield_data) * finfo->fd_formb_nsecs; | | 1625 | bp->b_bcount = sizeof(struct fd_idfield_data) * finfo->fd_formb_nsecs; |
1626 | bp->b_data = (void *)finfo; | | 1626 | bp->b_data = (void *)finfo; |
1627 | | | 1627 | |
1628 | #ifdef DEBUG | | 1628 | #ifdef FD_DEBUG |
1629 | printf("fdformat: blkno %" PRIx64 " count %x\n", | | 1629 | printf("fdformat: blkno %" PRIx64 " count %x\n", |
1630 | bp->b_blkno, bp->b_bcount); | | 1630 | bp->b_blkno, bp->b_bcount); |
1631 | #endif | | 1631 | #endif |
1632 | | | 1632 | |
1633 | /* now do the format */ | | 1633 | /* now do the format */ |
1634 | fdstrategy(bp); | | 1634 | fdstrategy(bp); |
1635 | | | 1635 | |
1636 | /* ...and wait for it to complete */ | | 1636 | /* ...and wait for it to complete */ |
1637 | rv = biowait(bp); | | 1637 | rv = biowait(bp); |
1638 | putiobuf(bp); | | 1638 | putiobuf(bp); |
1639 | return rv; | | 1639 | return rv; |
1640 | } | | 1640 | } |
1641 | | | 1641 | |