1 /*
2 * device_io.h - Exports for default device io. Part of the Linux-NTFS project.
3 *
4 * Copyright (c) 2000-2006 Anton Altaparmakov
5 *
6 * This program/include file is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program/include file is distributed in the hope that it will be
12 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program (in the main directory of the Linux-NTFS
18 * distribution in the file COPYING); if not, write to the Free Software
19 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22 #ifndef _NTFS_DEVICE_IO_H
23 #define _NTFS_DEVICE_IO_H
24
25 #ifdef HAVE_CONFIG_H
26 #include "config.h"
27 #endif
28
29 #ifndef NO_NTFS_DEVICE_DEFAULT_IO_OPS
30
31 #ifndef __CYGWIN32__
32
33 /* Not on Cygwin; use standard Unix style low level device operations. */
34 #define ntfs_device_default_io_ops ntfs_device_unix_io_ops
35
36 #else /* __CYGWIN32__ */
37
38 #ifndef HDIO_GETGEO
39 # define HDIO_GETGEO 0x301
40 /**
41 * struct hd_geometry -
42 */
43 struct hd_geometry {
44 unsigned char heads;
45 unsigned char sectors;
46 unsigned short cylinders;
47 unsigned long start;
48 };
49 #endif
50 #ifndef BLKGETSIZE
51 # define BLKGETSIZE 0x1260
52 #endif
53 #ifndef BLKSSZGET
54 # define BLKSSZGET 0x1268
55 #endif
56 #ifndef BLKGETSIZE64
57 # define BLKGETSIZE64 0x80041272
58 #endif
59 #ifndef BLKBSZSET
60 # define BLKBSZSET 0x40041271
61 #endif
62
63 /* On Cygwin; use Win32 low level device operations. */
64 #define ntfs_device_default_io_ops ntfs_device_win32_io_ops
65
66 #endif /* __CYGWIN32__ */
67
68
69 /* Forward declaration. */
70 struct ntfs_device_operations;
71
72 extern struct ntfs_device_operations ntfs_device_default_io_ops;
73
74 #endif /* NO_NTFS_DEVICE_DEFAULT_IO_OPS */
75
76 #endif /* defined _NTFS_DEVICE_IO_H */
77