Deleted Added
full compact
usb_pf.c (215810) usb_pf.c (215812)
1/*-
2 * Copyright (c) 1990, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from the Stanford/CMU enet packet filter,
6 * (net/enet.c) distributed as part of 4.3BSD, and code contributed
7 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
8 * Berkeley Laboratory.

--- 19 unchanged lines hidden (view full) ---

28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from the Stanford/CMU enet packet filter,
6 * (net/enet.c) distributed as part of 4.3BSD, and code contributed
7 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
8 * Berkeley Laboratory.

--- 19 unchanged lines hidden (view full) ---

28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/dev/usb/usb_pf.c 215810 2010-11-25 03:02:53Z weongyo $");
36__FBSDID("$FreeBSD: head/sys/dev/usb/usb_pf.c 215812 2010-11-25 03:30:43Z weongyo $");
37#include <sys/param.h>
38#include <sys/kernel.h>
39#include <sys/bus.h>
40#include <sys/fcntl.h>
41#include <sys/malloc.h>
42#include <sys/proc.h>
43#include <sys/socket.h>
44#include <sys/sockio.h>

--- 11 unchanged lines hidden (view full) ---

56#include <dev/usb/usb_bus.h>
57#include <dev/usb/usb_pf.h>
58#include <dev/usb/usb_transfer.h>
59
60void
61usbpf_attach(struct usb_bus *ubus)
62{
63 struct ifnet *ifp;
37#include <sys/param.h>
38#include <sys/kernel.h>
39#include <sys/bus.h>
40#include <sys/fcntl.h>
41#include <sys/malloc.h>
42#include <sys/proc.h>
43#include <sys/socket.h>
44#include <sys/sockio.h>

--- 11 unchanged lines hidden (view full) ---

56#include <dev/usb/usb_bus.h>
57#include <dev/usb/usb_pf.h>
58#include <dev/usb/usb_transfer.h>
59
60void
61usbpf_attach(struct usb_bus *ubus)
62{
63 struct ifnet *ifp;
64 devclass_t dc = devclass_find("usbus");
65
66 ifp = ubus->ifp = if_alloc(IFT_USB);
64
65 ifp = ubus->ifp = if_alloc(IFT_USB);
67 if_initname(ifp, "usbus", devclass_get_count(dc));
66 if_initname(ifp, "usbus", device_get_unit(ubus->bdev));
68 if_attach(ifp);
69
70 KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
71 ("wrong USB pf header length (%zd)", sizeof(struct usbpf_pkthdr)));
72
73 /*
74 * XXX According to the specification of DLT_USB, it indicates packets
75 * beginning with USB setup header. But not sure all packets would be.

--- 173 unchanged lines hidden ---
67 if_attach(ifp);
68
69 KASSERT(sizeof(struct usbpf_pkthdr) == USBPF_HDR_LEN,
70 ("wrong USB pf header length (%zd)", sizeof(struct usbpf_pkthdr)));
71
72 /*
73 * XXX According to the specification of DLT_USB, it indicates packets
74 * beginning with USB setup header. But not sure all packets would be.

--- 173 unchanged lines hidden ---