Commit 70e22779 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman
Browse files

staging: vt6656: 64bit fixes: vCommandTimerWait change calculation of timer.



The timer appears to run too fast/race on 64 bit systems.

Using msecs_to_jiffies seems to cause a deadlock on 64 bit.

A calculation of (MSecond * HZ) / 1000 appears to run satisfactory.

Change BSSIDInfoCount to u32.

After this patch the driver can be successfully connect on little endian 64/32 bit systems.

Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1d651be1
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -316,16 +316,18 @@ s_MgrMakeProbeRequest(
    return pTxPacket;
}

void vCommandTimerWait(void *hDeviceContext, unsigned int MSecond)
void vCommandTimerWait(void *hDeviceContext, unsigned long MSecond)
{
	PSDevice pDevice = (PSDevice)hDeviceContext;

	init_timer(&pDevice->sTimerCommand);

	pDevice->sTimerCommand.data = (unsigned long)pDevice;
	pDevice->sTimerCommand.function = (TimerFunction)vRunCommand;
    // RUN_AT :1 msec ~= (HZ/1024)
    pDevice->sTimerCommand.expires = (unsigned int)RUN_AT((MSecond * HZ) >> 10);
	pDevice->sTimerCommand.expires = RUN_AT((MSecond * HZ) / 1000);

	add_timer(&pDevice->sTimerCommand);

	return;
}

+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ typedef struct tagsPMKIDInfo {
} PMKIDInfo, *PPMKIDInfo;

typedef struct tagSPMKIDCache {
    unsigned long       BSSIDInfoCount;
	u32 BSSIDInfoCount;
	PMKIDInfo BSSIDInfo[MAX_PMKID_CACHE];
} SPMKIDCache, *PSPMKIDCache;