Changeset 1451
- Timestamp:
- 11/22/08 07:01:20 (14 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/src/bebob/edirol/edirol_fa101.cpp
r1371 r1451 40 40 m_fixed_clocksource.slipping = false; 41 41 m_fixed_clocksource.description = "Device Controlled"; 42 43 get1394Service().setFCPResponseFiltering(true); 42 44 } 43 45 branches/libffado-2.0/src/libieee1394/ieee1394service.cpp
r1432 r1451 63 63 , m_pCTRHelper ( new CycleTimerHelper( *this, IEEE1394SERVICE_CYCLETIMER_DLL_UPDATE_INTERVAL_USEC ) ) 64 64 , m_have_new_ctr_read ( false ) 65 , m_filterFCPResponse ( false ) 65 66 , m_pWatchdog ( new Util::Watchdog() ) 66 67 { … … 92 93 IEEE1394SERVICE_CYCLETIMER_HELPER_PRIO ) ) 93 94 , m_have_new_ctr_read ( false ) 95 , m_filterFCPResponse ( false ) 94 96 , m_pWatchdog ( new Util::Watchdog() ) 95 97 { … … 822 824 unsigned char *data) 823 825 { 826 static struct sFcpBlock fcp_block_last; 827 824 828 fb_quadlet_t *data_quads = (fb_quadlet_t *)data; 825 829 #ifdef DEBUG … … 857 861 FCP_MASK_SUBUNIT_AND_OPCODE(first_quadlet), 858 862 FCP_MASK_SUBUNIT_AND_OPCODE(CondSwapFromBus32(m_fcp_block.request[0]))); 863 } else if(m_filterFCPResponse && (memcmp(fcp_block_last.response, data, length) == 0)) { 864 // This is workaround for the Edirol FA-101. The device tends to send more than 865 // one responde to one request. This seems to happen when discovering 866 // function blocks and looks very likely there is a race condition in the 867 // device. The workaround here compares the just arrived FCP responde 868 // to the last one. If it is the same as the previously one then we 869 // just ignore it. The downside of this approach is, we cannot issue 870 // the same FCP twice. 871 debugWarning("Received duplicate FCP response. Ignore it\n"); 859 872 } else { 860 873 m_fcp_block.response_length = (length + sizeof(quadlet_t) - 1) / sizeof(quadlet_t); 861 874 memcpy(m_fcp_block.response, data, length); 875 if (m_filterFCPResponse) { 876 memcpy(fcp_block_last.response, data, length); 877 } 862 878 m_fcp_block.status = eFS_Responded; 863 879 } … … 919 935 920 936 return (split_timeout_hi & 7) * 1000000 + (split_timeout_low >> 19) * 125; 937 } 938 939 void 940 Ieee1394Service::setFCPResponseFiltering(bool enable) 941 { 942 m_filterFCPResponse = enable; 921 943 } 922 944 branches/libffado-2.0/src/libieee1394/ieee1394service.h
r1409 r1451 322 322 323 323 Util::Configuration *getConfiguration() {return m_configuration;}; 324 325 /** 326 * @brief enable or disable FCP response doublicate filtering 327 * 328 * this is use only for devices (e.g. edirol fa101) which have a 329 * buggy FCP implementation and send more then one FCP response 330 * for one request. 331 */ 332 void setFCPResponseFiltering(bool enable); 324 333 325 334 // ISO channel stuff … … 394 403 bool m_have_new_ctr_read; 395 404 405 bool m_filterFCPResponse; 406 396 407 // the RT watchdog 397 408 Util::Watchdog* m_pWatchdog;