[ros-diffs] [hpoussin] 15919: Add Green driver, that emulates a VT100 compatible server.

hpoussin at svn.reactos.com hpoussin at svn.reactos.com
Wed Jun 15 19:11:43 CEST 2005


Add Green driver, that emulates a VT100 compatible server.
Input won't work as long as we don't have a kdbclass driver.Add stubs
for IOCTL_USB_GET_NODE_CONNECTION_NAME,
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION,
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION
Modified: trunk/reactos/drivers/usb/cromwell/hub/fdo.c
  _____  

Modified: trunk/reactos/drivers/usb/cromwell/hub/fdo.c
--- trunk/reactos/drivers/usb/cromwell/hub/fdo.c	2005-06-14
22:08:13 UTC (rev 15918)
+++ trunk/reactos/drivers/usb/cromwell/hub/fdo.c	2005-06-15
17:11:36 UTC (rev 15919)
@@ -7,7 +7,7 @@

  * PROGRAMMERS:     HervÚ Poussineau (hpoussin at reactos.com)
  */
 
-//#define NDEBUG
+#define NDEBUG
 #include "usbhub.h"
 
 extern struct usb_driver hub_driver;
@@ -122,8 +122,6 @@
 	PVOID BufferIn, BufferOut;
 	NTSTATUS Status;
 
-	DPRINT("Usbhub: UsbhubDeviceControlFdo() called\n");
-
 	Stack = IoGetCurrentIrpStackLocation(Irp);
 	LengthIn = Stack->Parameters.DeviceIoControl.InputBufferLength;
 	LengthOut =
Stack->Parameters.DeviceIoControl.OutputBufferLength;
@@ -137,10 +135,6 @@
 		{
 			PUSB_NODE_INFORMATION NodeInformation;
 			struct usb_device* dev;
-			struct device* device;
-			struct usb_interface * intf;
-			struct usb_hub *hub;
-			struct usb_hub_descriptor *descriptor;
 			DPRINT("Usbhub:
IOCTL_USB_GET_NODE_INFORMATION\n");
 			if (LengthOut < sizeof(USB_NODE_INFORMATION))
 				Status = STATUS_BUFFER_TOO_SMALL;
@@ -150,14 +144,10 @@
 			{
 				NodeInformation =
(PUSB_NODE_INFORMATION)BufferOut;
 				dev =
((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->dev;
-				device = hubdev(dev);
-				intf = to_usb_interface(device);
-				hub = usb_get_intfdata(intf);
-				descriptor = hub->descriptor;
 				NodeInformation->NodeType = UsbHub;
 				RtlCopyMemory(
 
&NodeInformation->u.HubInformation.HubDescriptor,
-					descriptor,
+					((struct usb_hub
*)usb_get_intfdata(to_usb_interface(hubdev(dev))))->descriptor,
 					sizeof(USB_HUB_DESCRIPTOR));
 
NodeInformation->u.HubInformation.HubIsBusPowered = TRUE; /* FIXME */
 				Information =
sizeof(USB_NODE_INFORMATION);
@@ -165,6 +155,74 @@
 			}
 			break;
 		}
+		case IOCTL_USB_GET_NODE_CONNECTION_NAME:
+		{
+			PUSB_NODE_CONNECTION_NAME ConnectionName;
+			
+			DPRINT("Usbhub:
IOCTL_USB_GET_NODE_CONNECTION_NAME\n");
+			if (LengthOut <
sizeof(USB_NODE_CONNECTION_NAME))
+				Status = STATUS_BUFFER_TOO_SMALL;
+			else
+			{
+				ConnectionName =
(PUSB_NODE_CONNECTION_NAME)BufferOut;
+				DPRINT1("Usbhub:
IOCTL_USB_GET_NODE_CONNECTION_NAME unimplemented\n");
+				ConnectionName->ActualLength = 0;
+				ConnectionName->NodeName[0] =
UNICODE_NULL;
+				Information =
sizeof(USB_NODE_CONNECTION_NAME);
+				Status = STATUS_SUCCESS;
+			}
+			break;
+		}
+		case IOCTL_USB_GET_NODE_CONNECTION_INFORMATION:
+		{
+			PUSB_NODE_CONNECTION_INFORMATION
ConnectionInformation;
+			struct usb_device* dev;
+			//ULONG i;
+			
+			DPRINT("Usbhub:
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION\n");
+			if (LengthOut <
sizeof(USB_NODE_CONNECTION_INFORMATION))
+				Status = STATUS_BUFFER_TOO_SMALL;
+			else if (BufferOut == NULL)
+				Status = STATUS_INVALID_PARAMETER;
+			else
+			{
+				ConnectionInformation =
(PUSB_NODE_CONNECTION_INFORMATION)BufferOut;
+				DPRINT1("Usbhub:
IOCTL_USB_GET_NODE_CONNECTION_INFORMATION partially implemented\n");
+				dev =
((PHUB_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->dev;
+				ConnectionInformation->ConnectionIndex =
0; /* FIXME */
+				RtlCopyMemory(
+
&ConnectionInformation->DeviceDescriptor,
+					&dev->descriptor,
+					sizeof(USB_DEVICE_DESCRIPTOR));
+
ConnectionInformation->CurrentConfigurationValue = 0; /* FIXME */
+				ConnectionInformation->LowSpeed = TRUE;
/* FIXME */
+				ConnectionInformation->DeviceIsHub =
TRUE;
+
RtlZeroMemory(&ConnectionInformation->DeviceAddress,
sizeof(ConnectionInformation->DeviceAddress)); /* FIXME */
+
RtlZeroMemory(&ConnectionInformation->NumberOfOpenPipes,
sizeof(ConnectionInformation->NumberOfOpenPipes)); /* FIXME */
+
RtlZeroMemory(&ConnectionInformation->ConnectionStatus,
sizeof(ConnectionInformation->ConnectionStatus)); /* FIXME */
+
RtlZeroMemory(&ConnectionInformation->PipeList,
sizeof(ConnectionInformation->PipeList)); /* FIXME */
+				/*for (i = 0; i < 32; i++)
+				{
+					RtlCopyMemory(
+
&ConnectionInformation->PipeList[i].EndpointDescriptor,
+						xxx, // FIXME
+
sizeof(USB_ENDPOINT_DESCRIPTOR));
+
ConnectionInformation->PipeList[i].ScheduleOffset = 0; // FIXME
+				}*/
+				Information =
sizeof(USB_NODE_CONNECTION_INFORMATION);
+				Status = STATUS_SUCCESS;
+			}
+			break;
+		}
+		case IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION:
+		{
+			//PUSB_DESCRIPTOR_REQUEST Descriptor;
+			DPRINT("Usbhub:
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION\n");
+			DPRINT1("Usbhub:
IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION unimplemented\n");
+			Information = 0;
+			Status = STATUS_NOT_IMPLEMENTED;
+			break;
+		}
 		default:
 		{
 			/* Pass Irp to lower driver */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050615/4da25b32/attachment.html


More information about the Ros-diffs mailing list