Commit Graph

9 Commits

Author SHA1 Message Date
Hans Petter Selasky
0c8f4683ec Use correct kernel types for all fields in USB PF code and headers.
Approved by:	thompsa (mentor)
2011-02-01 10:25:48 +00:00
Weongyo Jeong
6e3cb00068 Introduces IFF_CANTCONFIG interface flag to point that the interface
isn't configurable in a meaningful way.  This is for ifconfig(8) or
other tools not to change code whenever IFT_USB-like interfaces are
registered at the interface list.

Reviewed by:	brooks
No objections:	gavin, jkim
2010-12-07 20:23:47 +00:00
Weongyo Jeong
b172e30376 Explicitly UP and DOWN the usbus interfaces (IFT_USB) when it's attached
or detached.  Normally it should be changed through user land ioctl(2)
system calls but it looks there's no apps for USB and no need.

With this patch, libpcap would detect the usbus interfaces correctly and
tcpdump(1) could dump the USB packets into PCAP format with -w option.
However it couldn't print the output to console because there's no
printer-routine at tcpdump(1).
2010-12-01 03:51:06 +00:00
Weongyo Jeong
fe1c24e3d6 Handles the unit number correctly that the previous commit had a problem
(wrong unit number for a host controller) when the module is load /
unloaded repeatly.  Attaching the USB pf is moved to usbus device's
attach.

Pointed by:	yongari
2010-11-25 03:30:43 +00:00
Weongyo Jeong
537e254f0a Assigning the unit number for each interfaces could not use ubus->parent
because it could differ depending on the host controller type.  It could
lead the duplicate unit number assignment.
2010-11-25 03:02:53 +00:00
Weongyo Jeong
10798b4875 Fixes a compiler warning when it's compiled with INVARIANTS.
Pointy hat to:	me
2010-11-24 21:43:36 +00:00
Weongyo Jeong
e376f9c3e7 Removes all duplicated code with BPF that it's greatly simplified and
take all benefits whenever BPF code is improved.

Pointed by:	jkim
Reviewed by:	thompsa
2010-11-24 19:11:32 +00:00
Weongyo Jeong
3c0efe7424 Fixes a kernel crash when usb module is reloaded after unload that it
didn't destroy the cdev properly.

Pointy hat to:	me
Reported by:	Brandon Gooch <jamesbrandongooch at gmail dot com>, jkim
2010-11-23 20:23:25 +00:00
Weongyo Jeong
18ec652552 Adds a USB packet filter feature to the stack that it could capture
packets which go through each USB host controllers.  Its implementations
are almost based on BPF code and very similar with it except it's
little bit customized for USB packet only.  The userland program
usbdump(8) would be committed soon.

Discussed with:	hps, thompsa, yongari
2010-11-22 01:11:28 +00:00