Am Dienstag, 22. Januar 2008 16:26:01 schrieben Sie:
> Um, I don't think you have explained the problem fully here.
>
> If you want to just create a random char device in the kernel, use the
> misc interface.  It's infrastructure will automatically do the proper
> stuff so that udev will create a /dev node.
>
> Otherwise, if you are using your own major number, you will have to set
> up the needed class information properly so that udev knows how to
> create your nodes for you.  But odds are you really don't need your own
> special major number, right?

This is the 1st Linux driver I'm writing from scratch, so my main problem I 
admit is that I'm not used to the whole Linux driver framework yet. I 
actually used your book Greg ("where the kernel meets the hardware", 3rd 
edition) to ease this learn process a bit and it was a great help so far!

BTW, I think there is a double-free bug in the book's USB 
example "usb-skeleton.c", function skel_write():
        ...
        error:
1->             usb_buffer_free(dev->udev, count, buf, urb->transfer_dma);
                usb_free_urb(urb);
2->             kfree(buf);

Am Dienstag, 22. Januar 2008 16:27:33 schrieben Sie:
> Hm, exactly how the usbfs2 endpoints are exported, right?  :)

I guess so, because what I'm trying to do is merely just to expose some of the 
device's (interrupt) endpoints as separate character device files under /dev. 
The "real" communication is thus moved to a user space app / lib which 
handles the control of the device with simple read() and write() calls to the 
various characters device files. Works fine so for one endpoint, but as said, 
due to the limitation of   struct usb_interface   (being limited to just one 
minor per USB interface), I could not simply add another usb_register_dev() 
call to create further character devices for the other endpoints of same USB 
interface.

If I'd provide a patch, replacing the scalar member of   struct usb_interface   
by a list of minors instead, would that a have a chance to be applied to the 
upstream kernel? Or is there probably a good reason for keeping it a scalar?

> Have you looked at that code?  You might just need to hook up the needed
> character operations, and add the async i/o stuff that Sarah is working
> on, and you would be done.  Take a look at her posts in the archives for
> working code and what is needed to be completed.

As you pointed me at it, I just checked out the respective git repository, but 
couldn't find it there. Do I have to update to a branch or something? Sorry 
for the question, but I never used git before, so that's what I used:

        git clone http://svcs.cs.pdx.edu/~sarah/usbfs2.git usbfs2

> thanks,
>
> greg k-h

No, thank YOU!

CU
Christian
-
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to