1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 *
| 1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 *
|
9 * $FreeBSD: head/sys/sys/disk.h 111979 2003-03-08 08:01:31Z phk $
| 9 * $FreeBSD: head/sys/sys/disk.h 112943 2003-04-01 13:19:14Z phk $
|
10 * 11 */ 12 13#ifndef _SYS_DISK_H_ 14#define _SYS_DISK_H_ 15 16#include <sys/ioccom.h> 17 18#ifdef _KERNEL 19
| 10 * 11 */ 12 13#ifndef _SYS_DISK_H_ 14#define _SYS_DISK_H_ 15 16#include <sys/ioccom.h> 17 18#ifdef _KERNEL 19
|
20#include <sys/queue.h> 21
| |
22#ifndef _SYS_CONF_H_ 23#include <sys/conf.h> /* XXX: temporary to avoid breakage */ 24#endif 25
| 20#ifndef _SYS_CONF_H_ 21#include <sys/conf.h> /* XXX: temporary to avoid breakage */ 22#endif 23
|
26typedef int disk_open_t(struct disk *); 27typedef int disk_close_t(struct disk *); 28typedef void disk_strategy_t(struct bio *bp); 29typedef int disk_ioctl_t(struct disk *, u_long cmd, void *data, 30 int fflag, struct thread *td); 31 /* NB: disk_ioctl_t SHALL be cast'able to d_ioctl_t */
| 24#include <geom/geom_disk.h>
|
32
| 25
|
33struct g_geom; 34struct devstat; 35 36struct disk { 37 /* Fields which are private to geom_disk */ 38 struct g_geom *d_geom; 39 struct devstat *d_devstat; 40 41 /* Shared fields */ 42 u_int d_flags; 43 const char *d_name; 44 u_int d_unit; 45 46 /* Disk methods */ 47 disk_open_t *d_open; 48 disk_close_t *d_close; 49 disk_strategy_t *d_strategy; 50 disk_ioctl_t *d_ioctl; 51 dumper_t *d_dump; 52 53 /* Info fields from driver to geom_disk.c. Valid when open */ 54 u_int d_sectorsize; 55 off_t d_mediasize; 56 u_int d_fwsectors; 57 u_int d_fwheads; 58 u_int d_maxsize; 59 u_int d_stripeoffset; 60 u_int d_stripesize; 61 62 /* Fields private to the driver */ 63 void *d_drv1; 64}; 65 66#define DISKFLAG_NOGIANT 0x1 67#define DISKFLAG_OPEN 0x2 68#define DISKFLAG_CANDELETE 0x4 69 70void disk_create(int unit, struct disk *disk, int flags, void *unused, void *unused2); 71void disk_destroy(struct disk *disk);
| |
72struct disk *disk_enumerate(struct disk *disk); 73void disk_err(struct bio *bp, const char *what, int blkdone, int nl); 74 75#endif 76 77#define DIOCGSECTORSIZE _IOR('d', 128, u_int) 78 /*- 79 * Get the sectorsize of the device in bytes. The sectorsize is the
--- 39 unchanged lines hidden --- | 26struct disk *disk_enumerate(struct disk *disk); 27void disk_err(struct bio *bp, const char *what, int blkdone, int nl); 28 29#endif 30 31#define DIOCGSECTORSIZE _IOR('d', 128, u_int) 32 /*- 33 * Get the sectorsize of the device in bytes. The sectorsize is the
--- 39 unchanged lines hidden --- |