author | wimpie <wimpie> | 2004-04-04 11:42:05 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-04-04 11:42:05 (UTC) |
commit | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (patch) (side-by-side diff) | |
tree | 3e3764f82d52f8c32b0ed9d92c13ec483dc34114 /noncore/settings/networksettings2/usb | |
parent | 321f82bb3d43cbab358434fef52fe76f17e7d1e3 (diff) | |
download | opie-8d2d2664e5f544b8292806e617deb7a0e4170dc0.zip opie-8d2d2664e5f544b8292806e617deb7a0e4170dc0.tar.gz opie-8d2d2664e5f544b8292806e617deb7a0e4170dc0.tar.bz2 |
Error in generation of files
Diffstat (limited to 'noncore/settings/networksettings2/usb') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NN.cpp | 9 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NN.h | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NNI.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usb_NNI.h | 1 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usbrun.cpp | 29 | ||||
-rw-r--r-- | noncore/settings/networksettings2/usb/usbrun.h | 5 |
6 files changed, 47 insertions, 12 deletions
diff --git a/noncore/settings/networksettings2/usb/usb_NN.cpp b/noncore/settings/networksettings2/usb/usb_NN.cpp index c65771d..be4a2bc 100644 --- a/noncore/settings/networksettings2/usb/usb_NN.cpp +++ b/noncore/settings/networksettings2/usb/usb_NN.cpp @@ -44,3 +44,3 @@ bool USBNetNode::generateProperFilesFor( -bool USBNetNode::hasDataFor( const QString & S ) { +bool USBNetNode::hasDataFor( const QString & S, bool ) { return (S== "interfaces"); @@ -55,2 +55,9 @@ bool USBNetNode::generateDataForCommonFile( +bool USBNetNode::generateDeviceDataForCommonFile( + SystemFile & S , + long DevNr, + ANetNodeInstance * NNI) { + return ((AUSB *)NNI)->generateDeviceDataForCommonFile(S, DevNr); +} + extern "C" { diff --git a/noncore/settings/networksettings2/usb/usb_NN.h b/noncore/settings/networksettings2/usb/usb_NN.h index 8b97452..8ff5289 100644 --- a/noncore/settings/networksettings2/usb/usb_NN.h +++ b/noncore/settings/networksettings2/usb/usb_NN.h @@ -30,5 +30,7 @@ public: virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); - virtual bool hasDataFor( const QString & S ); + virtual bool hasDataFor( const QString & S, bool DeviceSpec ); virtual bool generateDataForCommonFile( SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); + virtual bool generateDeviceDataForCommonFile( + SystemFile & SF, long DevNr, ANetNodeInstance * NNI ); diff --git a/noncore/settings/networksettings2/usb/usb_NNI.cpp b/noncore/settings/networksettings2/usb/usb_NNI.cpp index 4729416..6fcd6d5 100644 --- a/noncore/settings/networksettings2/usb/usb_NNI.cpp +++ b/noncore/settings/networksettings2/usb/usb_NNI.cpp @@ -45,2 +45,13 @@ bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) { +bool AUSB::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) { + AsDevice * Dev = runtime()->device(); + QString NIC = Dev->genNic( DevNr ); + if( S.name() == "interfaces" ) { + // generate mapping stanza for this interface + S << "# check if " << NIC << " can be brought UP" << endl; + S << "mapping " << NIC << endl; + S << " script networksettings2-request" << endl << endl; + } + return 0; +} diff --git a/noncore/settings/networksettings2/usb/usb_NNI.h b/noncore/settings/networksettings2/usb/usb_NNI.h index b09f17a..5dead36 100644 --- a/noncore/settings/networksettings2/usb/usb_NNI.h +++ b/noncore/settings/networksettings2/usb/usb_NNI.h @@ -30,2 +30,3 @@ public : bool generateDataForCommonFile( SystemFile & S, long DevNr ); + bool generateDeviceDataForCommonFile( SystemFile & S, long DevNr ); diff --git a/noncore/settings/networksettings2/usb/usbrun.cpp b/noncore/settings/networksettings2/usb/usbrun.cpp index 49b5a77..3007e79 100644 --- a/noncore/settings/networksettings2/usb/usbrun.cpp +++ b/noncore/settings/networksettings2/usb/usbrun.cpp @@ -36,4 +36,13 @@ void USBRun::detectState( NodeCollection * NC ) { - fprintf( stderr, "NUP\n" ); - // definitively not up + fprintf( stderr, "Assigned %p\n", assignedInterface() ); + if( ( Run = assignedInterface() ) ) { + // we already have an interface assigned -> still present ? + if( ! Run->IsUp ) { + // usb is still free -> keep assignment + NC->setCurrentState( Available ); + return; + } // else interface is up but NOT us -> some other profile + } + + // nothing (valid) assigned to us assignInterface( 0 ); @@ -45,7 +54,9 @@ void USBRun::detectState( NodeCollection * NC ) { Run = It.current(); + fprintf( stderr, "%s %d %d=%d %d\n", - Run->Name.latin1(), - handlesInterface( Run->Name ), - Run->CardType, ARPHRD_ETHER, - ! Run->IsUp ); + Run->Name.latin1(), + handlesInterface( Run->Name ), + Run->CardType, ARPHRD_ETHER, + ! Run->IsUp ); + if( handlesInterface( Run->Name ) && @@ -54,3 +65,3 @@ void USBRun::detectState( NodeCollection * NC ) { ) { - fprintf( stderr, "OFF\n" ); + fprintf( stderr, "Released(OFF)\n" ); // proper type, and Not UP -> free @@ -85,2 +96,3 @@ bool USBRun::setState( NodeCollection * NC, Action_t A ) { assignInterface( N ); + fprintf( stderr, "Assing %p\n", N ); NC->setCurrentState( Available ); @@ -94,4 +106,3 @@ bool USBRun::setState( NodeCollection * NC, Action_t A ) { return 0; - } - if( NC->currentState() != Available ) { + } else if( NC->currentState() != Available ) { return 1; diff --git a/noncore/settings/networksettings2/usb/usbrun.h b/noncore/settings/networksettings2/usb/usbrun.h index c9c9121..60f9fe8 100644 --- a/noncore/settings/networksettings2/usb/usbrun.h +++ b/noncore/settings/networksettings2/usb/usbrun.h @@ -20,5 +20,8 @@ public : virtual QString genNic( long nr ); + virtual AsDevice * device( void ) - { return asDevice(); } + { return (AsDevice *)this; } + virtual AsDevice * asDevice( void ) + { return (AsDevice *)this; } protected : |