Installation guide
47
IN PPHY pPhy,
IN PSDR_CONTEXT SDRContext,
IN ULONG ulRadioNum)
{
…
if (pPhy->PHYMode == DOT_11_A) {
hRes = NDIS_STATUS_FAILURE;
pPhy->Thread = SoraThreadAlloc();
if (pPhy->Thread)
if (SoraThreadStart(pPhy->Thread, viterbi_proc, &pPhy->BBContextFor11A.RxContext))
hRes = NDIS_STATUS_SUCCESS;
if (hRes != NDIS_STATUS_SUCCESS)
if (pPhy->Thread) {
SoraThreadFree(pPhy->Thread);
pPhy->Thread = NULL;
}
}
…
}
BOOLEAN viterbi_proc(PVOID pVoid) {
BB11ARxViterbiWorker(pVoid);
return *((PBB11A_RX_CONTEXT)pVoid)->ri_pbWorkIndicator;
}
Figure 23. Using Sora thread.
Figure 24 shows the sample code of a Viterbi work routine from arx_bg1.c. The function calls
different Viterbi decoding modules based on the data rate. It starts by checking if there is work
to do. If not, the routine will immediately return. Otherwise, it will accept the work by clearing
the flag and perform the decoding task. After decoding, the routine returns to the state waiting
for a new task.
void BB11ARxViterbiWorker(PVOID pContext)
{
PBB11A_RX_CONTEXT pRxContextA = (PBB11A_RX_CONTEXT)pContext;
if (BB11A_VITERBIRUN_WAIT_EVENT(pRxContextA))
{
BB11A_VITERBIRUN_CLEAR_EVENT(pRxContextA);
pRxContextA->bCRCCorrect = FALSE;
switch (pRxContextA->bRate & 0x7)
{
case 0x3:
VitDesCRC6(pRxContextA);
break;
case 0x7:
VitDesCRC9(pRxContextA);
break;
case 0x2:
VitDesCRC12(pRxContextA);
break;










