Re: [linux-usb-devel] [BUG] Still having problems with an USB Drive

2003-12-29 Thread Rogério Brito
Hi, Alan.

Thank you very much for your feedback. I'm now excited that maybe I will
finally be able to use my USB drive with my computer to carry some
documents to my workplace!

On Dec 28 2003, Alan Stern wrote:
> From the log you collected, it's clear that Windows initializes each
> port of your internal hub twice!  Don't ask me why.  Maybe that's what
> the Linux driver needs to do.

Humm, nice that those huge logs were at least a tiny bit useful. :-)

> Anyway, let's start off small.  Here's a diagnostic patch for you to try.  
> This won't fix anything, but it will print out some additional information
> in your system log about where the problem may be occurring.  Be sure to 
> leave usb debugging configured on and post the dmesg log messages you get 
> when you run this on your desktop system.

Ok. I tried the patch you sent me and I put the dmesg log messages at
. The old files are in the
subdirectory old of that directory, if you need them.

This time, I didn't disable the hotplug scripts, but right after I
booted in single user mode, I did the "echo 4 > /proc/driver/uhci/..."
command that you told me to use, before plugging the drive.

Oh, one more thing: I am using kernel stock 2.6.0 and the patch that you
sent me was applied with an offset of -11 lines. Is this a problem?

I suppose that that was the case because your tree is a bit more recent
than the kernel that I am using, right?


Thank you very much for your help, Rogério.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Rogério Brito - [EMAIL PROTECTED] - http://www.ime.usp.br/~rbrito
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] timeouts after upgrading from 2.4.21-pre1 to 2.4.23

2003-12-29 Thread Nathan Neulinger
On Thu, 2003-12-25 at 22:04, Nathan Neulinger wrote:
> On Thu, 2003-12-25 at 21:45, Nathan Neulinger wrote:
> > It looks like sddr09 definately behaves better than sddr55, but still
> > unusable. Below is trace... I will try to get a sddr55 one shortly.
> > 
> > -- Nathan
> 
> Here's a trace with sddr55. I'm not seeing the same errors as when
> debugging was not enabled, but still taking forever, and quite a few
> multi-second hangs in the diagnostics.

Any suggestions on how I should proceed from here?

-- Nathan


Nathan Neulinger   EMail:  [EMAIL PROTECTED]
University of Missouri - Rolla Phone: (573) 341-6679
UMR Information Technology Fax: (573) 341-4216


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [USB patch 2.6.0] ehci update: 2/3, microframe scanning

2003-12-29 Thread David Brownell
This patch is needed to make high bandwidth ISO streams behave,
but could resolve some other scanning glitches.  Current users
of periodic transfers (interrupt transfer modes for hubs, mice,
and keyboards) shouldn't even notice this change.
It makes the periodic schedule scan handle cases where a given
frame's schedule slot reports completions in several different
microframes.  So far that's been uncommon, but it's typical
for high bandwidth iso (or even with busier interrupt trees than
this driver has supported yet).
It also starts to remove the assumption that each ITD only uses
one microframe; but most of those changes are in the next patch.
And it fixes a bug where some status bits were mis-interpreted as
significant bits in the ITD transfer length.
Please merge.

- Dave



--- 1.27/drivers/usb/host/ehci-sched.c  Wed Jul 30 03:05:59 2003
+++ edited/drivers/usb/host/ehci-sched.cSun Dec 28 20:12:47 2003
@@ -868,37 +868,43 @@
 itd_complete (
struct ehci_hcd *ehci,
struct ehci_itd *itd,
-   unsigneduframe,
struct pt_regs  *regs
 ) {
struct urb  *urb = itd->urb;
struct usb_iso_packet_descriptor*desc;
u32 t;
+   unsigneduframe;
+   int urb_index = -1;
 
-   /* update status for this uframe's transfers */
-   desc = &urb->iso_frame_desc [itd->index];
-
-   t = itd->hw_transaction [uframe];
-   itd->hw_transaction [uframe] = 0;
-   if (t & EHCI_ISOC_ACTIVE)
-   desc->status = -EXDEV;
-   else if (t & ISO_ERRS) {
-   urb->error_count++;
-   if (t & EHCI_ISOC_BUF_ERR)
-   desc->status = usb_pipein (urb->pipe)
-   ? -ENOSR  /* couldn't read */
-   : -ECOMM; /* couldn't write */
-   else if (t & EHCI_ISOC_BABBLE)
-   desc->status = -EOVERFLOW;
-   else /* (t & EHCI_ISOC_XACTERR) */
-   desc->status = -EPROTO;
-
-   /* HC need not update length with this error */
-   if (!(t & EHCI_ISOC_BABBLE))
-   desc->actual_length += EHCI_ITD_LENGTH (t);
-   } else {
-   desc->status = 0;
-   desc->actual_length += EHCI_ITD_LENGTH (t);
+   /* for each uframe with a packet */
+   for (uframe = 0; uframe < 8; uframe++) {
+   if (itd->hw_transaction [uframe] == 0)
+   continue;
+   urb_index = itd->index;
+   desc = &urb->iso_frame_desc [urb_index];
+
+   t = le32_to_cpup (&itd->hw_transaction [uframe]);
+   itd->hw_transaction [uframe] = 0;
+
+   /* report transfer status */
+   if (unlikely (t & ISO_ERRS)) {
+   urb->error_count++;
+   if (t & EHCI_ISOC_BUF_ERR)
+   desc->status = usb_pipein (urb->pipe)
+   ? -ENOSR  /* hc couldn't read */
+   : -ECOMM; /* hc couldn't write */
+   else if (t & EHCI_ISOC_BABBLE)
+   desc->status = -EOVERFLOW;
+   else /* (t & EHCI_ISOC_XACTERR) */
+   desc->status = -EPROTO;
+
+   /* HC need not update length with this error */
+   if (!(t & EHCI_ISOC_BABBLE))
+   desc->actual_length = EHCI_ITD_LENGTH (t);
+   } else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) {
+   desc->status = 0;
+   desc->actual_length = EHCI_ITD_LENGTH (t);
+   }
}
 
vdbg ("itd %p urb %p packet %d/%d trans %x status %d len %d",
@@ -906,7 +912,7 @@
t, desc->status, desc->actual_length);
 
/* handle completion now? */
-   if ((itd->index + 1) != urb->number_of_packets)
+   if (likely ((urb_index + 1) != urb->number_of_packets))
return 0;
 
/*
@@ -986,24 +992,23 @@
 * When running, scan from last scan point up to "now"
 * else clean up by scanning everything that's left.
 * Touches as few pages as possible:  cache-friendly.
-* Don't scan ISO entries more than once, though.
 */
-   frame = ehci->next_uframe >> 3;
+   now_uframe = ehci->next_uframe;
if (HCD_IS_RUNNING (ehci->hcd.state))
-   now_uframe = readl (&ehci->regs->frame_index);
+   clock = readl (&ehci->regs->frame_index) % mod;
else
-   now_uframe = (frame << 3) - 1;
-   now_uframe %= mod;
-   clock = now_uframe >> 3;
+   clock = now_uframe + mod - 1;
 
for (;;) {
union ehci_shadow   q, *q_p;

[linux-usb-devel] [USB patch 2.6.0] ehci update: 1/3, misc

2003-12-29 Thread David Brownell
This is minor "obvious" fixes plus two tweaks to help later
patches:
   - Interrupt QH has a link to the device, needed to implement
 schedule trees (like OHCI does today) that are TT-aware
 (essential for most keyboards and mice).
   - Export the macros that do high bandwidth packetsize stuff.
 They're also needed for high bandwidth ISO transfers.
It also morphs some existing "too much debug info" urb tracing
so it's kicked in by a manual #define EHCI_URB_TRACE.  If some
generic version of that gets added to usbcore, this sort
of debug code can vanish (from all hcds).
Please merge

- Dave



--- 1.25/drivers/usb/host/ehci-dbg.cFri Dec 26 11:48:00 2003
+++ edited/drivers/usb/host/ehci-dbg.c  Sun Dec 28 19:10:01 2003
@@ -116,7 +116,7 @@
 #ifdef DEBUG
 
 static void __attribute__((__unused__))
-dbg_qtd (char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
+dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
 {
ehci_dbg (ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
cpu_to_le32p (&qtd->hw_next),
@@ -132,7 +132,7 @@
 }
 
 static void __attribute__((__unused__))
-dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
+dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
 {
ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,
qh, qh->hw_next, qh->hw_info1, qh->hw_info2,
--- 1.62/drivers/usb/host/ehci-hcd.cFri Dec 26 11:48:00 2003
+++ edited/drivers/usb/host/ehci-hcd.c  Sun Dec 28 19:13:12 2003
@@ -97,7 +97,9 @@
 static const char  hcd_name [] = "ehci_hcd";
 
 
-// #define EHCI_VERBOSE_DEBUG
+#undef EHCI_VERBOSE_DEBUG
+#undef EHCI_URB_TRACE
+
 // #define have_split_iso
 
 #ifdef DEBUG
--- 1.15/drivers/usb/host/ehci-mem.cWed Aug  6 04:52:20 2003
+++ edited/drivers/usb/host/ehci-mem.c  Sun Dec 28 16:02:23 2003
@@ -28,7 +28,7 @@
  * - driver buffers, read/written by HC ... single shot DMA mapped 
  *
  * There's also PCI "register" data, which is memory mapped.
- * No memory seen by this driver is pagable.
+ * No memory seen by this driver is pageable.
  */
 
 /*-*/
@@ -131,6 +131,7 @@
}
if (qh->dummy)
ehci_qtd_free (ehci, qh->dummy);
+   usb_put_dev (qh->dev);
pci_pool_free (ehci->qh_pool, qh, qh->qh_dma);
 }
 
--- 1.53/drivers/usb/host/ehci-q.c  Thu Oct  9 10:30:44 2003
+++ edited/drivers/usb/host/ehci-q.cSun Dec 28 19:10:40 2003
@@ -164,7 +164,8 @@
 
/* if async CSPLIT failed, try cleaning out the TT buffer */
} else if (urb->dev->tt && !usb_pipeint (urb->pipe)
-   && QTD_CERR(token) == 0) {
+   && ((token & QTD_STS_MMF) != 0
+   || QTD_CERR(token) == 0)) {
 #ifdef DEBUG
struct usb_device *tt = urb->dev->tt->hub;
dev_dbg (&tt->dev,
@@ -212,6 +213,16 @@
}
spin_unlock (&urb->lock);
 
+#ifdef EHCI_URB_TRACE
+   ehci_dbg (ehci,
+   "%s %s urb %p ep%d%s status %d len %d/%d\n",
+   __FUNCTION__, urb->dev->devpath, urb,
+   usb_pipeendpoint (urb->pipe),
+   usb_pipein (urb->pipe) ? "in" : "out",
+   urb->status,
+   urb->actual_length, urb->transfer_buffer_length);
+#endif
+
/* complete() can reenter this HCD */
spin_unlock (&ehci->lock);
usb_hcd_giveback_urb (&ehci->hcd, urb, regs);
@@ -640,6 +651,9 @@
 
qh->period = urb->interval;
}
+
+   /* support for tt scheduling */
+   qh->dev = usb_get_dev (urb->dev);
}
 
/* using TT? */
@@ -699,8 +713,6 @@
usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, 1);
return qh;
 }
-#undef hb_mult
-#undef hb_packet
 
 /*-*/
 
@@ -887,10 +899,14 @@
if (usb_pipein (urb->pipe) && !usb_pipecontrol (urb->pipe))
epnum |= 0x10;
 
-   ehci_vdbg (ehci, "submit_async urb %p len %d ep%d%s qtd %p [qh %p]\n",
-   urb, urb->transfer_buffer_length,
-   epnum & 0x0f, (epnum & 0x10) ? "in" : "out",
+#ifdef EHCI_URB_TRACE
+   ehci_dbg (ehci,
+   "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n",
+   __FUNCTION__, urb->dev->devpath, urb,
+   epnum & 0x0f, usb_pipein (urb->pipe) ? "in" : "out",
+   urb->transfer_buffer_length,
qtd, dev ? dev->ep [epnum] : (void *)~0);
+#endif
 
spin_lock_irqsave (&ehci->lock, flags);
qh = qh_append_tds (ehci, urb, qtd_list, epnum, &dev->ep [epnum]);
--- 1.23/drivers/usb/host/ehci.hFri Dec 26 11:48:00 2003
+++ edited/drivers/usb/host/ehci.h  Sun Dec 28 19:12:13 2003
@@ -381,7 +381,7 @@
unsig

[linux-usb-devel] [USB patch 2.6.0] ehci update: 3/3, highspeed iso rewrite

2003-12-29 Thread David Brownell
This is an updated version of a patch submitted to me from
Michal Sojka <[EMAIL PROTECTED]>, basically providing a
much-needed rewrite of the highspeed ISO support.  I updated
the scheduling and made it a closer match to how OHCI works;
and also tested it a bunch.
So far it seems most of the requests for highspeed ISO support
have been for realtime data collection -- custom apps, nothing
a mainstream kernel would ship with.   The USB Video class is
now defined; highspeed video will also need these updates.
Key changes:

  - Define an "iso_stream" head for iso endpoints.  This acts
enough like a QH that endpoint_disable() works.  It holds the
queue of ITDs, and the endpoint's current schedule state.
And it's easy to find (spinlocked array access), no search.
  - Uses a temporary "itd_sched" while submitting each URB, with
not-yet-linked ITDs and request-specific metadata.  There's
a per-stream cache of ITDs, so resubmitting ISO urbs (to
achieve a "ring" of transfers) is typically cheap.
  - Scheduling for most URBs is almost a NOP:  just a sanity
check to make sure there's no need to reschedule, and then
just link into the schedule at the current schedule slot.
(The previous code was a gross hack that didn't even work
reasonably with more than two URBs queued.)
  - Is a reasonable model to use with full speed ISO transfers.
(They need additional TT scheduling hooks, most of which
are already written but not merged.)
  - Handles several cases the previous code didn't, including
high bandwidth transfers (loads up to 24 MByte/sec)
  - Has had more testing than the old code, including 20+ hour
successful IN+OUT runs, more varied transfer intervals and
maxpacket sizes.  (Using net2280 and a gadgetfs driver.)
So it's worth replacing the existing code with this; there
aren't too many rough edges, and it's much more fixable than
the previous version.
Please merge, this goes on top of the preceding two patches.

- Dave

p.s. Many thanks, Michal!


--- 1.26/drivers/usb/host/ehci-dbg.cSun Dec 28 19:28:40 2003
+++ edited/drivers/usb/host/ehci-dbg.c  Sun Dec 28 20:35:18 2003
@@ -140,6 +140,36 @@
dbg_qtd ("overlay", ehci, (struct ehci_qtd *) &qh->hw_qtd_next);
 }
 
+static void __attribute__((__unused__))
+dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) 
+{
+   ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n",
+   label, itd->frame, itd, le32_to_cpu(itd->hw_next), itd->urb);
+   ehci_dbg (ehci,
+   "  trans: %08x %08x %08x %08x %08x %08x %08x %08x\n", 
+   le32_to_cpu(itd->hw_transaction[0]),
+   le32_to_cpu(itd->hw_transaction[1]),
+   le32_to_cpu(itd->hw_transaction[2]),
+   le32_to_cpu(itd->hw_transaction[3]),
+   le32_to_cpu(itd->hw_transaction[4]),
+   le32_to_cpu(itd->hw_transaction[5]),
+   le32_to_cpu(itd->hw_transaction[6]),
+   le32_to_cpu(itd->hw_transaction[7]));
+   ehci_dbg (ehci,
+   "  buf:   %08x %08x %08x %08x %08x %08x %08x\n", 
+   le32_to_cpu(itd->hw_bufp[0]),
+   le32_to_cpu(itd->hw_bufp[1]),
+   le32_to_cpu(itd->hw_bufp[2]),
+   le32_to_cpu(itd->hw_bufp[3]),
+   le32_to_cpu(itd->hw_bufp[4]),
+   le32_to_cpu(itd->hw_bufp[5]),
+   le32_to_cpu(itd->hw_bufp[6]));
+   ehci_dbg (ehci, "  index: %d %d %d %d %d %d %d %d\n",
+   itd->index[0], itd->index[1], itd->index[2],
+   itd->index[3], itd->index[4], itd->index[5],
+   itd->index[6], itd->index[7]);
+}
+
 static int __attribute__((__unused__))
 dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
 {
--- 1.63/drivers/usb/host/ehci-hcd.cSun Dec 28 19:28:40 2003
+++ edited/drivers/usb/host/ehci-hcd.c  Sun Dec 28 20:36:41 2003
@@ -67,6 +67,9 @@
  *
  * HISTORY:
  *
+ * 2003-12-29 Rewritten high speed iso transfer support (by Michal Sojka,
+ * <[EMAIL PROTECTED]>, updates by DB).
+ *
  * 2002-11-29  Correct handling for hw async_next register.
  * 2002-08-06  Handling for bulk and interrupt transfers is mostly shared;
  * only scheduling is different, no arbitrary limitations.
@@ -90,7 +93,7 @@
  * 2001-June   Works with usb-storage and NEC EHCI on 2.4
  */
 
-#define DRIVER_VERSION "2003-Jun-13"
+#define DRIVER_VERSION "2003-Dec-29"
 #define DRIVER_AUTHOR "David Brownell"
 #define DRIVER_DESC "USB 2.0 'Enhanced' Host Controller (EHCI) Driver"
 
@@ -901,10 +904,19 @@
if (!qh)
goto done;
 
+   /* endpoints can be iso streams.  for now, we don't
+* accelerate iso completions ... so spin a while.
+*/
+   if (qh->hw_info1 == 0) {
+   ehci_vdbg (ehci, "iso delay\n");
+   goto idle_timeout;
+   }
+
if (!HCD_IS_RUNNING (ehci->hcd.state))
qh->qh_state = QH_STATE_IDLE;
sw

Re: [linux-usb-devel] [USB patch 2.6.0] ehci update: 1/3, misc

2003-12-29 Thread David Brownell
David Brownell wrote:
This is minor "obvious" fixes plus two tweaks to help later
patches:
   - Interrupt QH has a link to the device, needed to implement
 schedule trees (like OHCI does today) that are TT-aware
 (essential for most keyboards and mice).
   - Export the macros that do high bandwidth packetsize stuff.
 They're also needed for high bandwidth ISO transfers.
It also morphs some existing "too much debug info" urb tracing
so it's kicked in by a manual #define EHCI_URB_TRACE.  If some
generic version of that gets added to usbcore, this sort
of debug code can vanish (from all hcds).
Please merge

- Dave



Here's the 2.4 version of the patch ... it's the same, modulo
some TT fault cleanup (needlessly different between the kernels)
and lack of device refcounting.  (Which can't cause new bugs
in this circumstance, though old ones can still bite.)
Please merge to 2.4.24.pre.

- Dave




--- 1.11/drivers/usb/host/ehci-dbg.cFri Dec 26 12:08:01 2003
+++ edited/drivers/usb/host/ehci-dbg.c  Mon Dec 29 12:17:01 2003
@@ -126,7 +126,7 @@
 #ifdef DEBUG
 
 static void __attribute__((__unused__))
-dbg_qtd (char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
+dbg_qtd (const char *label, struct ehci_hcd *ehci, struct ehci_qtd *qtd)
 {
ehci_dbg (ehci, "%s td %p n%08x %08x t%08x p0=%08x\n", label, qtd,
cpu_to_le32p (&qtd->hw_next),
@@ -142,7 +142,7 @@
 }
 
 static void __attribute__((__unused__))
-dbg_qh (char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
+dbg_qh (const char *label, struct ehci_hcd *ehci, struct ehci_qh *qh)
 {
ehci_dbg (ehci, "%s qh %p n%08x info %x %x qtd %x\n", label,
qh, qh->hw_next, qh->hw_info1, qh->hw_info2,
--- 1.17/drivers/usb/host/ehci-hcd.cFri Dec 26 12:08:01 2003
+++ edited/drivers/usb/host/ehci-hcd.c  Mon Dec 29 12:17:01 2003
@@ -98,7 +98,9 @@
 static const char  hcd_name [] = "ehci_hcd";
 
 
-// #define EHCI_VERBOSE_DEBUG
+#undef EHCI_VERBOSE_DEBUG
+#undef EHCI_URB_TRACE
+
 // #define have_split_iso
 
 #ifdef DEBUG
--- 1.7/drivers/usb/host/ehci-mem.c Tue Apr  1 12:23:15 2003
+++ edited/drivers/usb/host/ehci-mem.c  Mon Dec 29 12:21:13 2003
@@ -28,7 +28,7 @@
  * - driver buffers, read/written by HC ... single shot DMA mapped 
  *
  * There's also PCI "register" data, which is memory mapped.
- * No memory seen by this driver is pagable.
+ * No memory seen by this driver is pageable.
  */
 
 /*-*/
@@ -130,6 +130,7 @@
}
if (qh->dummy)
ehci_qtd_free (ehci, qh->dummy);
+   // usb_put_dev (qh->dev);
pci_pool_free (ehci->qh_pool, qh, qh->qh_dma);
 }
 
--- 1.18/drivers/usb/host/ehci-q.c  Mon Oct 13 14:41:54 2003
+++ edited/drivers/usb/host/ehci-q.cMon Dec 29 12:22:20 2003
@@ -225,6 +225,16 @@
}
spin_unlock (&urb->lock);
 
+#ifdef EHCI_URB_TRACE
+   ehci_dbg (ehci,
+   "%s %s urb %p ep%d%s status %d len %d/%d\n",
+   __FUNCTION__, urb->dev->devpath, urb,
+   usb_pipeendpoint (urb->pipe),
+   usb_pipein (urb->pipe) ? "in" : "out",
+   urb->status,
+   urb->actual_length, urb->transfer_buffer_length);
+#endif
+
/* complete() can reenter this HCD */
spin_unlock (&ehci->lock);
usb_hcd_giveback_urb (&ehci->hcd, urb, regs);
@@ -673,6 +683,10 @@
 
qh->period = urb->interval;
}
+
+   /* support for tt scheduling */
+   // qh->dev = usb_get_dev (urb->dev);
+   qh->dev = urb->dev;
}
 
/* using TT? */
@@ -732,8 +746,6 @@
usb_settoggle (urb->dev, usb_pipeendpoint (urb->pipe), !is_input, 1);
return qh;
 }
-#undef hb_mult
-#undef hb_packet
 
 /*-*/
 
@@ -929,10 +941,14 @@
if (usb_pipein (urb->pipe) && !usb_pipecontrol (urb->pipe))
epnum |= 0x10;
 
-   ehci_vdbg (ehci, "submit_async urb %p len %d ep%d%s qtd %p [qh %p]\n",
-   urb, urb->transfer_buffer_length,
-   epnum & 0x0f, (epnum & 0x10) ? "in" : "out",
+#ifdef EHCI_URB_TRACE
+   ehci_dbg (ehci,
+   "%s %s urb %p ep%d%s len %d, qtd %p [qh %p]\n",
+   __FUNCTION__, urb->dev->devpath, urb,
+   epnum & 0x0f, usb_pipein (urb->pipe) ? "in" : "out",
+   urb->transfer_buffer_length,
qtd, dev ? dev->ep [epnum] : (void *)~0);
+#endif
 
spin_lock_irqsave (&ehci->lock, flags);
qh = qh_append_tds (ehci, urb, qtd_list, epnum, &dev->ep [epnum]);
--- 1.11/drivers/usb/host/ehci.hFri Dec 26 12:08:01 2003
+++ edited/drivers/usb/host/ehci.h  Mon Dec 29 12:20:25 2003
@@ -381,7 +381,7 @@
unsigned short  period; /* polling interval */
unsigned short  start;  /* where polling starts */

Re: [linux-usb-devel] [USB patch 2.6.0] ehci update: 2/3, microframe scanning

2003-12-29 Thread David Brownell
David Brownell wrote:
This patch is needed to make high bandwidth ISO streams behave,
but could resolve some other scanning glitches.  Current users
of periodic transfers (interrupt transfer modes for hubs, mice,
and keyboards) shouldn't even notice this change.
It makes the periodic schedule scan handle cases where a given
frame's schedule slot reports completions in several different
microframes.  So far that's been uncommon, but it's typical
for high bandwidth iso (or even with busier interrupt trees than
this driver has supported yet).
It also starts to remove the assumption that each ITD only uses
one microframe; but most of those changes are in the next patch.
And it fixes a bug where some status bits were mis-interpreted as
significant bits in the ITD transfer length.
Please merge.

- Dave


This 2.6.0 patch should apply to 2.4.23 with no changes; please
merge there too.
- Dave





---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [USB patch 2.6.0] ehci update: 3/3, highspeed iso rewrite

2003-12-29 Thread David Brownell
David Brownell wrote:
This is an updated version of a patch submitted to me from
Michal Sojka <[EMAIL PROTECTED]>, basically providing a
much-needed rewrite of the highspeed ISO support.  I updated
the scheduling and made it a closer match to how OHCI works;
and also tested it a bunch.
So far it seems most of the requests for highspeed ISO support
have been for realtime data collection -- custom apps, nothing
a mainstream kernel would ship with.   The USB Video class is
now defined; highspeed video will also need these updates.
Key changes:

  - Define an "iso_stream" head for iso endpoints.  This acts
enough like a QH that endpoint_disable() works.  It holds the
queue of ITDs, and the endpoint's current schedule state.
And it's easy to find (spinlocked array access), no search.
  - Uses a temporary "itd_sched" while submitting each URB, with
not-yet-linked ITDs and request-specific metadata.  There's
a per-stream cache of ITDs, so resubmitting ISO urbs (to
achieve a "ring" of transfers) is typically cheap.
  - Scheduling for most URBs is almost a NOP:  just a sanity
check to make sure there's no need to reschedule, and then
just link into the schedule at the current schedule slot.
(The previous code was a gross hack that didn't even work
reasonably with more than two URBs queued.)
  - Is a reasonable model to use with full speed ISO transfers.
(They need additional TT scheduling hooks, most of which
are already written but not merged.)
  - Handles several cases the previous code didn't, including
high bandwidth transfers (loads up to 24 MByte/sec)
  - Has had more testing than the old code, including 20+ hour
successful IN+OUT runs, more varied transfer intervals and
maxpacket sizes.  (Using net2280 and a gadgetfs driver.)
So it's worth replacing the existing code with this; there
aren't too many rough edges, and it's much more fixable than
the previous version.
Please merge, this goes on top of the preceding two patches.

- Dave

p.s. Many thanks, Michal!


And here's a version of this for 2.4.24pre.  Differences include
again usb device refcounting (affects only a debug message here),
and handling of what endpoint_disable() does in 2.6 ... basically
usb device drivers in 2.4 that don't disconnect() by waiting for
all URBs have always been oops-prone.  This doesn't try to improve
on that by doing more than reporting that driver problem.
- Dave


--- 1.12/drivers/usb/host/ehci-dbg.cMon Dec 29 12:26:10 2003
+++ edited/drivers/usb/host/ehci-dbg.c  Mon Dec 29 12:37:31 2003
@@ -150,6 +150,36 @@
dbg_qtd ("overlay", ehci, (struct ehci_qtd *) &qh->hw_qtd_next);
 }
 
+static void __attribute__((__unused__))
+dbg_itd (const char *label, struct ehci_hcd *ehci, struct ehci_itd *itd) 
+{
+   ehci_dbg (ehci, "%s [%d] itd %p, next %08x, urb %p\n",
+   label, itd->frame, itd, le32_to_cpu(itd->hw_next), itd->urb);
+   ehci_dbg (ehci,
+   "  trans: %08x %08x %08x %08x %08x %08x %08x %08x\n", 
+   le32_to_cpu(itd->hw_transaction[0]),
+   le32_to_cpu(itd->hw_transaction[1]),
+   le32_to_cpu(itd->hw_transaction[2]),
+   le32_to_cpu(itd->hw_transaction[3]),
+   le32_to_cpu(itd->hw_transaction[4]),
+   le32_to_cpu(itd->hw_transaction[5]),
+   le32_to_cpu(itd->hw_transaction[6]),
+   le32_to_cpu(itd->hw_transaction[7]));
+   ehci_dbg (ehci,
+   "  buf:   %08x %08x %08x %08x %08x %08x %08x\n", 
+   le32_to_cpu(itd->hw_bufp[0]),
+   le32_to_cpu(itd->hw_bufp[1]),
+   le32_to_cpu(itd->hw_bufp[2]),
+   le32_to_cpu(itd->hw_bufp[3]),
+   le32_to_cpu(itd->hw_bufp[4]),
+   le32_to_cpu(itd->hw_bufp[5]),
+   le32_to_cpu(itd->hw_bufp[6]));
+   ehci_dbg (ehci, "  index: %d %d %d %d %d %d %d %d\n",
+   itd->index[0], itd->index[1], itd->index[2],
+   itd->index[3], itd->index[4], itd->index[5],
+   itd->index[6], itd->index[7]);
+}
+
 static int __attribute__((__unused__))
 dbg_status_buf (char *buf, unsigned len, char *label, u32 status)
 {
--- 1.18/drivers/usb/host/ehci-hcd.cMon Dec 29 12:26:10 2003
+++ edited/drivers/usb/host/ehci-hcd.c  Mon Dec 29 12:55:07 2003
@@ -68,6 +68,9 @@
  *
  * HISTORY:
  *
+ * 2003-12-29 Rewritten high speed iso transfer support (by Michal Sojka,
+ * <[EMAIL PROTECTED]>, updates by DB).
+ *
  * 2002-11-29  Correct handling for hw async_next register.
  * 2002-08-06  Handling for bulk and interrupt transfers is mostly shared;
  * only scheduling is different, no arbitrary limitations.
@@ -91,7 +94,7 @@
  * 2001-June   Works with usb-storage and NEC EHCI on 2.4
  */
 
-#define DRIVER_VERSION "2003-Jun-19/2.4"
+#define DRIVER_VERSION "2003-Dec-29/2.4"
 #define DRIVER_AUTHOR "David Brownell"
 #define DRIVER_DESC "USB 2.0 'Enhanced' Host Controller (EHCI) Driver"
 
@@ -8

[linux-usb-devel] Re: [PATCH] Stop hiddev generating empty events

2003-12-29 Thread Greg KH
On Fri, Dec 19, 2003 at 11:33:37PM +0100, Vojtech Pavlik wrote:
> On Fri, Dec 19, 2003 at 10:02:13AM -0800, Greg KH wrote:
> 
> > On Thu, Dec 18, 2003 at 12:07:39AM -0500, Adam Kropelin wrote:
> > > hiddev is mistakenly returning empty hiddev_event structures for report
> > > events. According to Documentation/usb/hiddev.txt, report events are
> > > only sent when HIDDEV_FLAG_REPORT and HIDDEV_FLAG_UREF are both set.
> > > Currently, report events from hid cause hiddev to generate empty
> > > hiddev_event events when HIDDEV_FLAG_UREF is not set.
> > > 
> > > Patch below, against 2.6.0-test11, fixes the problem.
> > 
> > Vojtech, is this ok?
> 
> Yes, the patch is correct.

Applied, thanks.

greg k-h


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: Réf. : Re: hiddev patch : disable hiddev support for MGE UPSs

2003-12-29 Thread Greg KH
On Mon, Dec 22, 2003 at 02:01:45PM +0100, [EMAIL PROTECTED] wrote:
 
> ok, thanks.
> Sorry about 2.6, I've worked on 2.4 and thought it would apply on 2.6, but with
> some hunks.
> I completly forgot that there were huge changes about that.
> 
> Here is the good version for 2.6 (attached, gzip compressed...). Thanks for
> applying it.

Applied, thanks.

> Best wishes Young Dad ;-)

Heh, thanks.  But I'm not that young :)

greg k-h


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [patch 2.6.0] ethernet gadget supports goku_udc

2003-12-29 Thread Greg KH
On Fri, Dec 19, 2003 at 05:03:16PM -0800, David Brownell wrote:
> This patch just adds TC86c001 (goku) UDC support to
> the "ether.c" gadget driver.  This hardware supports
> a full speed CDC Ethernet interface.
> 
> Please merge.

Applied, thanks.

greg k-h


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [patch 2.6.0] doc updates

2003-12-29 Thread Greg KH
On Fri, Dec 19, 2003 at 03:00:34PM -0800, David Brownell wrote:
> As more people have been using this API, the need for some
> clarifications has (no surprise!) came up.
> 
> Most significant is the halt processing, needed to make
> Alan's "File Storage Gadget" (mass storage class, talks
> to usb-storage and Windows) handle fault cases cleanly.
> Gadget drivers can't halt IN endpoints until the FIFO is
> emptied by the host ...  virtually no hardware tries to
> sequence the DATA and STALL packets by itself.
> 
> Please merge.

Applied, thanks.

greg k-h


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [patch 2.6.0] USB, gadget zero updates

2003-12-29 Thread Greg KH
On Fri, Dec 19, 2003 at 03:04:38PM -0800, David Brownell wrote:
> [ once more, with patch! ]
> 
> Small updates:
> 
>   - support TC86c001 (goku_udc) controller
>   - simplify the per-controller configuration
>   - add two vendor requests to test control-OUT
>   - some minor fixes
> 
> Please merge.

Applied, thanks.

greg k-h


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [BK PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
Hi,

Here are some USB patches for 2.6.0.  There are a number of different
fixes and a few new drivers added.  Some of the highlights are:
- lots of usb-storage fixes
- lots of usb-storage unusual-devs updates
- added new w9968cf driver
- added new lego tower driver
- core tweaks for non-compliant USB devices.
- lots of other little fixes

Please pull from:  bk://linuxusb.bkbits.net/usb-devel-2.6

Patches will be posted to linux-usb-devel as a follow-up thread for
those who want to see them.

thanks,

greg k-h

 CREDITS |9 
 Documentation/usb/w9968cf.txt   |  463 +++
 drivers/usb/class/audio.h   |6 
 drivers/usb/class/cdc-acm.c |   42 
 drivers/usb/class/usblp.c   |   18 
 drivers/usb/class/usb-midi.h|6 
 drivers/usb/core/hcd.c  |8 
 drivers/usb/core/hub.c  |   62 
 drivers/usb/core/hub.h  |2 
 drivers/usb/core/message.c  |7 
 drivers/usb/core/usb.c  |  101 
 drivers/usb/gadget/ether.c  |   21 
 drivers/usb/gadget/zero.c   |  102 
 drivers/usb/host/ohci-dbg.c |   43 
 drivers/usb/host/ohci.h |   10 
 drivers/usb/host/ohci-hcd.c |8 
 drivers/usb/host/ohci-q.c   |   32 
 drivers/usb/image/scanner.c |4 
 drivers/usb/image/scanner.h |   17 
 drivers/usb/input/hid-core.c|4 
 drivers/usb/input/hiddev.c  |1 
 drivers/usb/Makefile|2 
 drivers/usb/media/Kconfig   |   42 
 drivers/usb/media/Makefile  |1 
 drivers/usb/media/pwc-ctrl.c|  173 +
 drivers/usb/media/pwc.h |   22 
 drivers/usb/media/pwc-if.c  |   75 
 drivers/usb/media/pwc-ioctl.h   |   44 
 drivers/usb/media/pwc-misc.c|   31 
 drivers/usb/media/w9968cf.c | 3712 
 drivers/usb/media/w9968cf_decoder.h |   86 
 drivers/usb/media/w9968cf_externaldef.h |   95 
 drivers/usb/media/w9968cf.h |  312 ++
 drivers/usb/misc/Kconfig|   14 
 drivers/usb/misc/legousbtower.c | 1224 +-
 drivers/usb/misc/Makefile   |1 
 drivers/usb/net/Kconfig |   15 
 drivers/usb/net/pegasus.h   |5 
 drivers/usb/net/usbnet.c|   78 
 drivers/usb/serial/cyberjack.c  |   25 
 drivers/usb/serial/ftdi_sio.c   |   12 
 drivers/usb/serial/ftdi_sio.h   |8 
 drivers/usb/serial/io_edgeport.c|   12 
 drivers/usb/serial/io_fw_boot2.h|2 
 drivers/usb/serial/io_fw_boot.h |2 
 drivers/usb/serial/io_fw_down2.h|2 
 drivers/usb/serial/io_fw_down.h |2 
 drivers/usb/serial/mct_u232.c   |   37 
 drivers/usb/serial/mct_u232.h   |  101 
 drivers/usb/serial/pl2303.c |   44 
 drivers/usb/serial/pl2303.h |1 
 drivers/usb/serial/visor.c  |3 
 drivers/usb/serial/visor.h  |1 
 drivers/usb/storage/datafab.c   |  136 -
 drivers/usb/storage/debug.c |   59 
 drivers/usb/storage/debug.h |1 
 drivers/usb/storage/isd200.c|   76 
 drivers/usb/storage/jumpshot.c  |  123 -
 drivers/usb/storage/Makefile|   10 
 drivers/usb/storage/protocol.c  |  172 +
 drivers/usb/storage/protocol.h  |   10 
 drivers/usb/storage/raw_bulk.c  |  116 -
 drivers/usb/storage/raw_bulk.c  |2 
 drivers/usb/storage/raw_bulk.h  |   20 
 drivers/usb/storage/scsiglue.c  |3 
 drivers/usb/storage/sddr09.c|  395 +--
 drivers/usb/storage/sddr55.c|   98 
 drivers/usb/storage/shuttle_usbat.c |   42 
 drivers/usb/storage/transport.c |   37 
 drivers/usb/storage/unusual_devs.h  |   91 
 drivers/usb/storage/usb.c   |   41 
 include/linux/i2c-id.h  |1 
 include/linux/usb_ch9.h |   42 
 include/linux/usb_gadget.h  |   29 
 include/linux/usb.h |5 
 include/linux/videodev.h|1 
 MAINTAINERS |   28 
 sound/usb/usbaudio.h|6 
 78 files changed, 7491 insertions(+), 1203 deletions(-)
-

:
  o USB storage: patch for unusual_devs.h

:
  o USB storage: Minolta Dimage S414 usb patch

:
  o USB: add TIOCMIWAIT support to pl2303 driver

:
  o USB storage: patch for Fujifilm EX-20

:
  o USB: add W996[87]CF driver

:
  o Status Query On My MCT-U232 Patch

:
  o USB storage: add unusual storage device entry for Minolta DiMAGE

:
  o USB storage: Make Pentax Optio S4 work

:
  o USB: pegasus driver update

:
  o USB storage: patch for Kyocera S5 camera

:
  o USB: fix bug when er

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.47, 2003/12/12 13:11:36-08:00, [EMAIL PROTECTED]

[PATCH] USB: add support for Sony UX50 device to visor driver

Thanks to Ralf Dietrich <[EMAIL PROTECTED]> for the information.


 drivers/usb/serial/visor.c |3 +++
 drivers/usb/serial/visor.h |1 +
 2 files changed, 4 insertions(+)


diff -Nru a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
--- a/drivers/usb/serial/visor.cMon Dec 29 14:21:44 2003
+++ b/drivers/usb/serial/visor.cMon Dec 29 14:21:44 2003
@@ -231,6 +231,8 @@
.driver_info = (kernel_ulong_t)&palm_os_4_probe },
{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_NX60_ID),
.driver_info = (kernel_ulong_t)&palm_os_4_probe },
+   { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_UX50_ID),
+   .driver_info = (kernel_ulong_t)&palm_os_4_probe },
{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_NZ90V_ID),
.driver_info = (kernel_ulong_t)&palm_os_4_probe },
{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID), 
@@ -266,6 +268,7 @@
{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_1_ID) },
{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_NX60_ID) },
{ USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_NZ90V_ID) },
+   { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_UX50_ID) },
{ USB_DEVICE(SAMSUNG_VENDOR_ID, SAMSUNG_SCH_I330_ID) },
{ USB_DEVICE(GARMIN_VENDOR_ID, GARMIN_IQUE_3600_ID) },
{ },/* optional parameter entry */
diff -Nru a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h
--- a/drivers/usb/serial/visor.hMon Dec 29 14:21:44 2003
+++ b/drivers/usb/serial/visor.hMon Dec 29 14:21:44 2003
@@ -41,6 +41,7 @@
 #define SONY_CLIE_4_1_ID   0x009A
 #define SONY_CLIE_NX60_ID  0x00DA
 #define SONY_CLIE_NZ90V_ID 0x00E9
+#define SONY_CLIE_UX50_ID  0x0144
 
 #define SAMSUNG_VENDOR_ID  0x04E8
 #define SAMSUNG_SCH_I330_ID0x8001



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1557, 2003/12/29 12:21:02-08:00, [EMAIL PROTECTED]

[PATCH] USB: Stop hiddev generating empty events

hiddev is mistakenly returning empty hiddev_event structures for report
events. According to Documentation/usb/hiddev.txt, report events are
only sent when HIDDEV_FLAG_REPORT and HIDDEV_FLAG_UREF are both set.
Currently, report events from hid cause hiddev to generate empty
hiddev_event events when HIDDEV_FLAG_UREF is not set.


 drivers/usb/input/hiddev.c |1 +
 1 files changed, 1 insertion(+)


diff -Nru a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
--- a/drivers/usb/input/hiddev.cMon Dec 29 14:20:48 2003
+++ b/drivers/usb/input/hiddev.cMon Dec 29 14:20:48 2003
@@ -213,6 +213,7 @@
  ((type == HID_OUTPUT_REPORT) ? HID_REPORT_TYPE_OUTPUT : 
   ((type == HID_FEATURE_REPORT) ? HID_REPORT_TYPE_FEATURE:0));
uref.report_id = report->id;
+   uref.field_index = HID_FIELD_INDEX_NONE;
 
hiddev_send_event(hid, &uref);
 }



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1561, 2003/12/29 12:30:55-08:00, [EMAIL PROTECTED]

[PATCH] USB: let USB_{PEGASUS,USBNET} depend on NET_ETHERNET

Adrian Bunk wrote:
> I observed the following small problem in 2.6:
>
> - MII depends on NET_ETHERNET
> - USB_PEGASUS and USB_USBNET select MII, but they depend only on NET
>
> The patch below lets USB_PEGASUS and USB_USBNET depend on NET_ETHERNET
> instead of NET to fix this issue.

Actually how about this one instead?  The PEGASUS bit is the same.
The difference is that MII (and CRC32) are only attributed to the
driver code that needs those ... AX8817X needs both, ZAURUS just
needs CRC32.  The core (which should eventually become a separate
module) shouldn't depend on those modules at all.

Also both CDCETHER and AX8817X are marked as non-experimental;
I recall Dave Hollis submitted a patch to do that for AX8817X,
and CDCETHER now seems to have gotten enough success reports too.


 drivers/usb/net/Kconfig |   13 ++---
 1 files changed, 6 insertions(+), 7 deletions(-)


diff -Nru a/drivers/usb/net/Kconfig b/drivers/usb/net/Kconfig
--- a/drivers/usb/net/Kconfig   Mon Dec 29 14:20:22 2003
+++ b/drivers/usb/net/Kconfig   Mon Dec 29 14:20:22 2003
@@ -69,7 +69,7 @@
 
 config USB_PEGASUS
tristate "USB Pegasus/Pegasus-II based ethernet device support"
-   depends on USB && NET
+   depends on USB && NET_ETHERNET
select MII
---help---
  Say Y here if you know you have Pegasus or Pegasus-II based adapter.
@@ -96,8 +96,6 @@
 config USB_USBNET
tristate "Multi-purpose USB Networking Framework"
depends on USB && NET
-   select CRC32
-   select MII
---help---
  This driver supports several kinds of network links over USB,
  with "minidrivers" built around a common network driver core
@@ -206,6 +204,7 @@
 config USB_ZAURUS
boolean "Sharp Zaurus (stock ROMs)"
depends on USB_USBNET
+   select CRC32
default y
help
  Choose this option to support the usb networking links used by
@@ -217,9 +216,7 @@
 
 config USB_CDCETHER
boolean "CDC Ethernet support (smart devices such as cable modems)"
-   # experimental primarily because cdc-ether was.
-   # make it non-experimental after more interop testing
-   depends on USB_USBNET && EXPERIMENTAL
+   depends on USB_USBNET
default y
help
  This option supports devices conforming to the Communication Device
@@ -247,7 +244,9 @@
 
 config USB_AX8817X
boolean "ASIX AX88172 Based USB 2.0 Ethernet Devices"
-   depends on USB_USBNET
+   depends on USB_USBNET && NET_ETHERNET
+   select CRC32
+   select MII
default y
help
 



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.5, 2003/12/05 11:06:34-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Command failure codes for sddr09 driver

This patch updates the sdd09 subdriver to make it return Command Failure
with appropriate sense data (rather than Tranport Error) when:

a MODE-SENSE command requests an unsupported page;

a CDB includes an unrecognized command code.

This should help prevent confusion and excessive retrying by the SCSI
drivers.


 drivers/usb/storage/sddr09.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
--- a/drivers/usb/storage/sddr09.c  Mon Dec 29 14:26:41 2003
+++ b/drivers/usb/storage/sddr09.c  Mon Dec 29 14:26:41 2003
@@ -1496,7 +1496,9 @@
return USB_STOR_TRANSPORT_GOOD;
}
 
-   return USB_STOR_TRANSPORT_ERROR;
+   sensekey = 0x05;/* illegal request */
+   sensecode = 0x24;   /* invalid field in CDB */
+   return USB_STOR_TRANSPORT_FAILED;
}
 
if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) {
@@ -1542,8 +1544,10 @@
 
if (srb->cmnd[0] != TEST_UNIT_READY &&
srb->cmnd[0] != REQUEST_SENSE) {
+   sensekey = 0x05;/* illegal request */
+   sensecode = 0x20;   /* invalid command */
havefakesense = 1;
-   return USB_STOR_TRANSPORT_ERROR;
+   return USB_STOR_TRANSPORT_FAILED;
}
 
for (; srb->cmd_len<12; srb->cmd_len++)



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.11, 2003/12/08 17:25:34-08:00, [EMAIL PROTECTED]

[PATCH] USB scanner driver: new device ids

Added vendor/product ids for Epson, Genius, Microtek, Plustek,
Reflecta, and Visioneer scanners. Removed ids for HP PSC devices as
these are supported by the hpoj userspace driver.


 drivers/usb/image/scanner.c |4 
 drivers/usb/image/scanner.h |   17 ++---
 2 files changed, 18 insertions(+), 3 deletions(-)


diff -Nru a/drivers/usb/image/scanner.c b/drivers/usb/image/scanner.c
--- a/drivers/usb/image/scanner.c   Mon Dec 29 14:25:48 2003
+++ b/drivers/usb/image/scanner.c   Mon Dec 29 14:25:48 2003
@@ -380,6 +380,10 @@
  *  Visioneer scanners.
  *- Added test for USB_CLASS_CDC_DATA which is used by some fingerprint scanners.
  *
+ * 0.4.16  2003-11-04
+ *- Added vendor/product ids for Epson, Genius, Microtek, Plustek, Reflecta, and
+ *  Visioneer scanners. Removed ids for HP PSC devices as these are supported by
+ *  the hpoj userspace driver.
  *
  * TODO
  *- Performance
diff -Nru a/drivers/usb/image/scanner.h b/drivers/usb/image/scanner.h
--- a/drivers/usb/image/scanner.h   Mon Dec 29 14:25:48 2003
+++ b/drivers/usb/image/scanner.h   Mon Dec 29 14:25:48 2003
@@ -43,7 +43,7 @@
 
 // #define DEBUG
 
-#define DRIVER_VERSION "0.4.15"
+#define DRIVER_VERSION "0.4.16"
 #define DRIVER_DESC "USB Scanner Driver"
 
 #include 
@@ -146,7 +146,12 @@
{ USB_DEVICE(0x0458, 0x2015) }, /* ColorPage HR7LE */
{ USB_DEVICE(0x0458, 0x2016) }, /* ColorPage HR6X */
{ USB_DEVICE(0x0458, 0x2018) }, /* ColorPage HR7X */
+   { USB_DEVICE(0x0458, 0x201b) }, /* Colorpage Vivid 4x */
/* Hewlett Packard */
+   /* IMPORTANT: Hewlett-Packard multi-function peripherals (OfficeJet, 
+  Printer/Scanner/Copier (PSC), LaserJet, or PhotoSmart printer)
+  should not be added to this table because they are accessed by a
+  userspace driver (hpoj) */
{ USB_DEVICE(0x03f0, 0x0101) }, /* ScanJet 4100C */
{ USB_DEVICE(0x03f0, 0x0102) }, /* PhotoSmart S20 */
{ USB_DEVICE(0x03f0, 0x0105) }, /* ScanJet 4200C */
@@ -168,10 +173,10 @@
{ USB_DEVICE(0x03F0, 0x1105) }, /* ScanJet 5470C */
{ USB_DEVICE(0x03f0, 0x1205) }, /* ScanJet 5550C */
{ USB_DEVICE(0x03f0, 0x1305) }, /* Scanjet 4570c */
-   { USB_DEVICE(0x03f0, 0x1411) }, /* PSC 750 */
+   //  { USB_DEVICE(0x03f0, 0x1411) }, /* PSC 750 - NOT SUPPORTED - use hpoj 
userspace driver */
{ USB_DEVICE(0x03f0, 0x2005) }, /* ScanJet 3570c */
{ USB_DEVICE(0x03f0, 0x2205) }, /* ScanJet 3500c */
-   { USB_DEVICE(0x03f0, 0x2f11) }, /* PSC 1210 */
+   //  { USB_DEVICE(0x03f0, 0x2f11) }, /* PSC 1210 - NOT SUPPORTED - use hpoj 
userspace driver */
/* Lexmark */
{ USB_DEVICE(0x043d, 0x002d) }, /* X70/X73 */
{ USB_DEVICE(0x043d, 0x003d) }, /* X83 */
@@ -187,6 +192,7 @@
{ USB_DEVICE(0x05da, 0x30ce) }, /* ScanMaker 3800 */
{ USB_DEVICE(0x05da, 0x30cf) }, /* ScanMaker 4800 */
{ USB_DEVICE(0x05da, 0x30d4) }, /* ScanMaker 3830 + 3840 */
+   { USB_DEVICE(0x05da, 0x30d8) }, /* ScanMaker 5900 */
{ USB_DEVICE(0x04a7, 0x0224) }, /* Scanport 3000 (actually Visioneer?)*/
/* The following SCSI-over-USB Microtek devices are supported by the
   microtek driver: Enable SCSI and USB Microtek in kernel config */
@@ -245,6 +251,7 @@
{ USB_DEVICE(0x07b3, 0x0400) }, /* OpticPro 1248U */
{ USB_DEVICE(0x07b3, 0x0401) }, /* OpticPro 1248U (another one) */
{ USB_DEVICE(0x07b3, 0x0403) }, /* U16B */
+   { USB_DEVICE(0x07b3, 0x0413) }, /* OpticSlim 1200 */
/* Primax/Colorado */
{ USB_DEVICE(0x0461, 0x0300) }, /* G2-300 #1 */
{ USB_DEVICE(0x0461, 0x0301) }, /* G2E-300 #1 */
@@ -261,6 +268,8 @@
{ USB_DEVICE(0x0461, 0x0383) }, /* G2E-600 */
/* Prolink */
{ USB_DEVICE(0x06dc, 0x0014) }, /* Winscan Pro 2448U */
+   /* Reflecta  */
+   { USB_DEVICE(0x05e3, 0x0120) }, /* iScan 1800 */
/* Relisis */
// { USB_DEVICE(0x0475, 0x0103) },  /* Episode - undetected endpoint */
{ USB_DEVICE(0x0475, 0x0210) }, /* Scorpio Ultra 3 */
@@ -285,6 +294,7 @@
{ USB_DEVICE(0x04b8, 0x011c) }, /* Perfection 3200 */
{ USB_DEVICE(0x04b8, 0x011d) }, /* Perfection 1260 */
{ USB_DEVICE(0x04b8, 0x011e) }, /* Perfection 1660 Photo */
+   { USB_DEVICE(0x04b8, 0x011f) }, /* Perfection 1670 */
{ USB_DEVICE(0x04b8, 0x0801) }, /* Stylus CX5200 */
{ USB_DEVICE(0x04b8, 0x0802) }, /* Stylus CX3200 */
/* Siemens */
@@ -309,6 +319,7 @@
{ USB_DEVICE(0x04a7, 0x0221) }, /* OneTouch 5300 USB */
{ USB_DEVICE(0x04a7, 0x0224) }, /* OneTouch 4800 USB */
{ USB_DEVICE(0x04a7, 0x0226) }, /* OneTouch 5800 USB */
+   { USB_DEVICE(0x04a7, 0x0229) }, /* OneTouch 7100 USB */
{ USB_DEVICE(0x04a7, 0x022c) }, /* OneTouch

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1337.3.5, 2003/10/16 12:22:46-07:00, [EMAIL PROTECTED]

[PATCH] USB: 64bit fixups for legousbtower driver


 drivers/usb/misc/legousbtower.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


diff -Nru a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
--- a/drivers/usb/misc/legousbtower.c   Mon Dec 29 14:27:43 2003
+++ b/drivers/usb/misc/legousbtower.c   Mon Dec 29 14:27:43 2003
@@ -379,7 +379,7 @@
int retval = 0;
int timeout = 0;
 
-   dbg(2," %s : enter, count = %d", __func__, count);
+   dbg(2," %s : enter, count = %Zd", __func__, count);
 
dev = (struct lego_usb_tower *)file->private_data;

@@ -479,7 +479,7 @@
int retval = 0;
int timeout = 0;
 
-   dbg(2," %s : enter, count = %d", __func__, count);
+   dbg(2," %s : enter, count = %Zd", __func__, count);
 
dev = (struct lego_usb_tower *)file->private_data;
 
@@ -528,14 +528,14 @@
goto exit;
}
 
-   dbg(4," %s : in progress, count = %d", __func__, count);
+   dbg(4," %s : in progress, count = %Zd", __func__, count);
} else {
-   dbg(4," %s : sending, count = %d", __func__, count);
+   dbg(4," %s : sending, count = %Zd", __func__, count);
 
/* write the data into interrupt_out_buffer from userspace */
buffer_size = dev->interrupt_out_endpoint->wMaxPacketSize;
bytes_to_write = count > buffer_size ? buffer_size : count;
-   dbg(4," %s : buffer_size = %d, count = %d, bytes_to_write = 
%d", __func__, buffer_size, count, bytes_to_write);
+   dbg(4," %s : buffer_size = %Zd, count = %Zd, bytes_to_write = 
%Zd", __func__, buffer_size, count, bytes_to_write);
 
if (copy_from_user (dev->interrupt_out_buffer, buffer, 
bytes_to_write) != 0) {
retval = -EFAULT;



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1529.1.2, 2003/12/19 11:11:27-08:00, [EMAIL PROTECTED]

[PATCH] Status Query On My MCT-U232 Patch

Brief Patch Description:

Fix a problem in the 'mct_u232' driver whereby output data gets held up in the
USB/RS-232 adapter for RS-232 devices which don't assert the 'CTS' signal.

Background:

The Belkin F5U109 is a 9-pin USB/RS-232 adapter that is supported by the
existing 'mct_u232' kernel module.  Recently, I've been testing it under the
2.4.22 (Slackware 9.1) kernel and the 2.6.0-test9 kernel.

I've connected a Garmin 'GPS35 TracPak' GPS receiver (RS-232 interface) and an
ordinary RS-232 external modem to my PC's USB port via the Belkin F5U109
adapter.

Problem:

Although _reads_ from either of the RS-232 devices mentioned above work fine
via the Belkin adapter, _writes_ to the GPS receiver are not being seen by
the GPS.  Writes to the modem, however, work perfectly.

Aside: The 'Linux USB Users' archives show that at least one other person
(circa May 2002) had the exact same problem I'm having, but it sounds like no
solution was ever determined because the person in question just bought a
different USB/RS-232 adapter.

Investigation:

Using the 'seyon' terminal emulator in Linux and a crude hardware RS-232
"breakout box" that I hacked together, I've determined that the problem is
related to the RTS/CTS RS-232 hardware handshaking.

After further investigation, I've concluded that RS-232 devices which do not
assert the 'Clear To Send' ('CTS') signal prevent the Belkin F5U109 adapter
from transmitting data to the RS-232 device when the current (version 1.1)
'mct_u232' module is used. The data gets "queued up" (up to a point -- 16
bytes, I think) in the adapter but never transmitted.

Since this GPS receiver works perfectly (reads and writes) when connected to a
PC running W98se using the same Belkin adapter and the Belkin-supplied
Windows driver, the Linux driver became suspect.

After some testing with SniffUSB, I found that the Windows driver sends a
couple of unique undocumented USB 'device requests' that the Linux driver
does not. As it turns out, the second of those 2 requests is critical in
making the adapter transmit data to a device which doesn't assert 'CTS'.

For completeness, the Windows driver in use was determined from the 'Device
Manager', 'Driver File Details' page:

   U2SPORT.VXD
   Provider: Magic Control Technology
   File version: 1.21P.0104 for Win98/Me

Solution:

My patch adds the 2 missing USB 'device request' commands right after a
baud-change command. This mimics the operation of the W98 driver.

Unfortunately, after much testing, I found no other operation (besides a
baud-change request) under Windows that triggers either of these 2 'device
request' commands. This makes it impossible to fully document the behavior of
these requests, but I've made entries for them alongside the others in the
'mct_u232.h' file.

Purely for clarity, the patch also modifies various comments in 'mct_u232.h',
mostly to reflect proper sizes of the various 'USB Device Request' fields per
the USB 1.1 specification.

The patch also updates the version number of the driver, corrects a minor
typographical error, and documents a difference in the length of the data in
a 'baud rate change' command for certain adapters which use a coded baud-rate
rather than the conventional RS-232 baud rate divisor.

I've provided (tested) patches for both the 2.4.22 and the 2.6.0-test9
kernels.

Please note that the changes to 'mct_u232.h' apply to both 2.4.22 and
2.6.0-test9 since that file has not changed between those kernel releases.
Nevertheless, I've included that (same) portion of the patch in both
attachments for simplicity.

Bill Marr


 drivers/usb/serial/mct_u232.c |   37 ++-
 drivers/usb/serial/mct_u232.h |  101 +-
 2 files changed, 116 insertions(+), 22 deletions(-)


diff -Nru a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
--- a/drivers/usb/serial/mct_u232.c Mon Dec 29 14:20:54 2003
+++ b/drivers/usb/serial/mct_u232.c Mon Dec 29 14:20:54 2003
@@ -24,6 +24,11 @@
  *   Basic tests have been performed with minicom/zmodem transfers and
  *   modem dialing under Linux 2.4.0-test10 (for me it works fine).
  *
+ * 04-Nov-2003 Bill Marr 
+ *   - Mimic Windows driver by sending 2 USB 'device request' messages
+ * following normal 'baud rate change' message.  This allows data to be
+ * transmitted to RS-232 devices which don't assert the 'CTS' signal.
+ *
  * 10-Nov-2001 Wolfgang Grandegger
  *   - Fixed an endianess problem with the baudrate selection for PowerPC.
  *
@@ -85,7 +90,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v1.1"
+#define DRIVER_VERSION "v1.2"
 #define DRIVER_AUTHOR "Wolfgang Grandegger <[EMAIL PROTECTED]>"
 #define DRIVER_DESC "Magic Control Technology USB-RS232 converter driver"
 
@@ -216,6 +221,7 @@
 {
unsigned int divisor;
 int rc;
+unsigned char zero_byte = 0;

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1560, 2003/12/29 12:29:37-08:00, [EMAIL PROTECTED]

[PATCH] USB: ethernet gadget supports goku_udc

This patch just adds TC86c001 (goku) UDC support to
the "ether.c" gadget driver.  This hardware supports
a full speed CDC Ethernet interface.


 drivers/usb/gadget/ether.c |   21 +
 1 files changed, 21 insertions(+)


diff -Nru a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
--- a/drivers/usb/gadget/ether.cMon Dec 29 14:20:29 2003
+++ b/drivers/usb/gadget/ether.cMon Dec 29 14:20:29 2003
@@ -226,6 +226,27 @@
 #define hw_optimize(g) do {} while (0)
 #endif
 
+/*
+ * Toshiba TC86C001 ("Goku-S") UDC
+ *
+ * This has three semi-configurable full speed bulk/interrupt endpoints.
+ */
+#ifdef CONFIG_USB_ETH_GOKU
+#define CHIP   "goku"
+#define DRIVER_VERSION_NUM 0x0106
+#define EP0_MAXPACKET  8
+static const char EP_OUT_NAME [] = "ep1-bulk";
+#define EP_OUT_NUM 1
+static const char EP_IN_NAME [] = "ep2-bulk";
+#define EP_IN_NUM  2
+static const char EP_STATUS_NAME [] = "ep3-bulk";
+#define EP_STATUS_NUM  3
+#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
+/* doesn't support remote wakeup */
+
+#define hw_optimize(g) do {} while (0)
+#endif
+
 /*-*/
 
 #ifndef EP0_MAXPACKET



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.49, 2003/12/12 14:31:42-08:00, [EMAIL PROTECTED]

[PATCH] USB: Mark AX8817x usbnet driver as non-experimental

Trivial patch to remove the Experimental mark on the AX8817x driver
portion of usbnet.  The driver seems to have made the rounds enough and
is working quite well.


 drivers/usb/net/Kconfig |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/net/Kconfig b/drivers/usb/net/Kconfig
--- a/drivers/usb/net/Kconfig   Mon Dec 29 14:21:30 2003
+++ b/drivers/usb/net/Kconfig   Mon Dec 29 14:21:30 2003
@@ -247,7 +247,7 @@
 
 config USB_AX8817X
boolean "ASIX AX88172 Based USB 2.0 Ethernet Devices"
-   depends on USB_USBNET && EXPERIMENTAL
+   depends on USB_USBNET
default y
help
 



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1515.1.5, 2003/12/15 13:38:28-08:00, [EMAIL PROTECTED]

[PATCH] USB:  new descriptor codes, types

This patch adds definitions:

  - New "video" class, for video cameras and more complicated devices;

  - New "Interface association" descriptor type, used by video class,
along with two other assigned desciptor type codes (OTG, "debug")
listed in the same ECN to the USB 2.0 spec;

  - Type declarations for "Interface association" and OTG descriptors.

It also replaces three copies of USB_DT_CS_* declarations in audio
support with one in , and uses the newly exposed
symbol in "usbnet".  (Near as I can tell, the convention for those
"class specific" descriptor types started with audio, and was then
adopted by several other class specifications.)


 drivers/usb/class/audio.h|6 --
 drivers/usb/class/usb-midi.h |6 --
 drivers/usb/net/usbnet.c |3 +--
 include/linux/usb_ch9.h  |   42 ++
 sound/usb/usbaudio.h |6 --
 5 files changed, 43 insertions(+), 20 deletions(-)


diff -Nru a/drivers/usb/class/audio.h b/drivers/usb/class/audio.h
--- a/drivers/usb/class/audio.h Mon Dec 29 14:21:09 2003
+++ b/drivers/usb/class/audio.h Mon Dec 29 14:21:09 2003
@@ -1,9 +1,3 @@
-#define USB_DT_CS_DEVICE0x21
-#define USB_DT_CS_CONFIG0x22
-#define USB_DT_CS_STRING0x23
-#define USB_DT_CS_INTERFACE 0x24
-#define USB_DT_CS_ENDPOINT  0x25
-
 #define CS_AUDIO_UNDEFINED 0x20
 #define CS_AUDIO_DEVICE0x21
 #define CS_AUDIO_CONFIGURATION 0x22
diff -Nru a/drivers/usb/class/usb-midi.h b/drivers/usb/class/usb-midi.h
--- a/drivers/usb/class/usb-midi.h  Mon Dec 29 14:21:09 2003
+++ b/drivers/usb/class/usb-midi.h  Mon Dec 29 14:21:09 2003
@@ -28,12 +28,6 @@
 #define USB_SUBCLASS_MIDISTREAMING 3
 #endif
 
-#define USB_DT_CS_DEVICE   0x21
-#define USB_DT_CS_CONFIG   0x22
-#define USB_DT_CS_STRING   0x23
-#define USB_DT_CS_INTERFACE0x24
-#define USB_DT_CS_ENDPOINT 0x25
-
 /* - */
 /* Roland MIDI Devices */
 
diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
--- a/drivers/usb/net/usbnet.c  Mon Dec 29 14:21:09 2003
+++ b/drivers/usb/net/usbnet.c  Mon Dec 29 14:21:09 2003
@@ -923,8 +923,7 @@
memset (info, 0, sizeof *info);
info->control = intf;
while (len > 3) {
-   /* ignore bDescriptorType != CS_INTERFACE */
-   if (buf [1] != 0x24)
+   if (buf [1] != USB_DT_CS_INTERFACE)
goto next_desc;
 
/* bDescriptorSubType identifies three "must have" descriptors;
diff -Nru a/include/linux/usb_ch9.h b/include/linux/usb_ch9.h
--- a/include/linux/usb_ch9.h   Mon Dec 29 14:21:09 2003
+++ b/include/linux/usb_ch9.h   Mon Dec 29 14:21:09 2003
@@ -116,6 +116,17 @@
 #define USB_DT_DEVICE_QUALIFIER0x06
 #define USB_DT_OTHER_SPEED_CONFIG  0x07
 #define USB_DT_INTERFACE_POWER 0x08
+/* these are from a minor usb 2.0 revision (ECN) */
+#define USB_DT_OTG 0x09
+#define USB_DT_DEBUG   0x0a
+#define USB_DT_INTERFACE_ASSOCIATION   0x0b
+
+/* conventional codes for class-specific descriptors */
+#define USB_DT_CS_DEVICE   0x21
+#define USB_DT_CS_CONFIG   0x22
+#define USB_DT_CS_STRING   0x23
+#define USB_DT_CS_INTERFACE0x24
+#define USB_DT_CS_ENDPOINT 0x25
 
 /* All standard descriptors have these 2 fields at the beginning */
 struct usb_descriptor_header {
@@ -165,6 +176,7 @@
 #define USB_CLASS_CDC_DATA 0x0a
 #define USB_CLASS_CSCID0x0b/* chip+ smart card */
 #define USB_CLASS_CONTENT_SEC  0x0d/* content security */
+#define USB_CLASS_VIDEO0x0e
 #define USB_CLASS_APP_SPEC 0xfe
 #define USB_CLASS_VENDOR_SPEC  0xff
 
@@ -278,6 +290,36 @@
__u8  bMaxPacketSize0;
__u8  bNumConfigurations;
__u8  bRESERVED;
+} __attribute__ ((packed));
+
+
+/*-*/
+
+/* USB_DT_OTG (from OTG 1.0a supplement) */
+struct usb_otg_descriptor {
+   __u8  bLength;
+   __u8  bDescriptorType;
+
+   __u8  bmAttributes; /* support for HNP, SRP, etc */
+} __attribute__ ((packed));
+
+/* from usb_otg_descriptor.bmAttributes */
+#define USB_OTG_SRP(1 << 0)
+#define USB_OTG_HNP(1 << 1)/* swap host/device roles */
+
+/*-*/
+
+/* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */
+struct usb_interface_assoc_descriptor {
+   __u8  bLength;
+   __u8  bDescriptorType;
+
+   __u8  bFirstInterface;
+   __u8  bInt

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.48, 2003/12/12 14:13:03-08:00, [EMAIL PROTECTED]

[PATCH] USB: PWC 8.12 driver update

Attached you will find patches that will bring the Philips Webcam driver
(PWC) up to version 8.12. The most important new feature is support for
the motorized pan & tilt feature of the new Logitech QuickCam
Orbit/Sphere, which I don't think is in the stores yet (at least it's
not on Logitech's website), but should be there soon. In addition, the
documentation in the kernel about the cams is updated.


 drivers/usb/media/Kconfig |   15 +--
 drivers/usb/media/pwc-ctrl.c  |  173 +-
 drivers/usb/media/pwc-if.c|   75 ++
 drivers/usb/media/pwc-ioctl.h |   44 ++
 drivers/usb/media/pwc-misc.c  |   31 +--
 drivers/usb/media/pwc.h   |   22 -
 6 files changed, 324 insertions(+), 36 deletions(-)


diff -Nru a/drivers/usb/media/Kconfig b/drivers/usb/media/Kconfig
--- a/drivers/usb/media/Kconfig Mon Dec 29 14:21:37 2003
+++ b/drivers/usb/media/Kconfig Mon Dec 29 14:21:37 2003
@@ -113,16 +113,17 @@
   webcams:
* Philips PCA645, PCA646
* Philips PCVC675, PCVC680, PCVC690
-   * Philips PCVC730, PCVC740, PCVC750
+   * Philips PCVC720/40, PCVC730, PCVC740, PCVC750
   * Askey VC010
-  * Logitech QuickCam Pro 3000, 4000, 'Zoom' and 'Notebook'
-  * Samsung MPC-C10, MPC-C30
-  * Creative Webcam 5
-  * SOTECT Afina Eye
+  * Logitech QuickCam Pro 3000, 4000, 'Zoom', 'Notebook Pro' 
+ and 'Orbit'/'Sphere'
+   * Samsung MPC-C10, MPC-C30
+  * Creative Webcam 5, Pro Ex
+  * SOTEC Afina Eye
   * Visionite VCS-UC300, VCS-UM100
   
- The PCA635, PCVC665 and PCVC720 are not supported by this driver
- and never will be, but the 665 and 720 are supported by other 
+ The PCA635, PCVC665 and PCVC720/20 are not supported by this driver
+ and never will be, but the 665 and 720/20 are supported by other 
  drivers.
 
  This driver has an optional plugin (called PWCX), which is 
diff -Nru a/drivers/usb/media/pwc-ctrl.c b/drivers/usb/media/pwc-ctrl.c
--- a/drivers/usb/media/pwc-ctrl.c  Mon Dec 29 14:21:38 2003
+++ b/drivers/usb/media/pwc-ctrl.c  Mon Dec 29 14:21:38 2003
@@ -44,6 +44,8 @@
 #define GET_STATUS_CTL 0x06
 #define SET_EP_STREAM_CTL  0x07
 #define GET_EP_STREAM_CTL  0x08
+#define SET_MPT_CTL0x0D
+#define GET_MPT_CTL0x0E
 
 /* Selectors for the Luminance controls [GS]ET_LUM_CTL */
 #define AGC_MODE_FORMATTER 0x2000
@@ -88,6 +90,11 @@
 /* Formatters for the Video Endpoint controls [GS]ET_EP_STREAM_CTL */
 #define VIDEO_OUTPUT_CONTROL_FORMATTER 0x0100
 
+/* Formatters for the motorized pan & tilt [GS]ET_MPT_CTL */
+#define PT_RELATIVE_CONTROL_FORMATTER  0x01
+#define PT_RESET_CONTROL_FORMATTER 0x02
+#define PT_STATUS_FORMATTER0x03
+
 static char *size2name[PSZ_MAX] =
 {
"subQCIF",
@@ -435,6 +442,7 @@
ret = set_video_mode_Timon(pdev, size, frames, compression, snapshot);
break;

+   case 720:
case 730:
case 740:
case 750:
@@ -745,6 +753,7 @@
buf[1] = speed >> 8;
buf[0] = speed & 0xff;
break;
+   case 720:
case 730:
case 740:
case 750:
@@ -1243,6 +1252,46 @@
return buf;
 }
 
+int pwc_mpt_reset(struct pwc_device *pdev, int flags)
+{
+   unsigned char buf;
+   
+   buf = flags & 0x03; // only lower two bits are currently used 
+   return SendControlMsg(SET_MPT_CTL, PT_RESET_CONTROL_FORMATTER, 1);
+}
+
+static inline int pwc_mpt_set_angle(struct pwc_device *pdev, int pan, int tilt)
+{
+   unsigned char buf[4];
+   
+   /* set new relative angle; angles are expressed in degrees * 100,
+  but cam as .5 degree resolution, hence devide by 200. Also
+  the angle must be multiplied by 64 before it's send to
+  the cam (??)
+*/
+   pan  =  64 * pan  / 100;
+   tilt = -64 * tilt / 100; /* positive tilt is down, which is not what the user 
would expect */
+   buf[0] = pan & 0xFF;
+   buf[1] = (pan >> 8) & 0xFF;
+   buf[2] = tilt & 0xFF;
+   buf[3] = (tilt >> 8) & 0xFF;
+   return SendControlMsg(SET_MPT_CTL, PT_RELATIVE_CONTROL_FORMATTER, 4);
+}
+
+static inline int pwc_mpt_get_status(struct pwc_device *pdev, struct pwc_mpt_status 
*status)
+{
+   int ret;
+   unsigned char buf[5];
+   
+   ret = RecvControlMsg(GET_MPT_CTL, PT_STATUS_FORMATTER, 5);
+   if (ret < 0)
+   return ret;
+   status->status = buf[0] & 0x7; // 3 bits are used for reporting
+   status->time_pan = (buf[1] 

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.45, 2003/12/12 11:03:38-08:00, [EMAIL PROTECTED]

[PATCH] USB: fix bug when errors happen in ioedgeport driver


 drivers/usb/serial/io_edgeport.c |   12 
 1 files changed, 8 insertions(+), 4 deletions(-)


diff -Nru a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
--- a/drivers/usb/serial/io_edgeport.c  Mon Dec 29 14:21:58 2003
+++ b/drivers/usb/serial/io_edgeport.c  Mon Dec 29 14:21:58 2003
@@ -1488,16 +1488,20 @@
   usb_sndbulkpipe(edge_serial->serial->dev, 
edge_serial->bulk_out_endpoint),
   buffer, count+2, edge_bulk_out_data_callback, edge_port);
 
+   /* decrement the number of credits we have by the number we just sent */
+   edge_port->txCredits -= count;
+   edge_port->icount.tx += count;
+
urb->dev = edge_serial->serial->dev;
status = usb_submit_urb(urb, GFP_ATOMIC);
if (status) {
/* something went wrong */
dbg("%s - usb_submit_urb(write bulk) failed", __FUNCTION__);
edge_port->write_in_progress = FALSE;
-   } else {
-   /* decrement the number of credits we have by the number we just sent 
*/
-   edge_port->txCredits -= count;
-   edge_port->icount.tx += count;
+
+   /* revert the credits as something bad happened. */
+   edge_port->txCredits += count;
+   edge_port->icount.tx -= count;
}
dbg("%s wrote %d byte(s) TxCredit %d, Fifo %d", __FUNCTION__, count, 
edge_port->txCredits, fifo->count);
 }



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.25, 2003/12/09 11:46:03-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Convert sddr55 to use the new s-g routines

This patch changes the sddr55 driver to make it use the new scatter-gather
routines.  It has not been tested, but perhaps Andries Brouwer will be
able to try it out.


 drivers/usb/storage/sddr55.c |   81 ---
 1 files changed, 46 insertions(+), 35 deletions(-)


diff -Nru a/drivers/usb/storage/sddr55.c b/drivers/usb/storage/sddr55.c
--- a/drivers/usb/storage/sddr55.c  Mon Dec 29 14:24:13 2003
+++ b/drivers/usb/storage/sddr55.c  Mon Dec 29 14:24:13 2003
@@ -25,7 +25,6 @@
  */
 
 #include "transport.h"
-#include "raw_bulk.h"
 #include "protocol.h"
 #include "usb.h"
 #include "debug.h"
@@ -155,7 +154,7 @@
unsigned int lba,
unsigned int page,
unsigned short sectors,
-   unsigned char *content,
+   unsigned char *buffer,
int use_sg) {
 
int result = USB_STOR_TRANSPORT_GOOD;
@@ -167,17 +166,20 @@
unsigned long address;
 
unsigned short pages;
-   unsigned char *buffer = NULL;
-   unsigned char *ptr;
-   int len;
+   unsigned int len, index, offset;
 
-   len = sectors * PAGESIZE;
+   // Since we only read in one block at a time, we have to create
+   // a bounce buffer if the transfer uses scatter-gather.
 
-   buffer = (use_sg ? kmalloc(len, GFP_NOIO) : content);
-   if (buffer == NULL)
-   return USB_STOR_TRANSPORT_ERROR; /* out of memory */
-
-   ptr = buffer;
+   if (use_sg) {
+   len = min((unsigned int) sectors,
+   (unsigned int) info->blocksize >>
+   info->smallpageshift) * PAGESIZE;
+   buffer = kmalloc(len, GFP_NOIO);
+   if (buffer == NULL)
+   return USB_STOR_TRANSPORT_ERROR; /* out of memory */
+   }
+   index = offset = 0;
 
while (sectors>0) {
 
@@ -189,9 +191,9 @@
 
// Read as many sectors as possible in this block
 
-   pages = info->blocksize - page;
-   if (pages > (sectors << info->smallpageshift))
-   pages = (sectors << info->smallpageshift);
+   pages = min((unsigned int) sectors << info->smallpageshift,
+   info->blocksize - page);
+   len = pages << info->pageshift;
 
US_DEBUGP("Read %02X pages, from PBA %04X"
" (LBA %04X) page %02X\n",
@@ -199,7 +201,7 @@
 
if (pba == NOT_ALLOCATED) {
/* no pba for this lba, fill with zeroes */
-   memset (ptr, 0, pages << info->pageshift);
+   memset (buffer, 0, len);
} else {
 
address = (pba << info->blockshift) + page;
@@ -228,8 +230,7 @@
 
/* read data */
result = sddr55_bulk_transport(us,
-   SCSI_DATA_READ, ptr,
-   pagessrb,
+   &index, &offset, TO_XFER_BUF);
+   else
+   buffer += len;
 
page = 0;
lba++;
sectors -= pages >> info->smallpageshift;
-   ptr += (pages << info->pageshift);
}
 
-   us_copy_to_sgbuf_all(buffer, len, content, use_sg);
result = USB_STOR_TRANSPORT_GOOD;
 
 leave:
@@ -273,7 +277,7 @@
unsigned int lba,
unsigned int page,
unsigned short sectors,
-   unsigned char *content,
+   unsigned char *buffer,
int use_sg) {
 
int result = USB_STOR_TRANSPORT_GOOD;
@@ -286,9 +290,8 @@
unsigned long address;
 
unsigned short pages;
-   unsigned char *buffer = NULL;
-   unsigned char *ptr;
-   int i, len;
+   int i;
+   unsigned int len, index, offset;
 
/* check if we are allowed to write */
if (info->read_only || info->force_read_only) {
@@ -296,13 +299,18 @@
return USB_STOR_TRANSPORT_FAILED;
}
 
-   len = sectors * PAGESIZE;
+   // Since we only write one block at a time, we have to create
+   // a bounce buffer if the transfer uses scatter-gather.
 
-   buffer = us_copy_from_sgbuf_all(content, len, use_sg);
-   if (buffer == NULL)
-   return US

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.37, 2003/12/11 16:35:03-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: patch for unusual_devs.h

I send a patch and copy of /proc/bus/usb/devices for my 5`25 external
USB enclosure. I don't know exactly manufacturer of this device, but
model is CD-509.
It will be nice if it helps somebody else.


T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 2
B:  Alloc= 93/900 us (10%), #Int=  1, #Iso=  0
D:  Ver= 1.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor= ProdID= Rev= 0.00
S:  Product=USB UHCI Root Hub
S:  SerialNumber=14a0
C:* #Ifs= 1 Cfg#= 1 Atr=40 MxPwr=  0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=255ms
T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=045e ProdID=0040 Rev= 3.00
S:  Manufacturer=Microsoft
S:  Product=Microsoft 3-Button Mouse with IntelliEye(TM)
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbmouse
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=10ms
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 15 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0701 Rev= 0.02
S:  Product=USB TO IDE
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr= 96mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms


 drivers/usb/storage/unusual_devs.h |7 +++
 1 files changed, 7 insertions(+)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:52 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:52 2003
@@ -366,6 +366,13 @@
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_FIX_INQUIRY ),
 
+/* Submitted Alexander Oltu <[EMAIL PROTECTED]> */
+UNUSUAL_DEV(  0x05e3, 0x0701, 0x, 0x, 
+   "", 
+   "USB TO IDE",
+   US_SC_SCSI, US_PR_BULK, NULL,
+   US_FL_MODE_XLATE ), 
+
 /* Reported by Peter Marks <[EMAIL PROTECTED]>
  * Like the SIIG unit above, this unit needs an INQUIRY to ask for exactly
  * 36 bytes of data.  No more, no less. That is the only reason this entry



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.18, 2003/12/09 09:53:57-08:00, [EMAIL PROTECTED]

[PATCH] USB: further cleanup in usblp

somebody built his own version of be16_to_cpu(). Such things affect
maintainability.


 drivers/usb/class/usblp.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
--- a/drivers/usb/class/usblp.c Mon Dec 29 14:25:04 2003
+++ b/drivers/usb/class/usblp.c Mon Dec 29 14:25:04 2003
@@ -1091,7 +1091,7 @@
/* First two bytes are length in big-endian.
 * They count themselves, and we copy them into
 * the user's buffer. */
-   length = (usblp->device_id_string[0] << 8) + usblp->device_id_string[1];
+   length = be16_to_cpu(*((u16 *)usblp->device_id_string));
if (length < 2)
length = 2;
else if (length >= USBLP_DEVICE_ID_SIZE)



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.16, 2003/12/08 17:45:52-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Change sddr09 to use the new s-g access routine

This patch updates the sddr09 driver to use the new scatter-gather access
routine.  After installing it, the user who experienced memory access
violations says everything is now working properly.


 drivers/usb/storage/sddr09.c |  125 ---
 1 files changed, 70 insertions(+), 55 deletions(-)


diff -Nru a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
--- a/drivers/usb/storage/sddr09.c  Mon Dec 29 14:25:16 2003
+++ b/drivers/usb/storage/sddr09.c  Mon Dec 29 14:25:16 2003
@@ -28,7 +28,6 @@
  */
 
 #include "transport.h"
-#include "raw_bulk.h"
 #include "protocol.h"
 #include "usb.h"
 #include "debug.h"
@@ -664,30 +663,27 @@
 sddr09_read_data(struct us_data *us,
 unsigned long address,
 unsigned int sectors,
-unsigned char *content,
+unsigned char *buffer,
 int use_sg) {
 
struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra;
unsigned int lba, maxlba, pba;
unsigned int page, pages;
-   unsigned char *buffer = NULL;
-   unsigned char *ptr;
-   int result, len;
-
-   // If we're using scatter-gather, we have to create a new
-   // buffer to read all of the data in first, since a
-   // scatter-gather buffer could in theory start in the middle
-   // of a page, which would be bad. A developer who wants a
-   // challenge might want to write a limited-buffer
-   // version of this code.
-
-   len = sectors*info->pagesize;
+   unsigned int len, index, offset;
+   int result;
 
-   buffer = (use_sg ? kmalloc(len, GFP_NOIO) : content);
-   if (buffer == NULL)
-   return USB_STOR_TRANSPORT_ERROR;
+   // Since we only read in one block at a time, we have to create
+   // a bounce buffer if the transfer uses scatter-gather.
 
-   ptr = buffer;
+   if (use_sg) {
+   len = min(sectors, (unsigned int) info->blocksize) *
+   info->pagesize;
+   buffer = kmalloc(len, GFP_NOIO);
+   if (buffer == NULL) {
+   printk("sddr09_read_data: Out of memory\n");
+   return USB_STOR_TRANSPORT_ERROR;
+   }
+   }
 
// Figure out the initial LBA and page
lba = address >> info->blockshift;
@@ -698,13 +694,13 @@
// contiguous LBA's. Another exercise left to the student.
 
result = USB_STOR_TRANSPORT_GOOD;
+   index = offset = 0;
 
while (sectors > 0) {
 
/* Find number of pages we can read in this block */
-   pages = info->blocksize - page;
-   if (pages > sectors)
-   pages = sectors;
+   pages = min(sectors, info->blocksize - page);
+   len = pages << info->pageshift;
 
/* Not overflowing capacity? */
if (lba >= maxlba) {
@@ -727,7 +723,7 @@
   Instead of returning USB_STOR_TRANSPORT_ERROR
   it is better to return all zero data. */
 
-   memset(ptr, 0, pages << info->pageshift);
+   memset(buffer, 0, len);
 
} else {
US_DEBUGP("Read %d pages, from PBA %d"
@@ -738,20 +734,21 @@
info->pageshift;
 
result = sddr09_read20(us, address>>1,
-  pages, info->pageshift, ptr, 0);
+   pages, info->pageshift, buffer, 0);
if (result != USB_STOR_TRANSPORT_GOOD)
break;
}
+   if (use_sg)
+   usb_stor_access_xfer_buf(buffer, len, us->srb,
+   &index, &offset, TO_XFER_BUF);
+   else
+   buffer += len;
 
page = 0;
lba++;
sectors -= pages;
-   ptr += (pages << info->pageshift);
}
 
-   if (use_sg && result == USB_STOR_TRANSPORT_GOOD)
-   us_copy_to_sgbuf_all(buffer, len, content, use_sg);
-
if (use_sg)
kfree(buffer);
 
@@ -787,13 +784,13 @@
 static int
 sddr09_write_lba(struct us_data *us, unsigned int lba,
 unsigned int page, unsigned int pages,
-unsigned char *ptr) {
+unsigned char *ptr, unsigned char *blockbuffer) {
 
struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra;
unsigned long address;
unsigned int pba, lbap;
-   unsigned int pagelen, blocklen;
-   unsigned char *blockbuffer, *bptr, *cptr, *xptr;
+   unsigned int pagelen;
+   unsigned char

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.12, 2003/12/08 17:44:31-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Remove unneeded scatter-gather operations in sddr09

This patch removes some unnecessary scatter-gather code from the sddr09
driver.  In its place a single smaller buffer is re-used each time through
an I/O loop, as opposed to transferring all the data at once.

Andries Brouwer kindly tested this and suggested some improvements to get
it working right.


 drivers/usb/storage/sddr09.c |  112 ---
 1 files changed, 42 insertions(+), 70 deletions(-)


diff -Nru a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
--- a/drivers/usb/storage/sddr09.c  Mon Dec 29 14:25:42 2003
+++ b/drivers/usb/storage/sddr09.c  Mon Dec 29 14:25:42 2003
@@ -1092,69 +1092,33 @@
 static int
 sddr09_read_map(struct us_data *us) {
 
-   struct scatterlist *sg;
struct sddr09_card_info *info = (struct sddr09_card_info *) us->extra;
int numblocks, alloc_len, alloc_blocks;
int i, j, result;
-   unsigned char *ptr;
+   unsigned char *buffer, *buffer_end, *ptr;
unsigned int lba, lbact;
 
if (!info->capacity)
return -1;
 
-   // read 64 (1<<6) bytes for every block 
-   // ( 1 << ( blockshift + pageshift ) bytes)
-   //   of capacity:
-   // (1<<6)*capacity/(1<<(b+p)) =
-   // ((1<<6)*capacity)>>(b+p) =
-   // capacity>>(b+p-6)
-
-   alloc_len = info->capacity >> 
-   (info->blockshift + info->pageshift - CONTROL_SHIFT);
-
-   // Allocate a number of scatterlist structures according to
-   // the number of 128k blocks in the alloc_len. Adding 128k-1
-   // and then dividing by 128k gives the correct number of blocks.
-   // 128k = 1<<17
-
-   alloc_blocks = (alloc_len + (1<<17) - 1) >> 17;
-   sg = kmalloc(alloc_blocks*sizeof(struct scatterlist),
-GFP_NOIO);
-   if (sg == NULL)
-   return 0;
-
-   for (i=0; i= KERNEL_VERSION(2,5,3)
-   sg[i].page = virt_to_page(vaddr);
-   sg[i].offset = offset_in_page(vaddr);
-#else
-   sg[i].address = vaddr;
-#endif
-   sg[i].length = alloc_req;
-   alloc_len -= alloc_req;
-   }
-
-   for (i=0; icapacity >> (info->blockshift + info->pageshift);
 
-   result = sddr09_read_control(us, 0, numblocks,
-(unsigned char *)sg, alloc_blocks);
-   if (result != USB_STOR_TRANSPORT_GOOD) {
-   for (i=0; i> CONTROL_SHIFT);
+   alloc_len = (alloc_blocks << CONTROL_SHIFT);
+   buffer = kmalloc(alloc_len, GFP_NOIO);
+   if (buffer == NULL)
+   return 0;
+   buffer_end = buffer + alloc_len;
+
+#undef SDDR09_READ_MAP_BUFSZ
 
kfree(info->lba_to_pba);
kfree(info->pba_to_lba);
@@ -1162,29 +1126,31 @@
info->pba_to_lba = kmalloc(numblocks*sizeof(int), GFP_NOIO);
 
if (info->lba_to_pba == NULL || info->pba_to_lba == NULL) {
-   kfree(info->lba_to_pba);
-   kfree(info->pba_to_lba);
-   info->lba_to_pba = NULL;
-   info->pba_to_lba = NULL;
-   for (i=0; ilba_to_pba[i] = info->pba_to_lba[i] = UNDEF;
 
-   ptr = sg_address(sg[0]);
-
/*
 * Define lba-pba translation table
 */
-   // Each block is 64 bytes of control data, so block i is located in
-   // scatterlist block i*64/128k = i*(2^6)*(2^-17) = i*(2^-11)
 
-   for (i=0; i>11]) + ((i&0x7ff)<<6);
+   ptr = buffer_end;
+   for (i = 0; i < numblocks; i++) {
+   ptr += (1 << CONTROL_SHIFT);
+   if (ptr >= buffer_end) {
+   ptr = buffer;
+   result = sddr09_read_control(
+   us, i << (info->blockshift + 8),
+   min(alloc_blocks, numblocks - i),
+   buffer, 0);
+   if (result != USB_STOR_TRANSPORT_GOOD) {
+   result = -1;
+   goto done;
+   }
+   }
 
if (i == 0 || i == 1) {
info->pba_to_lba[i] = UNUSABLE;
@@ -1292,11 +1258,17 @@
}
info->lbact = lbact;
US_DEBUGP("Found %d LBA's\n", lbact);
+   result = 0;
 
-   for (i=0; ilba_to_pba);
+   kfree(info->pba_to_lba);
+   info->lba_to_pba = NULL;
+   info->pba_to_lba = NULL;
+   }
+   kfree(buffer);
+   return result;
 }
 
 static void



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.23, 2003/12/09 11:43:57-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Update scatter-gather handling in the isd200 driver

This patch fixes the scatter-gather handling in isd200, replacing an
incorrect routine there with calls to the new routine added in the
previous patch.  It also removes a couple of places where the driver
returned data for commands that shouldn't get any (TEST-UNIT-READY and
START-STOP).

This has not been tested.


 drivers/usb/storage/isd200.c |   76 +++
 1 files changed, 6 insertions(+), 70 deletions(-)


diff -Nru a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
--- a/drivers/usb/storage/isd200.c  Mon Dec 29 14:24:26 2003
+++ b/drivers/usb/storage/isd200.c  Mon Dec 29 14:24:26 2003
@@ -543,7 +543,6 @@
int result;
 
/* send the command to the transport layer */
-   srb->resid = 0;
memcpy(srb->cmnd, ataCdb, sizeof(ataCdb->generic));
srb->cmd_len = sizeof(ataCdb->generic);
transferStatus = usb_stor_Bulk_transport(srb, us);
@@ -1117,60 +1116,6 @@
 
 
 /**
- * isd200_data_copy
- *  
- * Copy data into the srb request buffer.  Use scatter gather if required.
- *
- * RETURNS:
- *void
- */
-void isd200_data_copy(Scsi_Cmnd *srb, char * src, int length)
-{
-   unsigned int len = length;
-   struct scatterlist *sg;
-
-   if (srb->use_sg) {
-   int i;
-   unsigned int total = 0;
-
-   /* Add up the sizes of all the sg segments */
-   sg = (struct scatterlist *) srb->request_buffer;
-   for (i = 0; i < srb->use_sg; i++)
-   total += sg[i].length;
-
-   if (length > total)
-   len = total;
-
-   total = 0;
-
-   /* Copy data into sg buffer(s) */
-   for (i = 0; i < srb->use_sg; i++) {
-   if ((len > total) && (len > 0)) {
-   /* transfer the lesser of the next buffer or the
-* remaining data */
-   if (len - total >= sg[i].length) {
-   memcpy(sg_address(sg[i]), src + total, 
sg[i].length);
-   total += sg[i].length;
-   } else {
-   memcpy(sg_address(sg[i]), src + total, len - 
total);
-   total = len;
-   }
-   } 
-   else
-   break;
-   }
-   } else  {
-   /* Make sure length does not exceed buffer length */
-   if (length > srb->request_bufflen)
-   len = srb->request_bufflen;
-
-   if (len > 0)
-   memcpy(srb->request_buffer, src, len);
-   }
-}
-
-
-/**
  * isd200_scsi_to_ata
  *  
  * Translate SCSI commands to ATA commands.
@@ -1198,11 +1143,9 @@
case INQUIRY:
US_DEBUGP("   ATA OUT - INQUIRY\n");
 
-   if (srb->request_bufflen > sizeof(struct inquiry_data))
-   srb->request_bufflen = sizeof(struct inquiry_data);
-
/* copy InquiryData */
-   isd200_data_copy(srb, (char *) &info->InquiryData, 
srb->request_bufflen);
+   usb_stor_set_xfer_buf((unsigned char *) &info->InquiryData,
+   sizeof(info->InquiryData), srb);
srb->result = SAM_STAT_GOOD;
sendToTransport = FALSE;
break;
@@ -1211,7 +1154,7 @@
US_DEBUGP("   ATA OUT - SCSIOP_MODE_SENSE\n");
 
/* Initialize the return buffer */
-   isd200_data_copy(srb, (char *) &senseData, 8);
+   usb_stor_set_xfer_buf(senseData, sizeof(senseData), srb);
 
if (info->DeviceFlags & DF_MEDIA_STATUS_ENABLED)
{
@@ -1231,9 +1174,6 @@
case TEST_UNIT_READY:
US_DEBUGP("   ATA OUT - SCSIOP_TEST_UNIT_READY\n");
 
-   /* Initialize the return buffer */
-   isd200_data_copy(srb, (char *) &senseData, 8);
-
if (info->DeviceFlags & DF_MEDIA_STATUS_ENABLED)
{
ataCdb->generic.SignatureByte0 = 
info->ConfigData.ATAMajorCommand;
@@ -1266,10 +1206,8 @@
readCapacityData.LogicalBlockAddress = cpu_to_be32(capacity);
readCapacityData.BytesPerBlock = cpu_to_be32(0x200);
 
-   if (srb->request_bufflen > sizeof(struct read_capacity_data))
- 

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.9, 2003/12/08 16:54:38-08:00, [EMAIL PROTECTED]

[PATCH] USB: khubd optimization

It changes spin_lock_save() to spin_lock() within the completion routine
and list_del()/INIT_LIST_HEAD() to list_del_init().  It's nothing more
than a minor optimization.


 drivers/usb/core/hub.c |   11 ---
 1 files changed, 4 insertions(+), 7 deletions(-)


diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.cMon Dec 29 14:26:01 2003
+++ b/drivers/usb/core/hub.cMon Dec 29 14:26:01 2003
@@ -126,7 +126,6 @@
 static void hub_irq(struct urb *urb, struct pt_regs *regs)
 {
struct usb_hub *hub = (struct usb_hub *)urb->context;
-   unsigned long flags;
int status;
 
switch (urb->status) {
@@ -151,12 +150,12 @@
hub->nerrors = 0;
 
/* Something happened, let khubd figure it out */
-   spin_lock_irqsave(&hub_event_lock, flags);
+   spin_lock(&hub_event_lock);
if (list_empty(&hub->event_list)) {
list_add(&hub->event_list, &hub_event_list);
wake_up(&khubd_wait);
}
-   spin_unlock_irqrestore(&hub_event_lock, flags);
+   spin_unlock(&hub_event_lock);
 
 resubmit:
if ((status = usb_submit_urb (hub->urb, GFP_ATOMIC)) != 0
@@ -494,10 +493,8 @@
spin_lock_irqsave(&hub_event_lock, flags);
 
/* Delete it and then reset it */
-   list_del(&hub->event_list);
-   INIT_LIST_HEAD(&hub->event_list);
-   list_del(&hub->hub_list);
-   INIT_LIST_HEAD(&hub->hub_list);
+   list_del_init(&hub->event_list);
+   list_del_init(&hub->hub_list);
 
spin_unlock_irqrestore(&hub_event_lock, flags);
 



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1337.3.7, 2003/10/23 17:03:54-07:00, [EMAIL PROTECTED]

[PATCH] USB: ax8817x additional ethtool support in usbnet

* Provide operational link testing via ethtool
* Provide get/set features via ethtool.


 drivers/usb/net/usbnet.c |   34 --
 1 files changed, 24 insertions(+), 10 deletions(-)


diff -Nru a/drivers/usb/net/usbnet.c b/drivers/usb/net/usbnet.c
--- a/drivers/usb/net/usbnet.c  Mon Dec 29 14:27:30 2003
+++ b/drivers/usb/net/usbnet.c  Mon Dec 29 14:27:30 2003
@@ -634,6 +634,27 @@
info->eedump_len = 0x3e;
 }
 
+static u32 ax8817x_get_link (struct net_device *net)
+{
+   struct usbnet *dev = (struct usbnet *)net->priv;
+
+   return (u32)mii_link_ok(&dev->mii);
+}
+
+static int ax8817x_get_settings(struct net_device *net, struct ethtool_cmd *cmd)
+{
+   struct usbnet *dev = (struct usbnet *)net->priv;
+
+   return mii_ethtool_gset(&dev->mii,cmd);
+}
+
+static int ax8817x_set_settings(struct net_device *net, struct ethtool_cmd *cmd)
+{
+   struct usbnet *dev = (struct usbnet *)net->priv;
+
+   return mii_ethtool_sset(&dev->mii,cmd);
+}
+
 static int ax8817x_bind(struct usbnet *dev, struct usb_interface *intf)
 {
int ret;
@@ -667,16 +688,6 @@
}
memcpy(dev->net->dev_addr, buf, ETH_ALEN);
 
-   /* Get IPG values */
-   if ((ret = ax8817x_read_cmd(dev, AX_CMD_READ_IPG012, 0, 0, 3, buf)) < 0) {
-   dbg("Error reading IPG values: %d", ret);
-   return ret;
-   }
-
-   for(i = 0;i < 3;i++) {
-   ax8817x_write_cmd(dev, AX_CMD_WRITE_IPG0 + i, 0, 0, 1, &buf[i]);
-   }
-
/* Get the PHY id */
if ((ret = ax8817x_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf)) < 0) {
dbg("error on read AX_CMD_READ_PHY_ID: %02x", ret);
@@ -732,9 +743,12 @@
dev->net->set_multicast_list = ax8817x_set_multicast;
 
usbnet_ethtool_ops.get_drvinfo = &ax8817x_get_drvinfo;
+   usbnet_ethtool_ops.get_link = &ax8817x_get_link;
usbnet_ethtool_ops.get_wol = &ax8817x_get_wol;
usbnet_ethtool_ops.set_wol = &ax8817x_set_wol;
usbnet_ethtool_ops.get_eeprom = &ax8817x_get_eeprom;
+   usbnet_ethtool_ops.get_settings = &ax8817x_get_settings;
+   usbnet_ethtool_ops.set_settings = &ax8817x_set_settings;
 
return 0;
 }



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.43, 2003/12/12 10:02:24-08:00, [EMAIL PROTECTED]

[PATCH] USB: add support for another pl2303 device

Info came from John Zhuge <[EMAIL PROTECTED]>


 drivers/usb/serial/pl2303.c |1 +
 drivers/usb/serial/pl2303.h |1 +
 2 files changed, 2 insertions(+)


diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
--- a/drivers/usb/serial/pl2303.c   Mon Dec 29 14:22:12 2003
+++ b/drivers/usb/serial/pl2303.c   Mon Dec 29 14:22:12 2003
@@ -71,6 +71,7 @@
{ USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_RSAQ2) },
{ USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
{ USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) },
+   { USB_DEVICE(ATEN_VENDOR_ID2, ATEN_PRODUCT_ID) },
{ USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) },
{ USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID) },
{ USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) },
diff -Nru a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
--- a/drivers/usb/serial/pl2303.h   Mon Dec 29 14:22:12 2003
+++ b/drivers/usb/serial/pl2303.h   Mon Dec 29 14:22:12 2003
@@ -12,6 +12,7 @@
 #define PL2303_PRODUCT_ID_RSAQ20x04bb
 
 #define ATEN_VENDOR_ID 0x0557
+#define ATEN_VENDOR_ID20x0547
 #define ATEN_PRODUCT_ID0x2008
 
 #define IODATA_VENDOR_ID   0x04bb



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.7, 2003/12/05 11:07:06-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Fix logic error in raw_bulk.c:us_copy_to_sgbuf()

This patch fixes a simple logic error in the routine that copies data from
a driver buffer to a scatter-gather user buffer.


 drivers/usb/storage/raw_bulk.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/storage/raw_bulk.c b/drivers/usb/storage/raw_bulk.c
--- a/drivers/usb/storage/raw_bulk.cMon Dec 29 14:26:24 2003
+++ b/drivers/usb/storage/raw_bulk.cMon Dec 29 14:26:24 2003
@@ -96,7 +96,7 @@
length = room;

memcpy(ptr, buffer+transferred, length);
-   transferred += sg[i].length;
+   transferred += length;
*offset += length;
if (length == room) {
i++;



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.36, 2003/12/11 16:25:56-08:00, [EMAIL PROTECTED]

[PATCH] USB Storage: freecom dvd-rw fx-50 usb-ide patch


 drivers/usb/storage/unusual_devs.h |5 +
 1 files changed, 5 insertions(+)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:59 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:59 2003
@@ -475,6 +475,11 @@
"Freecom",
"USB-IDE",
US_SC_QIC, US_PR_FREECOM, freecom_init, 0),
+
+UNUSUAL_DEV(  0x07ab, 0xfc84, 0x, 0x,
+   "Freecom",
+   "FX-5/FX-50",
+   US_SC_QIC, US_PR_FREECOM, freecom_init, 0),
 #endif
 
 UNUSUAL_DEV(  0x07af, 0x0004, 0x0100, 0x0133, 



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.10, 2003/12/08 17:08:03-08:00, [EMAIL PROTECTED]

[PATCH] USB: Fix khubd synchronization

It improves synchronization with hub_irq() and guarantees that the hub
disconnect() routine doesn't exit until the URB's completion routine has
finished.


 drivers/usb/core/hub.c |   22 ++
 drivers/usb/core/hub.h |2 ++
 2 files changed, 20 insertions(+), 4 deletions(-)


diff -Nru a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.cMon Dec 29 14:25:54 2003
+++ b/drivers/usb/core/hub.cMon Dec 29 14:25:54 2003
@@ -128,11 +128,18 @@
struct usb_hub *hub = (struct usb_hub *)urb->context;
int status;
 
+   spin_lock(&hub_event_lock);
+   hub->urb_active = 0;
+   if (hub->urb_complete) {/* disconnect or rmmod */
+   complete(hub->urb_complete);
+   goto done;
+   }
+
switch (urb->status) {
case -ENOENT:   /* synchronous unlink */
case -ECONNRESET:   /* async unlink */
case -ESHUTDOWN:/* hardware going away */
-   return;
+   goto done;
 
default:/* presumably an error */
/* Cause a hub reset after 10 consecutive errors */
@@ -150,18 +157,20 @@
hub->nerrors = 0;
 
/* Something happened, let khubd figure it out */
-   spin_lock(&hub_event_lock);
if (list_empty(&hub->event_list)) {
list_add(&hub->event_list, &hub_event_list);
wake_up(&khubd_wait);
}
-   spin_unlock(&hub_event_lock);
 
 resubmit:
if ((status = usb_submit_urb (hub->urb, GFP_ATOMIC)) != 0
/* ENODEV means we raced disconnect() */
&& status != -ENODEV)
dev_err (&hub->intf->dev, "resubmit --> %d\n", urb->status);
+   if (status == 0)
+   hub->urb_active = 1;
+done:
+   spin_unlock(&hub_event_lock);
 }
 
 /* USB 2.0 spec Section 11.24.2.3 */
@@ -466,7 +475,8 @@
message = "couldn't submit status urb";
goto fail;
}
-   
+   hub->urb_active = 1;
+
/* Wake up khubd */
wake_up(&khubd_wait);
 
@@ -484,6 +494,7 @@
 static void hub_disconnect(struct usb_interface *intf)
 {
struct usb_hub *hub = usb_get_intfdata (intf);
+   DECLARE_COMPLETION(urb_complete);
unsigned long flags;
 
if (!hub)
@@ -491,6 +502,7 @@
 
usb_set_intfdata (intf, NULL);
spin_lock_irqsave(&hub_event_lock, flags);
+   hub->urb_complete = &urb_complete;
 
/* Delete it and then reset it */
list_del_init(&hub->event_list);
@@ -507,6 +519,8 @@
 
if (hub->urb) {
usb_unlink_urb(hub->urb);
+   if (hub->urb_active)
+   wait_for_completion(&urb_complete);
usb_free_urb(hub->urb);
hub->urb = NULL;
}
diff -Nru a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h
--- a/drivers/usb/core/hub.hMon Dec 29 14:25:54 2003
+++ b/drivers/usb/core/hub.hMon Dec 29 14:25:54 2003
@@ -172,6 +172,8 @@
 struct usb_hub {
struct usb_interface*intf;  /* the "real" device */
struct urb  *urb;   /* for interrupt polling pipe */
+   struct completion   *urb_complete;  /* wait for urb to end */
+   unsigned inturb_active:1;
 
/* buffer for urb ... 1 bit each for hub and children, rounded up */
char(*buffer)[(USB_MAXCHILDREN + 1 + 7) / 8];



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.6, 2003/12/05 11:06:53-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Issue CBI clear_halt and fix BBB residue

This patch does 2 things (bad, I know -- but they're both pretty small
and pretty obscure).

The CBI specification states in section 2.4.3.1.3 that

... the host shall also issue Clear Feature for Endpoint Halt
to the Bulk In pipe if the device reports that the Data In
command block has Failed.

along with a note in section 2.5.3 that Data Out commands should work
analogously.  This patch does that, along with cleaning up the status
detection logic a little.

For Bulk-only transfers we currently ignore the dResidue field in the CSW,
except for reporting it (without byte-swapping!) in a debug message.  The
patch uses it to compute the residue value returned to the SCSI layer.
Note that the Bulk-only spec allows devices to transfer more data than
they actually use (i.e., they may add padding or ignore stuff) and then
inform the host of this by means of the dResidue value.  The logic used is
simple: our reported residue is the larger of what the device claims and
what we didn't transfer, except that it can't be larger than the total
transfer length.


 drivers/usb/storage/transport.c |   37 +++--
 1 files changed, 23 insertions(+), 14 deletions(-)


diff -Nru a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
--- a/drivers/usb/storage/transport.c   Mon Dec 29 14:26:35 2003
+++ b/drivers/usb/storage/transport.c   Mon Dec 29 14:26:35 2003
@@ -760,6 +760,7 @@
 int usb_stor_CBI_transport(Scsi_Cmnd *srb, struct us_data *us)
 {
unsigned int transfer_length = srb->request_bufflen;
+   unsigned int pipe = 0;
int result;
 
/* COMMAND STAGE */
@@ -785,7 +786,7 @@
/* DATA STAGE */
/* transfer the data payload for this command, if one exists*/
if (transfer_length) {
-   unsigned int pipe = srb->sc_data_direction == SCSI_DATA_READ ? 
+   pipe = srb->sc_data_direction == SCSI_DATA_READ ? 
us->recv_bulk_pipe : us->send_bulk_pipe;
result = usb_stor_bulk_transfer_sg(us, pipe,
srb->request_buffer, transfer_length,
@@ -813,12 +814,9 @@
if (srb->cmnd[0] == REQUEST_SENSE ||
srb->cmnd[0] == INQUIRY)
return USB_STOR_TRANSPORT_GOOD;
-   else {
-   if (us->iobuf[0])
-   return USB_STOR_TRANSPORT_FAILED;
-   else
-   return USB_STOR_TRANSPORT_GOOD;
-   }
+   if (us->iobuf[0])
+   goto Failed;
+   return USB_STOR_TRANSPORT_GOOD;
}
 
/* If not UFI, we interpret the data as a result code 
@@ -835,13 +833,17 @@
case 0x00: 
return USB_STOR_TRANSPORT_GOOD;
case 0x01: 
-   return USB_STOR_TRANSPORT_FAILED;
-   default: 
-   return USB_STOR_TRANSPORT_ERROR;
+   goto Failed;
}
-
-   /* we should never get here, but if we do, we're in trouble */
return USB_STOR_TRANSPORT_ERROR;
+
+   /* the CBI spec requires that the bulk pipe must be cleared
+* following any data-in/out command failure (section 2.4.3.1.3)
+*/
+  Failed:
+   if (pipe)
+   usb_stor_clear_halt(us, pipe);
+   return USB_STOR_TRANSPORT_FAILED;
 }
 
 /*
@@ -924,6 +926,7 @@
struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
struct bulk_cs_wrap *bcs = (struct bulk_cs_wrap *) us->iobuf;
unsigned int transfer_length = srb->request_bufflen;
+   unsigned int residue;
int result;
int fake_sense = 0;
 
@@ -999,9 +1002,10 @@
return USB_STOR_TRANSPORT_ERROR;
 
/* check bulk status */
-   US_DEBUGP("Bulk Status S 0x%x T 0x%x R %d Stat 0x%x\n",
+   residue = le32_to_cpu(bcs->Residue);
+   US_DEBUGP("Bulk Status S 0x%x T 0x%x R %u Stat 0x%x\n",
le32_to_cpu(bcs->Signature), bcs->Tag, 
-   bcs->Residue, bcs->Status);
+   residue, bcs->Status);
if ((bcs->Signature != cpu_to_le32(US_BULK_CS_SIGN) &&
bcs->Signature != cpu_to_le32(US_BULK_CS_OLYMPUS_SIGN)) ||
bcs->Tag != srb->serial_number || 
@@ -1009,6 +1013,11 @@
US_DEBUGP("Bulk logical error\n");
return USB_STOR_TRANSPORT_ERROR;
}
+
+   /* try to compute the actual residue, based on how much data
+* was really transferred and what the device tells us */
+   residue = min(residue, transfer_length);
+   srb->resid = max(srb->resid, (int) residue);
 
/* based on the status code, we report good or bad

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.39, 2003/12/11 17:07:51-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Minolta Dimage S414 usb patch

here I submitt you the vendor/id patch for the
Minolta Dimage S414 Camera,
which runs fine with the usb under linux.

cat /proc/bus/usb/device ->


 drivers/usb/storage/unusual_devs.h |7 +++
 1 files changed, 7 insertions(+)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:39 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:39 2003
@@ -45,6 +45,13 @@
  *
  */
 
+/* Patch submitted by Martin Berentsen  */
+#define US_FL_START_STOP  0x0004   /* ignore START_STOP commands */
+UNUSUAL_DEV(  0x0686, 0x4014, 0x0001, 0x0001, 
+   "Minolta",
+   "Dimage S414",
+   US_SC_SCSI, US_PR_BULK, NULL, US_FL_START_STOP), 
+
 UNUSUAL_DEV(  0x03ee, 0x, 0x, 0x0245, 
"Mitsumi",
"CD-R/RW Drive",



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.4, 2003/12/05 10:58:30-08:00, [EMAIL PROTECTED]

[PATCH] USB: add TIOCMIWAIT support to pl2303 driver


 drivers/usb/serial/pl2303.c |   43 +++
 1 files changed, 43 insertions(+)


diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
--- a/drivers/usb/serial/pl2303.c   Mon Dec 29 14:26:47 2003
+++ b/drivers/usb/serial/pl2303.c   Mon Dec 29 14:26:47 2003
@@ -169,6 +169,7 @@
 
 struct pl2303_private {
spinlock_t lock;
+   wait_queue_head_t delta_msr_wait;
u8 line_control;
u8 line_status;
u8 termios_initialized;
@@ -186,6 +187,7 @@
return -ENOMEM;
memset (priv, 0x00, sizeof (struct pl2303_private));
spin_lock_init(&priv->lock);
+   init_waitqueue_head(&priv->delta_msr_wait);
usb_set_serial_port_data(serial->port[i], priv);
}
return 0;
@@ -556,11 +558,51 @@
return result;
 }
 
+static int wait_modem_info(struct usb_serial_port *port, unsigned int arg)
+{
+   struct pl2303_private *priv = usb_get_serial_port_data(port);
+   unsigned long flags;
+   unsigned int prevstatus;
+   unsigned int status;
+   unsigned int changed;
+
+   spin_lock_irqsave (&priv->lock, flags);
+   prevstatus = priv->line_status;
+   spin_unlock_irqrestore (&priv->lock, flags);
+
+   while (1) {
+   interruptible_sleep_on(&priv->delta_msr_wait);
+   /* see if a signal did it */
+   if (signal_pending(current))
+   return -ERESTARTSYS;
+   
+   spin_lock_irqsave (&priv->lock, flags);
+   status = priv->line_status;
+   spin_unlock_irqrestore (&priv->lock, flags);
+   
+   changed=prevstatus^status;
+   
+   if (((arg & TIOCM_RNG) && (changed & UART_RING)) ||
+   ((arg & TIOCM_DSR) && (changed & UART_DSR)) ||
+   ((arg & TIOCM_CD)  && (changed & UART_DCD)) ||
+   ((arg & TIOCM_CTS) && (changed & UART_CTS)) ) {
+   return 0;
+   }
+   prevstatus = status;
+   }
+   /* NOTREACHED */
+   return 0;
+}
+
 static int pl2303_ioctl (struct usb_serial_port *port, struct file *file, unsigned 
int cmd, unsigned long arg)
 {
dbg("%s (%d) cmd = 0x%04x", __FUNCTION__, port->number, cmd);
 
switch (cmd) {
+   case TIOCMIWAIT:
+   dbg("%s (%d) TIOCMIWAIT", __FUNCTION__,  port->number);
+   return wait_modem_info(port, arg);
+
default:
dbg("%s not supported = 0x%04x", __FUNCTION__, cmd);
break;
@@ -703,6 +745,7 @@
spin_lock_irqsave(&priv->lock, flags);
status = priv->line_status;
spin_unlock_irqrestore(&priv->lock, flags);
+   wake_up_interruptible (&priv->delta_msr_wait);
 
/* break takes precedence over parity, */
/* which takes precedence over framing errors */



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.35, 2003/12/11 16:24:48-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: unusual_devs.h entry revision

Here is another update for unusual_devs.h in both 2.6 and 2.4.  No
urgency.


On Wed, 12 Nov 2003, Aris Basic wrote:

> Device Sony Memory Stick Reader MSAC-US1
> usb-storage: This device (054c,002d,0100 S 04 P 01) has unneeded SubClass and 
> Protocol entries in unusual_devs.h
>Please send a copy of this message to <[EMAIL PROTECTED]>

Thanks for sending this in.


 drivers/usb/storage/unusual_devs.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:05 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:05 2003
@@ -263,7 +263,7 @@
 UNUSUAL_DEV(  0x054c, 0x002d, 0x0100, 0x0100, 
"Sony",
"Memorystick MSAC-US1",
-   US_SC_UFI, US_PR_CB, NULL,
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_SINGLE_LUN ),
 
 /* Submitted by Klaus Mueller <[EMAIL PROTECTED]> */



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1337.3.3, 2003/10/09 10:45:51-07:00, [EMAIL PROTECTED]

[PATCH] USB: fix up formatting problems in the legotower driver

Basically fixed up spaces to tabs problems.


 drivers/usb/misc/legousbtower.c |  264 +++-
 1 files changed, 128 insertions(+), 136 deletions(-)


diff -Nru a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
--- a/drivers/usb/misc/legousbtower.c   Mon Dec 29 14:27:55 2003
+++ b/drivers/usb/misc/legousbtower.c   Mon Dec 29 14:27:55 2003
@@ -1,7 +1,7 @@
 /*
  * LEGO USB Tower driver
  *
- * Copyright (c) 2003 David Glance <[EMAIL PROTECTED]> 
+ * Copyright (C) 2003 David Glance <[EMAIL PROTECTED]> 
  *   2001 Juergen Stuber <[EMAIL PROTECTED]>
  *
  * This program is free software; you can redistribute it and/or
@@ -10,7 +10,7 @@
  * the License, or (at your option) any later version.
  *
  * derived from USB Skeleton driver - 0.5
- * Copyright (c) 2001 Greg Kroah-Hartman ([EMAIL PROTECTED])
+ * Copyright (C) 2001 Greg Kroah-Hartman ([EMAIL PROTECTED])
  *
  * History:
  *
@@ -127,10 +127,6 @@
  * interrupt_in_buffer belongs to urb alone and is overwritten on overflow
  */
 
-/* the global usb devfs handle */
-// extern devfs_handle_t usb_devfs_handle;
-
-
 /* local function prototypes */
 static ssize_t tower_read  (struct file *file, char *buffer, size_t count, loff_t 
*ppos);
 static ssize_t tower_write (struct file *file, const char *buffer, size_t count, 
loff_t *ppos);
@@ -212,7 +208,7 @@
/* free data structures */
if (dev->interrupt_in_urb != NULL) {
usb_free_urb (dev->interrupt_in_urb);
-   }
+   }
if (dev->interrupt_out_urb != NULL) {
usb_free_urb (dev->interrupt_out_urb);
}
@@ -240,7 +236,7 @@
int subminor;
int retval = 0;
struct usb_interface *interface;
-   
+
dbg(2,"%s : enter", __func__);
 
subminor = iminor(inode);
@@ -279,7 +275,7 @@
 
up (&dev->sem);
 
- exit_no_device:
+exit_no_device:
 
up (&disconnect_sem);
 
@@ -301,9 +297,9 @@
dev = (struct lego_usb_tower *)file->private_data;
 
if (dev == NULL) {
-   dbg(1," %s : object is NULL", __func__);
+   dbg(1," %s : object is NULL", __func__);
retval = -ENODEV;
-   goto exit;
+   goto exit;
}
 
 
@@ -319,7 +315,7 @@
/* do the work */
retval = tower_release_internal (dev);
 
- exit:
+exit:
up (&dev->sem);
dbg(2," %s : leave, return value %d", __func__, retval);
return retval;
@@ -344,11 +340,11 @@
/* decrement our usage count for the device */
--dev->open_count;
if (dev->open_count <= 0) {
-   tower_abort_transfers (dev);
+   tower_abort_transfers (dev);
dev->open_count = 0;
}
 
- exit:
+exit:
dbg(2," %s : leave", __func__);
return retval;
 }
@@ -369,13 +365,13 @@
 
/* shutdown transfer */
if (dev->interrupt_in_urb != NULL) {
-   usb_unlink_urb (dev->interrupt_in_urb);
+   usb_unlink_urb (dev->interrupt_in_urb);
}
if (dev->interrupt_out_urb != NULL) {
-   usb_unlink_urb (dev->interrupt_out_urb);
+   usb_unlink_urb (dev->interrupt_out_urb);
}
 
- exit:
+exit:
dbg(2," %s : leave", __func__);
 }
 
@@ -405,10 +401,10 @@
err("No device or device unplugged %d", retval);
goto exit;
}
-   
+
/* verify that we actually have some data to read */
if (count == 0) {
-   dbg(1," %s : read request of 0 bytes", __func__);
+   dbg(1," %s : read request of 0 bytes", __func__);
goto exit;
}
 
@@ -449,32 +445,30 @@
timeout = interruptible_sleep_on_timeout (&dev->read_wait, 
timeout);
down (&dev->sem);
 
-   } else {
-   /* copy the data from read_buffer into userspace */
-bytes_to_read = count > dev->read_buffer_length ? 
dev->read_buffer_length : count;
-if (copy_to_user (buffer, dev->read_buffer, bytes_to_read) != 
0) {
-retval = -EFAULT;
-goto exit;
-}
-dev->read_buffer_length -= bytes_to_read;
-for (i=0; iread_buffer_length; i++) {
-dev->read_buffer[i] = 
dev->read_buffer[i+bytes_to_read];
-}
-
-buffer += bytes_to_read;
-count -= bytes_to_read;
-bytes_read += bytes_to_read;
+   } else {
+   /* copy the data from read_buffer into userspace */
+   bytes_to_read = count

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.34, 2003/12/11 11:55:55-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: add unusual storage device entry for Minolta DiMAGE

Yes, it seems to work OK on the 7i with this updated patch.  I don't
have a 7 or 7Hi to try, but everything on the web seems to say the USB
firmware works the same way.


 drivers/usb/storage/unusual_devs.h |   22 ++
 1 files changed, 22 insertions(+)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:12 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:12 2003
@@ -412,6 +412,28 @@
 "DIMAGE E223",
 US_SC_SCSI, US_PR_DEVICE, NULL, 0 ),
 
+/* Following three Minolta cameras reported by Martin Pool
+ * <[EMAIL PROTECTED]>.  Originally discovered by Kedar Petankar,
+ * Matthew Geier, Mikael Lofj"ard, Marcel de Boer.
+ */
+UNUSUAL_DEV( 0x0686, 0x4006, 0x0001, 0x0001,
+ "Minolta",
+ "DiMAGE 7",
+ US_SC_SCSI, US_PR_DEVICE, NULL,
+ 0 ),
+
+UNUSUAL_DEV( 0x0686, 0x400b, 0x0001, 0x0001,
+ "Minolta",
+ "DiMAGE 7i",
+ US_SC_SCSI, US_PR_DEVICE, NULL,
+ 0 ),
+
+UNUSUAL_DEV( 0x0686, 0x400f, 0x0001, 0x0001,
+ "Minolta",
+ "DiMAGE 7Hi",
+ US_SC_SCSI, US_PR_DEVICE, NULL,
+ 0 ),
+
 UNUSUAL_DEV(  0x0693, 0x0002, 0x0100, 0x0100, 
"Hagiwara",
"FlashGate SmartMedia",



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.21, 2003/12/09 11:42:45-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Convert jumpshot to use the new s-g routines

This patch converts the jumpshot driver to use the new scatter-gather
routines.  It has not been tested.


 drivers/usb/storage/jumpshot.c |  106 +++--
 1 files changed, 51 insertions(+), 55 deletions(-)


diff -Nru a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
--- a/drivers/usb/storage/jumpshot.cMon Dec 29 14:24:40 2003
+++ b/drivers/usb/storage/jumpshot.cMon Dec 29 14:24:40 2003
@@ -48,7 +48,6 @@
   */
 
 #include "transport.h"
-#include "raw_bulk.h"
 #include "protocol.h"
 #include "usb.h"
 #include "debug.h"
@@ -111,15 +110,14 @@
  struct jumpshot_info *info,
  u32 sector,
  u32 sectors, 
- unsigned char *dest, 
+ unsigned char *buffer, 
  int use_sg)
 {
unsigned char *command = us->iobuf;
-   unsigned char *buffer = NULL;
-   unsigned char *ptr;
unsigned char  thistime;
-   int totallen, len, result;
-   int sg_idx = 0, current_sg_offset = 0;
+   unsigned int totallen, alloclen;
+   int len, result;
+   unsigned int sg_idx = 0, sg_offset = 0;
 
// we're working in LBA mode.  according to the ATA spec, 
// we can support up to 28-bit addressing.  I don't know if Jumpshot
@@ -131,20 +129,20 @@
 
totallen = sectors * info->ssize;
 
+   // Since we don't read more than 64 KB at a time, we have to create
+   // a bounce buffer if the transfer uses scatter-gather.
+
+   alloclen = min(totallen, 65536u);
+   if (use_sg) {
+   buffer = kmalloc(alloclen, GFP_NOIO);
+   if (buffer == NULL)
+   return USB_STOR_TRANSPORT_ERROR;
+   }
+
do {
// loop, never allocate or transfer more than 64k at once
// (min(128k, 255*info->ssize) is the real limit)
-   len = min_t(int, totallen, 65536);
-
-   if (use_sg) {
-   buffer = kmalloc(len, GFP_NOIO);
-   if (buffer == NULL)
-   return USB_STOR_TRANSPORT_ERROR;
-   ptr = buffer;
-   } else {
-   ptr = dest;
-   }
-
+   len = min(totallen, alloclen);
thistime = (len / info->ssize) & 0xff;
 
command[0] = 0;
@@ -163,26 +161,24 @@
goto leave;
 
// read the result
-   result = jumpshot_bulk_read(us, ptr, len);
+   result = jumpshot_bulk_read(us, buffer, len);
if (result != USB_STOR_XFER_GOOD)
goto leave;
 
US_DEBUGP("jumpshot_read_data:  %d bytes\n", len);
-   
-   sectors -= thistime;
-   sector  += thistime;
-
-   if (use_sg) {
-   us_copy_to_sgbuf(buffer, len, dest,
-&sg_idx, ¤t_sg_offset, use_sg);
-   kfree(buffer);
-   } else {
-   dest += len;
-   }
 
+   if (use_sg)
+   usb_stor_access_xfer_buf(buffer, len, us->srb,
+&sg_idx, &sg_offset, TO_XFER_BUF);
+   else
+   buffer += len;
+
+   sector += thistime;
totallen -= len;
} while (totallen > 0);
 
+   if (use_sg)
+   kfree(buffer);
return USB_STOR_TRANSPORT_GOOD;
 
  leave:
@@ -196,15 +192,14 @@
   struct jumpshot_info *info,
   u32 sector,
   u32 sectors, 
-  unsigned char *src, 
+  unsigned char *buffer, 
   int use_sg)
 {
unsigned char *command = us->iobuf;
-   unsigned char *buffer = NULL;
-   unsigned char *ptr;
unsigned char  thistime;
-   int totallen, len, result, waitcount;
-   int sg_idx = 0, sg_offset = 0;
+   unsigned int totallen, alloclen;
+   int len, result, waitcount;
+   unsigned int sg_idx = 0, sg_offset = 0;
 
// we're working in LBA mode.  according to the ATA spec, 
// we can support up to 28-bit addressing.  I don't know if Jumpshot
@@ -216,24 +211,27 @@
 
totallen = sectors * info->ssize;
 
-   do {
-   // loop, never allocate or transfer more than 64k at once
-   // (min(128k, 255*info->ssize) is the real limit)
-
-   len = min_t(int, totallen, 65536);
+   // Since we don't write more than 64 KB at a time, we have to create
+   // a bounce buffer if the t

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.50, 2003/12/12 14:33:47-08:00, [EMAIL PROTECTED]

[PATCH] USB: pegasus driver update

  another vendor/deviceID added;
  HAS_HOME_PNA flag for ADM8511 devices - that should
  make HomePNA users happy;


 drivers/usb/net/pegasus.h |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/net/pegasus.h b/drivers/usb/net/pegasus.h
--- a/drivers/usb/net/pegasus.h Mon Dec 29 14:21:23 2003
+++ b/drivers/usb/net/pegasus.h Mon Dec 29 14:21:23 2003
@@ -137,6 +137,7 @@
 #defineVENDOR_MELCO0x0411
 #defineVENDOR_MOBILITY 0x1342
 #defineVENDOR_NETGEAR  0x0846
+#defineVENDOR_OCT  0x0b39
 #defineVENDOR_SMARTBRIDGES 0x08d1
 #defineVENDOR_SMC  0x0707
 #defineVENDOR_SOHOWARE 0x15e8
@@ -173,7 +174,7 @@
DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "ADMtek ADM8511 \"Pegasus II\" USB Ethernet",
VENDOR_ADMTEK, 0x8511,
-   DEFAULT_GPIO_RESET | PEGASUS_II )
+   DEFAULT_GPIO_RESET | PEGASUS_II | HAS_HOME_PNA )
 PEGASUS_DEV( "ADMtek ADM8513 \"Pegasus II\" USB Ethernet",
VENDOR_ADMTEK, 0x8513,
DEFAULT_GPIO_RESET | PEGASUS_II )
@@ -259,6 +260,8 @@
 PEGASUS_DEV( "MELCO/BUFFALO LUA2-TX", VENDOR_MELCO, 0x0009,
DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "NETGEAR FA101", VENDOR_NETGEAR, 0x1020,
+   DEFAULT_GPIO_RESET | PEGASUS_II )
+PEGASUS_DEV( "OCT Inc.", VENDOR_OCT, 0x0109,
DEFAULT_GPIO_RESET | PEGASUS_II )
 PEGASUS_DEV( "smartNIC 2 PnP Adapter", VENDOR_SMARTBRIDGES, 0x0003,
DEFAULT_GPIO_RESET | PEGASUS_II )



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.33, 2003/12/11 11:51:43-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: patch for Kyocera S5 camera

I've seen some entries in 2.4.22 and 2.6.0 unusual_devs.h
for Kyocera Finecam S3 et S4 cameras and I own a Finecam S5
that does not work out of the box either
(here is the beast : http://www.yashica.com/digital/finecams5/finecams5.html)

so I found the unusual_devs.h entry and submitted it some month
ago at http://www.qbik.ch/usb/devices/showdev.php?id=1626
for the 2.4 kernels

I thought It would be nice to have the whole Finecam family
in Unusual_devs.h for 2.6.0

The patch for the 2.6.0-test9 is attached with this mail

It differs from the entry I submitted at www.qbik.ch
as I used the new SC/PR_DEVICE flags and got rid of the
IGNORE_SER flag from 2.4

Do you want a patch for 2.4 too ? If so, I should test my
old 2.4 entry with the lastest 2.4 Kernels, coz on a daily
basis I use a 2.4.20, which is rather old. Moreover, I could
used the SC/PR_DEVICE flags too for 2.4.22 (keeping the IGNORE_SER flag
though)


By the way, several entries with the running patch :

/proc/bus/usb/devices :

T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0482 ProdID=0103 Rev= 1.00
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=  2mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:  If#= 0 Alt= 1 #EPs= 3 Cls=ff(vend.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=83(I) Atr=03(Int.) MxPS=   8 Ivl=32ms


 drivers/usb/storage/unusual_devs.h |6 ++
 1 files changed, 6 insertions(+)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:19 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:19 2003
@@ -102,6 +102,12 @@
"Finecam S4",
US_SC_8070, US_PR_CB, NULL, US_FL_FIX_INQUIRY),
 
+/* Patch submitted by Stephane Galles <[EMAIL PROTECTED]> */
+UNUSUAL_DEV(  0x0482, 0x0103, 0x0100, 0x0100,
+   "Kyocera",
+   "Finecam S5",
+   US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY),
+
 /* Reported by Paul Stewart <[EMAIL PROTECTED]>
  * This entry is needed because the device reports Sub=ff */
 UNUSUAL_DEV(  0x04a4, 0x0004, 0x0001, 0x0001,



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.3, 2003/12/04 15:14:51-08:00, [EMAIL PROTECTED]

[PATCH] USB: fix comment in usblp

I know Linus is not taking cleanups at this point, but perhaps
you can delete it in your tree. Seems like someone (Oliver?)
fixed all the garbage in old printer.c, so the comment is not
needed anymore.

I reviewed changes, and usblp.c looks correct. I'm doing backport
to 2.4 for Fedora right now.


 drivers/usb/class/usblp.c |2 --
 1 files changed, 2 deletions(-)


diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
--- a/drivers/usb/class/usblp.c Mon Dec 29 14:26:53 2003
+++ b/drivers/usb/class/usblp.c Mon Dec 29 14:26:53 2003
@@ -706,8 +706,6 @@
goto done;
}
 
-   // FIXME:  only use urb->status inside completion
-   // callbacks; this way is racey...
add_wait_queue(&usblp->wait, &wait);
while (1==1) {
if (signal_pending(current)) {



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.32, 2003/12/11 11:48:40-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: patch for Fujifilm EX-20


 drivers/usb/storage/unusual_devs.h |6 ++
 1 files changed, 6 insertions(+)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:25 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:25 2003
@@ -298,6 +298,12 @@
US_SC_DEVICE,  US_PR_DEVICE, NULL,
US_FL_SINGLE_LUN),
 
+/* Fabrizio Fellini <[EMAIL PROTECTED]> */
+UNUSUAL_DEV(  0x0595, 0x4343, 0x, 0x2210,
+   "Fujifilm",
+   "Digital Camera EX-20 DSC",
+   US_SC_8070, US_PR_CBI, NULL, 0 ),
+
 UNUSUAL_DEV(  0x059f, 0xa601, 0x0200, 0x0200, 
"LaCie",
"USB Hard Disk",



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.8, 2003/12/05 11:14:07-08:00, [EMAIL PROTECTED]

[PATCH] USB: ohci, fix iso "bad entry" bug + misc

A while back there were some reports of ohci reporting a "bad entry"
diagnostic, mostly with ISO transfers, which were mysterious until
I recently found an easy way to reproduce it.

This patch:

  - Fixes at least one cause of that "bad entry" diagnostic by
waiting for INTR_WDH before completing ED unlink processing.
(Else URB unlinking could free TDs on the donelist, so the
WDH processing would see those entries as "bad".)

  - Merges the patch from Darwin Rambo <[EMAIL PROTECTED]>,
coping with CPUs that can't do 16 bit accesses (MIPS).

  - Renames a function as start_ed_unlink(), matching its role.

  - Fixes minor debug output issues, including a FIXME to tell
more info about TDs on the periodic schedule.  And adding
some missing newlines (makes this patch seem big).

Nobody's complained much about that "bad entry" issue lately, but
if necessary that part would be particularly easy to split out.

Please merge to the next kernel that gets USB patches.


 drivers/usb/host/ohci-dbg.c |   43 +--
 drivers/usb/host/ohci-hcd.c |8 
 drivers/usb/host/ohci-q.c   |   32 
 drivers/usb/host/ohci.h |   10 --
 4 files changed, 61 insertions(+), 32 deletions(-)


diff -Nru a/drivers/usb/host/ohci-dbg.c b/drivers/usb/host/ohci-dbg.c
--- a/drivers/usb/host/ohci-dbg.c   Mon Dec 29 14:26:11 2003
+++ b/drivers/usb/host/ohci-dbg.c   Mon Dec 29 14:26:11 2003
@@ -269,18 +269,19 @@
ohci_dump_status (controller, NULL, 0);
if (controller->hcca)
ohci_dbg (controller,
-   "hcca frame #%04x\n", controller->hcca->frame_no);
+   "hcca frame #%04x\n", OHCI_FRAME_NO(controller->hcca));
ohci_dump_roothub (controller, 1, NULL, 0);
 }
 
 static const char data0 [] = "DATA0";
 static const char data1 [] = "DATA1";
 
-static void ohci_dump_td (struct ohci_hcd *ohci, char *label, struct td *td)
+static void ohci_dump_td (const struct ohci_hcd *ohci, const char *label,
+   const struct td *td)
 {
u32 tmp = le32_to_cpup (&td->hwINFO);
 
-   ohci_dbg (ohci, "%s td %p%s; urb %p index %d; hw next td %08x",
+   ohci_dbg (ohci, "%s td %p%s; urb %p index %d; hw next td %08x\n",
label, td,
(tmp & TD_DONE) ? " (DONE)" : "",
td->urb, td->index,
@@ -301,28 +302,28 @@
case TD_DP_OUT: pid = "OUT"; break;
default: pid = "(bad pid)"; break;
}
-   ohci_dbg (ohci, " info %08x CC=%x %s DI=%d %s %s", tmp,
+   ohci_dbg (ohci, " info %08x CC=%x %s DI=%d %s %s\n", tmp,
TD_CC_GET(tmp), /* EC, */ toggle,
(tmp & TD_DI) >> 21, pid,
(tmp & TD_R) ? "R" : "");
cbp = le32_to_cpup (&td->hwCBP);
be = le32_to_cpup (&td->hwBE);
-   ohci_dbg (ohci, " cbp %08x be %08x (len %d)", cbp, be,
+   ohci_dbg (ohci, " cbp %08x be %08x (len %d)\n", cbp, be,
cbp ? (be + 1 - cbp) : 0);
} else {
unsignedi;
-   ohci_dbg (ohci, " info %08x CC=%x FC=%d DI=%d SF=%04x", tmp,
+   ohci_dbg (ohci, "  info %08x CC=%x FC=%d DI=%d SF=%04x\n", tmp,
TD_CC_GET(tmp),
(tmp >> 24) & 0x07,
(tmp & TD_DI) >> 21,
tmp & 0x);
-   ohci_dbg (ohci, " bp0 %08x be %08x",
+   ohci_dbg (ohci, "  bp0 %08x be %08x\n",
le32_to_cpup (&td->hwCBP) & ~0x0fff,
le32_to_cpup (&td->hwBE));
for (i = 0; i < MAXPSW; i++) {
u16 psw = le16_to_cpup (&td->hwPSW [i]);
int cc = (psw >> 12) & 0x0f;
-   ohci_dbg (ohci, "   psw [%d] = %2x, CC=%x %s=%d", i,
+   ohci_dbg (ohci, "psw [%d] = %2x, CC=%x %s=%d\n", i,
psw, cc,
(cc >= 0x0e) ? "OFFSET" : "SIZE",
psw & 0x0fff);
@@ -332,12 +333,13 @@
 
 /* caller MUST own hcd spinlock if verbose is set! */
 static void __attribute__((unused))
-ohci_dump_ed (struct ohci_hcd *ohci, char *label, struct ed *ed, int verbose)
+ohci_dump_ed (const struct ohci_hcd *ohci, const char *label,
+   const struct ed *ed, int verbose)
 {
u32 tmp = ed->hwINFO;
char*type = "";
 
-   ohci_dbg (ohci, "%s, ed %p state 0x%x type %s; next ed %08x",
+   ohci_dbg (ohci, "%s, ed %p state 0x%x type %s; next ed %08x\n",
label,
ed, ed->state, edstring (ed->type),
   

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.27, 2003/12/09 11:48:52-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Add comments explaining new s-g usage

On Sun, 30 Nov 2003, Matthew Dharm wrote:
> I'm going to pass this one along to Greg, but I think some places in this
> could really use some better comments.  Especially the way you use a single
> buffer inside the loop -- it took me a few minutes to figure out how your
> logic to refresh the buffer with new data worked.
>
> I'm also wondering if the access_xfer_buf() function could use some more
> header comments, stating why this is needed (i.e. spelling out the
> kmap()-isms).

Okay, here it is.  This patch basically just adds comments.  Each routine
that uses the new scatter-gather function gets a brief explanation of
what's going on, and access_xfer_buf() itself gets detailed comments
saying what it's doing and why it's necessary.  You may even want to cut
some of it back; I was pretty verbose.


 drivers/usb/storage/datafab.c   |   15 +--
 drivers/usb/storage/jumpshot.c  |   15 +--
 drivers/usb/storage/protocol.c  |   34 +++---
 drivers/usb/storage/sddr09.c|   17 +++--
 drivers/usb/storage/sddr55.c|   17 +++--
 drivers/usb/storage/shuttle_usbat.c |   10 --
 6 files changed, 95 insertions(+), 13 deletions(-)


diff -Nru a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c
--- a/drivers/usb/storage/datafab.c Mon Dec 29 14:23:59 2003
+++ b/drivers/usb/storage/datafab.c Mon Dec 29 14:23:59 2003
@@ -116,7 +116,11 @@
totallen = sectors * info->ssize;
 
// Since we don't read more than 64 KB at a time, we have to create
-   // a bounce buffer if the transfer uses scatter-gather.
+   // a bounce buffer if the transfer uses scatter-gather.  We will
+   // move the data a piece at a time between the bounce buffer and
+   // the actual transfer buffer.  If we're not using scatter-gather,
+   // we can simply update the transfer buffer pointer to get the
+   // same effect.
 
alloclen = min(totallen, 65536u);
if (use_sg) {
@@ -153,6 +157,7 @@
if (result != USB_STOR_XFER_GOOD)
goto leave;
 
+   // Store the data (s-g) or update the pointer (!s-g)
if (use_sg)
usb_stor_access_xfer_buf(buffer, len, us->srb,
 &sg_idx, &sg_offset, TO_XFER_BUF);
@@ -205,7 +210,11 @@
totallen = sectors * info->ssize;
 
// Since we don't write more than 64 KB at a time, we have to create
-   // a bounce buffer if the transfer uses scatter-gather.
+   // a bounce buffer if the transfer uses scatter-gather.  We will
+   // move the data a piece at a time between the bounce buffer and
+   // the actual transfer buffer.  If we're not using scatter-gather,
+   // we can simply update the transfer buffer pointer to get the
+   // same effect.
 
alloclen = min(totallen, 65536u);
if (use_sg) {
@@ -221,6 +230,7 @@
len = min(totallen, alloclen);
thistime = (len / info->ssize) & 0xff;
 
+   // Get the data from the transfer buffer (s-g)
if (use_sg)
usb_stor_access_xfer_buf(buffer, len, us->srb,
&sg_idx, &sg_offset, FROM_XFER_BUF);
@@ -259,6 +269,7 @@
goto leave;
}
 
+   // Update the transfer buffer pointer (!s-g)
if (!use_sg)
buffer += len;
 
diff -Nru a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
--- a/drivers/usb/storage/jumpshot.cMon Dec 29 14:23:59 2003
+++ b/drivers/usb/storage/jumpshot.cMon Dec 29 14:23:59 2003
@@ -130,7 +130,11 @@
totallen = sectors * info->ssize;
 
// Since we don't read more than 64 KB at a time, we have to create
-   // a bounce buffer if the transfer uses scatter-gather.
+   // a bounce buffer if the transfer uses scatter-gather.  We will
+   // move the data a piece at a time between the bounce buffer and
+   // the actual transfer buffer.  If we're not using scatter-gather,
+   // we can simply update the transfer buffer pointer to get the
+   // same effect.
 
alloclen = min(totallen, 65536u);
if (use_sg) {
@@ -167,6 +171,7 @@
 
US_DEBUGP("jumpshot_read_data:  %d bytes\n", len);
 
+   // Store the data (s-g) or update the pointer (!s-g)
if (use_sg)
usb_stor_access_xfer_buf(buffer, len, us->srb,
 &sg_idx, &sg_offset, TO_XFER_BUF);
@@ -212,7 +217,11 @@
totallen = sectors * info->ssize;
 
// Since we don't write more than 64 KB at a time, we have to create
-   // a bounce buffer if the transfer uses scatt

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.2, 2003/12/04 15:11:34-08:00, [EMAIL PROTECTED]

[PATCH] USB: change cdc-acm to do RX URB processing in a tasklet

Just for cdc-acm, it pushes RX URB processing into a tasklet;
and has minor cleanups.

I cc'd Vojtech since he's this driver's maintainer.  If this
checks out, usb-serial will need similar changes.


p.s. the issue is a WARN_ON that tells us:

   >> [] local_bh_enable+0x8c/0x90
   >> [] ppp_asynctty_receive+0x62/0xb0 [ppp_async]
   >> [] flush_to_ldisc+0xa3/0x120
   >> [] acm_read_bulk+0xbf/0x140 [cdc_acm]
   >> [] usb_hcd_giveback_urb+0x29/0x50
   >> [] dl_done_list+0x11c/0x130
   >> [] ohci_irq+0x85/0x170
   >> [] usb_hcd_irq+0x36/0x60
   >> [] handle_IRQ_event+0x3a/0x70
   >> [] do_IRQ+0x97/0x140
   >> [] common_interrupt+0x18/0x20


 drivers/usb/class/cdc-acm.c |   42 ++
 1 files changed, 30 insertions(+), 12 deletions(-)


diff -Nru a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
--- a/drivers/usb/class/cdc-acm.c   Mon Dec 29 14:26:59 2003
+++ b/drivers/usb/class/cdc-acm.c   Mon Dec 29 14:26:59 2003
@@ -1,5 +1,5 @@
 /*
- * acm.c  Version 0.22
+ * cdc-acm.c
  *
  * Copyright (c) 1999 Armin Fuerst <[EMAIL PROTECTED]>
  * Copyright (c) 1999 Pavel Machek <[EMAIL PROTECTED]>
@@ -26,6 +26,7 @@
  * v0.21 - revert to probing on device for devices with multiple configs
  * v0.22 - probe only the control interface. if usbcore doesn't choose the
  * config we want, sysadmin changes bConfigurationValue in sysfs.
+ * v0.23 - use softirq for rx processing, as needed by tty layer
  */
 
 /*
@@ -44,6 +45,8 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
+#undef DEBUG
+
 #include 
 #include 
 #include 
@@ -54,14 +57,13 @@
 #include 
 #include 
 #include 
-#undef DEBUG
 #include 
 #include 
 
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v0.21"
+#define DRIVER_VERSION "v0.23"
 #define DRIVER_AUTHOR "Armin Fuerst, Pavel Machek, Johannes Erdfelt, Vojtech Pavlik"
 #define DRIVER_DESC "USB Abstract Control Model driver for USB modems and ISDN 
adapters"
 
@@ -146,7 +148,8 @@
struct tty_struct *tty; /* the corresponding tty */
struct urb *ctrlurb, *readurb, *writeurb;   /* urbs */
struct acm_line line;   /* line coding (bits, stop, 
parity) */
-   struct work_struct work;/* work queue 
entry for line discipline waking up */
+   struct work_struct work;/* work queue entry for line 
discipline waking up */
+   struct tasklet_struct bh;   /* rx processing */
unsigned int ctrlin;/* input control lines (DCD, 
DSR, RI, break, overruns) */
unsigned int ctrlout;   /* output control lines (DTR, 
RTS) */
unsigned int writesize; /* max packet size for the 
output bulk endpoint */
@@ -184,9 +187,10 @@
 #define acm_send_break(acm, ms)acm_ctrl_msg(acm, ACM_REQ_SEND_BREAK, 
ms, NULL, 0)
 
 /*
- * Interrupt handler for various ACM control events
+ * Interrupt handlers for various ACM device responses
  */
 
+/* control interface reports status changes with "interrupt" transfers */
 static void acm_ctrl_irq(struct urb *urb, struct pt_regs *regs)
 {
struct acm *acm = urb->context;
@@ -251,20 +255,30 @@
 __FUNCTION__, status);
 }
 
+/* data interface returns incoming bytes, or we got unthrottled */
 static void acm_read_bulk(struct urb *urb, struct pt_regs *regs)
 {
struct acm *acm = urb->context;
-   struct tty_struct *tty = acm->tty;
-   unsigned char *data = urb->transfer_buffer;
-   int i = 0;
 
if (!ACM_READY(acm))
return;
 
if (urb->status)
-   dbg("nonzero read bulk status received: %d", urb->status);
+   dev_dbg(&acm->data->dev, "bulk rx status %d\n", urb->status);
+
+   /* calling tty_flip_buffer_push() in_irq() isn't allowed */
+   tasklet_schedule(&acm->bh);
+}
+
+static void acm_rx_tasklet(unsigned long _acm)
+{
+   struct acm *acm = (void *)_acm;
+   struct urb *urb = acm->readurb;
+   struct tty_struct *tty = acm->tty;
+   unsigned char *data = urb->transfer_buffer;
+   int i = 0;
 
-   if (!urb->status && !acm->throttle)  {
+   if (urb->actual_length > 0 && !acm->throttle)  {
for (i = 0; i < urb->actual_length && !acm->throttle; i++) {
/* if we insert more than TTY_FLIPBUF_SIZE characters,
 * we drop them. */
@@ -285,10 +299,12 @@
urb->actual_length = 0;
urb->dev = acm->dev;
 
-   if (usb_submit_urb(urb, GFP_ATOMIC))
-   dbg("failed resubmitting read urb");
+   i = usb_submit_urb(urb, GFP_ATOMIC);
+   if (i)
+   dev_dbg(&ac

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.20, 2003/12/09 11:42:16-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Convert datafab to use the new s-g routines

This patch updates the datafab driver to the new scatter-gather handling,
which makes it safe for systems with >1GByte of memory.
It has been tested by Eduard Hasenleithner.


 drivers/usb/storage/datafab.c |  119 +++---
 1 files changed, 56 insertions(+), 63 deletions(-)


diff -Nru a/drivers/usb/storage/datafab.c b/drivers/usb/storage/datafab.c
--- a/drivers/usb/storage/datafab.c Mon Dec 29 14:24:46 2003
+++ b/drivers/usb/storage/datafab.c Mon Dec 29 14:24:46 2003
@@ -51,7 +51,6 @@
  */
 
 #include "transport.h"
-#include "raw_bulk.h"
 #include "protocol.h"
 #include "usb.h"
 #include "debug.h"
@@ -91,16 +90,14 @@
 struct datafab_info *info,
 u32 sector,
 u32 sectors, 
-unsigned char *dest, 
+unsigned char *buffer, 
 int use_sg)
 {
unsigned char *command = us->iobuf;
-   unsigned char *buffer = NULL;
-   unsigned char *ptr;
unsigned char  thistime;
-   int totallen, len, result;
-   int sg_idx = 0, sg_offset = 0;
-   int rc;
+   unsigned int totallen, alloclen;
+   int len, result;
+   unsigned int sg_idx = 0, sg_offset = 0;
 
// we're working in LBA mode.  according to the ATA spec, 
// we can support up to 28-bit addressing.  I don't know if Datafab
@@ -111,23 +108,28 @@
return USB_STOR_TRANSPORT_ERROR;
 
if (info->lun == -1) {
-   rc = datafab_determine_lun(us, info);
-   if (rc != USB_STOR_TRANSPORT_GOOD)
-   return rc;
+   result = datafab_determine_lun(us, info);
+   if (result != USB_STOR_TRANSPORT_GOOD)
+   return result;
}
 
totallen = sectors * info->ssize;
 
-   do {
-   // loop, never allocate or transfer more than 64k at once
-   // (min(128k, 255*info->ssize) is the real limit)
-
-   len = min_t(int, totallen, 65536);
+   // Since we don't read more than 64 KB at a time, we have to create
+   // a bounce buffer if the transfer uses scatter-gather.
 
-   ptr = buffer = (use_sg ? kmalloc(len, GFP_NOIO) : dest);
+   alloclen = min(totallen, 65536u);
+   if (use_sg) {
+   buffer = kmalloc(alloclen, GFP_NOIO);
if (buffer == NULL)
return USB_STOR_TRANSPORT_ERROR;
+   }
 
+   do {
+   // loop, never allocate or transfer more than 64k at once
+   // (min(128k, 255*info->ssize) is the real limit)
+
+   len = min(totallen, alloclen);
thistime = (len / info->ssize) & 0xff;
 
command[0] = 0;
@@ -135,7 +137,7 @@
command[2] = sector & 0xFF;
command[3] = (sector >> 8) & 0xFF;
command[4] = (sector >> 16) & 0xFF;
-   
+
command[5] = 0xE0 + (info->lun << 4);
command[5] |= (sector >> 24) & 0x0F;
command[6] = 0x20;
@@ -147,24 +149,22 @@
goto leave;
 
// read the result
-   result = datafab_bulk_read(us, ptr, len);
+   result = datafab_bulk_read(us, buffer, len);
if (result != USB_STOR_XFER_GOOD)
goto leave;
 
-   sectors -= thistime;
-   sector  += thistime;
-
-   if (use_sg) {
-   us_copy_to_sgbuf(buffer, len, dest,
-&sg_idx, &sg_offset, use_sg);
-   kfree(buffer);
-   } else {
-   dest += len;
-   }
+   if (use_sg)
+   usb_stor_access_xfer_buf(buffer, len, us->srb,
+&sg_idx, &sg_offset, TO_XFER_BUF);
+   else
+   buffer += len;
 
+   sector += thistime;
totallen -= len;
} while (totallen > 0);
 
+   if (use_sg)
+   kfree(buffer);
return USB_STOR_TRANSPORT_GOOD;
 
  leave:
@@ -178,16 +178,15 @@
  struct datafab_info *info,
  u32 sector,
  u32 sectors, 
- unsigned char *src, 
+ unsigned char *buffer, 
  int use_sg)
 {
unsigned char *command = us->iobuf;
unsigned char *reply = us->iobuf;
-   unsigned char *buffer = NULL;
-   unsigned char *ptr;
unsigned char thistime;
-   int totallen, len, result, rc;
-   int sg_idx = 0, sg_offset = 0;
+   unsigned int totallen, a

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.28, 2003/12/09 12:10:22-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: remove the raw_bulk.c and raw_bulk.h files as they are no longer 
needed.


 drivers/usb/storage/raw_bulk.c |  116 -
 drivers/usb/storage/raw_bulk.h |   20 ---
 2 files changed, 136 deletions(-)


diff -Nru a/drivers/usb/storage/raw_bulk.c b/drivers/usb/storage/raw_bulk.c
--- a/drivers/usb/storage/raw_bulk.cMon Dec 29 14:23:52 2003
+++ /dev/null   Wed Dec 31 16:00:00 1969
@@ -1,116 +0,0 @@
-/*
- * Common routines for a handful of drivers.
- * Unrelated to CF/SM - just scatter-gather stuff.
- */
-
-#include "usb.h"
-#include "raw_bulk.h"
-
-/*
- * The routines below convert scatter-gather to single buffer.
- * Some drivers claim this is necessary.
- * Nothing is done when use_sg is zero.
- */
-
-/*
- * Copy from scatter-gather buffer into a newly allocated single buffer,
- * starting at a given index and offset.
- * When done, update index and offset.
- * Return a pointer to the single buffer.
- */
-unsigned char *
-us_copy_from_sgbuf(unsigned char *content, int len,
-  int *index, int *offset, int use_sg) {
-   struct scatterlist *sg;
-   unsigned char *buffer;
-   int transferred, i;
-
-   if (!use_sg)
-   return content;
-
-   sg = (struct scatterlist *)content;
-   buffer = kmalloc(len, GFP_NOIO);
-   if (buffer == NULL)
-   return NULL;
-
-   transferred = 0;
-   i = *index;
-   while (i < use_sg && transferred < len) {
-   unsigned char *ptr;
-   unsigned int length, room;
-
-   ptr = sg_address(sg[i]) + *offset;
-
-   room = sg[i].length - *offset;
-   length = len - transferred;
-   if (length > room)
-   length = room;
-
-   memcpy(buffer+transferred, ptr, length);
-   transferred += length;
-   *offset += length;
-   if (length == room) {
-   i++;
-   *offset = 0;
-   }
-   }
-   *index = i;
-
-   return buffer;
-}
-
-unsigned char *
-us_copy_from_sgbuf_all(unsigned char *content, int len, int use_sg) {
-   int index, offset;
-
-   index = offset = 0;
-   return us_copy_from_sgbuf(content, len, &index, &offset, use_sg);
-}
-
-/*
- * Copy from a single buffer into a scatter-gather buffer,
- * starting at a given index and offset.
- * When done, update index and offset.
- */
-void
-us_copy_to_sgbuf(unsigned char *buffer, int buflen,
-void *content, int *index, int *offset, int use_sg) {
-   struct scatterlist *sg;
-   int i, transferred;
-
-   if (!use_sg)
-   return;
-
-   transferred = 0;
-   sg = content;
-   i = *index;
-   while (i < use_sg && transferred < buflen) {
-   unsigned char *ptr;
-   unsigned int length, room;
-
-   ptr = sg_address(sg[i]) + *offset;
-
-   room = sg[i].length - *offset;
-   length = buflen - transferred;
-   if (length > room)
-   length = room;
-   
-   memcpy(ptr, buffer+transferred, length);
-   transferred += length;
-   *offset += length;
-   if (length == room) {
-   i++;
-   *offset = 0;
-   }
-   }
-   *index = i;
-}
-
-void
-us_copy_to_sgbuf_all(unsigned char *buffer, int buflen,
-void *content, int use_sg) {
-   int index, offset;
-
-   index = offset = 0;
-   us_copy_to_sgbuf(buffer, buflen, content, &index, &offset, use_sg);
-}
diff -Nru a/drivers/usb/storage/raw_bulk.h b/drivers/usb/storage/raw_bulk.h
--- a/drivers/usb/storage/raw_bulk.hMon Dec 29 14:23:52 2003
+++ /dev/null   Wed Dec 31 16:00:00 1969
@@ -1,20 +0,0 @@
-#ifndef _USB_STORAGE_RAW_BULK_H_
-#define _USB_STORAGE_RAW_BULK_H_
-
-/* scatter-gather */
-extern unsigned char *us_copy_from_sgbuf(
-   unsigned char *content, int buflen,
-   int *index, int *offset, int use_sg);
-
-extern unsigned char *us_copy_from_sgbuf_all(
-   unsigned char *content, int len, int use_sg);
-
-extern void us_copy_to_sgbuf(
-   unsigned char *buffer, int buflen,
-   void *content, int *index, int *offset, int use_sg);
-
-extern void us_copy_to_sgbuf_all(
-   unsigned char *buffer, int buflen,
-   void *content, int use_sg);
-
-#endif



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https:

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.24, 2003/12/09 11:44:56-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Update scatter-gather handling in the shuttle-usbat

This patch updates the shuttle_usbat driver to use the new scatter-gather
transfer routines.  The small set of changes needed speaks well for the
original organization of the code.

This has not been tested.


 drivers/usb/storage/shuttle_usbat.c |   32 
 1 files changed, 16 insertions(+), 16 deletions(-)


diff -Nru a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c
--- a/drivers/usb/storage/shuttle_usbat.c   Mon Dec 29 14:24:19 2003
+++ b/drivers/usb/storage/shuttle_usbat.c   Mon Dec 29 14:24:19 2003
@@ -40,7 +40,6 @@
  */
 
 #include "transport.h"
-#include "raw_bulk.h"
 #include "protocol.h"
 #include "usb.h"
 #include "debug.h"
@@ -529,9 +528,8 @@
unsigned char *buffer;
unsigned int len;
unsigned int sector;
-   struct scatterlist *sg = NULL;
-   int sg_segment = 0;
-   int sg_offset = 0;
+   unsigned int sg_segment = 0;
+   unsigned int sg_offset = 0;
 
US_DEBUGP("handle_read10: transfersize %d\n",
srb->transfersize);
@@ -572,19 +570,20 @@
 
len = (65535/srb->transfersize) * srb->transfersize;
US_DEBUGP("Max read is %d bytes\n", len);
-   buffer = kmalloc(len, GFP_NOIO);
-   if (buffer == NULL) // bloody hell!
-   return USB_STOR_TRANSPORT_FAILED;
+   len = min(len, srb->request_bufflen);
+   if (srb->use_sg) {
+   buffer = kmalloc(len, GFP_NOIO);
+   if (buffer == NULL) // bloody hell!
+   return USB_STOR_TRANSPORT_FAILED;
+   } else
+   buffer = srb->request_buffer;
sector = short_pack(data[7+3], data[7+2]);
sector <<= 16;
sector |= short_pack(data[7+5], data[7+4]);
transferred = 0;
 
-   if (srb->use_sg) {
-   sg = (struct scatterlist *)srb->request_buffer;
-   sg_segment = 0; // for keeping track of where we are in
-   sg_offset = 0;  // the scatter/gather list
-   }
+   sg_segment = 0; // for keeping track of where we are in
+   sg_offset = 0;  // the scatter/gather list
 
while (transferred != srb->request_bufflen) {
 
@@ -618,10 +617,10 @@
// Transfer the received data into the srb buffer
 
if (srb->use_sg)
-   us_copy_to_sgbuf(buffer, len, sg,
-&sg_segment, &sg_offset, srb->use_sg);
+   usb_stor_access_xfer_buf(buffer, len, srb,
+&sg_segment, &sg_offset, TO_XFER_BUF);
else
-   memcpy(srb->request_buffer+transferred, buffer, len);
+   buffer += len;
 
// Update the amount transferred and the sector number
 
@@ -630,7 +629,8 @@
 
} // while transferred != srb->request_bufflen
 
-   kfree(buffer);
+   if (srb->use_sg)
+   kfree(buffer);
return result;
 }
 



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.17, 2003/12/09 09:53:21-08:00, [EMAIL PROTECTED]

[PATCH] USB: fix error return codes in usblp

this fixes the questionable error return codes Paulo noticed
in usblp. I hope I really got all cases now.


 drivers/usb/class/usblp.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
--- a/drivers/usb/class/usblp.c Mon Dec 29 14:25:10 2003
+++ b/drivers/usb/class/usblp.c Mon Dec 29 14:25:10 2003
@@ -610,7 +610,7 @@
if (!usblp->wcomplete) {
barrier();
if (file->f_flags & O_NONBLOCK)
-   return -EAGAIN;
+   return writecount ? writecount : -EAGAIN;
 
timeout = USBLP_WRITE_TIMEOUT;
add_wait_queue(&usblp->wait, &wait);
@@ -673,8 +673,8 @@
 
usblp->writeurb->dev = usblp->dev;
usblp->wcomplete = 0;
-   if (usb_submit_urb(usblp->writeurb, GFP_KERNEL)) {
-   count = -EIO;
+   if (err = usb_submit_urb(usblp->writeurb, GFP_KERNEL)) {
+   count = err != -ENOMEM ? -EIO : (writecount ? writecount : 
-ENOMEM);
up (&usblp->sem);
break;
}



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.22, 2003/12/09 11:43:14-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Another utility scatter-gather routine

This patch adds a small utility routine for storing data in a transfer
buffer.  The next patch uses this routine quite a bit in the isd200
driver.


 drivers/usb/storage/protocol.c |   13 +
 drivers/usb/storage/protocol.h |2 ++
 drivers/usb/storage/usb.c  |8 +---
 3 files changed, 16 insertions(+), 7 deletions(-)


diff -Nru a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
--- a/drivers/usb/storage/protocol.cMon Dec 29 14:24:33 2003
+++ b/drivers/usb/storage/protocol.cMon Dec 29 14:24:33 2003
@@ -295,3 +295,16 @@
}
return cnt;
 }
+
+/* Store the contents of buffer into srb's transfer buffer and set the
+ * residue. */
+void usb_stor_set_xfer_buf(unsigned char *buffer,
+   unsigned int buflen, Scsi_Cmnd *srb)
+{
+   unsigned int index = 0, offset = 0;
+
+   usb_stor_access_xfer_buf(buffer, buflen, srb, &index, &offset,
+   TO_XFER_BUF);
+   if (buflen < srb->request_bufflen)
+   srb->resid = srb->request_bufflen - buflen;
+}
diff -Nru a/drivers/usb/storage/protocol.h b/drivers/usb/storage/protocol.h
--- a/drivers/usb/storage/protocol.hMon Dec 29 14:24:33 2003
+++ b/drivers/usb/storage/protocol.hMon Dec 29 14:24:33 2003
@@ -72,4 +72,6 @@
unsigned int buflen, Scsi_Cmnd *srb, unsigned int *index,
unsigned int *offset, enum xfer_buf_dir dir);
 
+extern void usb_stor_set_xfer_buf(unsigned char *buffer,
+   unsigned int buflen, Scsi_Cmnd *srb);
 #endif
diff -Nru a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
--- a/drivers/usb/storage/usb.c Mon Dec 29 14:24:33 2003
+++ b/drivers/usb/storage/usb.c Mon Dec 29 14:24:33 2003
@@ -236,8 +236,6 @@
 void fill_inquiry_response(struct us_data *us, unsigned char *data,
unsigned int data_len)
 {
-   unsigned int index, offset;
-
if (data_len<36) // You lose.
return;
 
@@ -264,11 +262,7 @@
data[35] = 0x30 + ((us->pusb_dev->descriptor.bcdDevice) & 0x0F);
}
 
-   index = offset = 0;
-   usb_stor_access_xfer_buf(data, data_len, us->srb,
-   &index, &offset, TO_XFER_BUF);
-   if (data_len < us->srb->request_bufflen)
-   us->srb->resid = us->srb->request_bufflen - data_len;
+   usb_stor_set_xfer_buf(data, data_len, us->srb);
 }
 
 static int usb_stor_control_thread(void * __us)



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.26, 2003/12/09 11:47:26-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Remove unneeded raw_bulk.[ch] files, change Makefile

As a result of the last round of changes, the raw_bulk source files aren't
needed any more.  They can be deleted and the Makefile changed
accordingly.


 drivers/usb/storage/Makefile |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


diff -Nru a/drivers/usb/storage/Makefile b/drivers/usb/storage/Makefile
--- a/drivers/usb/storage/Makefile  Mon Dec 29 14:24:06 2003
+++ b/drivers/usb/storage/Makefile  Mon Dec 29 14:24:06 2003
@@ -10,14 +10,14 @@
 obj-$(CONFIG_USB_STORAGE)  += usb-storage.o
 
 usb-storage-obj-$(CONFIG_USB_STORAGE_DEBUG)+= debug.o
-usb-storage-obj-$(CONFIG_USB_STORAGE_HP8200e)  += shuttle_usbat.o raw_bulk.o
-usb-storage-obj-$(CONFIG_USB_STORAGE_SDDR09)   += sddr09.o raw_bulk.o
-usb-storage-obj-$(CONFIG_USB_STORAGE_SDDR55)   += sddr55.o raw_bulk.o
+usb-storage-obj-$(CONFIG_USB_STORAGE_HP8200e)  += shuttle_usbat.o
+usb-storage-obj-$(CONFIG_USB_STORAGE_SDDR09)   += sddr09.o
+usb-storage-obj-$(CONFIG_USB_STORAGE_SDDR55)   += sddr55.o
 usb-storage-obj-$(CONFIG_USB_STORAGE_FREECOM)  += freecom.o
 usb-storage-obj-$(CONFIG_USB_STORAGE_DPCM) += dpcm.o
 usb-storage-obj-$(CONFIG_USB_STORAGE_ISD200)   += isd200.o
-usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB)  += datafab.o raw_bulk.o
-usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o raw_bulk.o
+usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB)  += datafab.o
+usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o
 
 usb-storage-objs :=scsiglue.o protocol.o transport.o usb.o \
initializers.o $(usb-storage-obj-y)



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.30, 2003/12/09 18:05:06-08:00, [EMAIL PROTECTED]

[PATCH] USB: usb_hcd_unlink_urb() test for list membership

This is a minor cleanup that replaces a test for non-null urb->hcpriv
with "is the urb on this list".  HCDs don't need to use hcpriv in that
way, and in general this is a safer way to test that.  (AIO does much
the same thing in its kiocb cancelation paths.)


 drivers/usb/core/hcd.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
--- a/drivers/usb/core/hcd.cMon Dec 29 14:23:39 2003
+++ b/drivers/usb/core/hcd.cMon Dec 29 14:23:39 2003
@@ -1165,6 +1165,7 @@
struct device   *sys = 0;
unsigned long   flags;
struct completion_splicesplice;
+   struct list_head*tmp;
int retval;
 
if (!urb)
@@ -1203,7 +1204,12 @@
 */
WARN_ON (!HCD_IS_RUNNING (hcd->state) && hcd->state != USB_STATE_HALT);
 
-   if (!urb->hcpriv) {
+   /* insist the urb is still queued */
+   list_for_each(tmp, &dev->urb_list) {
+   if (tmp == &urb->urb_list)
+   break;
+   }
+   if (tmp != &urb->urb_list) {
retval = -EINVAL;
goto done;
}



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.46, 2003/12/12 11:57:12-08:00, [EMAIL PROTECTED]

[PATCH] USB: Allow configuration #0

This patch helped Jon Wilson.  It allows devices to have a configuration
numbered 0, in spite of the standard convention that config #0 really
means unconfigured.


 drivers/usb/core/message.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/core/message.c b/drivers/usb/core/message.c
--- a/drivers/usb/core/message.cMon Dec 29 14:21:51 2003
+++ b/drivers/usb/core/message.cMon Dec 29 14:21:51 2003
@@ -1086,6 +1086,11 @@
ret = -EINVAL;
goto out;
}
+
+   /* The USB spec says configuration 0 means unconfigured.
+* But if a device includes a configuration numbered 0,
+* we will accept it as a correctly configured state.
+*/
if (cp && configuration == 0)
dev_warn(&dev->dev, "config 0 descriptor??\n");
 
@@ -1101,7 +1106,7 @@
goto out;
 
dev->actconfig = cp;
-   if (!configuration)
+   if (!cp)
dev->state = USB_STATE_ADDRESS;
else {
dev->state = USB_STATE_CONFIGURED;



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1371.4.2, 2003/10/28 13:48:54-08:00, [EMAIL PROTECTED]

[PATCH] USB: add support for Protego devices to ftdi_sio driver


 drivers/usb/serial/ftdi_sio.c |   12 
 drivers/usb/serial/ftdi_sio.h |8 
 2 files changed, 20 insertions(+)


diff -Nru a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
--- a/drivers/usb/serial/ftdi_sio.c Mon Dec 29 14:27:18 2003
+++ b/drivers/usb/serial/ftdi_sio.c Mon Dec 29 14:27:18 2003
@@ -342,6 +342,10 @@
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0, 0x3ff) },
{ USB_DEVICE_VER(OCT_VID, OCT_US101_PID, 0, 0x3ff) },
+   { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_1, 0, 0x3ff) },
+   { USB_DEVICE_VER(FTDI_VID, PROTEGO_R2X0, 0, 0x3ff) },
+   { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_3, 0, 0x3ff) },
+   { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_4, 0, 0x3ff) },
{ } /* Terminating entry */
 };
 
@@ -416,6 +420,10 @@
{ USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0x400, 0x) },
{ USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0x400, 0x) },
{ USB_DEVICE_VER(OCT_VID, OCT_US101_PID, 0x400, 0x) },
+   { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_1, 0x400, 0x) },
+   { USB_DEVICE_VER(FTDI_VID, PROTEGO_R2X0, 0x400, 0x) },
+   { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_3, 0x400, 0x) },
+   { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_4, 0x400, 0x) },
{ } /* Terminating entry */
 };
 
@@ -505,6 +513,10 @@
{ USB_DEVICE(OCT_VID, OCT_US101_PID) },
{ USB_DEVICE_VER(FTDI_VID, FTDI_HE_TIRA1_PID, 0x400, 0x) },
{ USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID) },
+   { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) },
+   { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) },
+   { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) },
+   { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) },
{ } /* Terminating entry */
 };
 
diff -Nru a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
--- a/drivers/usb/serial/ftdi_sio.h Mon Dec 29 14:27:18 2003
+++ b/drivers/usb/serial/ftdi_sio.h Mon Dec 29 14:27:18 2003
@@ -145,6 +145,14 @@
 /* Note: OCT US101 is also rebadged as Dick Smith Electronics (NZ) XH6381 */
 #define OCT_US101_PID  0x0421  /* OCT US101 USB to RS-232 */
 
+/*
+ * Protego product ids
+ */
+#define PROTEGO_SPECIAL_1  0xFC70  /* special/unknown device */
+#define PROTEGO_R2X0   0xFC71  /* R200-USB TRNG unit (R210, R220, and R230) */
+#define PROTEGO_SPECIAL_3  0xFC72  /* special/unknown device */
+#define PROTEGO_SPECIAL_4  0xFC73  /* special/unknown device */ 
+
 /* Commands */
 #define FTDI_SIO_RESET 0 /* Reset the port */
 #define FTDI_SIO_MODEM_CTRL1 /* Set the modem control register */



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.40, 2003/12/11 17:33:53-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Medion 6047 Digital Camera

...a patch for the "Medion 6047 Digital Camera"



*** a/drivers/usb/storage/unusual_devs.hSun Nov 23 22:31:51 2003


 drivers/usb/storage/unusual_devs.h |8 
 1 files changed, 8 insertions(+)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:32 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:32 2003
@@ -623,6 +623,14 @@
US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_MODE_XLATE ),
 
+/*Medion 6047 Digital Camera
+Davide Andrian <[EMAIL PROTECTED]>
+*/
+UNUSUAL_DEV( 0x08ca, 0x2011, 0x0001, 0x0001,
+   "3MegaCam",
+   "3MegaCam",
+   US_SC_DEVICE, US_PR_BULK, NULL,
+   US_FL_MODE_XLATE ),
 /* aeb */
 UNUSUAL_DEV( 0x090c, 0x1132, 0x, 0x,
"Feiya",



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.41, 2003/12/11 17:37:17-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Unusual_devs.h addition

This patch adds to unusual_devs.h an entry reported by Andries Brouwer and
it moves another entry to the correct position in the numerical ordering.


 drivers/usb/storage/unusual_devs.h |   22 +++---
 1 files changed, 15 insertions(+), 7 deletions(-)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:25 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:25 2003
@@ -581,6 +581,14 @@
US_SC_SCSI, US_PR_DATAFAB, NULL,
US_FL_MODE_XLATE ),
 #endif
+#ifdef CONFIG_USB_STORAGE_SDDR55
+/* SM part - aeb <[EMAIL PROTECTED]> */
+UNUSUAL_DEV(  0x07c4, 0xa109, 0x, 0x,
+   "Datafab Systems, Inc.",
+   "USB to CF + SM Combo (LC1)",
+   US_SC_SCSI, US_PR_SDDR55, NULL,
+   US_FL_SINGLE_LUN ),
+#endif
 
 /* Datafab KECF-USB / Sagatek DCS-CF / Simpletech Flashlink UCF-100
  * Only revision 1.13 tested (same for all of the above devices,
@@ -678,13 +686,6 @@
0 ),
 #endif
 
-/* Submitted by Antoine Mairesse <[EMAIL PROTECTED]> */
-UNUSUAL_DEV( 0x0ed1, 0x6660, 0x0100, 0x0300,
-   "USB",
-   "Solid state disk",
-   US_SC_DEVICE, US_PR_DEVICE, NULL,
-   US_FL_FIX_INQUIRY ),
-
 /* Submitted by Joris Struyve <[EMAIL PROTECTED]> */
 UNUSUAL_DEV( 0x0d96, 0x410a, 0x0001, 0x,
"Medion",
@@ -701,6 +702,13 @@
"Jenoptik",
"JD 5200 z3",
US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY),
+
+/* Submitted by Antoine Mairesse <[EMAIL PROTECTED]> */
+UNUSUAL_DEV( 0x0ed1, 0x6660, 0x0100, 0x0300,
+   "USB",
+   "Solid state disk",
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
+   US_FL_FIX_INQUIRY ),

 /* Reported by Kevin Cernekee <[EMAIL PROTECTED]>
  * Tested on hardware version 1.10.



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1558, 2003/12/29 12:29:03-08:00, [EMAIL PROTECTED]

[PATCH] USB:  doc updates

As more people have been using this API, the need for some
clarifications has (no surprise!) came up.

Most significant is the halt processing, needed to make
Alan's "File Storage Gadget" (mass storage class, talks
to usb-storage and Windows) handle fault cases cleanly.
Gadget drivers can't halt IN endpoints until the FIFO is
emptied by the host ...  virtually no hardware tries to
sequence the DATA and STALL packets by itself.


 include/linux/usb_gadget.h |   29 ++---
 1 files changed, 22 insertions(+), 7 deletions(-)


diff -Nru a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
--- a/include/linux/usb_gadget.hMon Dec 29 14:20:42 2003
+++ b/include/linux/usb_gadget.hMon Dec 29 14:20:42 2003
@@ -28,12 +28,20 @@
  * for mapping and unmapping the buffer.
  * @length: Length of that data
  * @no_interrupt: If true, hints that no completion irq is needed.
- * Helpful sometimes with deep request queues.
+ * Helpful sometimes with deep request queues that are handled
+ * directly by DMA controllers.
  * @zero: If true, when writing data, makes the last packet be "short"
  * by adding a zero length packet as needed;
  * @short_not_ok: When reading data, makes short packets be
  * treated as errors (queue stops advancing till cleanup).
- * @complete: Function called when request completes
+ * @complete: Function called when request completes, so this request and
+ * its buffer may be re-used.
+ * Reads terminate with a short packet, or when the buffer fills,
+ * whichever comes first.  When writes terminate, some data bytes
+ * will usually still be in flight (often in a hardware fifo).
+ * Errors (for reads or writes) stop the queue from advancing
+ * until the completion function returns, so that any transfers
+ * invalidated by the error may first be dequeued.
  * @context: For use by the completion callback
  * @list: For use by the gadget driver.
  * @status: Reports completion code, zero or a negative errno.
@@ -41,12 +49,13 @@
  * the completion callback returns.
  * Code "-ESHUTDOWN" indicates completion caused by device disconnect,
  * or when the driver disabled the endpoint.
- * @actual: Reports actual bytes transferred.  For reads (OUT
+ * @actual: Reports bytes transferred to/from the buffer.  For reads (OUT
  * transfers) this may be less than the requested length.  If the
  * short_not_ok flag is set, short reads are treated as errors
  * even when status otherwise indicates successful completion.
- * Note that for writes (IN transfers) the data bytes may still
- * reside in a device-side FIFO.
+ * Note that for writes (IN transfers) some data bytes may still
+ * reside in a device-side FIFO when the request is reported as
+ * complete.
  *
  * These are allocated/freed through the endpoint they're used with.  The
  * hardware's driver can add extra per-request data to the memory it returns,
@@ -287,6 +296,9 @@
  * Each request is turned into one or more packets.  The controller driver
  * never merges adjacent requests into the same packet.  OUT transfers
  * will sometimes use data that's already buffered in the hardware.
+ * Drivers can rely on the fact that the first byte of the request's buffer
+ * always corresponds to the first byte of some USB packet, for both
+ * IN and OUT transfers.
  *
  * Bulk endpoints can queue any amount of data; the transfer is packetized
  * automatically.  The last packet will be short if the request doesn't fill it
@@ -361,6 +373,9 @@
  *
  * Returns zero, or a negative error code.  On success, this call sets
  * underlying hardware state that blocks data transfers.
+ * Attempts to halt IN endpoints will fail (returning -EAGAIN) if any
+ * transfer requests are still queued, or if the controller hardware
+ * (usually a FIFO) still holds bytes that the host hasn't collected.
  */
 static inline int
 usb_ep_set_halt (struct usb_ep *ep)
@@ -393,8 +408,8 @@
  *
  * FIFO endpoints may have "unclaimed data" in them in certain cases,
  * such as after aborted transfers.  Hosts may not have collected all
- * the IN data written by the gadget driver, as reported by a request
- * completion.  The gadget driver may not have collected all the data
+ * the IN data written by the gadget driver (and reported by a request
+ * completion).  The gadget driver may not have collected all the data
  * written OUT to it by the host.  Drivers that need precise handling for
  * fault reporting or recovery may need to use this call.
  *



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
_

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1337.3.6, 2003/10/23 17:03:25-07:00, [EMAIL PROTECTED]

[PATCH] USB: usbcore, better heuristic for choosing configs

Until now, the Linux-USB core has always chosen the first device
configuration, even when there was a choice.  In 2.4 kernels,
device driver probe() routines were allowed to override that
initial policy decisions.  But 2.6 kernels can't do that from
probe() routines, causing problems with some CDC-ACM modems
where the first config uses MSFT-proprietary protocols.

This patch switches to a smarter heuristic:  Linux now prefers
standard interface classes when there's a choice.  So those
CDC-ACM modems don't need a "write bConfigurationValue in sysfs"
step when they are connected; they act just like on 2.4 kernels.
(And sysfs can still be used to handle any problem cases.)


 drivers/usb/core/usb.c |   21 +
 1 files changed, 17 insertions(+), 4 deletions(-)


diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.cMon Dec 29 14:27:37 2003
+++ b/drivers/usb/core/usb.cMon Dec 29 14:27:37 2003
@@ -991,6 +991,7 @@
int err = -EINVAL;
int i;
int j;
+   int config;
 
/*
 * Set the driver for the usb device to point to the "generic" driver.
@@ -1105,18 +1106,30 @@
 
/* choose and set the configuration. that registers the interfaces
 * with the driver core, and lets usb device drivers bind to them.
+* NOTE:  should interact with hub power budgeting.
 */
+   config = dev->config[0].desc.bConfigurationValue;
if (dev->descriptor.bNumConfigurations != 1) {
+   for (i = 0; i < dev->descriptor.bNumConfigurations; i++) {
+   /* heuristic:  Linux is more likely to have class
+* drivers, so avoid vendor-specific interfaces.
+*/
+   if (dev->config[i].interface[0]->altsetting
+   ->desc.bInterfaceClass
+   == USB_CLASS_VENDOR_SPEC)
+   continue;
+   config = dev->config[i].desc.bConfigurationValue;
+   break;
+   }
dev_info(&dev->dev,
"configuration #%d chosen from %d choices\n",
-   dev->config[0].desc.bConfigurationValue,
+   config,
dev->descriptor.bNumConfigurations);
}
-   err = usb_set_configuration(dev,
-   dev->config[0].desc.bConfigurationValue);
+   err = usb_set_configuration(dev, config);
if (err) {
dev_err(&dev->dev, "can't set config #%d, error %d\n",
-   dev->config[0].desc.bConfigurationValue, err);
+   config, err);
goto fail;
}
 



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1337.3.4, 2003/10/09 10:46:05-07:00, [EMAIL PROTECTED]

[PATCH] USB: give legotower driver a real USB minor, and remove unneeded ioctl 
function.


 drivers/usb/misc/legousbtower.c |   38 ++
 1 files changed, 6 insertions(+), 32 deletions(-)


diff -Nru a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
--- a/drivers/usb/misc/legousbtower.c   Mon Dec 29 14:27:49 2003
+++ b/drivers/usb/misc/legousbtower.c   Mon Dec 29 14:27:49 2003
@@ -88,13 +88,12 @@
 
 MODULE_DEVICE_TABLE (usb, tower_table);
 
-/* FIXME: Get a minor range for your devices from the usb maintainer */
-#define LEGO_USB_TOWER_MINOR_BASE  0xB3
+#define LEGO_USB_TOWER_MINOR_BASE  160
 
 /* we can have up to this number of device plugged in at once */
 #define MAX_DEVICES16
 
-#define COMMAND_TIMEOUT(2*HZ)  /* 60 second timeout for a command */
+#define COMMAND_TIMEOUT(2*HZ)  /* 2 second timeout for a command */
 
 /* Structure to hold all of our device specific stuff */
 struct lego_usb_tower {
@@ -130,7 +129,6 @@
 /* local function prototypes */
 static ssize_t tower_read  (struct file *file, char *buffer, size_t count, loff_t 
*ppos);
 static ssize_t tower_write (struct file *file, const char *buffer, size_t count, 
loff_t *ppos);
-static int tower_ioctl (struct inode *inode, struct file *file, unsigned int 
cmd, unsigned long arg);
 static inline void tower_delete (struct lego_usb_tower *dev);
 static int tower_open  (struct inode *inode, struct file *file);
 static int tower_release   (struct inode *inode, struct file *file);
@@ -151,7 +149,6 @@
.owner =THIS_MODULE,
.read  =tower_read,
.write =tower_write,
-   .ioctl =tower_ioctl,
.open = tower_open,
.release =  tower_release,
 };
@@ -212,15 +209,9 @@
if (dev->interrupt_out_urb != NULL) {
usb_free_urb (dev->interrupt_out_urb);
}
-   if (dev->read_buffer != NULL) {
-   kfree (dev->read_buffer);
-   }
-   if (dev->interrupt_in_buffer != NULL) {
-   kfree (dev->interrupt_in_buffer);
-   }
-   if (dev->interrupt_out_buffer != NULL) {
-   kfree (dev->interrupt_out_buffer);
-   }
+   kfree (dev->read_buffer);
+   kfree (dev->interrupt_in_buffer);
+   kfree (dev->interrupt_out_buffer);
kfree (dev);
 
dbg(2, "%s : leave", __func__);
@@ -436,7 +427,6 @@
}
 
if (signal_pending(current)) {
-
retval = -EINTR;
goto exit;
}
@@ -505,7 +495,7 @@
 
/* verify that we actually have some data to write */
if (count == 0) {
-   dbg(1," %s : write request of 0 bytes", __func__);
+   dbg(1," %s : write request of 0 bytes", __func__);
goto exit;
}
 
@@ -590,20 +580,6 @@
 
 
 /**
- * Number of reasons why this isn't supported - GKH doesn't like them
- *  since they are non-portable and also most of this is derived from
- *  proprietary information
- */
-
-static int tower_ioctl (struct inode *inode, struct file *file, unsigned int cmd, 
unsigned long arg)
-{
-   int retval =  -ENOTTY;  /* default: we don't understand ioctl */
-
-   return retval;
-}
-
-
-/**
  * tower_interrupt_in_callback
  */
 static void tower_interrupt_in_callback (struct urb *urb, struct pt_regs *regs)
@@ -778,8 +754,6 @@
err("Couldn't allocate interrupt_out_urb");
goto error;
}
-
-   /* initialize the devfs node for this device and register it */
 
/* we can register the device now, as it is ready */
usb_set_intfdata (interface, dev);



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.15, 2003/12/08 17:45:21-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Fix scatter-gather buffer access in usb-storage core

This patch adds a routine to protocol.c that correctly transfers data to
or from a scatter-gather buffer.  According to Jens Axboe, we've been
using page_address() incorrectly -- it's necessary to use kmap() instead
-- and in fact it doesn't give the desired result when the buffers are
located in high memory.  This could affect anyone using a system with 1 GB
or more of RAM, and one user has already reported such a problem (as you
know).

The three fixup routines in protocol.c and usb.c have been changed to use
the new s-g access routine.  When similar adjustments have been made to
all the subdrivers, we will be able to eliminate the raw_bulk.c source
file entirely.


 drivers/usb/storage/protocol.c |  125 ++---
 drivers/usb/storage/protocol.h |8 ++
 drivers/usb/storage/usb.c  |   33 ++
 3 files changed, 109 insertions(+), 57 deletions(-)


diff -Nru a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
--- a/drivers/usb/storage/protocol.cMon Dec 29 14:25:23 2003
+++ b/drivers/usb/storage/protocol.cMon Dec 29 14:25:23 2003
@@ -44,6 +44,7 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include 
 #include "protocol.h"
 #include "usb.h"
 #include "debug.h"
@@ -54,48 +55,36 @@
  * Helper routines
  ***/
 
-static void *
-find_data_location(Scsi_Cmnd *srb) {
-   if (srb->use_sg) {
-   /*
-* This piece of code only works if the first page is
-* big enough to hold more than 3 bytes -- which is
-* _very_ likely.
-*/
-   struct scatterlist *sg;
-
-   sg = (struct scatterlist *) srb->request_buffer;
-   return (void *) sg_address(sg[0]);
-   } else
-   return (void *) srb->request_buffer;
-}
-
 /*
  * Fix-up the return data from an INQUIRY command to show 
  * ANSI SCSI rev 2 so we don't confuse the SCSI layers above us
  */
 static void fix_inquiry_data(Scsi_Cmnd *srb)
 {
-   unsigned char *data_ptr;
+   unsigned char databuf[3];
+   unsigned int index, offset;
 
/* verify that it's an INQUIRY command */
if (srb->cmnd[0] != INQUIRY)
return;
 
-   /* oddly short buffer -- bail out */
-   if (srb->request_bufflen < 3)
+   index = offset = 0;
+   if (usb_stor_access_xfer_buf(databuf, sizeof(databuf), srb,
+   &index, &offset, FROM_XFER_BUF) != sizeof(databuf))
return;
 
-   data_ptr = find_data_location(srb);
-
-   if ((data_ptr[2] & 7) == 2)
+   if ((databuf[2] & 7) == 2)
return;
 
US_DEBUGP("Fixing INQUIRY data to show SCSI rev 2 - was %d\n",
- data_ptr[2] & 7);
+ databuf[2] & 7);
 
/* Change the SCSI revision number */
-   data_ptr[2] = (data_ptr[2] & ~7) | 2;
+   databuf[2] = (databuf[2] & ~7) | 2;
+
+   index = offset = 0;
+   usb_stor_access_xfer_buf(databuf, sizeof(databuf), srb,
+   &index, &offset, TO_XFER_BUF);
 }
 
 /*
@@ -104,23 +93,27 @@
  */
 static void fix_read_capacity(Scsi_Cmnd *srb)
 {
-   unsigned char *dp;
+   unsigned int index, offset;
+   u32 c;
unsigned long capacity;
 
/* verify that it's a READ CAPACITY command */
if (srb->cmnd[0] != READ_CAPACITY)
return;
 
-   dp = find_data_location(srb);
+   index = offset = 0;
+   if (usb_stor_access_xfer_buf((unsigned char *) &c, 4, srb,
+   &index, &offset, FROM_XFER_BUF) != 4)
+   return;
 
-   capacity = (dp[0]<<24) + (dp[1]<<16) + (dp[2]<<8) + (dp[3]);
+   capacity = be32_to_cpu(c);
US_DEBUGP("US: Fixing capacity: from %ld to %ld\n",
   capacity+1, capacity);
-   capacity--;
-   dp[0] = (capacity >> 24);
-   dp[1] = (capacity >> 16);
-   dp[2] = (capacity >> 8);
-   dp[3] = (capacity);
+   c = cpu_to_be32(capacity - 1);
+
+   index = offset = 0;
+   usb_stor_access_xfer_buf((unsigned char *) &c, 4, srb,
+   &index, &offset, TO_XFER_BUF);
 }
 
 /***
@@ -233,4 +226,72 @@
if (us->flags & US_FL_FIX_CAPACITY)
fix_read_capacity(srb);
}
+}
+
+/***
+ * Scatter-gather transfer buffer access routines
+ ***/
+
+/* Copy a buffer of length buflen to/from the srb's transfer buffer.
+ * Update the index and offset variables so that the next copy will
+ * pick up from where this one left off. */
+
+unsigned int usb_stor_acce

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.44, 2003/12/12 10:31:35-08:00, [EMAIL PROTECTED]

[PATCH] USB: fix io_edgeport driver alignment issues.


 drivers/usb/serial/io_fw_boot.h  |2 +-
 drivers/usb/serial/io_fw_boot2.h |2 +-
 drivers/usb/serial/io_fw_down.h  |2 +-
 drivers/usb/serial/io_fw_down2.h |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/drivers/usb/serial/io_fw_boot.h b/drivers/usb/serial/io_fw_boot.h
--- a/drivers/usb/serial/io_fw_boot.h   Mon Dec 29 14:22:05 2003
+++ b/drivers/usb/serial/io_fw_boot.h   Mon Dec 29 14:22:05 2003
@@ -17,7 +17,7 @@
unsigned short Addr;
unsigned short Len;
unsigned char  Data[0];
-   };
+   } __attribute__ ((packed));
 
struct edge_firmware_version_info {
unsigned charMajorVersion;
diff -Nru a/drivers/usb/serial/io_fw_boot2.h b/drivers/usb/serial/io_fw_boot2.h
--- a/drivers/usb/serial/io_fw_boot2.h  Mon Dec 29 14:22:05 2003
+++ b/drivers/usb/serial/io_fw_boot2.h  Mon Dec 29 14:22:05 2003
@@ -17,7 +17,7 @@
unsigned short Addr;
unsigned short Len;
unsigned char  Data[0];
-   };
+   } __attribute__ ((packed));
 
struct edge_firmware_version_info {
unsigned charMajorVersion;
diff -Nru a/drivers/usb/serial/io_fw_down.h b/drivers/usb/serial/io_fw_down.h
--- a/drivers/usb/serial/io_fw_down.h   Mon Dec 29 14:22:05 2003
+++ b/drivers/usb/serial/io_fw_down.h   Mon Dec 29 14:22:05 2003
@@ -17,7 +17,7 @@
unsigned short  Addr;
unsigned short  Len;
unsigned char   Data[0];
-   };
+   } __attribute ((packed));
 
struct edge_firmware_version_info {
unsigned char   MajorVersion;
diff -Nru a/drivers/usb/serial/io_fw_down2.h b/drivers/usb/serial/io_fw_down2.h
--- a/drivers/usb/serial/io_fw_down2.h  Mon Dec 29 14:22:05 2003
+++ b/drivers/usb/serial/io_fw_down2.h  Mon Dec 29 14:22:05 2003
@@ -17,7 +17,7 @@
unsigned short Addr;
unsigned short Len;
unsigned char  Data[0];
-   };
+   } __attribute__ ((packed));
 
struct edge_firmware_version_info {
unsigned char  MajorVersion;



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.51, 2003/12/12 14:36:36-08:00, [EMAIL PROTECTED]

[PATCH] USB: usb driver binding fixes

There are problems lurking in the driver binding code for usb,
with highlights being disagreements about:

(a) locks: usb bus writelock v. BKL v. driver->serialize
(b) driver: interface.driver v. interface.dev.driver

Fixing those is going to take multiple patches, and I thought
I'd start out with a small one that's relatively simple.  This:

- Cleans up locking.

* Updates comments and kerneldoc to reflect that the
  usb bus writelock is what protects against conflicts
  when binding/unbinding drivers to devices.

* Removes driver->serialize ... not needed, since
  it's only gotten when the bus writelock is held.

* Removes incorrect "must have BKL" comments, and one
  bit of code that tried to use BKL not the writelock.

- Removes inconsistencies about what driver is bound to the
  interface ... for now "interface.driver" is "the truth".

* usb_probe_interface() will no longer clobber bindings
  established with usb_driver_claim_interface().

* usb_driver_release_interface() calls device_release_driver()
  for bindings established with probe(), so the driver model
  updates (sysfs etc) are done as expected.

* usb_unbind_interface() doesn't usb_driver_release_interface(),
  since release() should eventually _always_ call unbind()
  (indirectly through device_release_driver).

Essentially there are two driver binding models in USB today,
and this patch makes them start to cooperate properly:

   - probe()/disconnect(), used by most drivers.  This goes
 through the driver model core.

   - claim()/release(), used by CDC drivers (ACM, Ethernet)
 and audio to claim extra interfaces and by usbfs since it
 can't come in through probe().  Bypasses driver model.

That interface.driver pointer can be removed by changing the
claim()/release() code to use the driver model calls added
for that purpose:  device_{bind,release}_driver().  I didn't
do that in this patch, since it'll have side effects like
extra disconnect() calls that drivers will need to handle.

A separate usbfs patch is needed to fix its driver binding;
mostly just to use the right lock, but those changes were
more extensive and uncovered other issues.  (Like, I think,
some that Duncan has been noticing ...)


 drivers/usb/core/usb.c |   58 +++--
 include/linux/usb.h|5 
 2 files changed, 32 insertions(+), 31 deletions(-)


diff -Nru a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
--- a/drivers/usb/core/usb.cMon Dec 29 14:21:16 2003
+++ b/drivers/usb/core/usb.cMon Dec 29 14:21:16 2003
@@ -80,7 +80,7 @@
 
 static int usb_generic_driver_data;
 
-/* needs to be called with BKL held */
+/* called from driver core with usb_bus_type.subsys writelock */
 int usb_probe_interface(struct device *dev)
 {
struct usb_interface * intf = to_usb_interface(dev);
@@ -93,12 +93,14 @@
if (!driver->probe)
return error;
 
+   /* driver claim() doesn't yet affect dev->driver... */
+   if (intf->driver)
+   return error;
+
id = usb_match_id (intf, driver->id_table);
if (id) {
dev_dbg (dev, "%s - got id\n", __FUNCTION__);
-   down (&driver->serialize);
error = driver->probe (intf, id);
-   up (&driver->serialize);
}
if (!error)
intf->driver = driver;
@@ -106,23 +108,24 @@
return error;
 }
 
+/* called from driver core with usb_bus_type.subsys writelock */
 int usb_unbind_interface(struct device *dev)
 {
struct usb_interface *intf = to_usb_interface(dev);
-   struct usb_driver *driver = to_usb_driver(dev->driver);
-
-   down(&driver->serialize);
+   struct usb_driver *driver = intf->driver;
 
/* release all urbs for this interface */
usb_disable_interface(interface_to_usbdev(intf), intf);
 
-   if (intf->driver && intf->driver->disconnect)
-   intf->driver->disconnect(intf);
+   if (driver && driver->disconnect)
+   driver->disconnect(intf);
 
-   /* force a release and re-initialize the interface */
-   usb_driver_release_interface(driver, intf);
-
-   up(&driver->serialize);
+   /* reset other interface state */
+   usb_set_interface(interface_to_usbdev(intf),
+   intf->altsetting[0].desc.bInterfaceNumber,
+   0);
+   usb_set_intfdata(intf, NULL);
+   intf->driver = NULL;
 
return 0;
 }
@@ -152,8 +155,6 @@
new_driver->driver.probe = usb_probe_interface;
new_driver->driver.remove = usb_unbind_interface;
 
-   init_MUTEX(&new_driver->serialize);
-
retval = driver_register(&new_driver->driver);
 
if (!retval) {
@@ -170,7

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.13, 2003/12/08 17:44:49-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Enhance sddr09 to work with 64 MB SmartMedia cards

This patch was written by Andries Brouwer.  It adds to sddr09 the ability
to use 64 MB SmartMedia cards.  I have added a few minor alterations to
make it fit in with my sequence of other patches.


 drivers/usb/storage/sddr09.c |  133 ---
 1 files changed, 77 insertions(+), 56 deletions(-)


diff -Nru a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
--- a/drivers/usb/storage/sddr09.c  Mon Dec 29 14:25:36 2003
+++ b/drivers/usb/storage/sddr09.c  Mon Dec 29 14:25:36 2003
@@ -66,7 +66,7 @@
  * NAND Flash Manufacturer ID Codes
  */
 #define NAND_MFR_AMD   0x01
-#define NAND_MFR_NS0x8f
+#define NAND_MFR_NATSEMI   0x8f
 #define NAND_MFR_TOSHIBA   0x98
 #define NAND_MFR_SAMSUNG   0xec
 
@@ -74,8 +74,8 @@
switch(manuf_id) {
case NAND_MFR_AMD:
return "AMD";
-   case NAND_MFR_NS:
-   return "NS";
+   case NAND_MFR_NATSEMI:
+   return "NATSEMI";
case NAND_MFR_TOSHIBA:
return "Toshiba";
case NAND_MFR_SAMSUNG:
@@ -302,8 +302,7 @@
if (result != USB_STOR_XFER_GOOD) {
US_DEBUGP("request sense bulk in failed\n");
return USB_STOR_TRANSPORT_ERROR;
-   }
-   else {
+   } else {
US_DEBUGP("request sense worked\n");
return USB_STOR_TRANSPORT_GOOD;
}
@@ -469,6 +468,8 @@
unsigned char *command = us->iobuf;
int result;
 
+   US_DEBUGP("sddr09_erase: erase address %lu\n", Eaddress);
+
memset(command, 0, 12);
command[0] = 0xEA;
command[1] = LUNBITS;
@@ -757,17 +758,27 @@
return result;
 }
 
-/* we never free blocks, so lastpba can only increase */
 static unsigned int
-sddr09_find_unused_pba(struct sddr09_card_info *info) {
+sddr09_find_unused_pba(struct sddr09_card_info *info, unsigned int lba) {
static unsigned int lastpba = 1;
-   int numblocks = info->capacity >> (info->blockshift + info->pageshift);
-   int i;
+   int zonestart, end, i;
+
+   zonestart = (lba/1000) << 10;
+   end = info->capacity >> (info->blockshift + info->pageshift);
+   end -= zonestart;
+   if (end > 1024)
+   end = 1024;
 
-   for (i = lastpba+1; i < numblocks; i++) {
-   if (info->pba_to_lba[i] == UNDEF) {
+   for (i = lastpba+1; i < end; i++) {
+   if (info->pba_to_lba[zonestart+i] == UNDEF) {
lastpba = i;
-   return i;
+   return zonestart+i;
+   }
+   }
+   for (i = 0; i <= lastpba; i++) {
+   if (info->pba_to_lba[zonestart+i] == UNDEF) {
+   lastpba = i;
+   return zonestart+i;
}
}
return 0;
@@ -784,21 +795,23 @@
unsigned int pagelen, blocklen;
unsigned char *blockbuffer, *bptr, *cptr, *xptr;
unsigned char ecc[3];
-   int i, result;
+   int i, result, isnew;
 
-   lbap = ((lba & 0x3ff) << 1) | 0x1000;
+   lbap = ((lba % 1000) << 1) | 0x1000;
if (parity[MSB_of(lbap) ^ LSB_of(lbap)])
lbap ^= 1;
pba = info->lba_to_pba[lba];
+   isnew = 0;
 
if (pba == UNDEF) {
-   pba = sddr09_find_unused_pba(info);
+   pba = sddr09_find_unused_pba(info, lba);
if (!pba) {
printk("sddr09_write_lba: Out of unused blocks\n");
return USB_STOR_TRANSPORT_ERROR;
}
info->pba_to_lba[pba] = lba;
info->lba_to_pba[lba] = pba;
+   isnew = 1;
}
 
if (pba == 1) {
@@ -823,8 +836,8 @@
if (result != USB_STOR_TRANSPORT_GOOD)
goto err;
 
-   /* check old contents */
-   for (i = 0; i < info->blockshift; i++) {
+   /* check old contents and fill lba */
+   for (i = 0; i < info->blocksize; i++) {
bptr = blockbuffer + i*pagelen;
cptr = bptr + info->pagesize;
nand_compute_ecc(bptr, ecc);
@@ -839,6 +852,8 @@
  i, pba);
nand_store_ecc(cptr+8, ecc);
}
+   cptr[6] = cptr[11] = MSB_of(lbap);
+   cptr[7] = cptr[12] = LSB_of(lbap);
}
 
/* copy in new stuff and compute ECC */
@@ -852,8 +867,6 @@
nand_store_ecc(cptr+13, ecc);
nand_compute_ecc(bptr+(info->pagesize / 2), ecc);
nand_store_ecc(cptr+8, ecc);
-   cptr[6] = cptr[11] = MSB_of(lbap);
-   cptr[7] = cptr[12] = LSB_of(lbap);
}
 
US_DEBUGP("Rewrite PBA %d (LBA %d)\n", pba, lba);
@@ -947,10 +960,11 @@
 

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.29, 2003/12/09 17:48:19-08:00, [EMAIL PROTECTED]

[PATCH] USB: sleeping problems in cyberjack driver

this driver has locking problems. Here's the first round of fixes
for the obvious cases.

- it makes clear differences between completion handlers and task context
- it fixes cases of sleeping in interrupt


 drivers/usb/serial/cyberjack.c |   25 +++--
 1 files changed, 11 insertions(+), 14 deletions(-)


diff -Nru a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
--- a/drivers/usb/serial/cyberjack.cMon Dec 29 14:23:45 2003
+++ b/drivers/usb/serial/cyberjack.cMon Dec 29 14:23:45 2003
@@ -295,7 +295,6 @@
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct cyberjack_private *priv = usb_get_serial_port_data(port);
-   unsigned long flags;
struct usb_serial *serial;
unsigned char *data = urb->transfer_buffer;
int result;
@@ -323,13 +322,13 @@
/* This is a announcement of coming bulk_ins. */
unsigned short size = ((unsigned short)data[3]<<8)+data[2]+3;
 
-   spin_lock_irqsave(&priv->lock, flags);
+   spin_lock(&priv->lock);
 
old_rdtodo = priv->rdtodo;
 
if( (old_rdtodo+size)<(old_rdtodo) ) {
dbg( "To many bulk_in urbs to do." );
-   spin_unlock_irqrestore(&priv->lock, flags);
+   spin_unlock(&priv->lock);
goto resubmit;
}
 
@@ -338,11 +337,11 @@
 
dbg("%s - rdtodo: %d", __FUNCTION__, priv->rdtodo);
 
-   spin_unlock_irqrestore(&priv->lock, flags);
+   spin_unlock(&priv->lock);
 
if( !old_rdtodo ) {
port->read_urb->dev = port->serial->dev;
-   result = usb_submit_urb(port->read_urb, GFP_KERNEL);
+   result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if( result )
err("%s - failed resubmitting read urb, error %d", 
__FUNCTION__, result);
dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
@@ -351,7 +350,7 @@
 
 resubmit:
port->interrupt_in_urb->dev = port->serial->dev;
-   result = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
+   result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
if (result)
err(" usb_submit_urb(read int) failed");
dbg("%s - usb_submit_urb(int urb)", __FUNCTION__);
@@ -361,7 +360,6 @@
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct cyberjack_private *priv = usb_get_serial_port_data(port);
-   unsigned long flags;
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer;
@@ -397,7 +395,7 @@
tty_flip_buffer_push(tty);
}
 
-   spin_lock_irqsave(&priv->lock, flags);
+   spin_lock(&priv->lock);
 
/* Reduce urbs to do by one. */
priv->rdtodo-=urb->actual_length;
@@ -405,14 +403,14 @@
if ( priv->rdtodo<0 ) priv->rdtodo = 0;
todo = priv->rdtodo;
 
-   spin_unlock_irqrestore(&priv->lock, flags);
+   spin_unlock(&priv->lock);
 
dbg("%s - rdtodo: %d", __FUNCTION__, todo);
 
/* Continue to read if we have still urbs to do. */
if( todo /* || (urb->actual_length==port->bulk_in_endpointAddress)*/ ) {
port->read_urb->dev = port->serial->dev;
-   result = usb_submit_urb(port->read_urb, GFP_KERNEL);
+   result = usb_submit_urb(port->read_urb, GFP_ATOMIC);
if (result)
err("%s - failed resubmitting read urb, error %d", 
__FUNCTION__, result);
dbg("%s - usb_submit_urb(read urb)", __FUNCTION__);
@@ -423,7 +421,6 @@
 {
struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
struct cyberjack_private *priv = usb_get_serial_port_data(port);
-   unsigned long flags;
struct usb_serial *serial = get_usb_serial (port, __FUNCTION__);
 
dbg("%s - port %d", __FUNCTION__, port->number);
@@ -438,7 +435,7 @@
return;
}
 
-   spin_lock_irqsave(&priv->lock, flags);
+   spin_lock(&priv->lock);
 
/* only do something if we have more data to send */
if( priv->wrfilled ) {
@@ -446,7 +443,7 @@
 
if (port->write_urb->status == -EINPROGRESS) {
dbg("%s - already writing", __FUNCTION__);
-   spin_unlock_irqrestore(&priv->lock, flags);
+   spin_unlock(&priv->lock);
return;
}
 
@@ -492,7 +489,7 @@
}
 
 exit:
-   spin_unlock_irqrestore(&priv->lock, flags);
+   spin_unlock(&priv->lock);
s

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1562, 2003/12/29 12:31:36-08:00, [EMAIL PROTECTED]

[PATCH] USB: disable hiddev support for MGE UPS

following my recent posts on libusb-devel and hidups, here's
a patch to disable hiddev support for MGE UPSs. It only
declares VID/PID as QUIRK_IGNORE in hid-core's blacklist.
This simply prevent hiddev to be loaded when plugging
an MGE UPS.


 drivers/usb/input/hid-core.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
--- a/drivers/usb/input/hid-core.c  Mon Dec 29 14:20:15 2003
+++ b/drivers/usb/input/hid-core.c  Mon Dec 29 14:20:15 2003
@@ -1388,8 +1388,8 @@
{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET },
{ USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
-   { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_HIDDEV },
-   { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_HIDDEV },
+   { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_IGNORE },
+   { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS1, HID_QUIRK_IGNORE },
{ USB_VENDOR_ID_TOPMAX, USB_DEVICE_ID_TOPMAX_COBRAPAD, HID_QUIRK_BADPAD },
{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_DRIVING, 
HID_QUIRK_BADPAD|HID_QUIRK_MULTI_INPUT },
{ USB_VENDOR_ID_HAPP, USB_DEVICE_ID_UGCI_FLYING, 
HID_QUIRK_BADPAD|HID_QUIRK_MULTI_INPUT },



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1337.3.2, 2003/10/09 10:45:31-07:00, [EMAIL PROTECTED]

[PATCH] USB: Add Lego USB Infrared Tower driver


 drivers/usb/misc/Kconfig|   12 
 drivers/usb/misc/Makefile   |1 
 drivers/usb/misc/legousbtower.c |  912 
 3 files changed, 925 insertions(+)


diff -Nru a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
--- a/drivers/usb/misc/Kconfig  Mon Dec 29 14:28:01 2003
+++ b/drivers/usb/misc/Kconfig  Mon Dec 29 14:28:01 2003
@@ -58,6 +58,18 @@
  To compile this driver as a module, choose M here: the
  module will be called rio500.
 
+config USB_LEGOTOWER
+   tristate "USB Lego Infrared Tower support (EXPERIMENTAL)"
+   depends on USB && EXPERIMENTAL
+   help
+ Say Y here if you want to connect a USB Lego Infrared Tower to your
+ computer's USB port.
+
+ This code is also available as a module ( = code which can be
+ inserted in and removed from the running kernel whenever you want).
+ The module will be called legousbtower. If you want to compile it as
+ a module, say M here and read .
+
 config USB_BRLVGER
tristate "Tieman Voyager USB Braille display support (EXPERIMENTAL)"
depends on USB && EXPERIMENTAL
diff -Nru a/drivers/usb/misc/Makefile b/drivers/usb/misc/Makefile
--- a/drivers/usb/misc/Makefile Mon Dec 29 14:28:01 2003
+++ b/drivers/usb/misc/Makefile Mon Dec 29 14:28:01 2003
@@ -12,3 +12,4 @@
 obj-$(CONFIG_USB_TEST) += usbtest.o
 obj-$(CONFIG_USB_TIGL) += tiglusb.o
 obj-$(CONFIG_USB_USS720)   += uss720.o
+obj-$(CONFIG_USB_LEGOTOWER)+= legousbtower.o
diff -Nru a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
--- /dev/null   Wed Dec 31 16:00:00 1969
+++ b/drivers/usb/misc/legousbtower.c   Mon Dec 29 14:28:01 2003
@@ -0,0 +1,912 @@
+/*
+ * LEGO USB Tower driver
+ *
+ * Copyright (c) 2003 David Glance <[EMAIL PROTECTED]> 
+ *   2001 Juergen Stuber <[EMAIL PROTECTED]>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * derived from USB Skeleton driver - 0.5
+ * Copyright (c) 2001 Greg Kroah-Hartman ([EMAIL PROTECTED])
+ *
+ * History:
+ *
+ * 2001-10-13 - 0.1 js
+ *   - first version
+ * 2001-11-03 - 0.2 js
+ *   - simplified buffering, one-shot URBs for writing
+ * 2001-11-10 - 0.3 js
+ *   - removed IOCTL (setting power/mode is more complicated, postponed)
+ * 2001-11-28 - 0.4 js
+ *   - added vendor commands for mode of operation and power level in open
+ * 2001-12-04 - 0.5 js
+ *   - set IR mode by default (by oversight 0.4 set VLL mode)
+ * 2002-01-11 - 0.5? pcchan
+ *   - make read buffer reusable and work around bytes_to_write issue between
+ * uhci and legusbtower
+ * 2002-09-23 - 0.52 david ([EMAIL PROTECTED])
+ *   - imported into lejos project
+ *   - changed wake_up to wake_up_interruptible
+ *   - changed to use lego0 rather than tower0
+ *   - changed dbg() to use __func__ rather than deprecated __FUNCTION__
+ * 2003-01-12 - 0.53 david ([EMAIL PROTECTED])
+ *   - changed read and write to write everything or timeout (from a patch by Chris 
Riesen and 
+ * Brett Thaeler driver)
+ *   - added ioctl functionality to set timeouts
+ * 2003-07-18 - 0.54 davidgsf ([EMAIL PROTECTED]) 
+ *   - initial import into LegoUSB project
+ *   - merge of existing LegoUSB.c driver
+ * 2003-07-18 - 0.56 davidgsf ([EMAIL PROTECTED]) 
+ *   - port to 2.6 style driver
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+
+#ifdef CONFIG_USB_DEBUG
+   static int debug = 4;
+#else
+   static int debug = 1;
+#endif
+
+/* Use our own dbg macro */
+#undef dbg
+#define dbg(lvl, format, arg...) do { if (debug >= lvl) printk(KERN_DEBUG  __FILE__ " 
: " format " \n", ## arg); } while (0)
+
+
+/* Version Information */
+#define DRIVER_VERSION "v0.56"
+#define DRIVER_AUTHOR "David Glance, [EMAIL PROTECTED]"
+#define DRIVER_DESC "LEGO USB Tower Driver"
+
+/* Module paramaters */
+MODULE_PARM(debug, "i");
+MODULE_PARM_DESC(debug, "Debug enabled or not");
+
+
+/* Define these values to match your device */
+#define LEGO_USB_TOWER_VENDOR_ID   0x0694
+#define LEGO_USB_TOWER_PRODUCT_ID  0x0001
+
+/* table of devices that work with this driver */
+static struct usb_device_id tower_table [] = {
+   { USB_DEVICE(LEGO_USB_TOWER_VENDOR_ID, LEGO_USB_TOWER_PRODUCT_ID) },
+   { } /* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE (usb, tower_table);
+
+/* FIXME: Get a minor range for your devices from the usb maintainer */
+#define LEGO_USB_TOWER_MINOR_BASE  0xB3
+
+/* we can have up to this number of device plugged in at once */
+#define MAX_DEVICES16

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1559, 2003/12/29 12:29:21-08:00, [EMAIL PROTECTED]

[PATCH] USB: gadget zero updates

Small updates:

   - support TC86c001 (goku_udc) controller
   - simplify the per-controller configuration
   - add two vendor requests to test control-OUT
   - some minor fixes


 drivers/usb/gadget/zero.c |  102 +++---
 1 files changed, 60 insertions(+), 42 deletions(-)


diff -Nru a/drivers/usb/gadget/zero.c b/drivers/usb/gadget/zero.c
--- a/drivers/usb/gadget/zero.c Mon Dec 29 14:20:36 2003
+++ b/drivers/usb/gadget/zero.c Mon Dec 29 14:20:36 2003
@@ -108,18 +108,14 @@
  *
  * CHIP ... hardware identifier
  * DRIVER_VERSION_NUM ... alerts the host side driver to differences
- * EP0_MAXPACKET ... controls packetization of control requests
  * EP_*_NAME ... which endpoints do we use for which purpose?
  * EP_*_NUM ... numbers for them (often limited by hardware)
  * HIGHSPEED ... define if ep0 and descriptors need high speed support
  * MAX_USB_POWER ... define if we use other than 100 mA bus current
- * SELFPOWER ... unless we can run on bus power, USB_CONFIG_ATT_SELFPOWER
+ * SELFPOWER ... if we can run on bus power, zero
  * WAKEUP ... if hardware supports remote wakeup AND we will issue the
  * usb_gadget_wakeup() call to initiate it, USB_CONFIG_ATT_WAKEUP
  *
- * hw_optimize(gadget) ... for any hardware tweaks we want to kick in
- * before we enable our endpoints
- *
  * add other defines for other portability issues, like hardware that
  * for some reason doesn't handle full speed bulk maxpacket of 64.
  */
@@ -138,25 +134,13 @@
 #ifdef CONFIG_USB_ZERO_NET2280
 #define CHIP   "net2280"
 #define DRIVER_VERSION_NUM 0x0101
-#define EP0_MAXPACKET  64
 static const char EP_OUT_NAME [] = "ep-a";
 #define EP_OUT_NUM 2
 static const char EP_IN_NAME [] = "ep-b";
 #define EP_IN_NUM  2
 #define HIGHSPEED
 /* specific hardware configs could be bus-powered */
-#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
 /* supports remote wakeup, but this driver doesn't */
-
-extern int net2280_set_fifo_mode (struct usb_gadget *gadget, int mode);
-
-static inline void hw_optimize (struct usb_gadget *gadget)
-{
-   /* we can have bigger ep-a/ep-b fifos (2KB each, 4 packets
-* for highspeed bulk) because we're not using ep-c/ep-d.
-*/
-   net2280_set_fifo_mode (gadget, 1);
-}
 #endif
 
 /*
@@ -173,17 +157,12 @@
 #ifdef CONFIG_USB_ZERO_PXA2XX
 #define CHIP   "pxa2xx"
 #define DRIVER_VERSION_NUM 0x0103
-#define EP0_MAXPACKET  16
 static const char EP_OUT_NAME [] = "ep12out-bulk";
 #define EP_OUT_NUM 12
 static const char EP_IN_NAME [] = "ep11in-bulk";
 #define EP_IN_NUM  11
 /* doesn't support bus-powered operation */
-#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
 /* supports remote wakeup, but this driver doesn't */
-
-/* no hw optimizations to apply */
-#define hw_optimize(g) do {} while (0);
 #endif
 
 /*
@@ -200,22 +179,32 @@
 #ifdef CONFIG_USB_ZERO_SA1100
 #define CHIP   "sa1100"
 #define DRIVER_VERSION_NUM 0x0105
-#define EP0_MAXPACKET  8
 static const char EP_OUT_NAME [] = "ep1out-bulk";
 #define EP_OUT_NUM 1
 static const char EP_IN_NAME [] = "ep2in-bulk";
 #define EP_IN_NUM  2
 /* doesn't support bus-powered operation */
-#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
 /* doesn't support remote wakeup? */
+#endif
 
-/* no hw optimizations to apply */
-#define hw_optimize(g) do {} while (0);
+/*
+ * Toshiba TC86C001 ("Goku-S") UDC
+ *
+ * This has three semi-configurable full speed bulk/interrupt endpoints.
+ */
+#ifdef CONFIG_USB_ZERO_GOKU
+#define CHIP   "goku"
+#define DRIVER_VERSION_NUM 0x0106
+static const char EP_OUT_NAME [] = "ep1-bulk";
+#define EP_OUT_NUM 1
+static const char EP_IN_NAME [] = "ep2-bulk";
+#define EP_IN_NUM  2
+/* doesn't support remote wakeup */
 #endif
 
 /*-*/
 
-#ifndef EP0_MAXPACKET
+#ifndef EP_OUT_NUM
 #  error Configure some USB peripheral controller driver!
 #endif
 
@@ -224,10 +213,10 @@
  */
 
 #ifndefSELFPOWER
-/* default: say we rely on bus power */
-#define SELFPOWER  0
+/* default: say we're self-powered */
+#define SELFPOWER USB_CONFIG_ATT_SELFPOWER
 /* else:
- * - SELFPOWER value must be USB_CONFIG_ATT_SELFPOWER
+ * - SELFPOWER value must be zero
  * - MAX_USB_POWER may be nonzero.
  */
 #endif
@@ -338,14 +327,13 @@
 #defineCONFIG_SOURCE_SINK  3
 #defineCONFIG_LOOPBACK 2
 
-static const struct usb_device_descriptor
+static struct usb_device_descriptor
 device_desc = {
.bLength =  sizeof device_desc,
.bDescriptorType =  USB_DT_DEVICE,
 
.bcdUSB =   __constant_cpu_to_le16 (0x0200),
.bDeviceClass = USB_CLASS_VENDOR_SPEC,
-   .bMaxPacketSize0 =  EP0_MAXPACKET,
 
.idVendor = __constant_cp

[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.38, 2003/12/11 17:06:32-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Another unusual_devs.h update

On Thu, 20 Nov 2003, Stefan J. Betz wrote:

> Hello People,
>
> i have some Mitsumi USB Floppy Drive with the following Data:
> Manufactur: Mitsumi
> Typ   : D353FUE
>
> When i plug this Device into my Linux Box (Kernel 2.6.0-test9), i get
> the following messages in my Syslog:
>
> Nov 20 22:17:57 mobileone kernel: hub 1-0:1.0: new USB device on port 1, assigned 
> address 2
> Nov 20 22:17:57 mobileone kernel: usb-storage: This device (03ee,6901,0100 S 04 P 
> 00) has unneeded SubClass and Protocol entries in unusual_devs.h
> Nov 20 22:17:57 mobileone kernel:Please send a copy of this message to <[EMAIL 
> PROTECTED]>
> Nov 20 22:17:57 mobileone kernel: scsi2 : SCSI emulation for USB Mass Storage devices
> Nov 20 22:17:57 mobileone kernel:   Vendor: MITSUMI   Model: USB FDD   Rev: 
> 1039
> Nov 20 22:17:57 mobileone kernel:   Type:   Direct-Access  ANSI 
> SCSI revision: 02
> Nov 20 22:17:57 mobileone kernel: Attached scsi generic sg2 at scsi2, channel 0, id 
> 0, lun 0,  type 0

> I that is enough information to Support that drive (or how can i use ist
> today?)
>
> Greeting Betz Stefan

Thank you for sending this in.  The usb-storage driver will be updated
sometime after 2.6.0-final is released.

Alan Stern


 drivers/usb/storage/unusual_devs.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:45 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:22:45 2003
@@ -53,7 +53,7 @@
 UNUSUAL_DEV(  0x03ee, 0x6901, 0x, 0x0100,
"Mitsumi",
"USB FDD",
-   US_SC_UFI, US_PR_CBI, NULL,
+   US_SC_DEVICE, US_PR_DEVICE, NULL,
US_FL_SINGLE_LUN ),
 
 UNUSUAL_DEV(  0x03f0, 0x0107, 0x0200, 0x0200, 



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.31, 2003/12/11 11:43:15-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Make Pentax Optio S4 work

The change below is needed to get the S4 camera working.
Tested with both Optio S/S4


 drivers/usb/storage/unusual_devs.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
--- a/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:32 2003
+++ b/drivers/usb/storage/unusual_devs.hMon Dec 29 14:23:32 2003
@@ -605,8 +605,8 @@
 /* Submitted by Per Winkvist <[EMAIL PROTECTED]> */
 UNUSUAL_DEV( 0x0a17, 0x006, 0x1000, 0x9009,
 "Pentax",
-"Optio S",
-US_SC_8070, US_PR_CBI, NULL,
+"Optio S/S4",
+US_SC_DEVICE, US_PR_DEVICE, NULL,
 US_FL_FIX_INQUIRY ),

 #ifdef CONFIG_USB_STORAGE_ISD200



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.19, 2003/12/09 09:54:51-08:00, [EMAIL PROTECTED]

[PATCH] USB: fix up compiler warning in usblp driver caused by previous patches.


 drivers/usb/class/usblp.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
--- a/drivers/usb/class/usblp.c Mon Dec 29 14:24:53 2003
+++ b/drivers/usb/class/usblp.c Mon Dec 29 14:24:53 2003
@@ -673,8 +673,12 @@
 
usblp->writeurb->dev = usblp->dev;
usblp->wcomplete = 0;
-   if (err = usb_submit_urb(usblp->writeurb, GFP_KERNEL)) {
-   count = err != -ENOMEM ? -EIO : (writecount ? writecount : 
-ENOMEM);
+   err = usb_submit_urb(usblp->writeurb, GFP_KERNEL);
+   if (err) {
+   if (err != -ENOMEM)
+   count = -EIO;
+   else
+   count = writecount ? writecount : -ENOMEM;
up (&usblp->sem);
break;
}



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.42, 2003/12/12 09:35:24-08:00, [EMAIL PROTECTED]

[PATCH] USB: don't send any MODE SENSE commands to usb mass storage devices

This patch basically eliminates the use of MODE_SENSE or MODE_SENSE_10 for
direct-access USB storage devices.  That $&%*! command has caused us more
trouble than all the others combined, and after more than a year we still
don't have a good way of handling/using them.

I constantly get complaints about devices which don't work because of the
way 2.5/6 uses MODE_SENSE and MODE_SENSE_10 -- this patch will greatly
increase compatiblity with devices.  As with the patch to limit transfer
sizes, I'd like to see this applied as soon as possible.

Matt

> - Forwarded message from Patrick Mansfield <[EMAIL PROTECTED]> -
>
> Date: Thu, 20 Nov 2003 08:28:27 -0800
> From: Patrick Mansfield <[EMAIL PROTECTED]>
> Subject: [PATCH] don't send any MODE SENSE commands to usb mass storage devices
> To: [EMAIL PROTECTED]

Matthew -

Is this patch in your queue? I don't see it in Linus' tree yet.

Don't send any MODE SENSE commands to usb mass storage devices.


 drivers/usb/storage/scsiglue.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


diff -Nru a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
--- a/drivers/usb/storage/scsiglue.cMon Dec 29 14:22:19 2003
+++ b/drivers/usb/storage/scsiglue.cMon Dec 29 14:22:19 2003
@@ -325,7 +325,8 @@
.emulated = TRUE,
 
/* modify scsi_device bits on probe */
-   .flags = (BLIST_MS_SKIP_PAGE_08 | BLIST_USE_10_BYTE_MS),
+   .flags = (BLIST_MS_SKIP_PAGE_08 | BLIST_MS_SKIP_PAGE_3F |
+ BLIST_USE_10_BYTE_MS),
 
/* module management */
.module =   THIS_MODULE



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
ChangeSet 1.1504.2.14, 2003/12/08 17:45:04-08:00, [EMAIL PROTECTED]

[PATCH] USB storage: Remove dead code from debug.c

This patch removes an uncalled subroutine from debug.c.  I only noticed it
when tracking down scatter-gather usage; there didn't seem to be any
reason to repair it since it wasn't being used anywhere.


 drivers/usb/storage/debug.c |   59 
 drivers/usb/storage/debug.h |1 
 2 files changed, 60 deletions(-)


diff -Nru a/drivers/usb/storage/debug.c b/drivers/usb/storage/debug.c
--- a/drivers/usb/storage/debug.c   Mon Dec 29 14:25:29 2003
+++ b/drivers/usb/storage/debug.c   Mon Dec 29 14:25:29 2003
@@ -150,65 +150,6 @@
US_DEBUGPX("\n");
 }
 
-void usb_stor_print_Scsi_Cmnd(Scsi_Cmnd *cmd)
-{
-   int i=0, bufferSize = cmd->request_bufflen;
-   u8 *buffer = cmd->request_buffer;
-   struct scatterlist *sg = (struct scatterlist*)cmd->request_buffer;
-
-   US_DEBUGP("Dumping information about %p.\n", cmd);
-   US_DEBUGP("cmd->cmnd[0] value is %d.\n", cmd->cmnd[0]);
-   US_DEBUGP("(MODE_SENSE is %d and MODE_SENSE_10 is %d)\n",
- MODE_SENSE, MODE_SENSE_10);
-
-   US_DEBUGP("buffer is %p with length %d.\n", buffer, bufferSize);
-   for (i=0; iuse_sg );
-   for (i=0; iuse_sg; i++) {
-   char *adr = sg_address(sg[i]);
-   
-   US_DEBUGP("Length of scatterlist %d is %d.\n",i,sg[i].length);
-   US_DEBUGP("%02x %02x %02x %02x %02x %02x %02x %02x\n"
- "%02x %02x %02x %02x %02x %02x %02x %02x\n",
- adr[0],
- adr[1],
- adr[2],
- adr[3],
- adr[4],
- adr[5],
- adr[6],
- adr[7],
- adr[8],
- adr[9],
- adr[10],
- adr[11],
- adr[12],
- adr[13],
- adr[14],
- adr[15]);
-   }
-}
-
 void usb_stor_show_sense(
unsigned char key,
unsigned char asc,
diff -Nru a/drivers/usb/storage/debug.h b/drivers/usb/storage/debug.h
--- a/drivers/usb/storage/debug.h   Mon Dec 29 14:25:29 2003
+++ b/drivers/usb/storage/debug.h   Mon Dec 29 14:25:29 2003
@@ -53,7 +53,6 @@
 
 #ifdef CONFIG_USB_STORAGE_DEBUG
 void usb_stor_show_command(Scsi_Cmnd *srb);
-void usb_stor_print_Scsi_Cmnd( Scsi_Cmnd* cmd );
 void usb_stor_show_sense( unsigned char key,
unsigned char asc, unsigned char ascq );
 #define US_DEBUGP(x...) printk( KERN_DEBUG USB_STORAGE x )



---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] [BK PATCH] USB patches for 2.6.0

2003-12-29 Thread Greg KH
On Mon, Dec 29, 2003 at 02:34:22PM -0800, Greg KH wrote:
> Hi,
> 
> Here are some USB patches for 2.6.0.

And for those of you that have sent me USB patches, but don't see them
here, don't worry, they are still in my todo queue, and I will get to
them, hopefully by the end of the week.  I just wanted to get this large
batch out as soon as possible.

thanks,

greg k-h


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Usb patch : interval of iso urb doesn't get initialized.

2003-12-29 Thread Duncan Sands
>- That epnum_to_ep_desc() result shouldn't be used without a bit
>  more locking; else the config could change from under usbfs.
...
> I cc'd Duncan Sands, who's got a devio.c patch in the works that'll
> fix a bunch of such stuff.

Hi Dave, I'm sorry that my patch is slow in coming - I'm busy testing
it (will wonders never cease?).  Problems are showing up in
usb_set_configuration.  Can you please tell me - how (and where) is
a driver's disconnect method called?  I ask because in some situations
usbfs's disconnect method is not being called.  The only place I see is
in usb_unbind_interface.  usb_unbind_interface seems to be passed to
sysfs in usb_register:
new_driver->driver.remove = usb_unbind_interface;
When does that get called?  I guess it gets called by (for example)
usb_disable_device when it does device_del(&interface->dev);
Is that right?

Thanks,

Duncan.


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Usb patch : interval of iso urb doesn't get initialized.

2003-12-29 Thread David Brownell
Duncan Sands wrote:
  - That epnum_to_ep_desc() result shouldn't be used without a bit
more locking; else the config could change from under usbfs.
...

I cc'd Duncan Sands, who's got a devio.c patch in the works that'll
fix a bunch of such stuff.


Hi Dave, I'm sorry that my patch is slow in coming - I'm busy testing
it (will wonders never cease?).  Problems are showing up in
Testing is usually the under-estimated 80% of development time!
And I'm not surprised that particular patch is taking a while,
especially this time of year.

usb_set_configuration.  Can you please tell me - how (and where) is
a driver's disconnect method called?  I ask because in some situations
Disconnection is only triggered through the driver model, somewhere
in the device_del() and/or device_release_driver() paths.  That's
a point that's very easy to miss (non-obvious).
There's also a complication (suffered almost entirely by usbfs) in
the existence of a sort of "half bound" state for driver bindings
established through usb_driver_claim_interface().

usbfs's disconnect method is not being called.  The only place I see is
in usb_unbind_interface.  usb_unbind_interface seems to be passed to
sysfs in usb_register:
new_driver->driver.remove = usb_unbind_interface;
When does that get called?  I guess it gets called by (for example)
usb_disable_device when it does device_del(&interface->dev);
Is that right?
One other place is from usb_driver_release_interface(), but that
won't happen unless the driver model was used to claim the interface.
That locking patch of mine (in the latest 2.6 BK trees) cleans up
some of those cases; but not all.
In particular I didn't remove usb_interface.driver -- so usbcore
would use only usb_interface.dev.driver -- because once I started
down that path, I was sure I'd end up touching way too much of
the usbfs code.  Just like you're already doing ... but you're
actually set up to test after such changes!  ;)
If you need to have disconnect() called in all cases, feel free
to get rid of usb_interface.driver ... it needs to go someday,
and I'd guess that's making trouble for you.
I can't see the CDC (ACM, Ethernet) or audio (ALSA, OSS) drivers
getting into trouble with that any time soon, but those are the
only other users of the claim/release calls righ now.
- Dave



Thanks,

Duncan.





---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Problem with USB in 2.6.0 kernel

2003-12-29 Thread Greg KH
On Sun, Dec 28, 2003 at 03:14:17PM -0500, Alan Stern wrote:
> 
> Apparently some devices put extra garbage at the end of their
> configuration information.  For the particular device considered here,
> there's a device descriptor followed by an illegal length-1 descriptor.  
> (Note that configuration information should never include a device
> descriptor -- or a configuration descriptor anywhere but at the start, for
> that matter.)
> 
> If we encounter this sort of thing, should we reject the entire device?  

As much as I would like to, we really shouldn't.

> Or should we simply stop parsing the configuration information at that 
> point?

I think we should do this, along with a nice error message in the syslog
saying what we just did.

thanks,

greg k-h


---
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
___
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: [2.6 patch] improce USB Gadget Kconfig

2003-12-29 Thread David Brownell
Adrian Bunk wrote:
The patch below contains small changes to the USB Gadget Kconfig.

The main change is that multiple modular peripheral controllers are no 
longer allowed (currently only one is there, but this may change).
How about using this approach instead?   It simplifies the kconfig
for the gadget drivers by providing a boolean "which hardware"
symbol, so gadget drivers don't need to make their own.  The symbol
that's synthetic is the one needed only by the Makefile.
It's a larger change, but likely a better one.  Greg, does it
behave for you?
Roman, this seems to trigger some kind of xconfig/menuconfig bug,
since I can go down the list of hardware options (net2280, goku,
dummy -- three, not the single one Adrian was working with) and
each deselects the previous selection ... but then it's impossible
to turn off the dummy, and select real hardware.
- Dave

#
# USB Gadget support on a system involves
#(a) a peripheral controller, and
#(b) the gadget driver using it.
#
menu "USB Gadget Support"

config USB_GADGET
tristate "Support for USB Gadgets"
depends on EXPERIMENTAL
help
   USB is a master/slave protocol, organized with one master
   host (such as a PC) controlling up to 127 peripheral devices.
   The USB hardware is asymmetric, which makes it easier to set up:
   you can't connect two "to-the-host" connectors to each other.

   Linux can run in the host, or in the peripheral.  In both cases
   you need a low level bus controller driver, and some software
   talking to it.  Peripheral controllers are often discrete silicon,
   or are integrated with the CPU in a microcontroller.  The more
   familiar host side controllers have names like like "EHCI", "OHCI",
   or "UHCI", and are usually integrated into southbridges on PC
   motherboards.

   Enable this configuration option if you want to run Linux inside
   a USB peripheral device.  Configure one hardware driver for your
   peripheral/device side bus controller, and a "gadget driver" for
   your peripheral protocol.  (If you use modular gadget drivers,
   you may configure more than one.)

   If in doubt, say "N" and don't enable these drivers; most people
   don't have this kind of hardware (except maybe inside Linux PDAs).

#
# USB Peripheral Controller Support
#
choice
prompt "USB Peripheral Controller Support"
depends on USB_GADGET != n
optional
help
   A USB device uses a controller to talk to its host.
   Systems should have only one such upstream link.

config USB_GADGET_NET2280
boolean "NetChip 2280 USB Peripheral Controller"
depends on PCI
help
   NetChip 2280 is a PCI based USB peripheral controller which
   supports both full and high speed USB 2.0 data transfers.  
   
   It has six configurable endpoints, as well as endpoint zero
   (for control transfers) and several endpoints with dedicated
   functions.

   Say "y" to link the driver statically, or "m" to build a
   dynamically linked module called "net2280" and force all
   gadget drivers to also be dynamically linked.

config USB_GADGET_PXA2XX
boolean "PXA 2xx USB Device Controller"
depends on ARCH_PXA
help
   Intel's PXA 2xx series XScale ARM-5TE processors include
   an integrated full speed USB 1.1 device controller.

   It has fifteen fixed-function endpoints, as well as endpoint
   zero (for control transfers).

   Say "y" to link the driver statically, or "m" to build a
   dynamically linked module called "pxa2xx_udc" and force all
   gadget drivers to also be dynamically linked.

config USB_GADGET_GOKU
boolean "Toshiba TC86C001 (Goku-S) USB Device Controller"
depends on PCI
help
   The Toshiba TC86C001 is a PCI device which includes controllers
   for full speed USB devices, IDE, I2C, SIO, plus a USB host (OHCI).
   
   The device controller has three configurable (bulk or interrupt)
   endpoints, plus endpoint zero (for control transfers).

   Say "y" to link the driver statically, or "m" to build a
   dynamically linked module called "goku_udc" and to force all
   gadget drivers to also be dynamically linked.

# this could be built elsewhere (doesn't yet exist)
config USB_GADGET_SA1100
boolean "SA 1100 USB Device Controller"
depends on ARCH_SA1100
help
   Intel's SA-1100 is an ARM-4 processor with an integrated
   full speed USB 1.1 device controller.

   It has two fixed-function endpoints, as well as endpoint
   zero (for control transfers).

config USB_GADGET_DUMMY_HCD
boolean "Dummy HCD support (DEVELOPMENT)"
depe