source: build-files/freebsd-update/patches/9.1-RELEASE/11-vimage-patch @ e6c2871

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since e6c2871 was e6c2871, checked in by Kris Moore <kris@…>, 17 months ago

Add vimage patch for bluetooth devices

Obtained from:

http://lists.freebsd.org/pipermail/freebsd-virtualization/2013-July/001389.html

  • Property mode set to 100644
File size: 1.3 KB
Line 
1Index: sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
2===================================================================
3--- sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c (revision 252218)
4+++ sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c (working copy)
5@@ -109,7 +109,9 @@
6 #include <sys/unistd.h>
7 #include <sys/callout.h>
8 #include <sys/malloc.h>
9+#include <sys/jail.h>
10 #include <sys/priv.h>
11+#include <sys/proc.h>
12 
13 #include "usbdevs.h"
14 #include <dev/usb/usb.h>
15@@ -123,6 +125,7 @@
16 #include <sys/mbuf.h>
17 #include <sys/taskqueue.h>
18 
19+#include <net/vnet.h>
20 #include <netgraph/ng_message.h>
21 #include <netgraph/netgraph.h>
22 #include <netgraph/ng_parse.h>
23@@ -453,13 +456,14 @@
24 
25        sc->sc_dev = dev;
26        sc->sc_debug = NG_UBT_WARN_LEVEL;
27-
28+       CURVNET_SET(TD_TO_VNET(curthread));
29        /*
30         * Create Netgraph node
31         */
32 
33        if (ng_make_node_common(&typestruct, &sc->sc_node) != 0) {
34                UBT_ALERT(sc, "could not create Netgraph node\n");
35+               CURVNET_RESTORE();
36                return (ENXIO);
37        }
38 
39@@ -467,10 +471,12 @@
40        if (ng_name_node(sc->sc_node, device_get_nameunit(dev)) != 0) {
41                UBT_ALERT(sc, "could not name Netgraph node\n");
42                NG_NODE_UNREF(sc->sc_node);
43+               CURVNET_RESTORE();
44                return (ENXIO);
45        }
46        NG_NODE_SET_PRIVATE(sc->sc_node, sc);
47        NG_NODE_FORCE_WRITER(sc->sc_node);
48+       CURVNET_RESTORE();
49 
50        /*
51         * Initialize device softc structure
Note: See TracBrowser for help on using the repository browser.