Diffstat (limited to 'libopie2/opiecore/linux/opcmciasystem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/linux/opcmciasystem.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libopie2/opiecore/linux/opcmciasystem.cpp b/libopie2/opiecore/linux/opcmciasystem.cpp index 2eece6b..054d261 100644 --- a/libopie2/opiecore/linux/opcmciasystem.cpp +++ b/libopie2/opiecore/linux/opcmciasystem.cpp | |||
@@ -40,25 +40,25 @@ using namespace Opie::Core; | |||
40 | /* STD */ | 40 | /* STD */ |
41 | #include <errno.h> | 41 | #include <errno.h> |
42 | #include <fcntl.h> | 42 | #include <fcntl.h> |
43 | #include <string.h> | 43 | #include <string.h> |
44 | #include <stdlib.h> | 44 | #include <stdlib.h> |
45 | #include <sys/ioctl.h> | 45 | #include <sys/ioctl.h> |
46 | #include <sys/types.h> | 46 | #include <sys/types.h> |
47 | #include <sys/stat.h> | 47 | #include <sys/stat.h> |
48 | #include <unistd.h> | 48 | #include <unistd.h> |
49 | 49 | ||
50 | #define PROC_DEVICES "/proc/devices" | 50 | #define PROC_DEVICES "/proc/devices" |
51 | 51 | ||
52 | #define OPCMCIA_DEBUG 1 | 52 | // #define OPCMCIA_DEBUG 1 |
53 | 53 | ||
54 | /*====================================================================================== | 54 | /*====================================================================================== |
55 | * OPcmciaSystem | 55 | * OPcmciaSystem |
56 | *======================================================================================*/ | 56 | *======================================================================================*/ |
57 | 57 | ||
58 | OPcmciaSystem* OPcmciaSystem::_instance = 0; | 58 | OPcmciaSystem* OPcmciaSystem::_instance = 0; |
59 | 59 | ||
60 | OPcmciaSystem::OPcmciaSystem() | 60 | OPcmciaSystem::OPcmciaSystem() |
61 | :_major( 0 ) | 61 | :_major( 0 ) |
62 | { | 62 | { |
63 | qDebug( "OPcmciaSystem::OPcmciaSystem()" ); | 63 | qDebug( "OPcmciaSystem::OPcmciaSystem()" ); |
64 | 64 | ||
@@ -296,49 +296,49 @@ bool OPcmciaSocket::isEmpty() const | |||
296 | return ! status() && ( Occupied || OccupiedCardBus ); | 296 | return ! status() && ( Occupied || OccupiedCardBus ); |
297 | } | 297 | } |
298 | 298 | ||
299 | 299 | ||
300 | bool OPcmciaSocket::isSuspended() const | 300 | bool OPcmciaSocket::isSuspended() const |
301 | { | 301 | { |
302 | return status() && Suspended; | 302 | return status() && Suspended; |
303 | } | 303 | } |
304 | 304 | ||
305 | 305 | ||
306 | bool OPcmciaSocket::eject() | 306 | bool OPcmciaSocket::eject() |
307 | { | 307 | { |
308 | return ::ioctl( _fd, DS_EJECT_CARD ); | 308 | return ::ioctl( _fd, DS_EJECT_CARD ) != -1; |
309 | } | 309 | } |
310 | 310 | ||
311 | 311 | ||
312 | bool OPcmciaSocket::insert() | 312 | bool OPcmciaSocket::insert() |
313 | { | 313 | { |
314 | return ::ioctl( _fd, DS_INSERT_CARD ); | 314 | return ::ioctl( _fd, DS_INSERT_CARD ) != -1; |
315 | } | 315 | } |
316 | 316 | ||
317 | 317 | ||
318 | bool OPcmciaSocket::suspend() | 318 | bool OPcmciaSocket::suspend() |
319 | { | 319 | { |
320 | return ::ioctl( _fd, DS_SUSPEND_CARD ); | 320 | return ::ioctl( _fd, DS_SUSPEND_CARD ) != -1; |
321 | } | 321 | } |
322 | 322 | ||
323 | 323 | ||
324 | bool OPcmciaSocket::resume() | 324 | bool OPcmciaSocket::resume() |
325 | { | 325 | { |
326 | return ::ioctl( _fd, DS_RESUME_CARD ); | 326 | return ::ioctl( _fd, DS_RESUME_CARD ) != -1; |
327 | } | 327 | } |
328 | 328 | ||
329 | 329 | ||
330 | bool OPcmciaSocket::reset() | 330 | bool OPcmciaSocket::reset() |
331 | { | 331 | { |
332 | return ::ioctl( _fd, DS_RESET_CARD ); | 332 | return ::ioctl( _fd, DS_RESET_CARD ) != -1; |
333 | } | 333 | } |
334 | 334 | ||
335 | 335 | ||
336 | QStringList OPcmciaSocket::productIdentity() const | 336 | QStringList OPcmciaSocket::productIdentity() const |
337 | { | 337 | { |
338 | QStringList list; | 338 | QStringList list; |
339 | cistpl_vers_1_t *vers = &_ioctlarg.tuple_parse.parse.version_1; | 339 | cistpl_vers_1_t *vers = &_ioctlarg.tuple_parse.parse.version_1; |
340 | if ( getTuple( CISTPL_VERS_1 ) ) | 340 | if ( getTuple( CISTPL_VERS_1 ) ) |
341 | { | 341 | { |
342 | for ( int i = 0; i < CISTPL_VERS_1_MAX_PROD_STRINGS; ++i ) | 342 | for ( int i = 0; i < CISTPL_VERS_1_MAX_PROD_STRINGS; ++i ) |
343 | { | 343 | { |
344 | qDebug( " PRODID = '%s'", vers->str+vers->ofs[i] ); | 344 | qDebug( " PRODID = '%s'", vers->str+vers->ofs[i] ); |