summaryrefslogtreecommitdiff
path: root/usb/usbsamp/sys/queue.c
diff options
context:
space:
mode:
authorWei Mao <[email protected]>2017-03-15 12:58:20 -0700
committerWei Mao <[email protected]>2017-03-15 12:58:20 -0700
commit80cc22cbdea1de8d21eb406bf351a916ca2c4b43 (patch)
tree6ea96c638c1b8041f12aab4dc7d19d5d952a2e73 /usb/usbsamp/sys/queue.c
parent6b8cbe40b82f442860902752ff2df18ac1daf229 (diff)
[usb] Fix Code Analysis Warnings
Diffstat (limited to 'usb/usbsamp/sys/queue.c')
-rw-r--r--usb/usbsamp/sys/queue.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/usb/usbsamp/sys/queue.c b/usb/usbsamp/sys/queue.c
index 5047d24c..c635adb6 100644
--- a/usb/usbsamp/sys/queue.c
+++ b/usb/usbsamp/sys/queue.c
@@ -101,7 +101,7 @@ Return Value:
WdfUsbTargetPipeSetNoMaximumPacketSizeCheck(pipe);
status = STATUS_SUCCESS;
- }
+ }
else {
status = STATUS_INVALID_DEVICE_REQUEST;
}
@@ -161,6 +161,12 @@ Return Value:
UsbSamp_DbgPrint(3, ("Entered UsbSamp_DispatchDevCtrl\n"));
+ //
+ // If your driver is at the top of its driver stack, EvtIoDeviceControl is called
+ // at IRQL = PASSIVE_LEVEL.
+ //
+ _Analysis_assume_(KeGetCurrentIrql() == PASSIVE_LEVEL);
+
PAGED_CODE();
//
@@ -257,6 +263,12 @@ Return Value:
WDFUSBPIPE pipe;
WDF_USB_PIPE_INFORMATION pipeInfo;
+ //
+ // If your driver is at the top of its driver stack, EvtIoRead is called
+ // at IRQL = PASSIVE_LEVEL.
+ //
+ _Analysis_assume_(KeGetCurrentIrql() == PASSIVE_LEVEL);
+
PAGED_CODE();
//
@@ -278,7 +290,7 @@ Return Value:
ReadWriteBulkEndPoints(Queue, Request, (ULONG) Length, WdfRequestTypeRead);
return;
- }
+ }
else if (WdfUsbPipeTypeIsochronous == pipeInfo.PipeType){
#if !defined(BUFFERED_READ_WRITE) // if doing DIRECT_IO
@@ -325,6 +337,12 @@ Return Value:
WDFUSBPIPE pipe;
WDF_USB_PIPE_INFORMATION pipeInfo;
+ //
+ // If your driver is at the top of its driver stack, EvtIoWrite is called
+ // at IRQL = PASSIVE_LEVEL.
+ //
+ _Analysis_assume_(KeGetCurrentIrql() == PASSIVE_LEVEL);
+
PAGED_CODE();
//
@@ -346,7 +364,7 @@ Return Value:
ReadWriteBulkEndPoints(Queue, Request, (ULONG) Length, WdfRequestTypeWrite);
return;
- }
+ }
else if (WdfUsbPipeTypeIsochronous == pipeInfo.PipeType){
#if !defined(BUFFERED_READ_WRITE) // if doing DIRECT_IO
@@ -565,7 +583,7 @@ Return Value:
PAGED_CODE();
pDeviceContext = GetDeviceContext(Device);
-
+
//
// A reset-device
// request will be stuck in the USB until the pending transactions
@@ -576,7 +594,7 @@ Return Value:
// continuous reader (by calling WdfIoTargetStart) after the request completes.
//
StopAllPipes(pDeviceContext);
-
+
//
// It may not be necessary to check whether device is connected before
// resetting the port.
@@ -588,7 +606,7 @@ Return Value:
}
StartAllPipes(pDeviceContext);
-
+
UsbSamp_DbgPrint(3, ("ResetDevice - ends\n"));
return status;