Changeset 1371
- Timestamp:
- 10/23/08 09:00:47 (3 years ago)
- Files:
-
- branches/libffado-2.0/config.h.in (modified) (2 diffs)
- branches/libffado-2.0/libffado/ffado.h (modified) (1 diff)
- branches/libffado-2.0/README (modified) (2 diffs)
- branches/libffado-2.0/SConstruct (modified) (1 diff)
- branches/libffado-2.0/src/bebob/bebob_avdevice.cpp (modified) (1 diff)
- branches/libffado-2.0/src/bebob/edirol/edirol_fa101.cpp (modified) (1 diff)
- branches/libffado-2.0/src/bebob/edirol/edirol_fa66.cpp (modified) (1 diff)
- branches/libffado-2.0/src/bebob/focusrite/focusrite_cmd.h (modified) (1 diff)
- branches/libffado-2.0/src/bebob/focusrite/focusrite_generic.cpp (modified) (3 diffs)
- branches/libffado-2.0/src/bebob/focusrite/focusrite_saffire.cpp (modified) (1 diff)
- branches/libffado-2.0/src/bebob/focusrite/focusrite_saffirepro.cpp (modified) (1 diff)
- branches/libffado-2.0/src/bebob/mackie/onyxmixer.cpp (modified) (1 diff)
- branches/libffado-2.0/src/bebob/terratec/terratec_cmd.h (modified) (1 diff)
- branches/libffado-2.0/src/ffado.cpp (modified) (1 diff)
- branches/libffado-2.0/src/fireworks/efc/efc_avc_cmd.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/audiosubunit/avc_function_block.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/avc_definitions.h (modified) (2 diffs)
- branches/libffado-2.0/src/libavc/ccm/avc_signal_source.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libavc/ccm/avc_signal_source.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/descriptors/avc_descriptor.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/descriptors/avc_descriptor_cmd.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_connect.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_extended_plug_info.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_extended_subunit_info.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_generic.cpp (modified) (3 diffs)
- branches/libffado-2.0/src/libavc/general/avc_generic.h (modified) (4 diffs)
- branches/libffado-2.0/src/libavc/general/avc_plug_info.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_signal_format.cpp (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_signal_format.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_subunit_info.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_unit.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/general/avc_unit_info.h (modified) (2 diffs)
- branches/libffado-2.0/src/libavc/general/avc_vendor_dependent_cmd.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/musicsubunit/avc_descriptor_music.h (modified) (1 diff)
- branches/libffado-2.0/src/libavc/streamformat/avc_extended_stream_format.h (modified) (1 diff)
- branches/libffado-2.0/src/libieee1394/ieee1394service.cpp (modified) (6 diffs)
- branches/libffado-2.0/src/libieee1394/ieee1394service.h (modified) (4 diffs)
- branches/libffado-2.0/src/SConscript (modified) (1 diff)
- branches/libffado-2.0/support/firmware/SConscript (modified) (1 diff)
- branches/libffado-2.0/tests/test-ffado.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/config.h.in
r1345 r1371 109 109 #define IEEE1394SERVICE_CYCLETIMER_DLL_UPDATE_INTERVAL_USEC 200000 110 110 #define IEEE1394SERVICE_MAX_FIREWIRE_PORTS 4 111 #define IEEE1394SERVICE_MIN_SPLIT_TIMEOUT_USECS 1000000 111 112 112 113 #define IEEE1394SERVICE_CYCLETIMER_HELPER_RUN_REALTIME 1 … … 116 117 #define IEEE1394SERVICE_CONFIGROM_READ_WAIT_USECS 1000 117 118 119 // FCP defines 120 #define IEEE1394SERVICE_FCP_MAX_TRIES 20 121 #define IEEE1394SERVICE_FCP_SLEEP_BETWEEN_FAILURES_USECS 1000 122 #define IEEE1394SERVICE_FCP_POLL_TIMEOUT_MSEC 200 123 #define IEEE1394SERVICE_FCP_RESPONSE_TIMEOUT_USEC 2000000 118 124 119 125 // The current version of libiec61883 doesn't seem to calculate branches/libffado-2.0/libffado/ffado.h
r967 r1371 55 55 56 56 /* various function */ 57 58 /* workaround: wait usec after each AVC command.59 will disapear as soon bug is fixed */60 void ffado_sleep_after_avc_command( int time );61 62 57 63 58 /* The basic operation of the API is as follows: branches/libffado-2.0/README
r1259 r1371 102 102 libraw1394 (>= 1.3.0), http://www.linux1394.org 103 103 libiec61883 (>= 1.1.0), http://www.linux1394.org 104 libavc1394 (>= 0.5.3), http://sourceforge.net/projects/libavc1394105 104 dbus-1 (>= 1.0), http://dbus.freedesktop.org 106 105 … … 116 115 To build the optional ffado device mixer control utility you also require: 117 116 118 Qt (>= 3.0), http://trolltech.com/products/qt117 Qt (>= 4.0), http://trolltech.com/products/qt 119 118 SIP (>= 4.7.0), http://www.riverbankcomputing.co.uk/sip/index.php 120 119 PyQt (note below), http://www.riverbankcomputing.co.uk/pyqt/ 121 120 dbus-python (>= 0.82.0), http://dbus.freedesktop.org/releases/dbus-python/ 122 121 123 The version of PyQt must be chosen to match the version of Qt in use. For 124 Qt 4.x use PyQt 4.x, while PyQt 3.x is applicable for all other Qt versions 125 from 1.43. 122 The version of PyQt must be chosen to exactly match the version of Qt in use. 123 For Qt 4.x use PyQt 4.x. 126 124 127 125 SIP is only required to compile PyQt. If using a binary package of PyQt branches/libffado-2.0/SConstruct
r1364 r1371 236 236 pkgs = { 237 237 'libraw1394' : '1.3.0', 238 'libavc1394' : '0.5.3',239 238 'libiec61883' : '1.1.0', 240 239 'dbus-1' : '1.0', branches/libffado-2.0/src/bebob/bebob_avdevice.cpp
r1366 r1371 67 67 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::AvDevice (NodeID %d)\n", 68 68 getConfigRom().getNodeId() ); 69 70 // DM1500 based devices seem to upset the linux1394 stack when commands are71 // sent too fast.72 if (AVC::AVCCommand::getSleepAfterAVCCommand() < 200) {73 AVC::AVCCommand::setSleepAfterAVCCommand( 200 );74 }75 76 69 } 77 70 branches/libffado-2.0/src/bebob/edirol/edirol_fa101.cpp
r1362 r1371 40 40 m_fixed_clocksource.slipping = false; 41 41 m_fixed_clocksource.description = "Device Controlled"; 42 43 if (AVC::AVCCommand::getSleepAfterAVCCommand() < 1500) {44 AVC::AVCCommand::setSleepAfterAVCCommand( 1500 );45 }46 42 } 47 43 branches/libffado-2.0/src/bebob/edirol/edirol_fa66.cpp
r1362 r1371 40 40 m_fixed_clocksource.slipping = false; 41 41 m_fixed_clocksource.description = "Device Controlled"; 42 43 if (AVC::AVCCommand::getSleepAfterAVCCommand() < 1500) {44 AVC::AVCCommand::setSleepAfterAVCCommand( 1500 );45 }46 42 } 47 43 branches/libffado-2.0/src/bebob/focusrite/focusrite_cmd.h
r864 r1371 29 29 #include "libavc/general/avc_vendor_dependent_cmd.h" 30 30 31 #include <libavc1394/avc1394.h>32 33 31 namespace BeBoB { 34 32 namespace Focusrite { branches/libffado-2.0/src/bebob/focusrite/focusrite_generic.cpp
r1370 r1371 148 148 if(!get1394Service().write_quadlet( nodeId, addr, CondSwapToBus32(data) ) ) { 149 149 debugError("Could not write to node 0x%04X addr 0x%012X\n", nodeId, addr); 150 Util::SystemTimeSource::SleepUsecRelative(AVC::AVCCommand::getSleepAfterAVCCommand()); 151 return false; 152 } 153 Util::SystemTimeSource::SleepUsecRelative(AVC::AVCCommand::getSleepAfterAVCCommand()); 150 return false; 151 } 154 152 return true; 155 153 } … … 166 164 if(!get1394Service().read_quadlet( nodeId, addr, &result ) ) { 167 165 debugError("Could not read from node 0x%04llX addr 0x%012llX\n", nodeId, addr); 168 Util::SystemTimeSource::SleepUsecRelative(AVC::AVCCommand::getSleepAfterAVCCommand());169 166 return false; 170 167 } … … 174 171 175 172 *v = result; 176 Util::SystemTimeSource::SleepUsecRelative(AVC::AVCCommand::getSleepAfterAVCCommand());177 173 return true; 178 174 } branches/libffado-2.0/src/bebob/focusrite/focusrite_saffire.cpp
r1370 r1371 34 34 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Focusrite::SaffireDevice (NodeID %d)\n", 35 35 getConfigRom().getNodeId() ); 36 37 // the saffire doesn't seem to like it if the commands are too fast38 if (AVC::AVCCommand::getSleepAfterAVCCommand() < 4000) {39 AVC::AVCCommand::setSleepAfterAVCCommand( 4000 );40 }41 36 42 37 if(getConfigRom().getGuid() < 0x130e0100040000LL) { branches/libffado-2.0/src/bebob/focusrite/focusrite_saffirepro.cpp
r1370 r1371 44 44 45 45 addOption(Util::OptionContainer::Option("rebootOnSamplerateChange", true)); 46 47 // the saffire pro doesn't seem to like it if the commands are too fast48 if (AVC::AVCCommand::getSleepAfterAVCCommand() < 1000) {49 AVC::AVCCommand::setSleepAfterAVCCommand( 1000 );50 }51 46 52 47 updateClockSources(); branches/libffado-2.0/src/bebob/mackie/onyxmixer.cpp
r1210 r1371 41 41 debugOutput( DEBUG_LEVEL_VERBOSE, "Created BeBoB::Mackie::OnyxMixerDevice (NodeID %d)\n", 42 42 getConfigRom().getNodeId() ); 43 44 // needs a lot of time45 if (AVC::AVCCommand::getSleepAfterAVCCommand() < 1000) {46 AVC::AVCCommand::setSleepAfterAVCCommand( 1000 );47 }48 43 } 49 44 branches/libffado-2.0/src/bebob/terratec/terratec_cmd.h
r864 r1371 28 28 #include "libutil/cmd_serialize.h" 29 29 #include "libavc/general/avc_vendor_dependent_cmd.h" 30 31 #include <libavc1394/avc1394.h>32 30 33 31 namespace BeBoB { branches/libffado-2.0/src/ffado.cpp
r1282 r1371 74 74 ffado_get_api_version() { 75 75 return FFADO_API_VERSION; 76 }77 78 // FIXME: this should be cleaned up79 #include "libavc/general/avc_generic.h"80 void ffado_sleep_after_avc_command( int time )81 {82 AVC::AVCCommand::setSleepAfterAVCCommand( time );83 76 } 84 77 branches/libffado-2.0/src/fireworks/efc/efc_avc_cmd.h
r864 r1371 29 29 #include "libavc/general/avc_vendor_dependent_cmd.h" 30 30 31 #include <libavc1394/avc1394.h>32 33 31 #include "efc_cmd.h" 34 32 branches/libffado-2.0/src/libavc/audiosubunit/avc_function_block.h
r1351 r1371 28 28 #include "../general/avc_generic.h" 29 29 30 #include <libavc1394/avc1394.h>31 30 #include <vector> 32 31 using namespace std; branches/libffado-2.0/src/libavc/avc_definitions.h
r1235 r1371 25 25 #define AVCDEFINITIONS_H 26 26 27 #include <libavc1394/avc1394.h>28 27 #include <cstring> 29 28 #include <cstdlib> 30 29 #include <ostream> 31 30 #include <libraw1394/raw1394.h> 32 31 33 32 namespace AVC { … … 88 87 typedef quadlet_t company_id_t; 89 88 90 #define AVC1394_SUBUNIT_AUDIO 1 91 #define AVC1394_SUBUNIT_PRINTER 2 92 #define AVC1394_SUBUNIT_CA 6 93 #define AVC1394_SUBUNIT_PANEL 9 94 #define AVC1394_SUBUNIT_BULLETIN_BOARD 0xA 95 #define AVC1394_SUBUNIT_CAMERA_STORAGE 0xB 96 #define AVC1394_SUBUNIT_MUSIC 0xC 97 #define AVC1394_SUBUNIT_RESERVED 0x1D 89 enum ESubunitType { 90 eST_Monitor = 0x00, 91 eST_Audio = 0x01, 92 eST_Printer = 0x02, 93 eST_Disc = 0x03, 94 eST_VCR = 0x04, 95 eST_Tuner = 0x05, 96 eST_CA = 0x06, 97 eST_Camera = 0x07, 98 eST_Panel = 0x09, 99 eST_BulltinBoard = 0x0A, 100 eST_CameraStorage = 0x0B, 101 eST_Music = 0x0C, 102 eST_VendorUnique = 0x1C, 103 eST_Reserved = 0x1D, 104 eST_Extended = 0x1E, 105 eST_Unit = 0x1F, 106 }; 98 107 99 108 #define AVC1394_SUBUNIT_ID_RESERVED 0x06 100 101 enum ESubunitType {102 eST_Monitor = AVC1394_SUBUNIT_VIDEO_MONITOR,103 eST_Audio = AVC1394_SUBUNIT_AUDIO,104 eST_Printer = AVC1394_SUBUNIT_PRINTER,105 eST_Disc = AVC1394_SUBUNIT_DISC_RECORDER,106 eST_VCR = AVC1394_SUBUNIT_VCR,107 eST_Tuner = AVC1394_SUBUNIT_TUNER,108 eST_CA = AVC1394_SUBUNIT_CA,109 eST_Camera = AVC1394_SUBUNIT_VIDEO_CAMERA,110 eST_Panel = AVC1394_SUBUNIT_PANEL,111 eST_BulltinBoard = AVC1394_SUBUNIT_BULLETIN_BOARD,112 eST_CameraStorage = AVC1394_SUBUNIT_CAMERA_STORAGE,113 eST_Music = AVC1394_SUBUNIT_MUSIC,114 eST_VendorUnique = AVC1394_SUBUNIT_VENDOR_UNIQUE,115 eST_Reserved = AVC1394_SUBUNIT_RESERVED,116 eST_Extended = AVC1394_SUBUNIT_EXTENDED,117 eST_Unit = AVC1394_SUBUNIT_UNIT,118 };119 109 120 110 enum ESubunitType byteToSubunitType(byte_t s); branches/libffado-2.0/src/libavc/ccm/avc_signal_source.cpp
r1135 r1371 68 68 69 69 SignalSubunitAddress::SignalSubunitAddress() 70 : m_subunitType( AVC1394_SUBUNIT_RESERVED)70 : m_subunitType( eST_Reserved ) 71 71 , m_subunitId( AVC1394_SUBUNIT_ID_RESERVED ) 72 72 , m_plugId( ePI_Invalid ) branches/libffado-2.0/src/libavc/ccm/avc_signal_source.h
r1238 r1371 27 27 #include "../general/avc_generic.h" 28 28 #include "../avc_definitions.h" 29 30 #include <libavc1394/avc1394.h>31 29 32 30 namespace AVC { branches/libffado-2.0/src/libavc/descriptors/avc_descriptor.h
r1357 r1371 41 41 #include "debugmodule/debugmodule.h" 42 42 43 #include <libavc1394/avc1394.h>44 43 #include <string> 45 44 branches/libffado-2.0/src/libavc/descriptors/avc_descriptor_cmd.h
r864 r1371 27 27 #include "../general/avc_generic.h" 28 28 29 #include <libavc1394/avc1394.h>30 31 29 namespace AVC { 32 30 31 #define AVC1394_CMD_OPEN_DESCRIPTOR 0x08 32 #define AVC1394_CMD_READ_DESCRIPTOR 0x09 33 #define AVC1394_CMD_WRITE_DESCRIPTOR 0x0A 34 #define AVC1394_CMD_SEARCH_DESCRIPTOR 0x0B 35 #define AVC1394_CMD_OBJECT_NUMBER_SELECT 0x0D 33 36 34 // defined in avc1394.h35 // #define AVC1394_CMD_OPEN_DESCRIPTOR 0x0836 // #define AVC1394_CMD_READ_DESCRIPTOR 0x0937 // #define AVC1394_CMD_WRITE_DESCRIPTOR 0x0A38 // #define AVC1394_CMD_SEARCH_DESCRIPTOR 0x0B39 // #define AVC1394_CMD_OBJECT_NUMBER_SELECT 0x0D40 41 // not yet defined42 37 #define AVC1394_CMD_CREATE_DESCRIPTOR 0x0C 43 38 #define AVC1394_CMD_OPEN_INFOBLOCK 0x05 branches/libffado-2.0/src/libavc/general/avc_connect.h
r864 r1371 27 27 #include "avc_generic.h" 28 28 29 #include <libavc1394/avc1394.h> 29 #define AVC1394_CMD_CONNECT 0x24 30 30 31 namespace AVC { 31 32 branches/libffado-2.0/src/libavc/general/avc_extended_plug_info.h
r864 r1371 28 28 #include "avc_generic.h" 29 29 30 #include <libavc1394/avc1394.h>31 32 30 #include <string> 33 31 #include <vector> 32 33 #define AVC1394_CMD_PLUG_INFO 0x02 34 34 35 35 namespace AVC { branches/libffado-2.0/src/libavc/general/avc_extended_subunit_info.h
r864 r1371 27 27 #include "avc_generic.h" 28 28 29 #include <libavc1394/avc1394.h>30 31 29 #include <string> 32 30 #include <vector> 31 32 #define AVC1394_CMD_SUBUNIT_INFO 0x31 33 33 34 34 namespace AVC { branches/libffado-2.0/src/libavc/general/avc_generic.cpp
r1235 r1371 42 42 IMPL_DEBUG_MODULE( AVCCommand, AVCCommand, DEBUG_LEVEL_NORMAL ); 43 43 IMPL_DEBUG_MODULE( IBusData, IBusData, DEBUG_LEVEL_VERBOSE ); 44 45 int AVCCommand::m_time = 0;46 44 47 45 AVCCommand::AVCCommand( Ieee1394Service& ieee1394service, … … 269 267 debugOutput( DEBUG_LEVEL_VERBOSE, "no response (ntries: %d)\n", ntries ); 270 268 m_p1394Service->transactionBlockClose(); 271 SleepRelativeUsec( m_time * 10 );272 269 } 273 270 } … … 277 274 } 278 275 279 SleepRelativeUsec( m_time );280 281 276 return result; 282 }283 284 void285 AVCCommand::setSleepAfterAVCCommand( int time )286 {287 m_time = time;288 277 } 289 278 branches/libffado-2.0/src/libavc/general/avc_generic.h
r864 r1371 29 29 30 30 #include "fbtypes.h" 31 32 #include <libavc1394/avc1394.h>33 31 34 32 class Ieee1394Service; … … 70 68 public: 71 69 enum EResponse { 72 eR_Unknown = 0 ,73 eR_NotImplemented = AVC1394_RESP_NOT_IMPLEMENTED,74 eR_Accepted = AVC1394_RESP_ACCEPTED,75 eR_Rejected = AVC1394_RESP_REJECTED,76 eR_InTransition = AVC1394_RESP_IN_TRANSITION,77 eR_Implemented = AVC1394_RESP_IMPLEMENTED,78 eR_Changed = AVC1394_RESP_CHANGED,79 eR_Interim = AVC1394_RESP_INTERIM,70 eR_Unknown = 0xff, 71 eR_NotImplemented = 0x08, 72 eR_Accepted = 0x09, 73 eR_Rejected = 0x0A, 74 eR_InTransition = 0x0B, 75 eR_Implemented = 0x0C, 76 eR_Changed = 0x0D, 77 eR_Interim = 0x0F, 80 78 }; 81 79 82 80 enum ECommandType { 83 eCT_Control = AVC1394_CTYP_CONTROL,84 eCT_Status = AVC1394_CTYP_STATUS,85 eCT_SpecificInquiry = AVC1394_CTYP_SPECIFIC_INQUIRY,86 eCT_Notify = AVC1394_CTYP_NOTIFY,87 eCT_GeneralInquiry = AVC1394_CTYP_GENERAL_INQUIRY,81 eCT_Control = 0x00, 82 eCT_Status = 0x01, 83 eCT_SpecificInquiry = 0x02, 84 eCT_Notify = 0x03, 85 eCT_GeneralInquiry = 0x04, 88 86 eCT_Unknown = 0xff, 89 87 }; … … 112 110 virtual const char* getCmdName() const = 0; 113 111 114 // workaround115 static void setSleepAfterAVCCommand( int time );116 static int getSleepAfterAVCCommand( ) {return m_time;};117 112 protected: 118 113 void showFcpFrame( const unsigned char* buf, … … 136 131 EResponse m_eResponse; 137 132 ECommandType m_commandType; 138 static int m_time; 139 133 140 134 protected: 141 135 DECLARE_DEBUG_MODULE; branches/libffado-2.0/src/libavc/general/avc_plug_info.h
r864 r1371 27 27 #include "avc_generic.h" 28 28 29 # include <libavc1394/avc1394.h>29 #define AVC1394_CMD_PLUG_INFO 0x02 30 30 31 31 #define AVC1394_PLUG_INFO_SUBFUNCTION_SERIAL_BUS_ISOCHRONOUS_AND_EXTERNAL_PLUG 0x00 branches/libffado-2.0/src/libavc/general/avc_signal_format.cpp
r1135 r1371 28 28 #include "libutil/ByteSwap.h" 29 29 #include <iostream> 30 31 #define AVC1394_CMD_INPUT_PLUG_SIGNAL_FORMAT 0x19 32 #define AVC1394_CMD_OUTPUT_PLUG_SIGNAL_FORMAT 0x18 30 33 31 34 using namespace std; branches/libffado-2.0/src/libavc/general/avc_signal_format.h
r864 r1371 27 27 28 28 #include "avc_generic.h" 29 30 #include <libavc1394/avc1394.h>31 29 32 30 namespace AVC { branches/libffado-2.0/src/libavc/general/avc_subunit_info.h
r864 r1371 27 27 #include "avc_generic.h" 28 28 29 #include <libavc1394/avc1394.h> 30 29 #define AVC1394_CMD_SUBUNIT_INFO 0x31 31 30 32 31 namespace AVC { branches/libffado-2.0/src/libavc/general/avc_unit.h
r1238 r1371 98 98 SubunitAudio* getAudioSubunit( subunit_id_t subunitId ) 99 99 { return dynamic_cast<SubunitAudio*>( 100 getSubunit( AVC1394_SUBUNIT_AUDIO, subunitId ));};100 getSubunit( eST_Audio , subunitId ));}; 101 101 SubunitMusic* getMusicSubunit( subunit_id_t subunitId ) 102 102 { return dynamic_cast<SubunitMusic*>( 103 getSubunit( AVC1394_SUBUNIT_MUSIC, subunitId ));};103 getSubunit( eST_Music , subunitId ));}; 104 104 Subunit* getSubunit( subunit_type_t subunitType, 105 105 subunit_id_t subunitId ) const; branches/libffado-2.0/src/libavc/general/avc_unit_info.h
r864 r1371 27 27 #include "avc_generic.h" 28 28 29 # include <libavc1394/avc1394.h>29 #define AVC1394_CMD_UNIT_INFO 0x30 30 30 31 31 namespace AVC { … … 35 35 { 36 36 public: 37 38 enum EUnitType {39 eUT_Monitor = AVC1394_SUBUNIT_VIDEO_MONITOR,40 eUT_Audio = AVC1394_SUBUNIT_AUDIO,41 eUT_Printer = AVC1394_SUBUNIT_PRINTER,42 eUT_Disc = AVC1394_SUBUNIT_DISC_RECORDER,43 eUT_VCR = AVC1394_SUBUNIT_VCR,44 eUT_Tuner = AVC1394_SUBUNIT_TUNER,45 eUT_CA = AVC1394_SUBUNIT_CA,46 eUT_Camera = AVC1394_SUBUNIT_VIDEO_CAMERA,47 eUT_Panel = AVC1394_SUBUNIT_PANEL,48 eUT_BulltinBoard = AVC1394_SUBUNIT_BULLETIN_BOARD,49 eUT_CameraStorage = AVC1394_SUBUNIT_CAMERA_STORAGE,50 eUT_Music = AVC1394_SUBUNIT_MUSIC,51 eUT_VendorUnique = AVC1394_SUBUNIT_VENDOR_UNIQUE,52 eUT_Reserved = AVC1394_SUBUNIT_RESERVED,53 eUT_Extended = AVC1394_SUBUNIT_EXTENDED,54 eUT_Unit = AVC1394_SUBUNIT_UNIT,55 };56 57 37 UnitInfoCmd( Ieee1394Service& ieee1349service ); 58 38 virtual ~UnitInfoCmd(); branches/libffado-2.0/src/libavc/general/avc_vendor_dependent_cmd.h
r864 r1371 27 27 #include "avc_generic.h" 28 28 29 #include <libavc1394/avc1394.h>30 29 namespace AVC { 31 30 branches/libffado-2.0/src/libavc/musicsubunit/avc_descriptor_music.h
r1357 r1371 37 37 38 38 #include "debugmodule/debugmodule.h" 39 40 #include <libavc1394/avc1394.h>41 39 42 40 #include <vector> branches/libffado-2.0/src/libavc/streamformat/avc_extended_stream_format.h
r1356 r1371 28 28 #include "../general/avc_extended_cmd_generic.h" 29 29 30 #include <libavc1394/avc1394.h>31 30 #include <iostream> 32 31 #include <vector> branches/libffado-2.0/src/libieee1394/ieee1394service.cpp
r1341 r1371 29 29 #include "CycleTimerHelper.h" 30 30 31 #include <libavc1394/avc1394.h>32 31 #include <libraw1394/csr.h> 33 32 #include <libiec61883/iec61883.h> … … 274 273 } 275 274 275 // set userdata 276 276 raw1394_set_userdata( m_handle, this ); 277 277 raw1394_set_userdata( m_resetHandle, this ); … … 280 280 this->resetHandlerLowLevel ); 281 281 282 // set SPLIT_TIMEOUT to one second to cope with DM1x00 devices that 283 // send responses regardless of the timeout 284 int timeout = getSplitTimeoutUsecs(getLocalNodeId()); 285 if (timeout < IEEE1394SERVICE_MIN_SPLIT_TIMEOUT_USECS) { 286 if(!setSplitTimeoutUsecs(getLocalNodeId(), IEEE1394SERVICE_MIN_SPLIT_TIMEOUT_USECS+124)) { 287 debugWarning("Could not set SPLIT_TIMEOUT to min requested\n"); 288 } 289 timeout = getSplitTimeoutUsecs(getLocalNodeId()); 290 if (timeout < IEEE1394SERVICE_MIN_SPLIT_TIMEOUT_USECS) { 291 debugWarning("Set SPLIT_TIMEOUT to min requested did not succeed\n"); 292 } 293 } 294 295 // check state 282 296 if(!m_pCTRHelper) { 283 297 debugFatal("No CycleTimerHelper available, bad!\n"); … … 435 449 { 436 450 Util::MutexLockHelper lock(*m_handle_lock); 451 return readNoLock(nodeId, addr, length, buffer); 452 } 453 454 bool 455 Ieee1394Service::readNoLock( fb_nodeid_t nodeId, 456 fb_nodeaddr_t addr, 457 size_t length, 458 fb_quadlet_t* buffer ) 459 { 437 460 if (nodeId == INVALID_NODE_ID) { 438 461 debugWarning("operation on invalid node\n"); … … 483 506 { 484 507 Util::MutexLockHelper lock(*m_handle_lock); 508 return writeNoLock(nodeId, addr, length, data); 509 } 510 511 bool 512 Ieee1394Service::writeNoLock( fb_nodeid_t nodeId, 513 fb_nodeaddr_t addr, 514 size_t length, 515 fb_quadlet_t* data ) 516 { 485 517 if (nodeId == INVALID_NODE_ID) { 486 518 debugWarning("operation on invalid node\n"); … … 573 605 unsigned int* resp_len ) 574 606 { 607 // FIXME: simplify semantics 575 608 if (nodeId == INVALID_NODE_ID) { 576 609 debugWarning("operation on invalid node\n"); 577 610 return false; 578 611 } 579 // FIXME: this requirestransactionBlockClose to unlock612 // NOTE: this expects a call to transactionBlockClose to unlock 580 613 m_handle_lock->Lock(); 581 for (int i = 0; i < len; ++i) { 582 buf[i] = CondSwapFromBus32( buf[i] ); 583 } 584 585 fb_quadlet_t* result = 586 avc1394_transaction_block2( m_handle, 587 nodeId, 588 buf, 589 len, 590 resp_len, 591 1 ); 592 593 for ( unsigned int i = 0; i < *resp_len; ++i ) { 594 result[i] = CondSwapToBus32( result[i] ); 595 } 596 597 return result; 598 } 599 614 615 // clear the request & response memory 616 memset(&m_fcp_block, 0, sizeof(m_fcp_block)); 617 618 // make a local copy of the request 619 if(len < MAX_FCP_BLOCK_SIZE_QUADS) { 620 memcpy(m_fcp_block.request, buf, len*sizeof(quadlet_t)); 621 m_fcp_block.request_length = len; 622 } else { 623 debugWarning("Truncating FCP request\n"); 624 memcpy(m_fcp_block.request, buf, MAX_FCP_BLOCK_SIZE_BYTES); 625 m_fcp_block.request_length = MAX_FCP_BLOCK_SIZE_QUADS; 626 } 627 m_fcp_block.target_nodeid = 0xffc0 | nodeId; 628 629 bool success = doFcpTransaction(); 630 if(success) { 631 *resp_len = m_fcp_block.response_length; 632 return m_fcp_block.response; 633 } else { 634 debugWarning("FCP transaction failed\n"); 635 *resp_len = 0; 636 return NULL; 637 } 638 } 600 639 601 640 bool 602 641 Ieee1394Service::transactionBlockClose() 603 642 { 604 avc1394_transaction_block_close( m_handle );605 643 m_handle_lock->Unlock(); 606 644 return true; 645 } 646 647 // FCP code 648 bool 649 Ieee1394Service::doFcpTransaction() 650 { 651 for(int i=0; i < IEEE1394SERVICE_FCP_MAX_TRIES; i++) { 652 if(doFcpTransactionTry()) { 653 return true; 654 } else { 655 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP transaction try %d failed\n", i); 656 Util::SystemTimeSource::SleepUsecRelative( IEEE1394SERVICE_FCP_SLEEP_BETWEEN_FAILURES_USECS); 657 } 658 } 659 debugError("FCP transaction didn't succeed in %d tries\n", IEEE1394SERVICE_FCP_MAX_TRIES); 660 return false; 661 } 662 663 #define FCP_COMMAND_ADDR 0xFFFFF0000B00ULL 664 #define FCP_RESPONSE_ADDR 0xFFFFF0000D00ULL 665 666 /* AV/C FCP response codes */ 667 #define FCP_RESPONSE_NOT_IMPLEMENTED 0x08000000 668 #define FCP_RESPONSE_ACCEPTED 0x09000000 669 #define FCP_RESPONSE_REJECTED 0x0A000000 670 #define FCP_RESPONSE_IN_TRANSITION 0x0B000000 671 #define FCP_RESPONSE_IMPLEMENTED 0x0C000000 672 #define FCP_RESPONSE_STABLE 0x0C000000 673 #define FCP_RESPONSE_CHANGED 0x0D000000 674 #define FCP_RESPONSE_INTERIM 0x0F000000 675 676 /* AV/C FCP mask macros */ 677 #define FCP_MASK_START(x) ((x) & 0xF0000000) 678 #define FCP_MASK_CTYPE(x) ((x) & 0x0F000000) 679 #define FCP_MASK_RESPONSE(x) ((x) & 0x0F000000) 680 #define FCP_MASK_SUBUNIT(x) ((x) & 0x00FF0000) 681 #define FCP_MASK_SUBUNIT_TYPE(x) ((x) & 0x00F80000) 682 #define FCP_MASK_SUBUNIT_ID(x) ((x) & 0x00070000) 683 #define FCP_MASK_OPCODE(x) ((x) & 0x0000FF00) 684 #define FCP_MASK_SUBUNIT_AND_OPCODE(x) ((x) & 0x00FFFF00) 685 #define FCP_MASK_OPERAND0(x) ((x) & 0x000000FF) 686 #define FCP_MASK_OPERAND(x, n) ((x) & (0xFF000000 >> ((((n)-1)%4)*8))) 687 #define FCP_MASK_RESPONSE_OPERAND(x, n) ((x) & (0xFF000000 >> (((n)%4)*8))) 688 689 bool 690 Ieee1394Service::doFcpTransactionTry() 691 { 692 // NOTE that access to this is protected by the m_handle lock 693 int err; 694 bool retval = true; 695 uint64_t timeout; 696 697 // prepare an fcp response handler 698 raw1394_set_fcp_handler(m_handle, _avc_fcp_handler); 699 700 // start listening for FCP requests 701 // this fails if some other program is listening for a FCP response 702 err = raw1394_start_fcp_listen(m_handle); 703 if(err) { 704 debugOutput(DEBUG_LEVEL_VERBOSE, "could not start FCP listen (err=%d, errno=%d)\n", err, errno); 705 retval = false; 706 goto out; 707 } 708 709 m_fcp_block.status = eFS_Waiting; 710 711 #ifdef DEBUG 712 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"fcp request: node 0x%hX, length = %d bytes\n", 713 m_fcp_block.target_nodeid, m_fcp_block.request_length*4); 714 printBuffer(DEBUG_LEVEL_VERY_VERBOSE, m_fcp_block.request_length, m_fcp_block.request ); 715 #endif 716 717 // write the FCP request 718 if(!writeNoLock( m_fcp_block.target_nodeid, FCP_COMMAND_ADDR, 719 m_fcp_block.request_length, m_fcp_block.request)) { 720 debugOutput(DEBUG_LEVEL_VERBOSE, "write of FCP request failed\n"); 721 retval = false; 722 goto out; 723 } 724 725 // wait for the response to arrive 726 struct pollfd raw1394_poll; 727 raw1394_poll.fd = raw1394_get_fd(m_handle); 728 raw1394_poll.events = POLLIN; 729 730 timeout = Util::SystemTimeSource::getCurrentTimeAsUsecs() + 731 IEEE1394SERVICE_FCP_RESPONSE_TIMEOUT_USEC; 732 733 while(m_fcp_block.status == eFS_Waiting 734 && Util::SystemTimeSource::getCurrentTimeAsUsecs() < timeout) { 735 if(poll( &raw1394_poll, 1, IEEE1394SERVICE_FCP_POLL_TIMEOUT_MSEC) > 0) { 736 if (raw1394_poll.revents & POLLIN) { 737 raw1394_loop_iterate(m_handle); 738 } 739 } 740 } 741 742 // stop listening for FCP responses 743 err = raw1394_stop_fcp_listen(m_handle); 744 if(err) { 745 debugOutput(DEBUG_LEVEL_VERBOSE, "could not stop FCP listen (err=%d, errno=%d)\n", err, errno); 746 retval = false; 747 goto out; 748 } 749 750 // check the request and figure out what happened 751 if(m_fcp_block.status == eFS_Waiting) { 752 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response timed out\n"); 753 retval = false; 754 goto out; 755 } 756 if(m_fcp_block.status == eFS_Error) { 757 debugError("FCP request/response error\n"); 758 retval = false; 759 goto out; 760 } 761 762 out: 763 m_fcp_block.status = eFS_Empty; 764 return retval; 765 } 766 767 int 768 Ieee1394Service::_avc_fcp_handler(raw1394handle_t handle, nodeid_t nodeid, 769 int response, size_t length, 770 unsigned char *data) 771 { 772 Ieee1394Service *service = static_cast<Ieee1394Service *>(raw1394_get_userdata(handle)); 773 if(service) { 774 return service->handleFcpResponse(nodeid, response, length, data); 775 } else return -1; 776 } 777 778 int 779 Ieee1394Service::handleFcpResponse(nodeid_t nodeid, 780 int response, size_t length, 781 unsigned char *data) 782 { 783 fb_quadlet_t *data_quads = (fb_quadlet_t *)data; 784 #ifdef DEBUG 785 debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"fcp response: node 0x%hX, response = %d, length = %d bytes\n", 786 nodeid, response, length); 787 printBuffer(DEBUG_LEVEL_VERY_VERBOSE, (length+3)/4, data_quads ); 788 #endif 789 790 if (response && length > 3) { 791 if(length > MAX_FCP_BLOCK_SIZE_BYTES) { 792 length = MAX_FCP_BLOCK_SIZE_BYTES; 793 debugWarning("Truncated FCP response\n"); 794 } 795 796 // is it an actual response or is it INTERIM? 797 quadlet_t first_quadlet = CondSwapFromBus32(data_quads[0]); 798 if(FCP_MASK_RESPONSE(first_quadlet) == FCP_RESPONSE_INTERIM) { 799 debugOutput(DEBUG_LEVEL_VERBOSE, "INTERIM\n"); 800 } else { 801 // it's an actual response, check if it matches our request 802 if(nodeid != m_fcp_block.target_nodeid) { 803 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response node id's don't match! (%x, %x)\n", 804 m_fcp_block.target_nodeid, nodeid); 805 } else if (first_quadlet == 0) { 806 debugWarning("Bogus FCP response\n"); 807 printBuffer(DEBUG_LEVEL_WARNING, (length+3)/4, data_quads ); 808 #ifdef DEBUG 809 } else if(FCP_MASK_RESPONSE(first_quadlet) < 0x08000000) { 810 debugWarning("Bogus AV/C FCP response code\n"); 811 printBuffer(DEBUG_LEVEL_WARNING, (length+3)/4, data_quads ); 812 #endif 813 } else if(FCP_MASK_SUBUNIT_AND_OPCODE(first_quadlet) 814 != FCP_MASK_SUBUNIT_AND_OPCODE(CondSwapFromBus32(m_fcp_block.request[0]))) { 815 debugOutput(DEBUG_LEVEL_VERBOSE, "FCP response not for this request: %08lX != %08lX\n", 816 FCP_MASK_SUBUNIT_AND_OPCODE(first_quadlet), 817 FCP_MASK_SUBUNIT_AND_OPCODE(CondSwapFromBus32(m_fcp_block.request[0]))); 818 } else { 819 m_fcp_block.response_length = (length + sizeof(quadlet_t) - 1) / sizeof(quadlet_t); 820 memcpy(m_fcp_block.response, data, length); 821 m_fcp_block.status = eFS_Responded; 822 } 823 } 824 } 825 return 0; 826 } 827 828 bool 829 Ieee1394Service::setSplitTimeoutUsecs(fb_nodeid_t nodeId, unsigned int timeout) 830 { 831 Util::MutexLockHelper lock(*m_handle_lock); 832 debugOutput(DEBUG_LEVEL_VERBOSE, "setting SPLIT_TIMEOUT on node 0x%X to %uusecs...\n", nodeId, timeout); 833 unsigned int secs = timeout / 1000000; 834 unsigned int usecs = timeout % 1000000; 835 836 quadlet_t split_timeout_hi = CondSwapToBus32(secs & 7); 837 quadlet_t split_timeout_low = CondSwapToBus32(((usecs / 125) & 0x1FFF) << 19); 838 839 // write the CSR registers 840 if(!writeNoLock( 0xffc0 | nodeId, CSR_REGISTER_BASE + CSR_SPLIT_TIMEOUT_HI, 1, 841 &split_timeout_hi)) { 842 debugOutput(DEBUG_LEVEL_VERBOSE, "write of CSR_SPLIT_TIMEOUT_HI failed\n"); 843 return false; 844 } 845 if(!writeNoLock( 0xffc0 | nodeId, CSR_REGISTER_BASE + CSR_SPLIT_TIMEOUT_LO, 1, 846 &split_timeout_low)) { 847 debugOutput(DEBUG_LEVEL_VERBOSE, "write of CSR_SPLIT_TIMEOUT_LO failed\n"); 848 return false; 849 } 850 return true; 851 } 852 853 int 854 Ieee1394Service::getSplitTimeoutUsecs(fb_nodeid_t nodeId) 855 { 856 Util::MutexLockHelper lock(*m_handle_lock); 857 quadlet_t split_timeout_hi; 858 quadlet_t split_timeout_low; 859 860 debugOutput(DEBUG_LEVEL_VERBOSE, "reading SPLIT_TIMEOUT on node 0x%X...\n", nodeId); 861 862 if(!readNoLock( 0xffc0 | nodeId, CSR_REGISTER_BASE + CSR_SPLIT_TIMEOUT_HI, 1, 863 &split_timeout_hi)) { 864 debugOutput(DEBUG_LEVEL_VERBOSE, "read of CSR_SPLIT_TIMEOUT_HI failed\n"); 865 return 0; 866 } 867 debugOutput(DEBUG_LEVEL_VERBOSE, " READ HI: 0x%08lX\n", split_timeout_hi); 868 869 if(!readNoLock( 0xffc0 | nodeId, CSR_REGISTER_BASE + CSR_SPLIT_TIMEOUT_LO, 1, 870 &split_timeout_low)) { 871 debugOutput(DEBUG_LEVEL_VERBOSE, "read of CSR_SPLIT_TIMEOUT_LO failed\n"); 872 return 0; 873 } 874 debugOutput(DEBUG_LEVEL_VERBOSE, " READ LO: 0x%08lX\n", split_timeout_low); 875 876 split_timeout_hi = CondSwapFromBus32(split_timeout_hi); 877 split_timeout_low = CondSwapFromBus32(split_timeout_low); 878 879 return (split_timeout_hi & 7) * 1000000 + (split_timeout_low >> 19) * 125; 607 880 } 608 881 branches/libffado-2.0/src/libieee1394/ieee1394service.h
r1341 r1371 39 39 #include <vector> 40 40 #include <string> 41 42 #define MAX_FCP_BLOCK_SIZE_BYTES (512) 43 #define MAX_FCP_BLOCK_SIZE_QUADS (MAX_FCP_BLOCK_SIZE_BYTES / 4) 41 44 42 45 class IsoHandlerManager; … … 226 229 * @return true if succesful, false otherwise 227 230 */ 228 bool lockCompareSwap64( fb_nodeid_t nodeId, 229 fb_nodeaddr_t addr, 230 fb_octlet_t compare_value, 231 fb_octlet_t swap_value, 232 fb_octlet_t* result ); 233 231 bool lockCompareSwap64( fb_nodeid_t nodeId, 232 fb_nodeaddr_t addr, 233 fb_octlet_t compare_value, 234 fb_octlet_t swap_value, 235 fb_octlet_t* result ); 236 237 /** 238 * initiate AV/C transaction 239 * @param nodeId 240 * @param buf 241 * @param len 242 * @param resp_len 243 * @return 244 */ 234 245 fb_quadlet_t* transactionBlock( fb_nodeid_t nodeId, 235 246 fb_quadlet_t* buf, 236 247 int len, 237 unsigned int* resp_len ); 238 248 unsigned int* resp_len ); 249 250 /** 251 * close AV/C transaction. 252 * @param nodeId 253 * @param buf 254 * @param len 255 * @param resp_len 256 * @return 257 */ 239 258 bool transactionBlockClose(); 240 259 … … 256 275 return raw1394_get_generation( m_handle ); 257 276 } 277 278 /** 279 * @brief sets the SPLIT_TIMEOUT_HI and SPLIT_TIMEOUT_LO CSR registers 280 * 281 * sets the SPLIT_TIMEOUT_HI and SPLIT_TIMEOUT_LO CSR registers on node 282 * nodeId such that the timeout is equal to timeout 283 * 284 * @param nodeId node to set CSR registers on 285 * @param timeout timeout in usecs 286 * @return true if successful 287 */ 288 bool setSplitTimeoutUsecs(fb_nodeid_t nodeId, unsigned int timeout); 289 290 /** 291 * @brief gets the SPLIT_TIMEOUT_X timeout value 292 * 293 * gets the SPLIT_TIMEOUT_HI and SPLIT_TIMEOUT_LO CSR registers on node 294 * nodeId and recombine them into one usec value 295 * 296 * @param nodeId node to get CSR registers from 297 * @return timeout in usecs if successful, 0 else 298 */ 299 int getSplitTimeoutUsecs(fb_nodeid_t nodeId); 258 300 259 301 // ISO channel stuff … … 329 371 reset_handler_vec_t m_busResetHandlers; 330 372 373 // unprotected variants 374 bool writeNoLock( fb_nodeid_t nodeId, 375 fb_nodeaddr_t addr, 376 size_t length, 377 fb_quadlet_t* data ); 378 bool readNoLock( fb_nodeid_t nodeId, 379 fb_nodeaddr_t addr, 380 size_t length, 381 fb_quadlet_t* buffer ); 382 383 // FCP transaction support 384 static int _avc_fcp_handler(raw1394handle_t handle, nodeid_t nodeid, 385 int response, size_t length, 386 unsigned char *data); 387 int handleFcpResponse(nodeid_t nodeid, 388 int response, size_t length, 389 unsigned char *data); 390 391 enum eFcpStatus { 392 eFS_Empty, 393 eFS_Waiting, 394 eFS_Responded, 395 eFS_Error, 396 }; 397 398 struct sFcpBlock { 399 enum eFcpStatus status; 400 nodeid_t target_nodeid; 401 unsigned int request_length; 402 quadlet_t request[MAX_FCP_BLOCK_SIZE_QUADS]; 403 unsigned int response_length; 404 quadlet_t response[MAX_FCP_BLOCK_SIZE_QUADS]; 405 }; 406 struct sFcpBlock m_fcp_block; 407 408 bool doFcpTransaction(); 409 bool doFcpTransactionTry(); 410 331 411 public: 332 412 void setVerboseLevel(int l); branches/libffado-2.0/src/SConscript
r1301 r1371 182 182 libenv.MergeFlags( "-lrt" ) 183 183 libenv.MergeFlags( env['LIBRAW1394_FLAGS'] ) 184 libenv.MergeFlags( env['LIBAVC1394_FLAGS'] )185 184 libenv.MergeFlags( env['LIBIEC61883_FLAGS'] ) 186 185 if not env['SERIALIZE_USE_EXPAT']: branches/libffado-2.0/support/firmware/SConscript
r1185 r1371 31 31 env.MergeFlags( "-lrt" ) 32 32 env.MergeFlags( env['LIBRAW1394_FLAGS'] ) 33 env.MergeFlags( env['LIBAVC1394_FLAGS'] )34 33 env.MergeFlags( env['LIBIEC61883_FLAGS'] ) 35 34 if not env['SERIALIZE_USE_EXPAT']: branches/libffado-2.0/tests/test-ffado.cpp
r1238 r1371 67 67 " BusReset\n" 68 68 " ListDevices\n" 69 " SetSplitTimeout timeout_usec\n" 70 " GetSplitTimeout\n" 69 71 ; 70 72 … … 414 416 delete m_deviceManager; 415 417 return exitfunction(0); 418 } else if ( strcmp( arguments.args[0], "SetSplitTimeout" ) == 0 ) { 419 char* tail; 420 int usecs = strtol( arguments.args[1], &tail, 0 ); 421 if ( errno ) { 422 fprintf( stderr, "Could not parse timeout argument\n" ); 423 return exitfunction(-1); 424 } 425 426 Ieee1394Service service; 427 // switch off all messages since they mess up the list 428 service.setVerboseLevel(arguments.verbose); 429 if ( !service.initialize( arguments.port ) ) { 430 printf("Could not initialize IEEE 1394 service on port %ld\n", arguments.port); 431 return exitfunction(-1); 432 } 433 434 nodeid_t nodeid; 435 if(arguments.node_id_set) { 436 nodeid = arguments.node_id; 437 } else { 438 nodeid = service.getLocalNodeId(); 439 } 440 441 if (!service.setSplitTimeoutUsecs(nodeid, usecs)) { 442 printf("Failed to set SPLIT_TIMEOUT to %u for node %X on port %ld\n", 443 usecs, nodeid, arguments.port); 444 return exitfunction(-1); 445 } 446 447 return exitfunction(0); 448 } else if ( strcmp( arguments.args[0], "GetSplitTimeout" ) == 0 ) { 449 Ieee1394Service service; 450 // switch off all messages since they mess up the list 451 service.setVerboseLevel(arguments.verbose); 452 if ( !service.initialize( arguments.port ) ) { 453 printf("Could not initialize IEEE 1394 service on port %ld\n", arguments.port); 454 return exitfunction(-1); 455 } 456 457 nodeid_t nodeid; 458 if(arguments.node_id_set) { 459 nodeid = arguments.node_id; 460 } else { 461 nodeid = service.getLocalNodeId(); 462 } 463 int usecs = service.getSplitTimeoutUsecs(nodeid); 464 if (usecs < 0) { 465 printf("Failed to get SPLIT_TIMEOUT for node %X on port %ld\n", 466 nodeid, arguments.port); 467 return exitfunction(-1); 468 } 469 printf("SPLIT_TIMEOUT for node %X on port %ld is %u\n", 470 nodeid, arguments.port, usecs); 471 472 return exitfunction(0); 416 473 } else if ( strcmp( arguments.args[0], "SytCalcTest" ) == 0 ) { 417 474 if (arguments.nargs < 4) {
