Author: fireball
Date: Sat Aug 19 20:53:49 2006
New Revision: 23610
URL:
http://svn.reactos.org/svn/reactos?rev=23610&view=rev
Log:
- Brandon Turner's warning fixing patch
- When compiled with gcc we assume that CPU can't do TSC (the function will be
rewritten anyway since it's weird to use inline assembly in a driver)
- Changed to the correct .rc file, removed duplicate one (ehci.rc)
- usbdriver now compiles with reactos build system
Removed:
trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.rc
Modified:
trunk/reactos/drivers/usb/nt4compat/directory.rbuild
trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c
trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c
trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild
trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rc
Modified: trunk/reactos/drivers/usb/nt4compat/directory.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/dire…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/directory.rbuild (original)
+++ trunk/reactos/drivers/usb/nt4compat/directory.rbuild Sat Aug 19 20:53:49 2006
@@ -1,3 +1,3 @@
-<!--<directory name="usbdriver">
+<directory name="usbdriver">
<xi:include href="usbdriver/usbdriver.rbuild" />
-</directory>-->
+</directory>
Removed: trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.rc (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/ehci.rc (removed)
@@ -1,45 +1,0 @@
-// Resource script for USBISO driver
-// Generated by Walt Oney's driver wizard
-
-#include <windows.h>
-
-LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL
-
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,0,1,0
- PRODUCTVERSION 0,0,1,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "Comments", "This is a beta version of usb driver stack(
ehci ), contact me at mypublic99(a)yahoo.com\0"
- VALUE "CompanyName", "Woodhead Software\0"
- VALUE "FileDescription", "ehci.sys\0"
- VALUE "FileVersion", "0, 0, 1, 0\0"
- VALUE "InternalName", "ehci.sys\0"
- VALUE "LegalCopyright", "Copyright © 2002-2004 Woodhead
Software\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "ehci.sys\0"
- VALUE "PrivateBuild", "0.01\0"
- VALUE "ProductName", "usb driver stack for windows NT\0"
- VALUE "ProductVersion", "0, 0, 1, 0\0"
- VALUE "SpecialBuild", "0131.d\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/gendrv.c Sat Aug 19 20:53:49 2006
@@ -57,7 +57,7 @@
return;\
}
-extern POBJECT_TYPE *IoDriverObjectType;
+extern POBJECT_TYPE NTSYSAPI IoDriverObjectType;
extern VOID
disp_urb_completion(
@@ -295,9 +295,8 @@
PUSB_CTRL_SETUP_PACKET psetup;
NTSTATUS status;
PUCHAR buf;
- LONG credit, i, j, match;
+ LONG i;
PUSB_CONFIGURATION_DESC pconfig_desc;
- PUSB_INTERFACE_DESC pif_desc;
PUSB_DEV_MANAGER dev_mgr;
if( param == NULL || dev_handle == 0 )
@@ -401,7 +400,6 @@
// and call its AddDevice.
//
LONG i;
- NTSTATUS status;
PUSB_DRIVER pdrvr;
PGENDRV_DRVR_EXTENSION pdrvr_ext;
PGENDRV_EXT_DRVR_ENTRY pentry;
@@ -411,10 +409,9 @@
PDEVICE_OBJECT pdev_obj;
PDRIVER_OBJECT pdrvr_obj;
- HANDLE handle;
PLIST_ENTRY pthis, pnext;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( pdev == NULL )
return FALSE;
@@ -509,12 +506,11 @@
{
DEV_HANDLE dev_handle;
PUSB_DEV_MANAGER dev_mgr;
- PWORK_QUEUE_ITEM pwork_item;
PUSB_DRIVER pdriver;
NTSTATUS status;
PUSB_DEV pdev;
PUSB_EVENT pevent;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
if( purb == NULL || context == NULL )
return;
@@ -576,7 +572,7 @@
pevent->context = 0;
pevent->param = ( ULONG )pdriver;
pevent->pnext = 0; //vertical queue for serialized operation
- pevent->process_event = gendrv_event_select_driver;
+ pevent->process_event = (PROCESS_EVENT)gendrv_event_select_driver;
pevent->process_queue = event_list_default_process_queue;
InsertTailList( &dev_mgr->event_list, &pevent->event_link );
@@ -828,7 +824,6 @@
PVOID pctx
)
{
- PDRIVER_EXTENSION pwin_drvr_ext;
if( pdev_obj == NULL )
return STATUS_INVALID_PARAMETER;
@@ -842,7 +837,7 @@
pdrvr_obj = (PDRIVER_OBJECT )pctx;
if( pdrvr_obj->DriverExtension )
{
- return pdrvr_obj->DriverExtension->AddDevice( pdrvr_obj, &pdev_obj );
+ return pdrvr_obj->DriverExtension->AddDevice( pdrvr_obj, pdev_obj );
}
return STATUS_IO_DEVICE_ERROR;
}
@@ -896,9 +891,8 @@
PDEVICE_OBJECT pdev_obj;
PDRIVER_OBJECT pdrvr_obj;
- HANDLE handle;
PLIST_ENTRY pthis, pnext;
- USE_IRQL;
+ USE_BASIC_NON_PENDING_IRQL;
pdev = NULL;
usb_dbg_print( DBGLVL_MAXIMUM, ( "gendrv_if_connect(): entering...\n" ) );
@@ -1062,13 +1056,11 @@
)
{
PUSB_DEV pdev;
- PDEVICE_OBJECT dev_obj;
+ PDEVICE_OBJECT dev_obj = NULL;
NTSTATUS status;
PUSB_DRIVER pdrvr;
- PGENDRV_DRVR_EXTENSION pdrvr_ext;
- PGENDRV_EXT_DRVR_ENTRY pentry;
- PLIST_ENTRY pthis;
- PGENDRV_DEVICE_EXTENSION pdev_ext;
+ PGENDRV_DRVR_EXTENSION pdrvr_ext = NULL;
+ PGENDRV_DEVICE_EXTENSION pdev_ext = NULL;
ULONG if_idx;
status = usb_query_and_lock_dev( dev_mgr, if_handle, &pdev );
@@ -1178,8 +1170,7 @@
)
{
PGENDRV_DRVR_EXTENSION pdrvr_ext;
- LONG i;
- PLIST_ENTRY pthis, pnext;
+ PLIST_ENTRY pthis;
PGENDRV_EXT_DRVR_ENTRY pentry;
if( dev_mgr == NULL || pdriver == NULL )
return FALSE;
@@ -1225,7 +1216,7 @@
OBJECT_ATTRIBUTES oa;
HANDLE drvr_handle;
UNICODE_STRING oname;
- PDRIVER_OBJECT pdrvr;
+ PDRIVER_OBJECT pdrvr = NULL;
RtlZeroMemory( &oa, sizeof( oa ) );
oa.Length = sizeof( oa );
@@ -1235,7 +1226,7 @@
RtlAppendUnicodeStringToString( &oname, unicode_string );
status = ObOpenObjectByName( &oa,
- *IoDriverObjectType, // object type
+ IoDriverObjectType, // object type
KernelMode, // access mode
NULL, // access state
FILE_READ_DATA, // STANDARD_RIGHTS_READ, access right
@@ -1248,9 +1239,9 @@
}
ObReferenceObjectByHandle( drvr_handle,
FILE_READ_DATA,
- *IoDriverObjectType,
+ IoDriverObjectType,
KernelMode,
- &pdrvr,
+ (PVOID)&pdrvr,
NULL // OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL
);
ZwClose( drvr_handle );
@@ -1334,8 +1325,6 @@
}
else if( irpstack->MinorFunction == IOCTL_GET_DEV_HANDLE )
{
- PUCHAR user_buffer;
- ULONG user_buffer_length;
PGENDRV_DEVICE_EXTENSION pdev_ext;
pdev_ext = dev_obj->DeviceExtension;
if( irpstack->Parameters.DeviceIoControl.OutputBufferLength < sizeof( LONG ) )
@@ -1383,8 +1372,6 @@
}
else if( irpstack->MinorFunction == IOCTL_GET_DEV_HANDLE )
{
- PUCHAR user_buffer;
- ULONG user_buffer_length;
PGENDRV_DEVICE_EXTENSION pdev_ext;
pdev_ext = dev_obj->DeviceExtension;
if( irpstack->Parameters.DeviceIoControl.OutputBufferLength < sizeof( LONG ) )
@@ -1409,14 +1396,14 @@
PUSB_DEV_MANAGER dev_mgr
)
{
- PDEVEXT_HEADER dev_hdr;
+ PDEVEXT_HEADER dev_hdr = NULL;
if( dev_obj == NULL || dev_mgr == NULL )
return FALSE;
dev_hdr = ( PDEVEXT_HEADER )dev_obj->DeviceExtension;
dev_hdr->type = NTDEV_TYPE_CLIENT_DEV;
dev_hdr->dispatch = gendrv_dispatch;
- dev_hdr->start_io = gendrv_startio;
+ dev_hdr->start_io = (PDRIVER_STARTIO)gendrv_startio;
return TRUE;
}
@@ -1557,7 +1544,6 @@
UCHAR dev_name[ 64 ];
STRING string;
UNICODE_STRING symb_link;
- NTSTATUS status;
PGENDRV_DRVR_EXTENSION pdrvr_ext;
if( dev_mgr == NULL || dev_obj == 0 )
@@ -1810,7 +1796,7 @@
PIO_STACK_LOCATION irp_stack;
ULONG ctrl_code;
PUSB_DEV_MANAGER dev_mgr;
- USE_IRQL;
+ USE_NON_PENDING_IRQL;
if( dev_obj == NULL || irp == NULL )
return;
@@ -1847,17 +1833,14 @@
case IOCTL_SUBMIT_URB_NOIO:
case IOCTL_SUBMIT_URB_WR:
{
- LONG buf_size;
PURB purb;
- KIRQL old_irql;
- ULONG endp_idx, if_idx, user_buffer_length;
- PUCHAR user_buffer;
+ ULONG endp_idx, if_idx, user_buffer_length = 0;
+ PUCHAR user_buffer = NULL;
PUSB_DEV pdev;
DEV_HANDLE endp_handle;
PUSB_ENDPOINT pendp;
NTSTATUS status;
- PUSB_CTRL_SETUP_PACKET psetup;
if( irp_stack->Parameters.DeviceIoControl.InputBufferLength < sizeof( URB ) )
{
@@ -2004,8 +1987,7 @@
KIRQL cancelIrql;
PIRP irp, cur_irp;
PKDEVICE_QUEUE_ENTRY packet;
- LIST_ENTRY cancel_irps, *pthis, *pnext;
- PDEVEXT_HEADER dev_hdr;
+ LIST_ENTRY cancel_irps, *pthis;
//
// cancel all the irps in the queue
@@ -2018,7 +2000,7 @@
// remove the irps from device queue
IoAcquireCancelSpinLock( &cancelIrql );
cur_irp = dev_obj->CurrentIrp;
- while( packet = KeRemoveDeviceQueue( &dev_obj->DeviceQueue ) )
+ while(( packet = KeRemoveDeviceQueue( &dev_obj->DeviceQueue ) ))
{
irp = struct_ptr( packet, IRP, Tail.Overlay.DeviceQueueEntry );
InsertTailList( &cancel_irps,
&irp->Tail.Overlay.DeviceQueueEntry.DeviceListEntry );
@@ -2050,7 +2032,6 @@
// cancel routine for irps queued in the device queue
PUSB_DEV_MANAGER dev_mgr;
PDEVEXT_HEADER pdev_ext_hdr;
- ULONG i;
pdev_ext_hdr = ( PDEVEXT_HEADER )dev_obj->DeviceExtension;
dev_mgr = pdev_ext_hdr->dev_mgr;
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usb.c Sat Aug 19 20:53:49 2006
@@ -1076,6 +1076,7 @@
return count;
}
+// checks if processor supports Time Stamp Counter
__inline BOOL
usb_query_clicks(
PLARGE_INTEGER clicks
@@ -1084,6 +1085,8 @@
BOOL ret_val;
//so we have to use intel's cpu???
ret_val = FALSE;
+
+#ifdef _MSC_VER
__asm
{
push ebx;
@@ -1102,6 +1105,9 @@
pop eax;
pop ebx;
}
+#else
+ ret_val = FALSE;
+#endif
return ret_val;
}
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rbuild Sat Aug 19 20:53:49
2006
@@ -15,5 +15,5 @@
<file>compdrv.c</file>
<file>etd.c</file>
<file>gendrv.c</file>
- <file>ehci.rc</file>
+ <file>usbdriver.rc</file>
</module>
Modified: trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rc (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdriver/usbdriver.rc Sat Aug 19 20:53:49 2006
@@ -25,12 +25,12 @@
BEGIN
VALUE "Comments", "This is a beta version of usb driver stack(
ehci ), contact me at mypublic99(a)yahoo.com\0"
VALUE "CompanyName", "Woodhead Software\0"
- VALUE "FileDescription", "ehci.sys\0"
+ VALUE "FileDescription", "usbdriver.sys\0"
VALUE "FileVersion", "0, 0, 1, 0\0"
- VALUE "InternalName", "ehci.sys\0"
+ VALUE "InternalName", "usbdriver.sys\0"
VALUE "LegalCopyright", "Copyright © 2002-2004 Woodhead
Software\0"
VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "ehci.sys\0"
+ VALUE "OriginalFilename", "usbdriver.sys\0"
VALUE "PrivateBuild", "0.01\0"
VALUE "ProductName", "usb driver stack for windows NT\0"
VALUE "ProductVersion", "0, 0, 1, 0\0"