summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-06-19 22:01:20 (UTC)
committer mickeyl <mickeyl>2005-06-19 22:01:20 (UTC)
commit83fec70860e56af97d66e9505b913602505423d7 (patch) (unidiff)
tree1d883e98c9d6897a7305ed2b87ba8fe9aaf9e99d
parentff5063b7d4f67b77c8bb87bd9c80649f59f3f12d (diff)
downloadopie-83fec70860e56af97d66e9505b913602505423d7.zip
opie-83fec70860e56af97d66e9505b913602505423d7.tar.gz
opie-83fec70860e56af97d66e9505b913602505423d7.tar.bz2
add note about why we don't use ioctls for gathering the cards initially
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/linux/opcmciasystem.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libopie2/opiecore/linux/opcmciasystem.cpp b/libopie2/opiecore/linux/opcmciasystem.cpp
index 054d261..eae356e 100644
--- a/libopie2/opiecore/linux/opcmciasystem.cpp
+++ b/libopie2/opiecore/linux/opcmciasystem.cpp
@@ -1,391 +1,394 @@
1/* 1/*
2                 This file is part of the Opie Project 2                 This file is part of the Opie Project
3 =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de> 3 =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
4 .=l. 4 .=l.
5           .>+-= 5           .>+-=
6 _;:,     .>    :=|. This program is free software; you can 6 _;:,     .>    :=|. This program is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
9.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; version 2 of the License. 10 - .   .-<_>     .<> Foundation; version 2 of the License.
11     ._= =}       : 11     ._= =}       :
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This program is distributed in the hope that 13    .i_,=:_.      -<s. This program is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
18..}^=.=       =       ; Library General Public License for more 18..}^=.=       =       ; Library General Public License for more
19++=   -.     .`     .: details. 19++=   -.     .`     .: details.
20 :     =  ...= . :.=- 20 :     =  ...= . :.=-
21 -.   .:....=;==+<; You should have received a copy of the GNU 21 -.   .:....=;==+<; You should have received a copy of the GNU
22  -_. . .   )=.  = Library General Public License along with 22  -_. . .   )=.  = Library General Public License along with
23    --        :-=` this library; see the file COPYING.LIB. 23    --        :-=` this library; see the file COPYING.LIB.
24 If not, write to the Free Software Foundation, 24 If not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330, 25 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 26 Boston, MA 02111-1307, USA.
27 27
28*/ 28*/
29 29
30#include "opcmciasystem.h" 30#include "opcmciasystem.h"
31using namespace Opie::Core; 31using namespace Opie::Core;
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie2/odebug.h> 34#include <opie2/odebug.h>
35 35
36/* QT */ 36/* QT */
37#include <qfile.h> 37#include <qfile.h>
38#include <qtextstream.h> 38#include <qtextstream.h>
39 39
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
58OPcmciaSystem* OPcmciaSystem::_instance = 0; 58OPcmciaSystem* OPcmciaSystem::_instance = 0;
59 59
60OPcmciaSystem::OPcmciaSystem() 60OPcmciaSystem::OPcmciaSystem()
61 :_major( 0 ) 61 :_major( 0 )
62{ 62{
63 qDebug( "OPcmciaSystem::OPcmciaSystem()" ); 63 qDebug( "OPcmciaSystem::OPcmciaSystem()" );
64 64
65 // get major node number out of /proc/devices 65 // get major node number out of /proc/devices
66 QFile procfile( PROC_DEVICES ); 66 QFile procfile( PROC_DEVICES );
67 if ( procfile.exists() && procfile.open( IO_ReadOnly ) ) 67 if ( procfile.exists() && procfile.open( IO_ReadOnly ) )
68 { 68 {
69 QTextStream devstream( &procfile ); 69 QTextStream devstream( &procfile );
70 devstream.readLine(); // skip header 70 devstream.readLine(); // skip header
71 while ( !devstream.atEnd() && !_major ) 71 while ( !devstream.atEnd() && !_major )
72 { 72 {
73 int nodenumber; 73 int nodenumber;
74 QString driver; 74 QString driver;
75 devstream >> nodenumber >> driver; 75 devstream >> nodenumber >> driver;
76 if ( driver == "pcmcia" ) 76 if ( driver == "pcmcia" )
77 { 77 {
78 qDebug( "OPcmciaSystem::OPcmciaSystem(): gotcha! pcmcia node number = %d", nodenumber ); 78 qDebug( "OPcmciaSystem::OPcmciaSystem(): gotcha! pcmcia node number = %d", nodenumber );
79 _major = nodenumber; 79 _major = nodenumber;
80 break; 80 break;
81 } 81 }
82 } 82 }
83 } 83 }
84 else 84 else
85 { 85 {
86 qWarning( "OPcmciaSystem::OPcmciaSystem() - can't open /proc/devices - continuing with limited functionality." ); 86 qWarning( "OPcmciaSystem::OPcmciaSystem() - can't open /proc/devices - continuing with limited functionality." );
87 } 87 }
88 88
89 synchronize(); 89 synchronize();
90} 90}
91 91
92void OPcmciaSystem::synchronize() 92void OPcmciaSystem::synchronize()
93{ 93{
94 qDebug( "OPcmciaSystem::synchronize()" ); 94 qDebug( "OPcmciaSystem::synchronize()" );
95 _interfaces.clear(); 95 _interfaces.clear();
96 96
97 //FIXME: Use cardmgr subsystem ioctls 97 //NOTE: We _could_ use ioctl's here as well, however we want to know if
98 // the card is recognized by the cardmgr (hence has a valid binding)
99 // If it is not recognized yet, userland may want to provide a configuration dialog
100 //TODO: Revise for pcmciautils
98 101
99 QString fileName; 102 QString fileName;
100 if ( QFile::exists( "/var/run/stab" ) ) { fileName = "/var/run/stab"; } 103 if ( QFile::exists( "/var/run/stab" ) ) { fileName = "/var/run/stab"; }
101 else if ( QFile::exists( "/var/state/pcmcia/stab" ) ) { fileName = "/var/state/pcmcia/stab"; } 104 else if ( QFile::exists( "/var/state/pcmcia/stab" ) ) { fileName = "/var/state/pcmcia/stab"; }
102 else { fileName = "/var/lib/pcmcia/stab"; } 105 else { fileName = "/var/lib/pcmcia/stab"; }
103 QFile cardinfofile( fileName ); 106 QFile cardinfofile( fileName );
104 if ( !cardinfofile.exists() || !cardinfofile.open( IO_ReadOnly ) ) 107 if ( !cardinfofile.exists() || !cardinfofile.open( IO_ReadOnly ) )
105 { 108 {
106 qWarning( "pcmcia info file not found or unaccessible" ); 109 qWarning( "pcmcia info file not found or unaccessible" );
107 return; 110 return;
108 } 111 }
109 QTextStream cardinfo( &cardinfofile ); 112 QTextStream cardinfo( &cardinfofile );
110 while ( !cardinfo.atEnd() ) 113 while ( !cardinfo.atEnd() )
111 { 114 {
112 QString strSocket; 115 QString strSocket;
113 int numSocket; 116 int numSocket;
114 char colon; 117 char colon;
115 QString cardName; 118 QString cardName;
116 cardinfo >> strSocket >> numSocket >> colon; 119 cardinfo >> strSocket >> numSocket >> colon;
117 cardName = cardinfo.readLine().stripWhiteSpace(); 120 cardName = cardinfo.readLine().stripWhiteSpace();
118 qDebug( "strSocket = '%s', numSocket = '%d', colon = '%c', cardName = '%s'", (const char*) strSocket, numSocket, colon, ( const char*) cardName ); 121 qDebug( "strSocket = '%s', numSocket = '%d', colon = '%c', cardName = '%s'", (const char*) strSocket, numSocket, colon, ( const char*) cardName );
119 if ( strSocket == "Socket" && colon == ':' ) 122 if ( strSocket == "Socket" && colon == ':' )
120 { 123 {
121 _interfaces.append( new OPcmciaSocket( _major, numSocket, this, (const char*) cardName ) ); 124 _interfaces.append( new OPcmciaSocket( _major, numSocket, this, (const char*) cardName ) );
122 } 125 }
123 else 126 else
124 { 127 {
125 continue; 128 continue;
126 } 129 }
127 } 130 }
128} 131}
129 132
130 133
131int OPcmciaSystem::count() const 134int OPcmciaSystem::count() const
132{ 135{
133 return _interfaces.count(); 136 return _interfaces.count();
134} 137}
135 138
136 139
137int OPcmciaSystem::cardCount() const 140int OPcmciaSystem::cardCount() const
138{ 141{
139 int nonEmpty = 0; 142 int nonEmpty = 0;
140 OPcmciaSystem::CardIterator it = iterator(); 143 OPcmciaSystem::CardIterator it = iterator();
141 while ( it.current() ) 144 while ( it.current() )
142 { 145 {
143 if ( !it.current()->isEmpty() ) nonEmpty++; 146 if ( !it.current()->isEmpty() ) nonEmpty++;
144 ++it; 147 ++it;
145 } 148 }
146 return nonEmpty; 149 return nonEmpty;
147} 150}
148 151
149 152
150OPcmciaSocket* OPcmciaSystem::socket( unsigned int number ) 153OPcmciaSocket* OPcmciaSystem::socket( unsigned int number )
151{ 154{
152 return _interfaces.at( number ); 155 return _interfaces.at( number );
153} 156}
154 157
155 158
156OPcmciaSystem* OPcmciaSystem::instance() 159OPcmciaSystem* OPcmciaSystem::instance()
157{ 160{
158 if ( !_instance ) _instance = new OPcmciaSystem(); 161 if ( !_instance ) _instance = new OPcmciaSystem();
159 return _instance; 162 return _instance;
160} 163}
161 164
162 165
163OPcmciaSystem::CardIterator OPcmciaSystem::iterator() const 166OPcmciaSystem::CardIterator OPcmciaSystem::iterator() const
164{ 167{
165 return OPcmciaSystem::CardIterator( _interfaces ); 168 return OPcmciaSystem::CardIterator( _interfaces );
166} 169}
167 170
168 171
169/*====================================================================================== 172/*======================================================================================
170 * OPcmciaSocket 173 * OPcmciaSocket
171 *======================================================================================*/ 174 *======================================================================================*/
172 175
173OPcmciaSocket::OPcmciaSocket( int major, int socket, QObject* parent, const char* name ) 176OPcmciaSocket::OPcmciaSocket( int major, int socket, QObject* parent, const char* name )
174 :QObject( parent, name ), _major( major ), _socket( socket ) 177 :QObject( parent, name ), _major( major ), _socket( socket )
175{ 178{
176 qDebug( "OPcmciaSocket::OPcmciaSocket()" ); 179 qDebug( "OPcmciaSocket::OPcmciaSocket()" );
177 init(); 180 init();
178} 181}
179 182
180 183
181OPcmciaSocket::~OPcmciaSocket() 184OPcmciaSocket::~OPcmciaSocket()
182{ 185{
183 qDebug( "OPcmciaSocket::~OPcmciaSocket()" ); 186 qDebug( "OPcmciaSocket::~OPcmciaSocket()" );
184 cleanup(); 187 cleanup();
185} 188}
186 189
187 190
188/* internal */ void OPcmciaSocket::init() 191/* internal */ void OPcmciaSocket::init()
189{ 192{
190 // open control socket and gather file descriptor 193 // open control socket and gather file descriptor
191 if ( _major ) 194 if ( _major )
192 { 195 {
193 dev_t dev = makedev( _major, _socket ); 196 dev_t dev = makedev( _major, _socket );
194 197
195#ifdef OPCMCIA_DEBUG 198#ifdef OPCMCIA_DEBUG
196 QString filename = "/tmp/opcmciasystem-debug"; 199 QString filename = "/tmp/opcmciasystem-debug";
197 if ( QFile::exists( filename ) ) 200 if ( QFile::exists( filename ) )
198#else 201#else
199 QString filename = QString().sprintf( "/tmp/opcmciasystem-%d", ::getpid() ); 202 QString filename = QString().sprintf( "/tmp/opcmciasystem-%d", ::getpid() );
200 if ( ::mknod( (const char*) filename, ( S_IFCHR|S_IREAD|S_IWRITE ), dev ) == 0 ) 203 if ( ::mknod( (const char*) filename, ( S_IFCHR|S_IREAD|S_IWRITE ), dev ) == 0 )
201#endif 204#endif
202 { 205 {
203 _fd = ::open( (const char*) filename, O_RDONLY); 206 _fd = ::open( (const char*) filename, O_RDONLY);
204 if ( !_fd ) 207 if ( !_fd )
205 { 208 {
206 qWarning( "OPcmciaSocket::init() - can't open control socket (%s)", strerror( errno ) ); 209 qWarning( "OPcmciaSocket::init() - can't open control socket (%s)", strerror( errno ) );
207 } 210 }
208 else 211 else
209 { 212 {
210 ::unlink( (const char*) filename ); 213 ::unlink( (const char*) filename );
211 } 214 }
212 } 215 }
213 else 216 else
214 { 217 {
215 qWarning( "OPcmciaSocket::init() - can't create device node '%s' (%s)", (const char*) filename, strerror( errno ) ); 218 qWarning( "OPcmciaSocket::init() - can't create device node '%s' (%s)", (const char*) filename, strerror( errno ) );
216 } 219 }
217 } 220 }
218} 221}
219 222
220/* internal */ void OPcmciaSocket::cleanup() 223/* internal */ void OPcmciaSocket::cleanup()
221{ 224{
222 // close control socket 225 // close control socket
223} 226}
224 227
225/* internal */ bool OPcmciaSocket::getTuple( cisdata_t tuple ) const 228/* internal */ bool OPcmciaSocket::getTuple( cisdata_t tuple ) const
226{ 229{
227 _ioctlarg.tuple.DesiredTuple = tuple; 230 _ioctlarg.tuple.DesiredTuple = tuple;
228 _ioctlarg.tuple.Attributes = TUPLE_RETURN_COMMON; 231 _ioctlarg.tuple.Attributes = TUPLE_RETURN_COMMON;
229 _ioctlarg.tuple.TupleOffset = 0; 232 _ioctlarg.tuple.TupleOffset = 0;
230 233
231 int result; 234 int result;
232 result = ::ioctl(_fd, DS_GET_FIRST_TUPLE, &_ioctlarg); 235 result = ::ioctl(_fd, DS_GET_FIRST_TUPLE, &_ioctlarg);
233 if ( result != 0 ) 236 if ( result != 0 )
234 { 237 {
235 qWarning( "OPcmciaSocket::getTuple() - DS_GET_FIRST_TUPLE failed (%s)", strerror( errno ) ); 238 qWarning( "OPcmciaSocket::getTuple() - DS_GET_FIRST_TUPLE failed (%s)", strerror( errno ) );
236 return false; 239 return false;
237 } 240 }
238 241
239 result = ::ioctl(_fd, DS_GET_TUPLE_DATA, &_ioctlarg); 242 result = ::ioctl(_fd, DS_GET_TUPLE_DATA, &_ioctlarg);
240 if ( result != 0 ) 243 if ( result != 0 )
241 { 244 {
242 qWarning( "OPcmciaSocket::getTuple() - DS_GET_TUPLE_DATA failed (%s)", strerror( errno ) ); 245 qWarning( "OPcmciaSocket::getTuple() - DS_GET_TUPLE_DATA failed (%s)", strerror( errno ) );
243 return false; 246 return false;
244 } 247 }
245 248
246 result = ::ioctl( _fd, DS_PARSE_TUPLE, &_ioctlarg ); 249 result = ::ioctl( _fd, DS_PARSE_TUPLE, &_ioctlarg );
247 if ( result != 0 ) 250 if ( result != 0 )
248 { 251 {
249 qWarning( "OPcmciaSocket::getTuple() - DS_PARSE_TUPLE failed (%s)", strerror( errno ) ); 252 qWarning( "OPcmciaSocket::getTuple() - DS_PARSE_TUPLE failed (%s)", strerror( errno ) );
250 return false; 253 return false;
251 } 254 }
252 255
253 return true; 256 return true;
254} 257}
255 258
256 259
257int OPcmciaSocket::number() const 260int OPcmciaSocket::number() const
258{ 261{
259 return _socket; 262 return _socket;
260} 263}
261 264
262 265
263QString OPcmciaSocket::identity() const 266QString OPcmciaSocket::identity() const
264{ 267{
265 return ( strcmp( name(), "empty" ) == 0 ) ? "<Empty Socket>" : name(); 268 return ( strcmp( name(), "empty" ) == 0 ) ? "<Empty Socket>" : name();
266} 269}
267 270
268 271
269const OPcmciaSocket::OPcmciaSocketCardStatus OPcmciaSocket::status() const 272const OPcmciaSocket::OPcmciaSocketCardStatus OPcmciaSocket::status() const
270{ 273{
271 cs_status_t cs_status; 274 cs_status_t cs_status;
272 cs_status.Function = 0; 275 cs_status.Function = 0;
273 int result = ::ioctl( _fd, DS_GET_STATUS, &cs_status ); 276 int result = ::ioctl( _fd, DS_GET_STATUS, &cs_status );
274 if ( result != 0 ) 277 if ( result != 0 )
275 { 278 {
276 qWarning( "OPcmciaSocket::status() - DS_GET_STATUS failed (%s)", strerror( errno ) ); 279 qWarning( "OPcmciaSocket::status() - DS_GET_STATUS failed (%s)", strerror( errno ) );
277 return Unknown; 280 return Unknown;
278 } 281 }
279 else 282 else
280 { 283 {
281 qDebug( " card status = 0x%08x", cs_status.CardState ); 284 qDebug( " card status = 0x%08x", cs_status.CardState );
282 qDebug( " socket status = 0x%08x", cs_status.SocketState ); 285 qDebug( " socket status = 0x%08x", cs_status.SocketState );
283 return (OPcmciaSocket::OPcmciaSocketCardStatus) (cs_status.CardState + cs_status.SocketState); 286 return (OPcmciaSocket::OPcmciaSocketCardStatus) (cs_status.CardState + cs_status.SocketState);
284 } 287 }
285} 288}
286 289
287 290
288bool OPcmciaSocket::isUnsupported() const 291bool OPcmciaSocket::isUnsupported() const
289{ 292{
290 return ( strcmp( name(), "unsupported card" ) == 0 ); 293 return ( strcmp( name(), "unsupported card" ) == 0 );
291} 294}
292 295
293 296
294bool OPcmciaSocket::isEmpty() const 297bool OPcmciaSocket::isEmpty() const
295{ 298{
296 return ! status() && ( Occupied || OccupiedCardBus ); 299 return ! status() && ( Occupied || OccupiedCardBus );
297} 300}
298 301
299 302
300bool OPcmciaSocket::isSuspended() const 303bool OPcmciaSocket::isSuspended() const
301{ 304{
302 return status() && Suspended; 305 return status() && Suspended;
303} 306}
304 307
305 308
306bool OPcmciaSocket::eject() 309bool OPcmciaSocket::eject()
307{ 310{
308 return ::ioctl( _fd, DS_EJECT_CARD ) != -1; 311 return ::ioctl( _fd, DS_EJECT_CARD ) != -1;
309} 312}
310 313
311 314
312bool OPcmciaSocket::insert() 315bool OPcmciaSocket::insert()
313{ 316{
314 return ::ioctl( _fd, DS_INSERT_CARD ) != -1; 317 return ::ioctl( _fd, DS_INSERT_CARD ) != -1;
315} 318}
316 319
317 320
318bool OPcmciaSocket::suspend() 321bool OPcmciaSocket::suspend()
319{ 322{
320 return ::ioctl( _fd, DS_SUSPEND_CARD ) != -1; 323 return ::ioctl( _fd, DS_SUSPEND_CARD ) != -1;
321} 324}
322 325
323 326
324bool OPcmciaSocket::resume() 327bool OPcmciaSocket::resume()
325{ 328{
326 return ::ioctl( _fd, DS_RESUME_CARD ) != -1; 329 return ::ioctl( _fd, DS_RESUME_CARD ) != -1;
327} 330}
328 331
329 332
330bool OPcmciaSocket::reset() 333bool OPcmciaSocket::reset()
331{ 334{
332 return ::ioctl( _fd, DS_RESET_CARD ) != -1; 335 return ::ioctl( _fd, DS_RESET_CARD ) != -1;
333} 336}
334 337
335 338
336QStringList OPcmciaSocket::productIdentity() const 339QStringList OPcmciaSocket::productIdentity() const
337{ 340{
338 QStringList list; 341 QStringList list;
339 cistpl_vers_1_t *vers = &_ioctlarg.tuple_parse.parse.version_1; 342 cistpl_vers_1_t *vers = &_ioctlarg.tuple_parse.parse.version_1;
340 if ( getTuple( CISTPL_VERS_1 ) ) 343 if ( getTuple( CISTPL_VERS_1 ) )
341 { 344 {
342 for ( int i = 0; i < CISTPL_VERS_1_MAX_PROD_STRINGS; ++i ) 345 for ( int i = 0; i < CISTPL_VERS_1_MAX_PROD_STRINGS; ++i )
343 { 346 {
344 qDebug( " PRODID = '%s'", vers->str+vers->ofs[i] ); 347 qDebug( " PRODID = '%s'", vers->str+vers->ofs[i] );
345 list += vers->str+vers->ofs[i]; 348 list += vers->str+vers->ofs[i];
346 } 349 }
347 } 350 }
348 else 351 else
349 { 352 {
350 list += "<unknown>"; 353 list += "<unknown>";
351 } 354 }
352 return list; 355 return list;
353} 356}
354 357
355 358
356QString OPcmciaSocket::manufacturerIdentity() const 359QString OPcmciaSocket::manufacturerIdentity() const
357{ 360{
358 cistpl_manfid_t *manfid = &_ioctlarg.tuple_parse.parse.manfid; 361 cistpl_manfid_t *manfid = &_ioctlarg.tuple_parse.parse.manfid;
359 if ( getTuple( CISTPL_MANFID ) ) 362 if ( getTuple( CISTPL_MANFID ) )
360 { 363 {
361 return QString().sprintf( "0x%04x, 0x%04x", manfid->manf, manfid->card ); 364 return QString().sprintf( "0x%04x, 0x%04x", manfid->manf, manfid->card );
362 } 365 }
363 else 366 else
364 return "<unknown>"; 367 return "<unknown>";
365} 368}
366 369
367 370
368QString OPcmciaSocket::function() const 371QString OPcmciaSocket::function() const
369{ 372{
370 cistpl_funcid_t *funcid = &_ioctlarg.tuple_parse.parse.funcid; 373 cistpl_funcid_t *funcid = &_ioctlarg.tuple_parse.parse.funcid;
371 if ( getTuple( CISTPL_FUNCID ) ) 374 if ( getTuple( CISTPL_FUNCID ) )
372 { 375 {
373 switch ( funcid->func ) 376 switch ( funcid->func )
374 { 377 {
375 case 0: return "Multifunction"; break; 378 case 0: return "Multifunction"; break;
376 case 1: return "Memory"; break; 379 case 1: return "Memory"; break;
377 case 2: return "Serial"; break; 380 case 2: return "Serial"; break;
378 case 3: return "Parallel"; break; 381 case 3: return "Parallel"; break;
379 case 4: return "Fixed Disk"; break; 382 case 4: return "Fixed Disk"; break;
380 case 5: return "Video"; break; 383 case 5: return "Video"; break;
381 case 6: return "Network"; break; 384 case 6: return "Network"; break;
382 case 7: return "AIMS"; break; 385 case 7: return "AIMS"; break;
383 case 8: return "SCSI"; break; 386 case 8: return "SCSI"; break;
384 default: return "<unknown>"; break; 387 default: return "<unknown>"; break;
385 } 388 }
386 } 389 }
387 else 390 else
388 { 391 {
389 return "<unknown>"; 392 return "<unknown>";
390 } 393 }
391} 394}