@@ -551,6 +551,8 @@ int spi_set_interface(const char *intf)
551
551
552
552
int spi_init (void )
553
553
{
554
+ struct ftdi_version_info fv ;
555
+
554
556
LOG (DEBUG , "spi_nrefs=%d, spi_dev_open=%d" , spi_nrefs , spi_dev_open );
555
557
556
558
spi_nrefs ++ ;
@@ -560,7 +562,10 @@ int spi_init(void)
560
562
return 0 ;
561
563
}
562
564
563
- LOG (ALL , "csr-spi-ftdi " VERSION ", git rev " GIT_REVISION );
565
+ fv = ftdi_get_library_version ();
566
+ LOG (ALL , "csr-spi-ftdi " VERSION ", git rev " GIT_REVISION ", libftdi %s-%s" ,
567
+ fv .version_str , fv .snapshot_str );
568
+
564
569
565
570
if (ftdi_init (& ftdic ) < 0 ) {
566
571
SPI_ERR ("FTDI: init failed" );
@@ -879,6 +884,7 @@ int spi_isopen(void)
879
884
#ifdef SPI_STATS
880
885
void spi_output_stats (void )
881
886
{
887
+ struct ftdi_version_info fv ;
882
888
double xfer_pct = NAN , avg_read = NAN , avg_write = NAN , rate = NAN , iops = NAN ;
883
889
double ftdi_rate = NAN , ftdi_xfers_per_io = NAN , avg_ftdi_xfer = NAN , ftdi_short_rate = NAN ;
884
890
struct timeval tv ;
@@ -889,6 +895,8 @@ void spi_output_stats(void)
889
895
if (!fp )
890
896
return ;
891
897
898
+ fv = ftdi_get_library_version ();
899
+
892
900
/* Calculate timeranges until now */
893
901
if (gettimeofday (& tv , NULL ) < 0 )
894
902
LOG (WARN , "gettimeofday failed: %s" , strerror (errno ));
@@ -936,6 +944,7 @@ void spi_output_stats(void)
936
944
fprintf (fp ,
937
945
"*** FTDI Statistics ********************************************************\n"
938
946
"csr-spi-ftdi version: " VERSION " (git rev " GIT_REVISION ")\n"
947
+ "libftdi version: %s-%s\n"
939
948
"Time open: %ld.%02ld s\n"
940
949
"Time in xfer: %ld.%02ld s (%.2f%% of open time)\n"
941
950
"Reads: %ld (%ld bytes, %.2f bytes avg read size)\n"
@@ -948,6 +957,7 @@ void spi_output_stats(void)
948
957
" %.2f xfers/IO, %.2f bytes/xfer)\n"
949
958
"SPI max clock: %lu kHz, min clock: %lu kHz, slowdowns: %lu\n"
950
959
"****************************************************************************\n" ,
960
+ fv .version_str , fv .snapshot_str ,
951
961
spi_stats .tv_open .tv_sec , spi_stats .tv_open .tv_usec / 10000 ,
952
962
spi_stats .tv_xfer .tv_sec , spi_stats .tv_xfer .tv_usec / 10000 , xfer_pct ,
953
963
spi_stats .reads , spi_stats .read_bytes , avg_read ,
0 commit comments