fdc.c (27513ca73b31d5371bd82aeed639895ae924ff6d) fdc.c (4b2af45f4ba1f8d8d5a56c4b18f29da6d08146e9)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Don Ahn.
7 *
8 * Copyright (c) 1993, 1994 by

--- 29 unchanged lines hidden (view full) ---

38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
43 * SUCH DAMAGE.
44 *
45 * from: @(#)fd.c 7.4 (Berkeley) 5/25/91
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Don Ahn.
7 *
8 * Copyright (c) 1993, 1994 by

--- 29 unchanged lines hidden (view full) ---

38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
43 * SUCH DAMAGE.
44 *
45 * from: @(#)fd.c 7.4 (Berkeley) 5/25/91
46 * $Id: fd.c,v 1.69 1995/11/04 17:07:17 bde Exp $
46 * $Id: fd.c,v 1.70 1995/11/18 07:48:11 bde Exp $
47 *
48 */
49
50#include "ft.h"
51#if NFT < 1
52#undef NFDC
53#endif
54#include "fd.h"

--- 29 unchanged lines hidden (view full) ---

84#include <i386/isa/ftreg.h>
85#endif
86#ifdef DEVFS
87#include <sys/devfsext.h>
88#endif
89
90static int fd_goaway(struct kern_devconf *, int);
91static int fdc_goaway(struct kern_devconf *, int);
47 *
48 */
49
50#include "ft.h"
51#if NFT < 1
52#undef NFDC
53#endif
54#include "fd.h"

--- 29 unchanged lines hidden (view full) ---

84#include <i386/isa/ftreg.h>
85#endif
86#ifdef DEVFS
87#include <sys/devfsext.h>
88#endif
89
90static int fd_goaway(struct kern_devconf *, int);
91static int fdc_goaway(struct kern_devconf *, int);
92static int
93fd_externalize(struct proc *, struct kern_devconf *, void *, size_t);
92static int fd_externalize(struct kern_devconf *, struct sysctl_req *);
94
95/*
96 * Templates for the kern_devconf structures used when we attach.
97 */
98static struct kern_devconf kdc_fd[NFD] = { {
99 0, 0, 0, /* filled in by kern_devconf.c */
100 "fd", 0, { MDDT_DISK, 0 },
101 fd_externalize, 0, fd_goaway, DISK_EXTERNALLEN,

--- 237 unchanged lines hidden (view full) ---

339};
340
341struct isa_device *fdcdevs[NFDC];
342
343/*
344 * Provide hw.devconf information.
345 */
346static int
93
94/*
95 * Templates for the kern_devconf structures used when we attach.
96 */
97static struct kern_devconf kdc_fd[NFD] = { {
98 0, 0, 0, /* filled in by kern_devconf.c */
99 "fd", 0, { MDDT_DISK, 0 },
100 fd_externalize, 0, fd_goaway, DISK_EXTERNALLEN,

--- 237 unchanged lines hidden (view full) ---

338};
339
340struct isa_device *fdcdevs[NFDC];
341
342/*
343 * Provide hw.devconf information.
344 */
345static int
347fd_externalize(struct proc *p, struct kern_devconf *kdc,
348 void *userp, size_t len)
346fd_externalize(struct kern_devconf *kdc, struct sysctl_req *req)
349{
347{
350 return disk_externalize(fd_data[kdc->kdc_unit].fdsu, userp, &len);
348 return disk_externalize(fd_data[kdc->kdc_unit].fdsu, req);
351}
352
353static int
349}
350
351static int
354fdc_externalize(struct proc *p, struct kern_devconf *kdc,
355 void *userp, size_t len)
356{
357 return isa_externalize(fdcdevs[kdc->kdc_unit], userp, &len);
358}
359
360static int
361fdc_err(fdcu_t fdcu, const char *s)
362{
363 fdc_data[fdcu].fdc_errs++;
364 if(s) {
365 if(fdc_data[fdcu].fdc_errs < FDC_ERRMAX)
366 printf("fdc%d: %s", fdcu, s);
367 else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX)
368 printf("fdc%d: too many errors, not logging any more\n",

--- 1544 unchanged lines hidden ---
352fdc_err(fdcu_t fdcu, const char *s)
353{
354 fdc_data[fdcu].fdc_errs++;
355 if(s) {
356 if(fdc_data[fdcu].fdc_errs < FDC_ERRMAX)
357 printf("fdc%d: %s", fdcu, s);
358 else if(fdc_data[fdcu].fdc_errs == FDC_ERRMAX)
359 printf("fdc%d: too many errors, not logging any more\n",

--- 1544 unchanged lines hidden ---