public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Max Krasnyansky <maxk@qualcomm.com>
Cc: Greg KH <greg@kroah.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-usb-devel@lists.sourceforge.net
Subject: Re: [linux-usb-devel] Re: [Bluetooth] HCI USB driver update.   Support for SCO over HCI USB.
Date: Fri, 09 May 2003 12:06:27 -0700	[thread overview]
Message-ID: <3EBBFC33.7050702@pacbell.net> (raw)
In-Reply-To: 5.1.0.14.2.20030508123858.01c004f8@unixmail.qualcomm.com

[-- Attachment #1: Type: text/plain, Size: 1352 bytes --]

Hi Max,

> Do you think we can add this 
>         struct urb {
>                 ...
>                 struct list_head drv_list;
>                 char drv_cb[X];
>                 char hcd_cb[X]; 
>                 ...
>         };

Only with kerneldoc ... :)

I'd certainly like the list_head.  Patch attached,
in case Greg agrees enough.  On x86, this makes
sizeof(struct urb) == 120, so it's using space
that was previously wasted.


As for the skb->cb analogue(s), details need working.

  - What should "X" be?  skb->cb is 48 bytes.

  - Should the cb[] arrays be "long"?  They tend to
    be used for pointers...

  - The HCDs want different amounts of per-urb data.
    Sizes on x86:
      * UHCI wants a lot -- 60 bytes!
      * OHCI typically uses 16 bytes, but more for
        multi-TD urbs (control 24 bytes, ISO often 36).
      * EHCI doesn't allocate such extra data.

  - The HCDs would need conversion to use hcd_cb[].
    I once had a patch that did that, but it's not
    current.  It made urb->cb replace urb->hcpriv.

I suppose X=60 for hcd_cb[] will be enough, at least
on 32 bit CPUs.  But you start to see why in the
new "USB Gadget" API, the analogue of "urb" gets
allocated by the USB (device) controller rather
than by generic code:  so that in typical cases,
no additional per-request allocations are needed.

- Dave





[-- Attachment #2: urb.patch --]
[-- Type: text/plain, Size: 1079 bytes --]

--- 1.139/include/linux/usb.h	Wed May  7 00:02:43 2003
+++ edited/include/linux/usb.h	Thu May  8 20:06:31 2003
@@ -511,6 +511,8 @@
 /**
  * struct urb - USB Request Block
  * @urb_list: For use by current owner of the URB.
+ * @dev_list: For use by device driver, even while the URB is owned by
+ * 	usbcore and the HCD.  Th device driver must initialize this list.
  * @pipe: Holds endpoint number, direction, type, and more.
  *	Create these values with the eight macros available;
  *	usb_{snd,rcv}TYPEpipe(dev,endpoint), where the type is "ctrl"
@@ -669,7 +671,8 @@
 	spinlock_t lock;		/* lock for the URB */
 	atomic_t count;			/* reference count of the URB */
 	void *hcpriv;			/* private data for host controller */
-	struct list_head urb_list;	/* list pointer to all active urbs */
+	struct list_head urb_list;	/* private data for usbcore */
+	struct list_head dev_list;	/* private data for device driver */
 	struct usb_device *dev; 	/* (in) pointer to associated device */
 	unsigned int pipe;		/* (in) pipe information */
 	int status;			/* (return) non-ISO status */

  reply	other threads:[~2003-05-09 18:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200304290317.h3T3HOdA027579@hera.kernel.org>
2003-04-29  4:15 ` [Bluetooth] HCI USB driver update. Support for SCO over HCI USB Greg KH
2003-04-29 20:29   ` Max Krasnyansky
2003-04-29 21:15     ` Greg KH
2003-04-29 21:34       ` Oliver Neukum
2003-04-29 21:40         ` Greg KH
2003-04-29 22:24           ` [linux-usb-devel] " Oliver Neukum
2003-04-30  0:44           ` Max Krasnyansky
2003-04-30  7:06             ` Oliver Neukum
2003-04-29 21:55       ` Max Krasnyansky
2003-04-29 22:04         ` Greg KH
2003-04-29 21:39     ` [linux-usb-devel] " David Brownell
2003-04-29 21:37       ` Greg KH
2003-04-29 22:04       ` Max Krasnyansky
2003-04-30  4:55         ` David Brownell
2003-05-08 22:55           ` Max Krasnyansky
2003-05-09 19:06             ` David Brownell [this message]
2003-05-09 19:29               ` Greg KH
2003-05-09 22:35                 ` Max Krasnyansky
2003-05-09 22:35               ` Max Krasnyansky
2003-05-09 23:05                 ` Greg KH
2003-05-10  0:48                   ` David Brownell
2003-05-10  5:06                     ` Brad Hards
2003-05-10  5:40                     ` Greg KH
2003-05-10  5:55                       ` William Lee Irwin III
2003-05-10  6:11                         ` Greg KH
2003-05-10  6:14                           ` William Lee Irwin III
2003-05-12 17:53                     ` Max Krasnyansky
2003-05-12 18:01                       ` Greg KH
2003-05-12 18:55                         ` Max Krasnyansky
2003-05-12 20:23                         ` David Brownell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EBBFC33.7050702@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb-devel@lists.sourceforge.net \
    --cc=maxk@qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox