Date: Tue, 23 Dec 2008 04:23:04 GMT From: Weongyo Jeong <weongyo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 155147 for review Message-ID: <200812230423.mBN4N4Rm099328@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=155147 Change 155147 by weongyo@weongyo_ws on 2008/12/23 04:22:30 revert r154981 to implement a PnP Manager; it looks unnecessary. Affected files ... .. //depot/projects/ndisusb/sys/compat/ndis/kern_ndis.c#9 edit .. //depot/projects/ndisusb/sys/compat/ndis/ntoskrnl_var.h#7 edit .. //depot/projects/ndisusb/sys/compat/ndis/subr_ntoskrnl.c#8 edit .. //depot/projects/ndisusb/sys/compat/ndis/subr_usbd.c#34 edit .. //depot/projects/ndisusb/sys/compat/ndis/usbd_var.h#7 edit .. //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis.c#15 edit Differences ... ==== //depot/projects/ndisusb/sys/compat/ndis/kern_ndis.c#9 (text+ko) ==== @@ -88,10 +88,6 @@ static void ndis_intrsetup(kdpc *, device_object *, irp *, struct ndis_softc *); static void ndis_return(device_object *, void *); -static int32_t ndis_iodispatch(device_object *, irp *); -static int32_t ndis_ioinvalid(device_object *, irp *); -static int32_t ndis_pnp(device_object *, irp *); -static int32_t ndis_power(device_object *, irp *); static image_patch_table kernndis_functbl[] = { IMPORT_SFUNC(ndis_status_func, 4), @@ -108,11 +104,6 @@ static struct nd_head ndis_devhead; -static funcptr ndis_iodispatch_wrap; -static funcptr ndis_ioinvalid_wrap; -static funcptr ndis_pnp_wrap; -static funcptr ndis_power_wrap; - /* * This allows us to export our symbols to other modules. * Note that we call ourselves 'ndisapi' to avoid a namespace @@ -156,16 +147,6 @@ } TAILQ_INIT(&ndis_devhead); - - windrv_wrap((funcptr)ndis_ioinvalid, - (funcptr *)&ndis_ioinvalid_wrap, 2, WINDRV_WRAP_STDCALL); - windrv_wrap((funcptr)ndis_iodispatch, - (funcptr *)&ndis_iodispatch_wrap, 2, WINDRV_WRAP_STDCALL); - windrv_wrap((funcptr)ndis_pnp, - (funcptr *)&ndis_pnp_wrap, 2, WINDRV_WRAP_STDCALL); - windrv_wrap((funcptr)ndis_power, - (funcptr *)&ndis_power_wrap, 2, WINDRV_WRAP_STDCALL); - break; case MOD_SHUTDOWN: if (TAILQ_FIRST(&ndis_devhead) == NULL) { @@ -181,11 +162,6 @@ windrv_unwrap(patch->ipt_wrap); patch++; } - - windrv_unwrap(ndis_ioinvalid_wrap); - windrv_unwrap(ndis_iodispatch_wrap); - windrv_unwrap(ndis_pnp_wrap); - windrv_unwrap(ndis_power_wrap); } break; case MOD_UNLOAD: @@ -1418,7 +1394,7 @@ ndis_miniport_block *block; struct ndis_softc *sc; uint32_t status; - int error, i; + int error; sc = device_get_softc(pdo->do_devext); @@ -1492,96 +1468,9 @@ TAILQ_INSERT_TAIL(&ndis_devhead, block, link); - for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) - drv->dro_dispatch[i] = (driver_dispatch)ndis_ioinvalid_wrap; - drv->dro_dispatch[IRP_MJ_INTERNAL_DEVICE_CONTROL] = - (driver_dispatch)ndis_iodispatch_wrap; - drv->dro_dispatch[IRP_MJ_POWER] = (driver_dispatch)ndis_power_wrap; - drv->dro_dispatch[IRP_MJ_PNP] = (driver_dispatch)ndis_pnp_wrap; - return (STATUS_SUCCESS); } -static int32_t -ndis_ioinvalid(dobj, ip) - device_object *dobj; - irp *ip; -{ - device_t dev = IRP_NDIS_DEV(ip); - struct io_stack_location *irp_sl; - - irp_sl = IoGetCurrentIrpStackLocation(ip); - device_printf(dev, "%s: unsupported I/O dispatch %d:%d\n", - __func__, irp_sl->isl_major, irp_sl->isl_minor); - - ip->irp_iostat.isb_status = STATUS_FAILURE; - ip->irp_iostat.isb_info = 0; - - IoCompleteRequest(ip, IO_NO_INCREMENT); - - return (STATUS_FAILURE); -} - -static int32_t -ndis_iodispatch(dobj, ip) - device_object *dobj; - irp *ip; -{ - device_t dev = IRP_NDIS_DEV(ip); - struct io_stack_location *irp_sl; - - irp_sl = IoGetCurrentIrpStackLocation(ip); - device_printf(dev, "%s: unsupported I/O dispatch %d:%d\n", - __func__, irp_sl->isl_major, irp_sl->isl_minor); - - ip->irp_iostat.isb_status = STATUS_FAILURE; - ip->irp_iostat.isb_info = 0; - - IoCompleteRequest(ip, IO_NO_INCREMENT); - - return (STATUS_FAILURE); -} - -static int32_t -ndis_power(dobj, ip) - device_object *dobj; - irp *ip; -{ - device_t dev = IRP_NDIS_DEV(ip); - struct io_stack_location *irp_sl; - - irp_sl = IoGetCurrentIrpStackLocation(ip); - device_printf(dev, "%s: unsupported I/O dispatch %d:%d\n", - __func__, irp_sl->isl_major, irp_sl->isl_minor); - - ip->irp_iostat.isb_status = STATUS_FAILURE; - ip->irp_iostat.isb_info = 0; - - IoCompleteRequest(ip, IO_NO_INCREMENT); - - return (STATUS_FAILURE); -} - -static int32_t -ndis_pnp(dobj, ip) - device_object *dobj; - irp *ip; -{ - device_t dev = IRP_NDIS_DEV(ip); - struct io_stack_location *irp_sl; - - irp_sl = IoGetCurrentIrpStackLocation(ip); - device_printf(dev, "%s: unsupported I/O dispatch %d:%d\n", - __func__, irp_sl->isl_major, irp_sl->isl_minor); - - ip->irp_iostat.isb_status = STATUS_FAILURE; - ip->irp_iostat.isb_info = 0; - - IoCompleteRequest(ip, IO_NO_INCREMENT); - - return (STATUS_FAILURE); -} - int ndis_unload_driver(arg) void *arg; ==== //depot/projects/ndisusb/sys/compat/ndis/ntoskrnl_var.h#7 (text+ko) ==== @@ -924,10 +924,6 @@ void *isl_arg3; void *isl_arg4; } isl_others; - struct { - void *isl_res; - void *isl_restran; - } isl_startdev; } isl_parameters __attribute__((packed)); void *isl_devobj; @@ -1423,8 +1419,6 @@ extern void IoFreeWorkItem(io_workitem *); extern void IoQueueWorkItem(io_workitem *, io_workitem_func, uint32_t, void *); -extern irp *IoBuildSynchronousFsdRequest(uint32_t, device_object *, - void *, uint32_t, uint64_t *, nt_kevent *, io_status_block *); #define IoCallDriver(a, b) IofCallDriver(a, b) #define IoCompleteRequest(a, b) IofCompleteRequest(a, b) ==== //depot/projects/ndisusb/sys/compat/ndis/subr_ntoskrnl.c#8 (text+ko) ==== @@ -130,6 +130,8 @@ unicode_string *, uint8_t); static void RtlCopyUnicodeString(unicode_string *, unicode_string *); +static irp *IoBuildSynchronousFsdRequest(uint32_t, device_object *, + void *, uint32_t, uint64_t *, nt_kevent *, io_status_block *); static irp *IoBuildAsynchronousFsdRequest(uint32_t, device_object *, void *, uint32_t, uint64_t *, io_status_block *); static irp *IoBuildDeviceIoControlRequest(uint32_t, @@ -858,7 +860,7 @@ return (d); } -irp * +static irp * IoBuildSynchronousFsdRequest(func, dobj, buf, len, off, event, status) uint32_t func; device_object *dobj; ==== //depot/projects/ndisusb/sys/compat/ndis/subr_usbd.c#34 (text+ko) ==== @@ -88,8 +88,6 @@ static int32_t usbd_ioinvalid(device_object *, irp *); static int32_t usbd_pnp(device_object *, irp *); static int32_t usbd_power(device_object *, irp *); -static uint32_t usbd_sendirp(device_t, device_object *, uint32_t, - uint32_t, io_stack_location *); static void usbd_irpcancel(device_object *, irp *); static void usbd_irpcancel_cb(void *); static int32_t usbd_submit_urb(irp *); @@ -288,55 +286,6 @@ return (STATUS_FAILURE); } -static uint32_t -usbd_sendirp(dev, pdo, major, minor, sl) - device_t dev; - device_object *pdo; - uint32_t major; - uint32_t minor; - io_stack_location *sl; -{ - device_object *top = IoGetAttachedDevice(pdo); - io_stack_location *irp_sl; - irp *ip; - nt_kevent evt; - uint32_t status; - - KeInitializeEvent(&evt, EVENT_TYPE_NOTIFY, FALSE); - ip = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, top, NULL, 0, NULL, &evt, - NULL); - if (ip == NULL) - return (STATUS_NO_MEMORY); - ip->irp_iostat.isb_info = 0; - ip->irp_iostat.isb_status = STATUS_NOT_IMPLEMENTED; - IRP_NDIS_DEV(ip) = dev; - irp_sl = IoGetNextIrpStackLocation(ip); - if (sl != NULL) - bcopy(sl, irp_sl, sizeof(*sl)); - irp_sl->isl_major = major; - irp_sl->isl_minor = minor; - status = IoCallDriver(top, ip); - if (status == STATUS_PENDING) { - KeWaitForSingleObject(&evt, 0, 0, FALSE, NULL); - status = ip->irp_iostat.isb_status; - } - return (status); -} - -uint32_t -usbd_pnp_startdev(dev, pdo) - device_t dev; - device_object *pdo; -{ - io_stack_location sl; - - bzero(&sl, sizeof(sl)); - sl.isl_parameters.isl_startdev.isl_res = NULL; - sl.isl_parameters.isl_startdev.isl_restran = NULL; - - return usbd_sendirp(dev, pdo, IRP_MJ_PNP, IRP_MN_START_DEVICE, &sl); -} - /* Convert USBD_STATUS to NTSTATUS */ static int32_t usbd_urb2nt(status) ==== //depot/projects/ndisusb/sys/compat/ndis/usbd_var.h#7 (text+ko) ==== @@ -217,7 +217,6 @@ __BEGIN_DECLS extern int usbd_libinit(void); extern int usbd_libfini(void); -extern uint32_t usbd_pnp_startdev(device_t, device_object *); __END_DECLS #endif /* _USBD_VAR_H_ */ ==== //depot/projects/ndisusb/sys/dev/if_ndis/if_ndis.c#15 (text+ko) ==== @@ -583,9 +583,6 @@ goto fail; } - if (sc->ndis_iftype == PNPBus) - usbd_pnp_startdev(dev, pdo); - /* Tell the user what version of the API the driver is using. */ device_printf(dev, "NDIS API version: %d.%d\n", sc->ndis_chars->nmc_version_major,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812230423.mBN4N4Rm099328>