lkml.org 
[lkml]   [2003]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-usb-devel] Re: [Bluetooth] HCI USB driver update. Support for SCO over HCI USB.
At 02:39 PM 4/29/2003, David Brownell wrote:

>> I was actually going to ask you guys if you'd be interested
>> in generalizing this _urb_queue() stuff that I have for
>> other drivers. Current URB api does not provide any interface
>> for queueing/linking/etc of URBs in the _driver_ itself.
>
>I only saw fragments of the original patch -- could you be just
>a bit more specific?
>
>If you're suggesting adding some "struct list_head" into
>"struct urb" for exclusive use of the interface's driver
>(instead of urb_list, which is for usbcore/hcd) ... I'd
>agree that'd be a good thing.
>
>In fact I recently got around to adding that to the
>"gadget side" analogue of an URB. For much the same
>kind of reasons as you mentioned.

Basically I'd like to have same kind of API that we have for SKB without
an overhead of SKBs.
Here is what I've done for Bluetooth HCI USB driver.

struct _urb_queue {
struct list_head head;
spinlock_t lock;
};

struct _urb {
struct list_head list;
struct _urb_queue *queue;
int type;
void *priv;
struct urb urb;
};

struct _urb *_urb_alloc(int isoc, int gfp);
static inline void _urb_free(struct _urb *_urb);
static inline void _urb_queue_init(struct _urb_queue *q);
static inline void _urb_queue_head(struct _urb_queue *q, struct _urb *_urb);
static inline void _urb_queue_tail(struct _urb_queue *q, struct _urb *_urb);
static inline void _urb_unlink(struct _urb *_urb);
struct _urb *_urb_dequeue(struct _urb_queue *q);

_urb is an ugly name I know but I couldn't come up with the better one :)

It's now easy to do things like
_urb_queue_tail(&pending_q, _urb);
usb_urb_submit(&_urb->urb);
and
while (_urb = _urb_dequeue(&pending_q))
usb_unlink_urb(&_urb->urb);
etc

Max

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.111 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site