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> |
49#include <sys/disk.h> |
50#include <sys/stat.h> |
51#include <sys/disklabel.h> |
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*/ |
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, |
104 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, "iir%d", unit); |
105#else 106 if (sdev_made) 107 return (0); 108 dev = make_dev(&iir_cdevsw, 0, UID_ROOT, GID_OPERATOR, |
109 S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH, "iir"); |
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*/ |