From 69241529ffa4b45b3ebf408e4ed81b6a4142728f Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Fri, 22 Jun 2007 18:53:27 +0000 Subject: rbutil: reworked device detection, now uses rockbox-info.txt and the patchers to detect the device. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13687 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/autodetection.h | 86 ++++++++++---------------------------------------- 1 file changed, 17 insertions(+), 69 deletions(-) (limited to 'rbutil/autodetection.h') diff --git a/rbutil/autodetection.h b/rbutil/autodetection.h index dc2d7d2490..a69b9e4bca 100644 --- a/rbutil/autodetection.h +++ b/rbutil/autodetection.h @@ -29,6 +29,7 @@ #define TOMANYDEVICES 2 #define NODEVICE 1 +#define DEVICEFOUND 0 struct UsbDeviceInfo { @@ -37,87 +38,24 @@ struct UsbDeviceInfo int status; }; -UsbDeviceInfo detectDevicesViaPatchers(); + +bool detectDevices(UsbDeviceInfo* tempdevice); + +wxArrayString getPossibleMountPoints(); /* this funktion has to be implemented for every OS /******************************** -* Windows code for USB Device detection and information +* Windows header for USB Device detection and information **************************************/ #if defined( __WXMSW__ ) -#include // For DeviceChange. -#include // For DeviceIOCtl. - -// IOCTL control code -#define IOCTL_STORAGE_QUERY_PROPERTY CTL_CODE(IOCTL_STORAGE_BASE, 0x0500, METHOD_BUFFERED, FILE_ANY_ACCESS) - -//// The following structures all can find at MSDN. -// enumeration type specifies the various types of storage buses -typedef enum _STORAGE_BUS_TYPE { - BusTypeUnknown = 0x00, - BusTypeScsi, - BusTypeAtapi, - BusTypeAta, - BusType1394, - BusTypeSsa, - BusTypeFibre, - BusTypeUsb, - BusTypeRAID, - BusTypeMaxReserved = 0x7F -} STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE; -// retrieve the storage device descriptor data for a device. -typedef struct _STORAGE_DEVICE_DESCRIPTOR { - ULONG Version; - ULONG Size; - UCHAR DeviceType; - UCHAR DeviceTypeModifier; - BOOLEAN RemovableMedia; - BOOLEAN CommandQueueing; - ULONG VendorIdOffset; - ULONG ProductIdOffset; - ULONG ProductRevisionOffset; - ULONG SerialNumberOffset; - STORAGE_BUS_TYPE BusType; - ULONG RawPropertiesLength; - UCHAR RawDeviceProperties[1]; - -} STORAGE_DEVICE_DESCRIPTOR, *PSTORAGE_DEVICE_DESCRIPTOR; -// retrieve the properties of a storage device or adapter. -typedef enum _STORAGE_QUERY_TYPE { - PropertyStandardQuery = 0, - PropertyExistsQuery, - PropertyMaskQuery, - PropertyQueryMaxDefined - -} STORAGE_QUERY_TYPE, *PSTORAGE_QUERY_TYPE; - -// retrieve the properties of a storage device or adapter. -typedef enum _STORAGE_PROPERTY_ID { - StorageDeviceProperty = 0, - StorageAdapterProperty, - StorageDeviceIdProperty - -} STORAGE_PROPERTY_ID, *PSTORAGE_PROPERTY_ID; -// retrieve the properties of a storage device or adapter. -typedef struct _STORAGE_PROPERTY_QUERY { - STORAGE_PROPERTY_ID PropertyId; - STORAGE_QUERY_TYPE QueryType; - UCHAR AdditionalParameters[1]; - -} STORAGE_PROPERTY_QUERY, *PSTORAGE_PROPERTY_QUERY; - - -wxString guess_mount_point(); - -BOOL GetDisksProperty(HANDLE hDevice, PSTORAGE_DEVICE_DESCRIPTOR pDevDesc); -char chFirstDriveFromMask (ULONG unitmask); #endif /*__WXMSW__ */ /************************************************************************+ -*Linux code for autodetection +*Linux header for autodetection **************************************************************************/ @@ -131,6 +69,16 @@ wxString resolve_mount_point( const wxString device ); +/************************************************************************+ +*MAc header for autodetection +**************************************************************************/ + + +#if defined( __DARWIN__) + + + +#endif /* MAc Code */ -- cgit v1.2.3