device.h revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted - a library for manipulating disk partitions
Copyright (C) 1998 - 2001, 2005, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \addtogroup PedDevice
* @{
*/
/** \file device.h */
#ifndef PED_DEVICE_H_INCLUDED
#define PED_DEVICE_H_INCLUDED
/** We can address 2^63 sectors */
typedef long long PedSector;
/** \deprecated Removal from API planned */
typedef enum {
PED_DEVICE_UNKNOWN = 0,
PED_DEVICE_SCSI = 1,
PED_DEVICE_IDE = 2,
PED_DEVICE_DAC960 = 3,
PED_DEVICE_CPQARRAY = 4,
PED_DEVICE_FILE = 5,
PED_DEVICE_ATARAID = 6,
PED_DEVICE_I2O = 7,
PED_DEVICE_UBD = 8,
PED_DEVICE_DASD = 9,
PED_DEVICE_VIODASD = 10,
PED_DEVICE_SX8 = 11,
#ifdef ENABLE_DEVICE_MAPPER
PED_DEVICE_DM = 12,
#endif
PED_DEVICE_XVD = 13
typedef struct _PedDevice PedDevice;
typedef struct _PedDeviceArchOps PedDeviceArchOps;
typedef struct _PedCHSGeometry PedCHSGeometry;
/**
* A cylinder-head-sector "old-style" geometry.
*
* A device addressed in this way has C*H*S sectors.
*/
struct _PedCHSGeometry {
int cylinders;
int heads;
int sectors;
};
struct _PedDevice {
char* model; /**< \brief description of hardware
(manufacturer, model) */
char* path; /**< device /dev entry */
\deprecated \sa PedDeviceType */
long long sector_size; /**< logical sector size */
long long phys_sector_size; /**< physical sector size */
int open_count; /**< the number of times this device has
been opened with ped_device_open(). */
int read_only;
int external_mode;
int dirty;
int boot_dirty;
void* arch_specific;
};
/**
* List of functions implementing architecture-specific operations.
*/
struct _PedDeviceArchOps {
void (*probe_all) ();
};
extern void ped_device_probe_all ();
extern void ped_device_free_all ();
/* private stuff ;-) */
extern void _ped_device_probe (const char* path);
#endif /* PED_DEVICE_H_INCLUDED */
/** @} */