diff --git a/Driver/Source.Plx6000_NT/Driver.c b/Driver/Source.Plx6000_NT/Driver.c index ff038d6..2a02697 100644 --- a/Driver/Source.Plx6000_NT/Driver.c +++ b/Driver/Source.Plx6000_NT/Driver.c @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include "ApiFunc.h" #include "Dispatch.h" #include "Driver.h" diff --git a/Driver/Source.Plx8000_DMA/Driver.c b/Driver/Source.Plx8000_DMA/Driver.c index 4ccff22..35e75f2 100644 --- a/Driver/Source.Plx8000_DMA/Driver.c +++ b/Driver/Source.Plx8000_DMA/Driver.c @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include "ApiFunc.h" #include "Dispatch.h" #include "Driver.h" diff --git a/Driver/Source.Plx8000_DMA/SuppFunc.c b/Driver/Source.Plx8000_DMA/SuppFunc.c index aaf3df3..f54932b 100644 --- a/Driver/Source.Plx8000_DMA/SuppFunc.c +++ b/Driver/Source.Plx8000_DMA/SuppFunc.c @@ -991,7 +991,11 @@ PlxLockBufferAndBuildSgl( } // Obtain the mmap reader/writer semaphore - down_read( ¤t->mm->mmap_sem ); + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) + down_read( ¤t->mm->mmap_sem ); + #else + mmap_read_lock( current->mm ); + #endif // Attempt to lock the user buffer into memory rc = @@ -1004,7 +1008,11 @@ PlxLockBufferAndBuildSgl( ); // Release mmap semaphore - up_read( ¤t->mm->mmap_sem ); + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) + up_read( ¤t->mm->mmap_sem ); + #else + mmap_read_unlock( current->mm ); + #endif if (rc != TotalDescr) { diff --git a/Driver/Source.Plx8000_NT/Driver.c b/Driver/Source.Plx8000_NT/Driver.c index 4c773b9..0767bff 100644 --- a/Driver/Source.Plx8000_NT/Driver.c +++ b/Driver/Source.Plx8000_NT/Driver.c @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include "ApiFunc.h" #include "Dispatch.h" #include "Driver.h" diff --git a/Driver/Source.Plx9000/Driver.c b/Driver/Source.Plx9000/Driver.c index 669921c..2d0c8b5 100644 --- a/Driver/Source.Plx9000/Driver.c +++ b/Driver/Source.Plx9000/Driver.c @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include "ApiFunc.h" #include "Dispatch.h" #include "Driver.h" diff --git a/Driver/Source.Plx9000/SuppFunc.c b/Driver/Source.Plx9000/SuppFunc.c index eeeb723..c15ab6c 100644 --- a/Driver/Source.Plx9000/SuppFunc.c +++ b/Driver/Source.Plx9000/SuppFunc.c @@ -953,7 +953,11 @@ PlxLockBufferAndBuildSgl( } // Obtain the mmap reader/writer semaphore - down_read( ¤t->mm->mmap_sem ); + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) + down_read( ¤t->mm->mmap_sem ); + #else + mmap_read_lock( current->mm ); + #endif // Attempt to lock the user buffer into memory rc = @@ -966,7 +970,11 @@ PlxLockBufferAndBuildSgl( ); // Release mmap semaphore - up_read( ¤t->mm->mmap_sem ); + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0) + up_read( ¤t->mm->mmap_sem ); + #else + mmap_read_unlock( current->mm ); + #endif if (rc != TotalDescr) { diff --git a/Driver/Source.PlxSvc/Driver.c b/Driver/Source.PlxSvc/Driver.c index 5c9a3bc..da6cd48 100644 --- a/Driver/Source.PlxSvc/Driver.c +++ b/Driver/Source.PlxSvc/Driver.c @@ -53,7 +53,7 @@ #include #include // For kmalloc() #include -#include +#include #include "Dispatch.h" #include "Driver.h" #include "PciFunc.h" diff --git a/PlxApi/SpiFlash.c b/PlxApi/SpiFlash.c index 7a7a86e..84bd9b1 100644 --- a/PlxApi/SpiFlash.c +++ b/PlxApi/SpiFlash.c @@ -49,7 +49,7 @@ #include // For memset()/memcpy() -#include // For ftime() +#include // For getttimeofday() #include "SpiFlash.h" #include "PlxApiDebug.h" @@ -764,12 +764,13 @@ Spi_WaitControllerReady( U32 regVal; U32 elapsedTimeMs; PLX_STATUS status; - struct timeb endTime; - struct timeb startTime; + struct timeval endTime; + struct timeval startTime; + struct timeval deltaTime; // Note start time - ftime( &startTime ); + gettimeofday( &startTime, NULL ); // Wait until command valid is clear do @@ -790,8 +791,9 @@ Spi_WaitControllerReady( } // Verify we don't exceed poll time - ftime( &endTime ); - elapsedTimeMs = (U32)(PLX_DIFF_TIMEB( endTime, startTime ) * 1000); + gettimeofday( &endTime, NULL ); + timersub( &startTime, &endTime, &deltaTime); + elapsedTimeMs = (U32)( deltaTime.tv_sec*1000 + deltaTime.tv_usec/1000 ); if (elapsedTimeMs >= SPI_MAX_WAIT_CTRL_READY_MS) { ErrorPrintf((