-rw-r--r-- | libopie2/opiecore/linux/opcmciasystem.cpp | 24 | ||||
-rw-r--r-- | libopie2/opiecore/linux/opcmciasystem.h | 6 |
2 files changed, 20 insertions, 10 deletions
diff --git a/libopie2/opiecore/linux/opcmciasystem.cpp b/libopie2/opiecore/linux/opcmciasystem.cpp index 929e289..2eece6b 100644 --- a/libopie2/opiecore/linux/opcmciasystem.cpp +++ b/libopie2/opiecore/linux/opcmciasystem.cpp | |||
@@ -48,8 +48,10 @@ using namespace Opie::Core; | |||
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 | ||
53 | |||
52 | /*====================================================================================== | 54 | /*====================================================================================== |
53 | * OPcmciaSystem | 55 | * OPcmciaSystem |
54 | *======================================================================================*/ | 56 | *======================================================================================*/ |
55 | 57 | ||
@@ -188,10 +190,16 @@ OPcmciaSocket::~OPcmciaSocket() | |||
188 | // open control socket and gather file descriptor | 190 | // open control socket and gather file descriptor |
189 | if ( _major ) | 191 | if ( _major ) |
190 | { | 192 | { |
191 | dev_t dev = makedev( _major, _socket ); | 193 | dev_t dev = makedev( _major, _socket ); |
194 | |||
195 | #ifdef OPCMCIA_DEBUG | ||
196 | QString filename = "/tmp/opcmciasystem-debug"; | ||
197 | if ( QFile::exists( filename ) ) | ||
198 | #else | ||
192 | QString filename = QString().sprintf( "/tmp/opcmciasystem-%d", ::getpid() ); | 199 | QString filename = QString().sprintf( "/tmp/opcmciasystem-%d", ::getpid() ); |
193 | if ( ::mknod( (const char*) filename, ( S_IFCHR|S_IREAD|S_IWRITE ), dev ) == 0 ) | 200 | if ( ::mknod( (const char*) filename, ( S_IFCHR|S_IREAD|S_IWRITE ), dev ) == 0 ) |
201 | #endif | ||
194 | { | 202 | { |
195 | _fd = ::open( (const char*) filename, O_RDONLY); | 203 | _fd = ::open( (const char*) filename, O_RDONLY); |
196 | if ( !_fd ) | 204 | if ( !_fd ) |
197 | { | 205 | { |
@@ -203,9 +211,9 @@ OPcmciaSocket::~OPcmciaSocket() | |||
203 | } | 211 | } |
204 | } | 212 | } |
205 | else | 213 | else |
206 | { | 214 | { |
207 | qWarning( "OPcmciaSocket::init() - can't create device node (%s)", strerror( errno ) ); | 215 | qWarning( "OPcmciaSocket::init() - can't create device node '%s' (%s)", (const char*) filename, strerror( errno ) ); |
208 | } | 216 | } |
209 | } | 217 | } |
210 | } | 218 | } |
211 | 219 | ||
@@ -290,9 +298,9 @@ bool OPcmciaSocket::isEmpty() const | |||
290 | 298 | ||
291 | 299 | ||
292 | bool OPcmciaSocket::isSuspended() const | 300 | bool OPcmciaSocket::isSuspended() const |
293 | { | 301 | { |
294 | return status() && Suspended; | 302 | return status() && Suspended; |
295 | } | 303 | } |
296 | 304 | ||
297 | 305 | ||
298 | bool OPcmciaSocket::eject() | 306 | bool OPcmciaSocket::eject() |
@@ -344,14 +352,18 @@ QStringList OPcmciaSocket::productIdentity() const | |||
344 | return list; | 352 | return list; |
345 | } | 353 | } |
346 | 354 | ||
347 | 355 | ||
348 | #if 0 | 356 | QString OPcmciaSocket::manufacturerIdentity() const |
349 | const QPair& OPcmciaSocket::manufacturerIdentity() const | ||
350 | { | 357 | { |
351 | return _manufId; | 358 | cistpl_manfid_t *manfid = &_ioctlarg.tuple_parse.parse.manfid; |
359 | if ( getTuple( CISTPL_MANFID ) ) | ||
360 | { | ||
361 | return QString().sprintf( "0x%04x, 0x%04x", manfid->manf, manfid->card ); | ||
362 | } | ||
363 | else | ||
364 | return "<unknown>"; | ||
352 | } | 365 | } |
353 | #endif | ||
354 | 366 | ||
355 | 367 | ||
356 | QString OPcmciaSocket::function() const | 368 | QString OPcmciaSocket::function() const |
357 | { | 369 | { |
diff --git a/libopie2/opiecore/linux/opcmciasystem.h b/libopie2/opiecore/linux/opcmciasystem.h index ac6c1de..0fd43cf 100644 --- a/libopie2/opiecore/linux/opcmciasystem.h +++ b/libopie2/opiecore/linux/opcmciasystem.h | |||
@@ -191,13 +191,11 @@ class OPcmciaSocket : public QObject | |||
191 | * @returns a list of product IDs | 191 | * @returns a list of product IDs |
192 | */ | 192 | */ |
193 | QStringList productIdentity() const; | 193 | QStringList productIdentity() const; |
194 | /** | 194 | /** |
195 | * @returns the manufacturer ID pair | 195 | * @returns the manufacturer ID string |
196 | */ | 196 | */ |
197 | #if 0 | 197 | QString manufacturerIdentity() const; |
198 | const QPair& manufacturerIdentity() const; | ||
199 | #endif | ||
200 | /** | 198 | /** |
201 | * @returns the function string | 199 | * @returns the function string |
202 | */ | 200 | */ |
203 | QString function() const; | 201 | QString function() const; |