diff options
| author | Luke <[email protected]> | 2017-11-28 00:22:11 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-11-28 00:22:11 -0800 |
| commit | 79bbbca2f6e37d94fbbbd60d12c5c1e7dde650da (patch) | |
| tree | 793ff943b8b641f95d05401156badd42da4a0f12 /network/radio | |
| parent | ed1df9a8b80b154b71b79635e40af75f4f19001c (diff) | |
| parent | 2817004092cee784d4aaf36c045fdb5b0bc09f7e (diff) | |
Merge pull request #1 from Microsoft/master
Updating Local
Diffstat (limited to 'network/radio')
| -rw-r--r-- | network/radio/HidSwitchDriverSample/README.md | 10 | ||||
| -rw-r--r-- | network/radio/HidSwitchDriverSample/RadioSwitchHidUsbFx2.inx | bin | 7394 -> 7088 bytes | |||
| -rw-r--r-- | network/radio/HidSwitchDriverSample/driver.c | 10 | ||||
| -rw-r--r-- | network/radio/HidSwitchDriverSample/hid.c | 10 | ||||
| -rw-r--r-- | network/radio/HidSwitchDriverSample/usb.c | 12 | ||||
| -rw-r--r-- | network/radio/RadioManagerSample/README.md | 10 |
6 files changed, 36 insertions, 16 deletions
diff --git a/network/radio/HidSwitchDriverSample/README.md b/network/radio/HidSwitchDriverSample/README.md index 5f4fdd81..9726babf 100644 --- a/network/radio/HidSwitchDriverSample/README.md +++ b/network/radio/HidSwitchDriverSample/README.md @@ -1,3 +1,13 @@ +<!--- + name: Radio Switch Test Driver for OSR USB-FX2 Development Board + platform: KMDF + language: cpp + category: Network Radio + description: Demonstrates how to structure a HID driver for radio switches for the OSR USB-FX2 Development Board. + samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=617919 +---> + + Radio Switch Test Driver for OSR USB-FX2 Development Board ========================================================== diff --git a/network/radio/HidSwitchDriverSample/RadioSwitchHidUsbFx2.inx b/network/radio/HidSwitchDriverSample/RadioSwitchHidUsbFx2.inx Binary files differindex a1f0bf1a..c7d1ba0f 100644 --- a/network/radio/HidSwitchDriverSample/RadioSwitchHidUsbFx2.inx +++ b/network/radio/HidSwitchDriverSample/RadioSwitchHidUsbFx2.inx diff --git a/network/radio/HidSwitchDriverSample/driver.c b/network/radio/HidSwitchDriverSample/driver.c index 54e80dae..61cc97fc 100644 --- a/network/radio/HidSwitchDriverSample/driver.c +++ b/network/radio/HidSwitchDriverSample/driver.c @@ -1,4 +1,4 @@ -#include <RadioSwitchHidUsbFx2.h> +#include "RadioSwitchHidUsbFx2.h" #pragma warning(disable:28252) #pragma warning(disable:28253) #include "driver.tmh" @@ -39,7 +39,7 @@ NTSTATUS DriverEntry (_In_ PDRIVER_OBJECT pDriverObject, _In_ PUNICODE_STRING ps &config, // Driver Config Info WDF_NO_HANDLE ); - if (!NT_SUCCESS(status)) + if (!NT_SUCCESS(status)) { TraceErr(DBG_INIT, "(%!FUNC!)WdfDriverCreate failed with status %!STATUS!\n", status); WPP_CLEANUP(pDriverObject); @@ -64,7 +64,7 @@ void HidFx2EvtDriverContextCleanup(_In_ WDFOBJECT hDriver) -//HidFx2EvtDeviceAdd is called by the framework in response to AddDevicecall from the PnP manager. +//HidFx2EvtDeviceAdd is called by the framework in response to AddDevicecall from the PnP manager. //We create and initialize a WDF device object to represent a new instance of device. // NTSTATUS HidFx2EvtDeviceAdd(_In_ WDFDRIVER hDriver, _Inout_ PWDFDEVICE_INIT pDeviceInit) @@ -111,7 +111,7 @@ NTSTATUS HidFx2EvtDeviceAdd(_In_ WDFDRIVER hDriver, _Inout_ PWDFDEVICE_INIT pDev } pDevContext = GetDeviceContext(hDevice); - + WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&queueConfig, WdfIoQueueDispatchParallel); queueConfig.EvtIoInternalDeviceControl = HidFx2EvtInternalDeviceControl; @@ -136,7 +136,7 @@ NTSTATUS HidFx2EvtDeviceAdd(_In_ WDFDRIVER hDriver, _Inout_ PWDFDEVICE_INIT pDev return status; } - // Create a timer to handle debouncing of switchpack + // Create a timer to handle debouncing of switchpack WDF_TIMER_CONFIG_INIT(&timerConfig, HidFx2EvtTimerFunction); timerConfig.AutomaticSerialization = FALSE; diff --git a/network/radio/HidSwitchDriverSample/hid.c b/network/radio/HidSwitchDriverSample/hid.c index 27fcefea..2421b88f 100644 --- a/network/radio/HidSwitchDriverSample/hid.c +++ b/network/radio/HidSwitchDriverSample/hid.c @@ -1,4 +1,4 @@ -#include <RadioSwitchHidUsbFx2.h> +#include "RadioSwitchHidUsbFx2.h" #include "hid.tmh" // Radio Management Collection - Scenario 1 control collection (Button only) @@ -223,7 +223,7 @@ NTSTATUS HidFx2GetInput(_In_ WDFREQUEST hRequest) TraceVerbose(DBG_IOCTL, "(%!FUNC!) Enter\n"); hDevice = WdfIoQueueGetDevice(WdfRequestGetIoQueue(hRequest)); - + WDF_REQUEST_PARAMETERS_INIT(¶ms); WdfRequestGetParameters(hRequest, ¶ms); @@ -296,7 +296,7 @@ NTSTATUS HidFx2SetOutput(_In_ WDFREQUEST hRequest) TraceVerbose(DBG_IOCTL, "(%!FUNC!) Enter\n"); hDevice = WdfIoQueueGetDevice(WdfRequestGetIoQueue(hRequest)); - + WDF_REQUEST_PARAMETERS_INIT(¶ms); WdfRequestGetParameters(hRequest, ¶ms); @@ -335,7 +335,7 @@ NTSTATUS HidFx2SetOutput(_In_ WDFREQUEST hRequest) TraceErr(DBG_IOCTL, "(%!FUNC!) Incorrect report ID, %!STATUS!\n", status); return status; } - + pOutputReport = (PHIDFX2_IO_REPORT)pTransferPacket->reportBuffer; if (pOutputReport->bData == 0) @@ -471,7 +471,7 @@ NTSTATUS HidFx2GetHidDescriptor(_In_ WDFDEVICE hDevice, _In_ WDFREQUEST hRequest TraceErr(DBG_IOCTL, "(%!FUNC!) c_DefaultHidDescriptor is zero, %!STATUS!\n", status); return status; } - + } else // WdfRequestRetrieveOutputMemory failed { diff --git a/network/radio/HidSwitchDriverSample/usb.c b/network/radio/HidSwitchDriverSample/usb.c index bacd1bce..84cf7faa 100644 --- a/network/radio/HidSwitchDriverSample/usb.c +++ b/network/radio/HidSwitchDriverSample/usb.c @@ -1,4 +1,4 @@ -#include <RadioSwitchHidUsbFx2.h> +#include "RadioSwitchHidUsbFx2.h" #include "usb.tmh" @@ -39,7 +39,7 @@ HidFx2EvtDevicePrepareHardware( // The parent of each USB device object is the driver's framework driver object. The driver cannot change this parent, and the ParentObject // member or the WDF_OBJECT_ATTRIBUTES structure must be NULL. // - // We only create device the first time PrepareHardware is called. If the device is restarted by pnp manager for resource rebalance, we + // We only create device the first time PrepareHardware is called. If the device is restarted by pnp manager for resource rebalance, we // will use the same device handle but then select the interfaces again because the USB stack could reconfigure the device on restart. if (pDevContext->hUsbDevice == NULL) { @@ -162,7 +162,7 @@ void HidFx2EvtUsbInterruptPipeReadComplete( } - // Make sure that there is data in the read packet. + // Make sure that there is data in the read packet. // Depending on the device specification, it is possible for it to return a 0 length read in certain conditions. if (cNumBytesTransferred == 0) { @@ -269,7 +269,7 @@ void HidFx2EvtTimerFunction(_In_ WDFTIMER hTimer) WdfRequestCompleteWithInformation(hRequest, status, cBytesReturned); - } + } else if (status != STATUS_NO_MORE_ENTRIES) { TraceErr(DBG_IOCTL, "(%!FUNC!) WdfIoQueueRetrieveNextRequest status %!STATUS!\n", status); @@ -340,7 +340,7 @@ NTSTATUS HidFx2GetSwitchState(_In_ WDFDEVICE hDevice, _Out_ unsigned char *pbSwi // EvtDeviceD0Entry event callback must perform any operations that are necessary before the specified device is used. // Called every time the hardware needs to be initialized/reinitialized. -// This function is not marked pageable because this function is in the device power up path. +// This function is not marked pageable because this function is in the device power up path. // This function runs at PASSIVE_LEVEL, even though it is not paged. // NTSTATUS HidFx2EvtDeviceD0Entry(_In_ WDFDEVICE hDevice, _In_ WDF_POWER_DEVICE_STATE previousState) @@ -412,7 +412,7 @@ stopped, when it is removed, and when it is powered off. The device is still in D0 when this callback is invoked, which means that the driver can still touch hardware in this routine. -EvtDeviceD0Exit event callback must perform any operations that are necessary before the specified device is moved out of the D0 state. +EvtDeviceD0Exit event callback must perform any operations that are necessary before the specified device is moved out of the D0 state. If the driver needs to save hardware state before the device is powered down, then that should be done here. This function runs at PASSIVE_LEVEL, though it is generally not paged. A driver can optionally make this function pageable if DO_POWER_PAGABLE is set. diff --git a/network/radio/RadioManagerSample/README.md b/network/radio/RadioManagerSample/README.md index e391e051..3cac53e9 100644 --- a/network/radio/RadioManagerSample/README.md +++ b/network/radio/RadioManagerSample/README.md @@ -1,3 +1,13 @@ +<!--- + name: Windows Radio Management Sample + platform: WDM + language: cpp + category: Network Radio + description: Demonstrates how to structure a Radio Manager for use with the Windows Radio Management APIs. + samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=617920 +---> + + Windows Radio Management Sample =============================== |
