diff --git a/examples/drivers/windows/include/openthread-core-windows-config.h b/examples/drivers/windows/include/openthread-core-windows-config.h index 71a964b31..98102f1b9 100644 --- a/examples/drivers/windows/include/openthread-core-windows-config.h +++ b/examples/drivers/windows/include/openthread-core-windows-config.h @@ -75,5 +75,13 @@ */ #define OPENTHREAD_CONFIG_LOG_LEVEL OPENTHREAD_LOG_LEVEL_DEBG + /** + * @def OPENTHREAD_CONFIG_LOG_PKT_DUMP + * + * Define to enable log content of packets. + * + */ +#define OPENTHREAD_CONFIG_LOG_PKT_DUMP 0 + #endif // OPENTHREAD_CORE_WINDOWS_CONFIG_H_ diff --git a/examples/drivers/windows/otLwf/address.c b/examples/drivers/windows/otLwf/address.c index 521930cfe..1d9b504b1 100644 --- a/examples/drivers/windows/otLwf/address.c +++ b/examples/drivers/windows/otLwf/address.c @@ -251,7 +251,7 @@ otLwfAddressChangeCallback( // Ignore notifications that aren't for our interface if (Row->InterfaceIndex != pFilter->InterfaceIndex) return; - LogFuncEntryMsg(DRIVER_DEFAULT, "%p (%u)", pFilter, NotificationType); + LogFuncEntryMsg(DRIVER_DEFAULT, "%p (%u) %!IPV6ADDR!", pFilter, NotificationType, &Row->Address.Ipv6.sin6_addr); // Since we don't pass in the initial flag, we shouldn't get this type NT_ASSERT(NotificationType != MibInitialNotification); @@ -259,12 +259,19 @@ otLwfAddressChangeCallback( // Make sure we can reference the interface if (ExAcquireRundownProtection(&pFilter->ExternalRefs)) { - // Queue up the event for processing - otLwfEventProcessingIndicateAddressChange( - pFilter, - NotificationType, - &Row->Address.Ipv6.sin6_addr - ); + if (pFilter->DeviceStatus == OTLWF_DEVICE_STATUS_RADIO_MODE) + { + // Queue up the event for processing + otLwfEventProcessingIndicateAddressChange( + pFilter, + NotificationType, + &Row->Address.Ipv6.sin6_addr + ); + } + else + { + NT_ASSERT(FALSE); // Need to add support for this in tunnel mode + } // Release reference on the interface ExReleaseRundownProtection(&pFilter->ExternalRefs); diff --git a/examples/drivers/windows/otLwf/eventprocessing.c b/examples/drivers/windows/otLwf/eventprocessing.c index 61e831525..9f097939c 100644 --- a/examples/drivers/windows/otLwf/eventprocessing.c +++ b/examples/drivers/windows/otLwf/eventprocessing.c @@ -339,15 +339,17 @@ otLwfEventProcessingIndicateAddressChange( _In_ PIN6_ADDR pAddr ) { - if (pFilter->DeviceCapabilities == OTLWF_DEVICE_STATUS_RADIO_MODE) + LogFuncEntryMsg(DRIVER_DEFAULT, "Filter: %p", pFilter); + + NT_ASSERT(pFilter->DeviceStatus == OTLWF_DEVICE_STATUS_RADIO_MODE); + + POTLWF_ADDR_EVENT Event = FILTER_ALLOC_MEM(pFilter->FilterHandle, sizeof(OTLWF_ADDR_EVENT)); + if (Event == NULL) + { + LogWarning(DRIVER_DEFAULT, "Failed to alloc new OTLWF_ADDR_EVENT"); + } + else { - POTLWF_ADDR_EVENT Event = FILTER_ALLOC_MEM(pFilter->FilterHandle, sizeof(OTLWF_ADDR_EVENT)); - if (Event == NULL) - { - LogWarning(DRIVER_DATA_PATH, "Failed to alloc new OTLWF_ADDR_EVENT"); - return; - } - Event->NotificationType = NotificationType; Event->Address = *pAddr; @@ -355,10 +357,12 @@ otLwfEventProcessingIndicateAddressChange( NdisAcquireSpinLock(&pFilter->EventsLock); InsertTailList(&pFilter->AddressChangesHead, &Event->Link); NdisReleaseSpinLock(&pFilter->EventsLock); - + // Set the event to indicate we have a new address to process KeSetEvent(&pFilter->EventWorkerThreadProcessAddressChanges, 0, FALSE); } + + LogFuncExit(DRIVER_DEFAULT); } // Called to indicate that we have a NetBufferLists to process