Prev Previous Post   Next Post Next

Regarding DFU+ IOCTL_INTERNAL_USB_CYCLE_PORT

Posted: 01-05-2007, 11:13 AM
Hi,
I am implementing DFU support to the usb function driver.For DFU
support,I need to re enumerate the device so that while enumerating all
the other drivers are unloaded and DFU supported USB function driver
gets loaded.I have posted my piece of code down.

PAGED_CODE();
NTSTATUS status;
PDEVICE_EXTENSION pdx = (PDEVICE_EXTENSION) fdo->DeviceExtension;
KEVENT event;
KeInitializeEvent(&event, NotificationEvent, FALSE);
IO_STATUS_BLOCK iostatus;

PIRP Irp =
IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_USB_C YCLE_PORT,
pdx->LowerDeviceObject, NULL, 0, NULL, 0, TRUE, &event,
&iostatus);
KdPrint((DRIVERNAME " - IoBuildDeviceIoControlRequest %X \n",
iostatus.Status));
KdPrint((DRIVERNAME " - IRP Pointer %X \n", Irp));
PIO_STACK_LOCATION stack = IoGetNextIrpStackLocation(Irp);
stack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
stack->Parameters.DeviceIoControl.IoControlCode =
IOCTL_INTERNAL_USB_CYCLE_PORT;
//stack->Parameters.Others.Argument1 = (PVOID) urb;

status = IoCallDriver(pdx->LowerDeviceObject, Irp);
KdPrint((DRIVERNAME " - After IoCallDriver %X \n", status));

if (status == STATUS_PENDING)
{
KeWaitForSingleObject(&event, Executive, KernelMode, FALSE,
NULL);
status = iostatus.Status;

}
KdPrint((DRIVERNAME " - IoBuildDeviceIoControlRequest %X \n",
iostatus.Status));
if (!NT_SUCCESS(status))
{
KdPrint((DRIVERNAME " - Error %X trying to reset device\n",
status));
}
KdPrint((DRIVERNAME " - Returning DFUReset status %X \n", status));
return status;.


The problem here is my device is getting reset.But when it enumerates
again I am getting STATUS_NAME_OBJECT_COLLISION error.IoCreateDevice
fails.
The hardware device I am using is a bluetooth dongle.
Help me thru this.

Reply With Quote

Responses to "Regarding DFU+ IOCTL_INTERNAL_USB_CYCLE_PORT"

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem of using IOCTL_INTERNAL_USB_CYCLE_PORT (USB composite device) on Windows 2000 . Jeth Chang Windows XP Device Drivers 0 01-15-2005 02:12 AM