Deleted Added
full compact
iir_ctrl.c (111815) iir_ctrl.c (114001)
1/* $FreeBSD: head/sys/dev/iir/iir_ctrl.c 111815 2003-03-03 12:15:54Z phk $ */
1/* $FreeBSD: head/sys/dev/iir/iir_ctrl.c 114001 2003-04-25 05:37:04Z scottl $ */
2/*
3 * Copyright (c) 2000-01 Intel Corporation
4 * All Rights Reserved
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

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

41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/endian.h>
45#include <sys/malloc.h>
46#include <sys/kernel.h>
47#include <sys/uio.h>
48#include <sys/conf.h>
2/*
3 * Copyright (c) 2000-01 Intel Corporation
4 * All Rights Reserved
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

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

41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/endian.h>
45#include <sys/malloc.h>
46#include <sys/kernel.h>
47#include <sys/uio.h>
48#include <sys/conf.h>
49#include <sys/disk.h>
49#include <sys/stat.h>
50#include <sys/stat.h>
50#include <sys/ioccom.h>
51#include <sys/disklabel.h>
51#include <machine/bus.h>
52#include <vm/vm.h>
53#include <vm/vm_kern.h>
54#include <vm/vm_extern.h>
55#include <vm/pmap.h>
56
57#include <dev/iir/iir.h>
58

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

73 .d_close = iir_close,
74 .d_read = iir_read,
75 .d_write = iir_write,
76 .d_ioctl = iir_ioctl,
77 .d_name = "iir",
78 .d_maj = CDEV_MAJOR,
79};
80
52#include <machine/bus.h>
53#include <vm/vm.h>
54#include <vm/vm_kern.h>
55#include <vm/vm_extern.h>
56#include <vm/pmap.h>
57
58#include <dev/iir/iir.h>
59

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

74 .d_close = iir_close,
75 .d_read = iir_read,
76 .d_write = iir_write,
77 .d_ioctl = iir_ioctl,
78 .d_name = "iir",
79 .d_maj = CDEV_MAJOR,
80};
81
82/*
83static int iir_devsw_installed = 0;
84*/
81#ifndef SDEV_PER_HBA
82static int sdev_made = 0;
83#endif
84extern int gdt_cnt;
85extern char ostype[];
86extern char osrelease[];
87extern gdt_statist_t gdt_stat;
88
89/*
90 * Given a controller number,
91 * make a special device and return the dev_t
92 */
93dev_t
94gdt_make_dev(int unit)
95{
96 dev_t dev;
97
98#ifdef SDEV_PER_HBA
99 dev = make_dev(&iir_cdevsw, hba2minor(unit), UID_ROOT, GID_OPERATOR,
85#ifndef SDEV_PER_HBA
86static int sdev_made = 0;
87#endif
88extern int gdt_cnt;
89extern char ostype[];
90extern char osrelease[];
91extern gdt_statist_t gdt_stat;
92
93/*
94 * Given a controller number,
95 * make a special device and return the dev_t
96 */
97dev_t
98gdt_make_dev(int unit)
99{
100 dev_t dev;
101
102#ifdef SDEV_PER_HBA
103 dev = make_dev(&iir_cdevsw, hba2minor(unit), UID_ROOT, GID_OPERATOR,
100 S_IRUSR | S_IWUSR | S_IRGRP, "iir%d", unit);
104 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, "iir%d", unit);
101#else
102 if (sdev_made)
103 return (0);
104 dev = make_dev(&iir_cdevsw, 0, UID_ROOT, GID_OPERATOR,
105#else
106 if (sdev_made)
107 return (0);
108 dev = make_dev(&iir_cdevsw, 0, UID_ROOT, GID_OPERATOR,
105 S_IRUSR | S_IWUSR | S_IRGRP, "iir");
109 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, "iir");
106 sdev_made = 1;
107#endif
108 return (dev);
109}
110
111void
112gdt_destroy_dev(dev_t dev)
113{

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

343
344 default:
345 break;
346 }
347
348 --gdt_stat.io_count_act;
349 return (0);
350}
110 sdev_made = 1;
111#endif
112 return (dev);
113}
114
115void
116gdt_destroy_dev(dev_t dev)
117{

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

347
348 default:
349 break;
350 }
351
352 --gdt_stat.io_count_act;
353 return (0);
354}
355
356/*
357static void
358iir_drvinit(void *unused)
359{
360 GDT_DPRINTF(GDT_D_DEBUG, ("iir_drvinit()\n"));
361
362 if (!iir_devsw_installed) {
363 cdevsw_add(&iir_cdevsw);
364 iir_devsw_installed = 1;
365 }
366}
367
368SYSINIT(iir_dev, SI_SUB_DRIVERS, SI_ORDER_MIDDLE + CDEV_MAJOR, iir_drvinit, NULL)
369*/