PSAS/ usbfs2

Project description from Greg K-H

Hi,

The things we just talked about (while I still remember it) were:

The main file is drivers/usb/core/endpoint.c in the kernel source tree. The main function that creates the endpoint's device node is usb_create_ep_files(). Look at the MKDEV() call in that function. Right now it is saying that it has a character device for this endpoint, but that is a lie. To fix this try these steps:

If you have any questions, please feel free to let me know. And as always, no patch is too small to accept :)

hope this helps,

greg k-h

Current Work

Worked out project schedule for Winter break:

We still need to install a file operations table for each type of endpoint in endpoints.c.

Past work

Link to the patch(es) for a dynamic major for endpoints.

Tools

Necessary Packages:

Other tools

To get usbmon, you need to recompile your kernel with debugfs built-in and usbmon as a module. debugfs is under Kernel Hacking in the main menuconfig menu and usbmon is under Device Drivers->USB support->USB Network->USB Monitor. Follow the directions in the kernel tree in Documentation/usb/usbmon.txt.

Wireshark is the new name for the network analyzer Ethereal. Wireshark can also read USB packets. You'll need to grab a CVS checkout of libpcap (the lastest release, 0.9.5, isn't new enough). Then you should recompile wireshark with the newest libpcap.

You'll also need the 2.6.18 Linux kernel sources. Once you have git installed, download Linus' 2.6.18 tree:

$ git-clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

Build the 2.6.18 kernel

$ make defconfig
$ make

Download a debian disk image from oszoo. Or make your own.

Make sure that you have permissions for the device nodes in /proc/bus/usb. Assuming you have your own group with id 1000, add this line to /etc/fstab, and remount /proc/bus/usb:

usbfs           /proc/bus/usb   usbfs   devgid=1000,devmode=0660        0       0

Run qemu, giving it the kernel and disk image and enabling usb and the network interface:

$ qemu -kernel $KERNEL -hda $IMG -append 'root=/dev/hda' -usb -net user -net nic,model=rtl8139

You'll have to run dhclient to bring up the dhcp interface:

$ dhclient eth0

Links

Greg's original announcement about making usb endpoints real devices in sysfs.

Sarah's questions list.

A list of more USB links.

A second list of USB links.


Attachments: