summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
Unidiff
Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index b6c9876..e141097 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -116,13 +116,13 @@ void ONetwork::synchronize()
116 _interfaces.insert( str, iface ); 116 _interfaces.insert( str, iface );
117 s.readLine(); 117 s.readLine();
118 } 118 }
119} 119}
120 120
121 121
122short ONetwork::wirelessExtensionVersion() 122short ONetwork::wirelessExtensionCompileVersion()
123{ 123{
124 return WIRELESS_EXT; 124 return WIRELESS_EXT;
125} 125}
126 126
127 127
128int ONetwork::count() const 128int ONetwork::count() const
@@ -379,13 +379,13 @@ bool ONetworkInterface::isWireless() const
379 *======================================================================================*/ 379 *======================================================================================*/
380 380
381OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface ) 381OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface )
382 :QObject( 0, "Mickey's funky hopper" ), 382 :QObject( 0, "Mickey's funky hopper" ),
383 _iface( iface ), _interval( 0 ), _tid( 0 ) 383 _iface( iface ), _interval( 0 ), _tid( 0 )
384{ 384{
385 int _maxChannel = iface->channels()+1; 385 int _maxChannel = iface->channels();
386 // generate fancy hopping sequence honoring the device capabilities 386 // generate fancy hopping sequence honoring the device capabilities
387 if ( _maxChannel >= 1 ) _channels.append( 1 ); 387 if ( _maxChannel >= 1 ) _channels.append( 1 );
388 if ( _maxChannel >= 7 ) _channels.append( 7 ); 388 if ( _maxChannel >= 7 ) _channels.append( 7 );
389 if ( _maxChannel >= 13 ) _channels.append( 13 ); 389 if ( _maxChannel >= 13 ) _channels.append( 13 );
390 if ( _maxChannel >= 2 ) _channels.append( 2 ); 390 if ( _maxChannel >= 2 ) _channels.append( 2 );
391 if ( _maxChannel >= 8 ) _channels.append( 8 ); 391 if ( _maxChannel >= 8 ) _channels.append( 8 );
@@ -396,13 +396,12 @@ OChannelHopper::OChannelHopper( OWirelessNetworkInterface* iface )
396 if ( _maxChannel >= 10 ) _channels.append( 10 ); 396 if ( _maxChannel >= 10 ) _channels.append( 10 );
397 if ( _maxChannel >= 5 ) _channels.append( 5 ); 397 if ( _maxChannel >= 5 ) _channels.append( 5 );
398 if ( _maxChannel >= 11 ) _channels.append( 11 ); 398 if ( _maxChannel >= 11 ) _channels.append( 11 );
399 if ( _maxChannel >= 6 ) _channels.append( 6 ); 399 if ( _maxChannel >= 6 ) _channels.append( 6 );
400 if ( _maxChannel >= 12 ) _channels.append( 12 ); 400 if ( _maxChannel >= 12 ) _channels.append( 12 );
401 _channel = _channels.begin(); 401 _channel = _channels.begin();
402
403} 402}
404 403
405 404
406OChannelHopper::~OChannelHopper() 405OChannelHopper::~OChannelHopper()
407{ 406{
408} 407}
@@ -558,22 +557,29 @@ void OWirelessNetworkInterface::buildInformation()
558 memcpy( &range, buffer, sizeof range ); 557 memcpy( &range, buffer, sizeof range );
559 558
560 odebug << "OWirelessNetworkInterface::buildInformation(): Interface reported to have " << (int) range.num_frequency << " channels." << oendl; 559 odebug << "OWirelessNetworkInterface::buildInformation(): Interface reported to have " << (int) range.num_frequency << " channels." << oendl;
561 for ( int i = 0; i < range.num_frequency; ++i ) 560 for ( int i = 0; i < range.num_frequency; ++i )
562 { 561 {
563 int freq = (int) ( double( range.freq[i].m ) * pow( 10.0, range.freq[i].e ) / 1000000.0 ); 562 int freq = (int) ( double( range.freq[i].m ) * pow( 10.0, range.freq[i].e ) / 1000000.0 );
563 odebug << "OWirelessNetworkInterface::buildInformation: Adding frequency " << freq << " as channel " << i+1 << oendl;
564 _channels.insert( freq, i+1 ); 564 _channels.insert( freq, i+1 );
565 } 565 }
566 } 566 }
567 567
568 memcpy( &_range, buffer, sizeof( struct iw_range ) ); 568 memcpy( &_range, buffer, sizeof( struct iw_range ) );
569 odebug << "OWirelessNetworkInterface::buildInformation(): Information block constructed." << oendl; 569 odebug << "OWirelessNetworkInterface::buildInformation(): Information block constructed." << oendl;
570 free(buffer); 570 free(buffer);
571} 571}
572 572
573 573
574short OWirelessNetworkInterface::wirelessExtensionDriverVersion() const
575{
576 return _range.we_version_compiled;
577}
578
579
574void OWirelessNetworkInterface::buildPrivateList() 580void OWirelessNetworkInterface::buildPrivateList()
575{ 581{
576 odebug << "OWirelessNetworkInterface::buildPrivateList()" << oendl; 582 odebug << "OWirelessNetworkInterface::buildPrivateList()" << oendl;
577 583
578 struct iw_priv_args priv[IW_MAX_PRIV_DEF]; 584 struct iw_priv_args priv[IW_MAX_PRIV_DEF];
579 585