-rw-r--r-- | libopie2/opienet/onetwork.cpp | 12 | ||||
-rw-r--r-- | libopie2/opienet/onetwork.h | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp index 45ee4c0..767651e 100644 --- a/libopie2/opienet/onetwork.cpp +++ b/libopie2/opienet/onetwork.cpp | |||
@@ -592,8 +592,14 @@ int OWirelessNetworkInterface::channel() const | |||
592 | 592 | ||
593 | 593 | ||
594 | void OWirelessNetworkInterface::setChannel( int c ) const | 594 | void OWirelessNetworkInterface::setChannel( int c ) const |
595 | { | 595 | { |
596 | if ( c ) | ||
597 | { | ||
598 | qWarning( "OWirelessNetworkInterface::setChannel( 0 ) called - fix your application!" ); | ||
599 | return; | ||
600 | } | ||
601 | |||
596 | if ( !_mon ) | 602 | if ( !_mon ) |
597 | { | 603 | { |
598 | memset( &_iwr, 0, sizeof( struct iwreq ) ); | 604 | memset( &_iwr, 0, sizeof( struct iwreq ) ); |
599 | _iwr.u.freq.m = c; | 605 | _iwr.u.freq.m = c; |
@@ -938,9 +944,9 @@ void OWlanNGMonitoringInterface::setChannel( int c ) | |||
938 | QString enable = "true"; //_if->monitorMode() ? "true" : "false"; | 944 | QString enable = "true"; //_if->monitorMode() ? "true" : "false"; |
939 | QString prism = _prismHeader ? "true" : "false"; | 945 | QString prism = _prismHeader ? "true" : "false"; |
940 | QString cmd; | 946 | QString cmd; |
941 | cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s", | 947 | cmd.sprintf( "$(which wlanctl-ng) %s lnxreq_wlansniff channel=%d enable=%s prismheader=%s", |
942 | (const char*) _if->name(), c+1, (const char*) enable, (const char*) prism ); | 948 | (const char*) _if->name(), c, (const char*) enable, (const char*) prism ); |
943 | system( cmd ); | 949 | system( cmd ); |
944 | } | 950 | } |
945 | 951 | ||
946 | 952 | ||
@@ -1014,10 +1020,12 @@ void OOrinocoMonitoringInterface::setChannel( int c ) | |||
1014 | void OOrinocoMonitoringInterface::setEnabled( bool b ) | 1020 | void OOrinocoMonitoringInterface::setEnabled( bool b ) |
1015 | { | 1021 | { |
1016 | // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 | 1022 | // IW_MODE_MONITOR was introduced in Wireless Extensions Version 15 |
1017 | // Wireless Extensions < Version 15 need iwpriv commandos for monitoring | 1023 | // Wireless Extensions < Version 15 need iwpriv commandos for monitoring |
1024 | // However, as of recent orinoco drivers, IW_MODE_MONITOR is still not supported | ||
1018 | 1025 | ||
1019 | #if WIRELESS_EXT > 14 | 1026 | #if 0 |
1027 | //#if WIRELESS_EXT > 14 | ||
1020 | if ( b ) | 1028 | if ( b ) |
1021 | _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header | 1029 | _if->setMode( "monitor" ); // IW_MODE_MONITOR doesn't support prism header |
1022 | else | 1030 | else |
1023 | _if->setMode( "managed" ); | 1031 | _if->setMode( "managed" ); |
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index 2553a61..00d1ebb 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h | |||
@@ -335,8 +335,10 @@ class OWirelessNetworkInterface : public ONetworkInterface | |||
335 | virtual ~OWirelessNetworkInterface(); | 335 | virtual ~OWirelessNetworkInterface(); |
336 | /** | 336 | /** |
337 | * Setting the @a channel of the interface changes the radio frequency (RF) | 337 | * Setting the @a channel of the interface changes the radio frequency (RF) |
338 | * of the corresponding wireless network device. | 338 | * of the corresponding wireless network device. |
339 | * @note Common channel range is within [1-14]. A value of 0 is not allowed. | ||
340 | * @see channels() | ||
339 | */ | 341 | */ |
340 | virtual void setChannel( int channel ) const; | 342 | virtual void setChannel( int channel ) const; |
341 | /** | 343 | /** |
342 | * @returns the channel index of the current radio frequency. | 344 | * @returns the channel index of the current radio frequency. |