Date: Thu, 7 Sep 2006 06:24:15 GMT From: Matt Jacob <mjacob@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 105772 for review Message-ID: <200609070624.k876OFfi058140@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105772 Change 105772 by mjacob@newisp on 2006/09/07 06:23:22 More usb fallout. Affected files ... .. //depot/projects/newisp/dev/if_ndis/if_ndis_usb.c#3 integrate .. //depot/projects/newisp/netgraph/bluetooth/drivers/ubt/ng_ubt.c#2 integrate .. //depot/projects/newisp/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h#2 integrate .. //depot/projects/newisp/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c#2 integrate Differences ... ==== //depot/projects/newisp/dev/if_ndis/if_ndis_usb.c#3 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_usb.c,v 1.6 2006/09/07 05:34:04 trhodes Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/if_ndis/if_ndis_usb.c,v 1.7 2006/09/07 06:00:03 mjacob Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -83,7 +83,7 @@ extern unsigned char drv_data[]; -Static device_method_t ndis_methods[] = { +static device_method_t ndis_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ndisusb_match), DEVMETHOD(device_attach, ndisusb_attach), @@ -98,13 +98,13 @@ { 0, 0 } }; -Static driver_t ndis_driver = { +static driver_t ndis_driver = { "ndis", ndis_methods, sizeof(struct ndis_softc) }; -Static devclass_t ndis_devclass; +static devclass_t ndis_devclass; DRIVER_MODULE(ndis, uhub, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); ==== //depot/projects/newisp/netgraph/bluetooth/drivers/ubt/ng_ubt.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $Id: ng_ubt.c,v 1.16 2003/10/10 19:15:06 max Exp $ - * $FreeBSD: src/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c,v 1.26 2005/12/04 10:06:05 ru Exp $ + * $FreeBSD: src/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c,v 1.27 2006/09/07 06:14:05 mjacob Exp $ */ #include <sys/param.h> @@ -67,66 +67,66 @@ USB_DECLARE_DRIVER(ubt); -Static int ubt_modevent (module_t, int, void *); +static int ubt_modevent (module_t, int, void *); -Static usbd_status ubt_request_start (ubt_softc_p); -Static void ubt_request_complete (usbd_xfer_handle, +static usbd_status ubt_request_start (ubt_softc_p); +static void ubt_request_complete (usbd_xfer_handle, usbd_private_handle, usbd_status); -Static void ubt_request_complete2 (node_p, hook_p, void *, int); +static void ubt_request_complete2 (node_p, hook_p, void *, int); -Static usbd_status ubt_intr_start (ubt_softc_p); -Static void ubt_intr_complete (usbd_xfer_handle, +static usbd_status ubt_intr_start (ubt_softc_p); +static void ubt_intr_complete (usbd_xfer_handle, usbd_private_handle, usbd_status); -Static void ubt_intr_complete2 (node_p, hook_p, void *, int); +static void ubt_intr_complete2 (node_p, hook_p, void *, int); -Static usbd_status ubt_bulk_in_start (ubt_softc_p); -Static void ubt_bulk_in_complete (usbd_xfer_handle, +static usbd_status ubt_bulk_in_start (ubt_softc_p); +static void ubt_bulk_in_complete (usbd_xfer_handle, usbd_private_handle, usbd_status); -Static void ubt_bulk_in_complete2 (node_p, hook_p, void *, int); +static void ubt_bulk_in_complete2 (node_p, hook_p, void *, int); -Static usbd_status ubt_bulk_out_start (ubt_softc_p); -Static void ubt_bulk_out_complete (usbd_xfer_handle, +static usbd_status ubt_bulk_out_start (ubt_softc_p); +static void ubt_bulk_out_complete (usbd_xfer_handle, usbd_private_handle, usbd_status); -Static void ubt_bulk_out_complete2 (node_p, hook_p, void *, int); +static void ubt_bulk_out_complete2 (node_p, hook_p, void *, int); -Static usbd_status ubt_isoc_in_start (ubt_softc_p); -Static void ubt_isoc_in_complete (usbd_xfer_handle, +static usbd_status ubt_isoc_in_start (ubt_softc_p); +static void ubt_isoc_in_complete (usbd_xfer_handle, usbd_private_handle, usbd_status); -Static void ubt_isoc_in_complete2 (node_p, hook_p, void *, int); +static void ubt_isoc_in_complete2 (node_p, hook_p, void *, int); -Static usbd_status ubt_isoc_out_start (ubt_softc_p); -Static void ubt_isoc_out_complete (usbd_xfer_handle, +static usbd_status ubt_isoc_out_start (ubt_softc_p); +static void ubt_isoc_out_complete (usbd_xfer_handle, usbd_private_handle, usbd_status); -Static void ubt_isoc_out_complete2 (node_p, hook_p, void *, int); +static void ubt_isoc_out_complete2 (node_p, hook_p, void *, int); -Static void ubt_reset (ubt_softc_p); +static void ubt_reset (ubt_softc_p); /* * Netgraph methods */ -Static ng_constructor_t ng_ubt_constructor; -Static ng_shutdown_t ng_ubt_shutdown; -Static ng_newhook_t ng_ubt_newhook; -Static ng_connect_t ng_ubt_connect; -Static ng_disconnect_t ng_ubt_disconnect; -Static ng_rcvmsg_t ng_ubt_rcvmsg; -Static ng_rcvdata_t ng_ubt_rcvdata; +static ng_constructor_t ng_ubt_constructor; +static ng_shutdown_t ng_ubt_shutdown; +static ng_newhook_t ng_ubt_newhook; +static ng_connect_t ng_ubt_connect; +static ng_disconnect_t ng_ubt_disconnect; +static ng_rcvmsg_t ng_ubt_rcvmsg; +static ng_rcvdata_t ng_ubt_rcvdata; /* Queue length */ -Static const struct ng_parse_struct_field ng_ubt_node_qlen_type_fields[] = +static const struct ng_parse_struct_field ng_ubt_node_qlen_type_fields[] = { { "queue", &ng_parse_int32_type, }, { "qlen", &ng_parse_int32_type, }, { NULL, } }; -Static const struct ng_parse_type ng_ubt_node_qlen_type = { +static const struct ng_parse_type ng_ubt_node_qlen_type = { &ng_parse_struct_type, &ng_ubt_node_qlen_type_fields }; /* Stat info */ -Static const struct ng_parse_struct_field ng_ubt_node_stat_type_fields[] = +static const struct ng_parse_struct_field ng_ubt_node_stat_type_fields[] = { { "pckts_recv", &ng_parse_uint32_type, }, { "bytes_recv", &ng_parse_uint32_type, }, @@ -136,13 +136,13 @@ { "ierrors", &ng_parse_uint32_type, }, { NULL, } }; -Static const struct ng_parse_type ng_ubt_node_stat_type = { +static const struct ng_parse_type ng_ubt_node_stat_type = { &ng_parse_struct_type, &ng_ubt_node_stat_type_fields }; /* Netgraph node command list */ -Static const struct ng_cmdlist ng_ubt_cmdlist[] = { +static const struct ng_cmdlist ng_ubt_cmdlist[] = { { NGM_UBT_COOKIE, NGM_UBT_NODE_SET_DEBUG, @@ -189,7 +189,7 @@ }; /* Netgraph node type */ -Static struct ng_type typestruct = { +static struct ng_type typestruct = { .version = NG_ABI_VERSION, .name = NG_UBT_NODE_TYPE, .constructor = ng_ubt_constructor, @@ -220,7 +220,7 @@ * Load/Unload the driver module */ -Static int +static int ubt_modevent(module_t mod, int event, void *data) { int error; @@ -266,7 +266,7 @@ * where VENDOR_ID and PRODUCT_ID are hex numbers. */ - Static struct usb_devno const ubt_ignored_devices[] = { + static struct usb_devno const ubt_ignored_devices[] = { { USB_VENDOR_AVM, 0x2200 }, /* AVM USB Bluetooth-Adapter BlueFritz! v1.0 */ { 0, 0 } /* This should be the last item in the list */ }; @@ -279,7 +279,7 @@ * to attach to the broken device. */ - Static struct usb_devno const ubt_broken_devices[] = { + static struct usb_devno const ubt_broken_devices[] = { { USB_VENDOR_AVM, 0x3800 }, /* AVM USB Bluetooth-Adapter BlueFritz! v2.0 */ { 0, 0 } /* This should be the last item in the list */ }; @@ -853,7 +853,7 @@ * Start USB control request (HCI command). Must be called with node locked */ -Static usbd_status +static usbd_status ubt_request_start(ubt_softc_p sc) { usb_device_request_t req; @@ -939,14 +939,14 @@ * USB control request callback */ -Static void +static void ubt_request_complete(usbd_xfer_handle h, usbd_private_handle p, usbd_status s) { ng_send_fn((node_p) p, NULL, ubt_request_complete2, (void *) h, s); NG_NODE_UNREF((node_p) p); } /* ubt_request_complete */ -Static void +static void ubt_request_complete2(node_p node, hook_p hook, void *arg1, int arg2) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -994,7 +994,7 @@ * Start interrupt transfer. Must be called when node is locked */ -Static usbd_status +static usbd_status ubt_intr_start(ubt_softc_p sc) { struct mbuf *m = NULL; @@ -1058,14 +1058,14 @@ * Process interrupt from USB device (We got data from interrupt pipe) */ -Static void +static void ubt_intr_complete(usbd_xfer_handle h, usbd_private_handle p, usbd_status s) { ng_send_fn((node_p) p, NULL, ubt_intr_complete2, (void *) h, s); NG_NODE_UNREF((node_p) p); } /* ubt_intr_complete */ -Static void +static void ubt_intr_complete2(node_p node, hook_p hook, void *arg1, int arg2) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -1160,7 +1160,7 @@ * Start bulk-in USB transfer (ACL data). Must be called when node is locked */ -Static usbd_status +static usbd_status ubt_bulk_in_start(ubt_softc_p sc) { struct mbuf *m = NULL; @@ -1224,14 +1224,14 @@ * USB bulk-in transfer callback */ -Static void +static void ubt_bulk_in_complete(usbd_xfer_handle h, usbd_private_handle p, usbd_status s) { ng_send_fn((node_p) p, NULL, ubt_bulk_in_complete2, (void *) h, s); NG_NODE_UNREF((node_p) p); } /* ubt_bulk_in_complete */ -Static void +static void ubt_bulk_in_complete2(node_p node, hook_p hook, void *arg1, int arg2) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -1326,7 +1326,7 @@ * Start bulk-out USB transfer. Must be called with node locked */ -Static usbd_status +static usbd_status ubt_bulk_out_start(ubt_softc_p sc) { struct mbuf *m = NULL; @@ -1401,14 +1401,14 @@ * USB bulk-out transfer callback */ -Static void +static void ubt_bulk_out_complete(usbd_xfer_handle h, usbd_private_handle p, usbd_status s) { ng_send_fn((node_p) p, NULL, ubt_bulk_out_complete2, (void *) h, s); NG_NODE_UNREF((node_p) p); } /* ubt_bulk_out_complete */ -Static void +static void ubt_bulk_out_complete2(node_p node, hook_p hook, void *arg1, int arg2) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -1457,7 +1457,7 @@ * Start Isochronous-in USB transfer. Must be called with node locked */ -Static usbd_status +static usbd_status ubt_isoc_in_start(ubt_softc_p sc) { usbd_status status; @@ -1503,14 +1503,14 @@ * USB isochronous transfer callback */ -Static void +static void ubt_isoc_in_complete(usbd_xfer_handle h, usbd_private_handle p, usbd_status s) { ng_send_fn((node_p) p, NULL, ubt_isoc_in_complete2, (void *) h, s); NG_NODE_UNREF((node_p) p); } /* ubt_isoc_in_complete */ -Static void +static void ubt_isoc_in_complete2(node_p node, hook_p hook, void *arg1, int arg2) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -1632,7 +1632,7 @@ * Start isochronous-out USB transfer. Must be called with node locked */ -Static usbd_status +static usbd_status ubt_isoc_out_start(ubt_softc_p sc) { struct mbuf *m = NULL; @@ -1717,14 +1717,14 @@ * USB isoc-out. transfer callback */ -Static void +static void ubt_isoc_out_complete(usbd_xfer_handle h, usbd_private_handle p, usbd_status s) { ng_send_fn((node_p) p, NULL, ubt_isoc_out_complete2, (void *) h, s); NG_NODE_UNREF((node_p) p); } /* ubt_isoc_out_complete */ -Static void +static void ubt_isoc_out_complete2(node_p node, hook_p hook, void *arg1, int arg2) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -1774,7 +1774,7 @@ * Abort transfers on all USB pipes */ -Static void +static void ubt_reset(ubt_softc_p sc) { /* Interrupt */ @@ -1809,7 +1809,7 @@ * Netgraph node constructor. Do not allow to create node of this type. */ -Static int +static int ng_ubt_constructor(node_p node) { return (EINVAL); @@ -1819,7 +1819,7 @@ * Netgraph node destructor. Destroy node only when device has been detached */ -Static int +static int ng_ubt_shutdown(node_p node) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -1858,7 +1858,7 @@ * Create new hook. There can only be one. */ -Static int +static int ng_ubt_newhook(node_p node, hook_p hook, char const *name) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -1878,7 +1878,7 @@ * Connect hook. Start incoming USB transfers */ -Static int +static int ng_ubt_connect(hook_p hook) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); @@ -1930,7 +1930,7 @@ * Disconnect hook */ -Static int +static int ng_ubt_disconnect(hook_p hook) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); @@ -1950,7 +1950,7 @@ * Process control message */ -Static int +static int ng_ubt_rcvmsg(node_p node, item_p item, hook_p lasthook) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node); @@ -2131,7 +2131,7 @@ * Process data */ -Static int +static int ng_ubt_rcvdata(hook_p hook, item_p item) { ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); ==== //depot/projects/newisp/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h#2 (text+ko) ==== @@ -28,12 +28,17 @@ * SUCH DAMAGE. * * $Id: ng_ubt_var.h,v 1.2 2003/03/22 23:44:36 max Exp $ - * $FreeBSD: src/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h,v 1.5 2005/01/07 01:45:42 imp Exp $ + * $FreeBSD: src/sys/netgraph/bluetooth/drivers/ubt/ng_ubt_var.h,v 1.6 2006/09/07 06:14:05 mjacob Exp $ */ #ifndef _NG_UBT_VAR_H_ #define _NG_UBT_VAR_H_ +/* FreeBSD 7.0 defines */ + +#define USBBASEDEVICE device_t +#define USBDEVNAME device_get_nameunit + /* pullup wrapper */ #define NG_UBT_M_PULLUP(m, s) \ do { \ ==== //depot/projects/newisp/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ * SUCH DAMAGE. * * $Id: ubtbcmfw.c,v 1.3 2003/10/10 19:15:08 max Exp $ - * $FreeBSD: src/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c,v 1.10 2005/01/07 01:45:42 imp Exp $ + * $FreeBSD: src/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c,v 1.11 2006/09/07 06:18:34 mjacob Exp $ */ #include <sys/param.h> @@ -50,6 +50,12 @@ #include "usbdevs.h" +/* FreeBSD 7.0 defines */ + +#define USBBASEDEVICE device_t +#define USBDEVNAME device_get_nameunit +#define USBDEVUNIT(bdev) device_get_unit(bdev) + /* * Download firmware to BCM2033. */ @@ -88,14 +94,14 @@ #define UBTBCMFW_MINOR(u, e) (((u) << 4) | (e)) #define UBTBCMFW_BSIZE 1024 -Static d_open_t ubtbcmfw_open; -Static d_close_t ubtbcmfw_close; -Static d_read_t ubtbcmfw_read; -Static d_write_t ubtbcmfw_write; -Static d_ioctl_t ubtbcmfw_ioctl; -Static d_poll_t ubtbcmfw_poll; +static d_open_t ubtbcmfw_open; +static d_close_t ubtbcmfw_close; +static d_read_t ubtbcmfw_read; +static d_write_t ubtbcmfw_write; +static d_ioctl_t ubtbcmfw_ioctl; +static d_poll_t ubtbcmfw_poll; -Static struct cdevsw ubtbcmfw_cdevsw = { +static struct cdevsw ubtbcmfw_cdevsw = { .d_version = D_VERSION, .d_flags = D_NEEDGIANT, .d_open = ubtbcmfw_open, @@ -266,7 +272,7 @@ * XXX FIXME softc locking */ -Static int +static int ubtbcmfw_open(struct cdev *dev, int flag, int mode, usb_proc_ptr p) { ubtbcmfw_softc_p sc = NULL; @@ -318,7 +324,7 @@ * XXX FIXME softc locking */ -Static int +static int ubtbcmfw_close(struct cdev *dev, int flag, int mode, usb_proc_ptr p) { ubtbcmfw_softc_p sc = NULL; @@ -355,7 +361,7 @@ * XXX FIXME softc locking */ -Static int +static int ubtbcmfw_read(struct cdev *dev, struct uio *uio, int flag) { ubtbcmfw_softc_p sc = NULL; @@ -419,7 +425,7 @@ * XXX FIXME softc locking */ -Static int +static int ubtbcmfw_write(struct cdev *dev, struct uio *uio, int flag) { ubtbcmfw_softc_p sc = NULL; @@ -484,7 +490,7 @@ * XXX FIXME softc locking */ -Static int +static int ubtbcmfw_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, usb_proc_ptr p) { ubtbcmfw_softc_p sc = NULL; @@ -521,7 +527,7 @@ * XXX FIXME softc locking */ -Static int +static int ubtbcmfw_poll(struct cdev *dev, int events, usb_proc_ptr p) { ubtbcmfw_softc_p sc = NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609070624.k876OFfi058140>