[ros-diffs] [hpoussin] 23687: Build usbdriver without warning, at least with gcc 3.4.2

hpoussin at svn.reactos.org hpoussin at svn.reactos.org
Thu Aug 24 18:21:16 CEST 2006


Author: hpoussin
Date: Thu Aug 24 20:21:16 2006
New Revision: 23687

URL: http://svn.reactos.org/svn/reactos?rev=23687&view=rev
Log:
Build usbdriver without warning, at least with gcc 3.4.2

Modified:
    trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c
    trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c
    trunk/reactos/drivers/usb/nt4compat/usbdriver/hub.c
    trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h
    trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c
    trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild

Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c?rev=23687&r1=23686&r2=23687&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.c Thu Aug 24 20:21:16 2006
@@ -483,7 +483,7 @@
     UCHAR port_idx = 0;
     BOOLEAN tt_needed;
     UCHAR hub_addr = 0;
-    USE_IRQL;
+    USE_BASIC_IRQL;
 
     if (ehci == NULL)
         return FALSE;
@@ -688,7 +688,7 @@
     int i;
     PUHCI_PENDING_ENDP pending_endp;
     NTSTATUS status;
-    USE_IRQL;
+    USE_BASIC_IRQL;
 
     if (ehci == NULL)
         return STATUS_INVALID_PARAMETER;
@@ -946,7 +946,7 @@
 
     SYNC_PARAM sync_param;
     UCHAR ep_type;
-    USE_IRQL;
+    USE_BASIC_NON_PENDING_IRQL;
 
     ehci = (PEHCI_DEV) context;
     if (ehci == NULL)
@@ -1264,7 +1264,7 @@
     int i, j, k;
     SYNC_PARAM sync_param;
 
-    USE_IRQL;
+    USE_BASIC_IRQL;
 
     if (ehci == NULL || dev == NULL)
         return FALSE;
@@ -2764,7 +2764,7 @@
 
     SYNC_PARAM sync_param;
 
-    USE_IRQL;
+    USE_BASIC_NON_PENDING_IRQL;
 
     if (ehci == NULL || purb == NULL || pdev == NULL || pendp == NULL)
         return STATUS_INVALID_PARAMETER;
@@ -2839,7 +2839,7 @@
 {
     PUSB_DEV pdev;
     BOOLEAN is_ctrl = FALSE;
-    USE_IRQL;
+    USE_NON_PENDING_IRQL;
 
     old_irql = KeGetCurrentIrql();
     if (old_irql > DISPATCH_LEVEL)
@@ -2933,7 +2933,7 @@
     LONG i;
     UCHAR port_count;
 
-    USE_IRQL;
+    USE_NON_PENDING_IRQL;
     if (pdev == NULL || purb == NULL)
         return STATUS_INVALID_PARAMETER;
 

Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c?rev=23687&r1=23686&r2=23687&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c Thu Aug 24 20:21:16 2006
@@ -297,7 +297,8 @@
     usb_dbg_print(DBGLVL_MAXIMUM, ("gendrv_event_select_driver(): entering...\n"));
 
     pdrvr = (PUSB_DRIVER) param;
-    pconfig_desc = (PUSB_CONFIGURATION_DESC) pdev->desc_buf[sizeof(USB_DEVICE_DESC)];
+    //original code: pconfig_desc = (PUSB_CONFIGURATION_DESC) pdev->desc_buf[sizeof(USB_DEVICE_DESC)];
+    pconfig_desc = (PUSB_CONFIGURATION_DESC) &pdev->desc_buf[sizeof(USB_DEVICE_DESC)];
     pdrvr_ext = (PGENDRV_DRVR_EXTENSION) pdrvr->driver_ext;
 
     //
@@ -1105,9 +1106,9 @@
         case IRP_MJ_INTERNAL_DEVICE_CONTROL:
         {
             status = STATUS_NOT_SUPPORTED;
-            if (irpstack->MinorFunction == IOCTL_SUBMIT_URB_RD ||
-                irpstack->MinorFunction == IOCTL_SUBMIT_URB_WR ||
-                irpstack->MinorFunction == IOCTL_SUBMIT_URB_NOIO)
+            if (irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_SUBMIT_URB_RD ||
+                irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_SUBMIT_URB_WR ||
+                irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_SUBMIT_URB_NOIO)
             {
                 PURB purb;
                 DEV_HANDLE endp_handle;
@@ -1123,7 +1124,7 @@
                 endp_handle = purb->endp_handle;
                 if (purb->data_buffer == NULL || purb->data_length == 0)
                 {
-                    if (irpstack->MinorFunction != IOCTL_SUBMIT_URB_NOIO)
+                    if (irpstack->Parameters.DeviceIoControl.IoControlCode != IOCTL_SUBMIT_URB_NOIO)
                     {
                         GENDRV_EXIT_DISPATCH(dev_obj, STATUS_INVALID_PARAMETER, irp);
                     }
@@ -1137,12 +1138,12 @@
 
                 GENDRV_EXIT_DISPATCH(dev_obj, STATUS_PENDING, irp);
             }
-            else if (irpstack->MinorFunction == IOCTL_GET_DEV_DESC)
+            else if (irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_GET_DEV_DESC)
             {
                 // this is a synchronous call, route to dev_mgr_dispatch
                 return dev_mgr_dispatch(dev_mgr, irp);
             }
-            else if (irpstack->MinorFunction == IOCTL_GET_DEV_HANDLE)
+            else if (irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_GET_DEV_HANDLE)
             {
                 PGENDRV_DEVICE_EXTENSION pdev_ext;
                 pdev_ext = dev_obj->DeviceExtension;
@@ -1158,9 +1159,9 @@
         case IRP_MJ_DEVICE_CONTROL:
         {
             status = STATUS_NOT_SUPPORTED;
-            if (irpstack->MinorFunction == IOCTL_SUBMIT_URB_RD ||
-                irpstack->MinorFunction == IOCTL_SUBMIT_URB_WR ||
-                irpstack->MinorFunction == IOCTL_SUBMIT_URB_NOIO)
+            if (irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_SUBMIT_URB_RD ||
+                irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_SUBMIT_URB_WR ||
+                irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_SUBMIT_URB_NOIO)
             {
                 PURB purb;
                 DEV_HANDLE endp_handle;
@@ -1183,12 +1184,12 @@
 
                 GENDRV_EXIT_DISPATCH(dev_obj, STATUS_PENDING, irp);
             }
-            else if (irpstack->MinorFunction == IOCTL_GET_DEV_DESC)
+            else if (irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_GET_DEV_DESC)
             {
                 // this is a synchronous call, route to dev_mgr_dispatch
                 return dev_mgr_dispatch(dev_mgr, irp);
             }
-            else if (irpstack->MinorFunction == IOCTL_GET_DEV_HANDLE)
+            else if (irpstack->Parameters.DeviceIoControl.IoControlCode == IOCTL_GET_DEV_HANDLE)
             {
                 PGENDRV_DEVICE_EXTENSION pdev_ext;
                 pdev_ext = dev_obj->DeviceExtension;

Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/hub.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdriver/hub.c?rev=23687&r1=23686&r2=23687&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/hub.c (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/hub.c Thu Aug 24 20:21:16 2006
@@ -3278,7 +3278,7 @@
     if (purb == NULL)
     {
         unlock_dev(pdev, FALSE);
-        return STATUS_NO_MEMORY;
+        return FALSE;
     }
 
     purb->flags = 0;

Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h?rev=23687&r1=23686&r2=23687&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/td.h Thu Aug 24 20:21:16 2006
@@ -506,6 +506,9 @@
 
 #define USE_IRQL \
 KIRQL _pending_endp_lock_old_irql=0, _pending_endp_list_lock_old_irql=0, _dev_lock_old_irql=0, old_irql=0;
+
+#define USE_BASIC_IRQL \
+KIRQL _pending_endp_list_lock_old_irql=0, _dev_lock_old_irql=0;
 
 #define USE_NON_PENDING_IRQL \
 KIRQL _dev_lock_old_irql=0, old_irql=0;

Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c?rev=23687&r1=23686&r2=23687&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/uhci.c Thu Aug 24 20:21:16 2006
@@ -1166,7 +1166,7 @@
     NTSTATUS can_submit = STATUS_UNSUCCESSFUL;
     PWORK_QUEUE_ITEM pwork_item;
     PLIST_ENTRY cancel_list;
-    USE_IRQL;
+    USE_BASIC_IRQL;
 
     if (uhci == NULL)
         return FALSE;
@@ -1313,7 +1313,7 @@
     int i;
     PUHCI_PENDING_ENDP pending_endp;
     NTSTATUS status;
-    USE_IRQL;
+    USE_BASIC_IRQL;
 
     if (uhci == NULL || pdev == NULL || pendp == NULL || purb == NULL)
         return STATUS_INVALID_PARAMETER;
@@ -1787,7 +1787,7 @@
     int i, j, k;
     SYNC_PARAM sync_param;
 
-    USE_IRQL;
+    USE_BASIC_IRQL;
 
     if (uhci == NULL || dev == NULL)
         return FALSE;

Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild?rev=23687&r1=23686&r2=23687&view=diff
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild Thu Aug 24 20:21:16 2006
@@ -1,4 +1,4 @@
-<module name="usbdriver" type="kernelmodedriver" installbase="system32/drivers" installname="usbdriver.sys" allowwarnings="true">
+<module name="usbdriver" type="kernelmodedriver" installbase="system32/drivers" installname="usbdriver.sys">
 	<define name="INCLUDE_EHCI" />
 	<include base="usbdriver">.</include>
 	<library>ntoskrnl</library>




More information about the Ros-diffs mailing list