Re: [linux-usb-devel] [PATCH] USB: delete the bluetty driver

2005-10-29 Thread Marcel Holtmann
Hi Greg,

 We have a real Bluetooth system in Linux, lets finally delete this driver as 
 no
 one is using it (and if they are, they are using a closed source bluetooth
 stack, which I can't support anyway.)

I had my patch waiting for you to do this, but you were faster in
submitting it to Linus. And of course with less discussion ;)

 Marcel, you owe me a beer :)

Make it two if you apply the attached patch.

Regards

Marcel

[PATCH] USB: Delete leftovers from bluetty driver

This patch deletes the bluetooth.txt help file of the bluetty driver and
hands over its major device nodes for character devices to the RFCOMM TTY
implementation of the Bluetooth subsystem.

Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]

---
commit b11537c12ca162f731e3c6adba4580ef3c60c06e
tree a8340129dc9aad58515488fd35383cfdf3393fb4
parent 8a212ab6b8a4ccc6f3c3d1beba5f92655c576404
author Marcel Holtmann [EMAIL PROTECTED] Sat, 29 Oct 2005 13:39:35 +0200
committer Marcel Holtmann [EMAIL PROTECTED] Sat, 29 Oct 2005 13:39:35 +0200

 Documentation/devices.txt   |   12 +--
 Documentation/usb/bluetooth.txt |   44 ---
 2 files changed, 6 insertions(+), 50 deletions(-)

diff --git a/Documentation/devices.txt b/Documentation/devices.txt
index 0f51517..3c406ac 100644
--- a/Documentation/devices.txt
+++ b/Documentation/devices.txt
@@ -2903,14 +2903,14 @@ Your cooperation is appreciated.
196 = /dev/dvb/adapter3/video0first video decoder of fourth 
card
 
 
-216 char   USB BlueTooth devices
- 0 = /dev/ttyUB0   First USB BlueTooth device
- 1 = /dev/ttyUB1   Second USB BlueTooth device
+216 char   Bluetooth RFCOMM TTY devices
+ 0 = /dev/rfcomm0  First Bluetooth RFCOMM TTY 
device
+ 1 = /dev/rfcomm1  Second Bluetooth RFCOMM TTY 
device
...
 
-217 char   USB BlueTooth devices (alternate devices)
- 0 = /dev/cuub0Callout device for ttyUB0
- 1 = /dev/cuub1Callout device for ttyUB1
+217 char   Bluetooth RFCOMM TTY devices (alternate devices)
+ 0 = /dev/curf0Callout device for rfcomm0
+ 1 = /dev/curf1Callout device for rfcomm1
...
 
 218 char   The Logical Company bus Unibus/Qbus adapters
diff --git a/Documentation/usb/bluetooth.txt b/Documentation/usb/bluetooth.txt
deleted file mode 100644
index 774f5d3..000
--- a/Documentation/usb/bluetooth.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-INTRODUCTION
-
-  The USB Bluetooth driver supports any USB Bluetooth device.
-  It currently works well with the Linux USB Bluetooth stack from Axis 
-  (available at http://developer.axis.com/software/bluetooth/ ) and 
-  has been rumored to work with other Linux USB Bluetooth stacks.
-
-
-CONFIGURATION
-
-  Currently the driver can handle up to 256 different USB Bluetooth 
-  devices at once. 
-
-  If you are not using devfs:
-The major number that the driver uses is 216 so to use the driver,
-create the following nodes:
-   mknod /dev/ttyUB0 c 216 0
-   mknod /dev/ttyUB1 c 216 1
-   mknod /dev/ttyUB2 c 216 2
-   mknod /dev/ttyUB3 c 216 3
-   .
-   .
-   .
-   mknod /dev/ttyUB254 c 216 254
-   mknod /dev/ttyUB255 c 216 255
-
-  If you are using devfs:
-The devices supported by this driver will show up as
-/dev/usb/ttub/{0,1,...}
-
-  When the device is connected and recognized by the driver, the driver
-  will print to the system log, which node the device has been bound to.
-
-
-CONTACT:
-
-  If anyone has any problems using this driver, please contact me, or 
-  join the Linux-USB mailing list (information on joining the mailing 
-  list, as well as a link to its searchable archive is at 
-  http://www.linux-usb.org/ )
-
-
-Greg Kroah-Hartman
[EMAIL PROTECTED]


[linux-usb-devel] [PATCH resend] Add alauda usb-storage support

2005-10-29 Thread Daniel Drake
Matt, I guess you are busy, but is there any chance you can find some time to 
review this in the next couple of weeks? If acceptable, I'd like to see this 
in 2.6.15.


This patch adds another usb-storage subdriver, which supports two fairly old 
dual-XD/SmartMedia reader-writers (USB1.1 devices).


I wrote this driver without specs, however a vendor-supplied GPL driver for 
the previous generation of products (sma03) did prove to be quite useful, as 
did the sddr09 driver which also has to deal with low-level physical block 
layout on SmartMedia.


Please review and forward onto Greg if acceptable.

Signed-off-by: Daniel Drake [EMAIL PROTECTED]


diff -urNpX dontdiff linux/drivers/usb/storage/alauda.c linux/drivers/usb/storage/alauda.c
--- linux/drivers/usb/storage/alauda.c	1970-01-01 01:00:00.0 +0100
+++ linux/drivers/usb/storage/alauda.c	2005-10-01 16:48:25.0 +0100
@@ -0,0 +1,1119 @@
+/*
+ * Driver for Alauda-based card readers
+ *
+ * Current development and maintenance by:
+ *   (c) 2005 Daniel Drake [EMAIL PROTECTED]
+ *
+ * The 'Alauda' is a chip manufacturered by RATOC for OEM use.
+ *
+ * Alauda implements a vendor-specific command set to access two media reader
+ * ports (XD, SmartMedia). This driver converts SCSI commands to the commands
+ * which are accepted by these devices.
+ *
+ * The driver was developed through reverse-engineering, with the help of the
+ * sddr09 driver which has many similarities, and with some help from the
+ * (very old) vendor-supplied GPL sma03 driver.
+ *
+ * For protocol info, see http://alauda.sourceforge.net
+ *
+ * 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, or (at your option) any
+ * later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include scsi/scsi.h
+#include scsi/scsi_cmnd.h
+#include scsi/scsi_device.h
+
+#include usb.h
+#include transport.h
+#include protocol.h
+#include debug.h
+#include alauda.h
+
+#define short_pack(lsb,msb) ( ((u16)(lsb)) | ( ((u16)(msb))8 ) )
+#define LSB_of(s) ((s)0xFF)
+#define MSB_of(s) ((s)8)
+
+#define MEDIA_PORT(us) us-srb-device-lun
+#define MEDIA_INFO(us) ((struct alauda_info *)us-extra)-port[MEDIA_PORT(us)]
+
+#define PBA_LO(pba) ((pba  0xF)  5)
+#define PBA_HI(pba) (pba  3)
+#define PBA_ZONE(pba) (pba  11)
+
+/*
+ * Media handling
+ */
+
+struct alauda_card_info {
+	unsigned char id;		/* id byte */
+	unsigned char chipshift;	/* 1cs bytes total capacity */
+	unsigned char pageshift;	/* 1ps bytes in a page */
+	unsigned char blockshift;	/* 1bs pages per block */
+	unsigned char zoneshift;	/* 1zs blocks per zone */
+};
+
+static struct alauda_card_info alauda_card_ids[] = {
+	/* NAND flash */
+	{ 0x6e, 20, 8, 4, 8},	/* 1 MB */
+	{ 0xe8, 20, 8, 4, 8},	/* 1 MB */
+	{ 0xec, 20, 8, 4, 8},	/* 1 MB */
+	{ 0x64, 21, 8, 4, 9}, 	/* 2 MB */
+	{ 0xea, 21, 8, 4, 9},	/* 2 MB */
+	{ 0x6b, 22, 9, 4, 9},	/* 4 MB */
+	{ 0xe3, 22, 9, 4, 9},	/* 4 MB */
+	{ 0xe5, 22, 9, 4, 9},	/* 4 MB */
+	{ 0xe6, 23, 9, 4, 10},	/* 8 MB */
+	{ 0x73, 24, 9, 5, 10},	/* 16 MB */
+	{ 0x75, 25, 9, 5, 10},	/* 32 MB */
+	{ 0x76, 26, 9, 5, 10},	/* 64 MB */
+	{ 0x79, 27, 9, 5, 10},	/* 128 MB */
+	{ 0x71, 28, 9, 5, 10},	/* 256 MB */
+
+	/* MASK ROM */
+	{ 0x5d, 21, 9, 4, 8},	/* 2 MB */
+	{ 0xd5, 22, 9, 4, 9},	/* 4 MB */
+	{ 0xd6, 23, 9, 4, 10},	/* 8 MB */
+	{ 0x57, 24, 9, 4, 11},	/* 16 MB */
+	{ 0x58, 25, 9, 4, 12},	/* 32 MB */
+	{ 0,}
+};
+
+static struct alauda_card_info *alauda_card_find_id(unsigned char id) {
+	int i;
+
+	for (i = 0; alauda_card_ids[i].id != 0; i++)
+		if (alauda_card_ids[i].id == id)
+			return (alauda_card_ids[i]);
+	return NULL;
+}
+
+/*
+ * ECC computation.
+ */
+
+static unsigned char parity[256];
+static unsigned char ecc2[256];
+
+static void nand_init_ecc(void) {
+	int i, j, a;
+
+	parity[0] = 0;
+	for (i = 1; i  256; i++)
+		parity[i] = (parity[i(i-1)] ^ 1);
+
+	for (i = 0; i  256; i++) {
+		a = 0;
+		for (j = 0; j  8; j++) {
+			if (i  (1j)) {
+if ((j  1) == 0)
+	a ^= 0x04;
+if ((j  2) == 0)
+	a ^= 0x10;
+if ((j  4) == 0)
+	a ^= 0x40;
+			}
+		}
+		ecc2[i] = ~(a ^ (a1) ^ (parity[i] ? 0xa8 : 0));
+	}
+}
+
+/* compute 3-byte ecc on 256 bytes */
+static void nand_compute_ecc(unsigned char *data, unsigned char *ecc) {
+	int i, j, a;
+	unsigned char par, bit, bits[8];
+
+	par = 0;
+	for (j = 0; j  8; j++)
+		bits[j] = 0;
+
+	/* collect 16 checksum bits */
+	for (i = 0; i  256; i++) {
+		par ^= data[i];
+		bit = parity[data[i]];
+		for (j 

Re: [linux-usb-devel] [PATCH] USB: delete the bluetty driver

2005-10-29 Thread Marcel Holtmann
Hi Greg,

  Marcel, you owe me a beer :)
 
 Make it two if you apply the attached patch.

I also updated my bluetty-2.6 repository so that you can pull this patch
from it now.

Regards

Marcel


Please pull from

http://www.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetty-2.6.git

This will update the following files:

 Documentation/devices.txt   |   12 +-
 Documentation/usb/bluetooth.txt |   44 
 2 files changed, 6 insertions(+), 50 deletions(-)

through these ChangeSets:

Marcel Holtmann [EMAIL PROTECTED] Sat, 29 Oct 2005 15:56:06 +0200

[PATCH] USB: Delete leftovers from bluetty driver

This patch deletes the bluetooth.txt help file of the bluetty driver and
hands over its major device nodes for character devices to the RFCOMM TTY
implementation of the Bluetooth subsystem.

Signed-off-by: Marcel Holtmann [EMAIL PROTECTED]





---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] lease send a copy of this message to linux-usb-devel@lists.sourceforge.net

2005-10-29 Thread Thorsten George

Hi





Oct 29 20:43:54 atlantis kernel: usb 1-1.4: new full speed 
USB device using address 5
Oct 29 20:43:54 atlantis kernel: usb 1-1.4: Product: NEC USB 
UF000x

Oct 29 20:43:54 atlantis kernel: usb 1-1.4: Manufacturer: NEC
Oct 29 20:43:54 atlantis kernel: usb-storage: This device 
(0409,0040,0150 S 04 P 00) has unneeded SubClass and 
Protocol entries in unusual_devs.h
Oct 29 20:43:54 atlantis kernel:Please send a copy of 
this message to linux-usb-devel@lists.sourceforge.net
Oct 29 20:43:55 atlantis kernel: scsi2 : SCSI emulation for 
USB Mass Storage devices
Oct 29 20:43:55 atlantis kernel:   Vendor: NEC   Model: 
USB UF000xRev: 1.50
Oct 29 20:43:55 atlantis kernel:   Type:   Direct-Access 
  ANSI SCSI revision: 02
Oct 29 20:43:57 atlantis kernel: SCSI device sda: 2880 
512-byte hdwr sectors (1 MB)

Oct 29 20:43:57 atlantis kernel: sda: Write Protect is off
Oct 29 20:43:57 atlantis kernel: sda: Mode Sense: 00 46 94 00
Oct 29 20:43:57 atlantis kernel: sda: assuming drive cache: 
write through

Oct 29 20:43:58 atlantis kernel:  sda:
Oct 29 20:43:59 atlantis 
/etc/dev.d/block/51-subfs.dev[24615]: umount block device 
/block/sda
Oct 29 20:43:59 atlantis 
/etc/dev.d/block/51-subfs.dev[24615]: umount: /dev/sda: not 
mounted
Oct 29 20:44:01 atlantis kernel: Attached scsi removable 
disk sda at scsi2, channel 0, id 0, lun 0
Oct 29 20:44:01 atlantis kernel: Attached scsi generic sg0 
at scsi2, channel 0, id 0, lun 0,  type 0
Oct 29 20:44:03 atlantis kernel: USB Mass Storage device 
found at 5
Oct 29 20:44:07 atlantis 
/etc/dev.d/block/50-hwscan.dev[24807]: new block device 
/block/sda
Oct 29 20:44:07 atlantis 
/etc/dev.d/block/51-subfs.dev[24821]: mount block device 
/block/sda



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Character gadget

2005-10-29 Thread Joshua Wise

Hi all,

Over the past few years, handhelds.org has been maintaining a small gadget
inside of its own tree called g_char. g_char was spawned in the days
before g_serial, as a response to the new USB gadget API's replacement of
the old way of doing things (usb_char talking to gadget controller drivers
with no common API). [1]

Recently, I found that g_serial was a little too complex for our needs for a
current project (Linux as Bootloader), so I decided to spend some hours
resurrecting g_char, and I think I have it in a state in which it's ready to
push upstream.

g_char is a g_zero-derived gadget, as many others are, supporting one
configuration. It registers a misc device (10, 240 -- is there something I
should be doing with this that's better? I believe that's what usb-char did
in the past), which can be opened once the gadget has been bound. Reads are
buffered, but writes are not. It emulates a seriial device in that it does
not error if there is nothing on the other side, which is a characteristic
that is vital for LAB (at the moment).

It is not as fully functional as g_serial, but it does not intend to be --
its main goal is to stay small in a situation where every byte counts:
   textdata bss dec hex filename
  14454 596 332   153823c16 drivers/usb/gadget/g_serial.o
   6220 484 10468081a98 drivers/usb/gadget/g_char.o
[EMAIL PROTECTED]:~/Code/iPAQ/kernel26$ wc -l drivers/usb/gadget/serial.c
drivers/usb/gadget/char.c
 2437 drivers/usb/gadget/serial.c
  921 drivers/usb/gadget/char.c

It can be presently retrieved from handhelds.org CVS, or downloaded from my
site[2].

The requisite line in Makefile is as such:
g_serial-objs := serial.o usbstring.o config.o epautoconf.o

and the requisite Kconfig goo is as such:
config USB_G_CHAR
tristate Character Gadget
help
  Character Gadget is what usb-char used to be. Have fun.

I understand that it'll probably not be ready for a commit now, but it's a
lot cleaner than it used to be. Can someone run a pair of eyes over it and
tell me if anything is glaringly preventing it from going into the tree?

Thanks,
joshua


[1] http://marc.theaimsgroup.com/?l=linux-usb-develm=106254956522642w=2
[2] http://joshuawise.com/char.c


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Re: This is regarding module count usage for usbserial driver

2005-10-29 Thread Greg KH

A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

A: No.
Q: Should I include quotations after my reply?


On Sat, Oct 29, 2005 at 05:15:20PM +0530, [EMAIL PROTECTED] wrote:
 Please find the enclosed attachment of usb-serial.c driver in which I'm
 facing problems, which I mentioned in the previous mail.

No, not the usb-serial.c code, everyone has access to that.  I mean your
usb-serial driver that registers with this usb-serial.c core.

Unless you have modified this copy of usb-serial.c?  If you have, please
just send the diff, not the whole thing.

Also, what kernel version are you using?

thanks,

greg k-h


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


Re: [linux-usb-devel] Character gadget

2005-10-29 Thread Alan Stern
On Sat, 29 Oct 2005, Joshua Wise wrote:

 I understand that it'll probably not be ready for a commit now, but it's a
 lot cleaner than it used to be. Can someone run a pair of eyes over it and
 tell me if anything is glaringly preventing it from going into the tree?

Here are a few comments, mixed in with your code.

 #define DBUFMAX 65536

This is pretty big for a kernel buffer.  You ought to be able to
use something smaller.

 static unsigned buflen = 2048;
 static unsigned qlen = 8;

It's not clear that these values are the best.  It depends on the
characteristics of the transfers you expect.

 static const struct usb_device_descriptor
 device_desc = {
...
   .bMaxPacketSize0 =  EP0_MAXPACKET,

For portability, this value cannot be predefined.  You have to get
it from the controller driver.

 static void gchar_complete (struct usb_ep *ep, struct usb_request *req)
 {
   struct gchar_dev*dev = ep-driver_data;
   int status = req-status;
 
   switch (status) {
 
   case 0: /* normal completion? */
   if (ep == dev-out_ep) {

This is an unnecessary test.  What other endpoint could it be?

   /* it looks like you've got a packet! */
   req-zero = (req-actual  req-length);

There's no point setting req-zero for an OUT transfer.

   req-length = req-actual;
   
   spin_lock(dev-buflock);
   if ((dev-databuflen+req-actual)  DBUFMAX) {

You might as well copy all the data that will fit.  Is there any
reason to leave out an entire packet if it's a few bytes too long?

   memcpy(dev-databuf[dev-databuflen], 
 req-buf, req-actual);
   dev-databuflen += req-actual;
   }
   spin_unlock(dev-buflock);
   wake_up_interruptible(dev-wait);
   
   /* queue the buffer for some later OUT packet */
   req-length = buflen;
   status = usb_ep_queue (dev-out_ep, req, GFP_ATOMIC);
   if (status == 0)
   return;
   
   ERROR (dev, complete: failed to requeue request -- 
 %d\n, status);
   return;
   }

This next section is all dead code.

   /* queue the buffer for some later OUT packet */
   req-length = buflen;
   status = usb_ep_queue (dev-out_ep, req, GFP_ATOMIC);
   
   ERROR (dev, complete: invalid endpoint -- %s (%d/%d)\n, 
 ep-name, req-actual, req-length);
   if (status == 0)
   return;
   /* FALLTHROUGH */

What is it doing here?  Looks like it something got left out or moved
to the wrong spot.


 static ssize_t read_gchar(struct file* file, char* buf, size_t count, loff_t 
 *ppos)

Isn't buf supposed to be __user?  And ditto for the write_gchar routine?

   struct gchar_dev *dev = (struct gchar_dev *)file-private_data;
   ssize_t readcnt;
   DECLARE_WAITQUEUE(wait, current);
   
   add_wait_queue(dev-wait, wait);
   current-state = TASK_INTERRUPTIBLE;
 
   do {
   if (dev-databuflen != 0)
   break;
 
   if (file-f_flags  O_NONBLOCK)
   {
   readcnt = -EAGAIN;
   goto out;
   }
 
   if (!dev-configured)
   return -ENXIO;

Whoops!  You're still in TASK_INTERRUPTIBLE.

   schedule();
   } while (1);
 
   spin_lock_irq(dev-buflock);
   readcnt = (count  dev-databuflen) ? dev-databuflen : count;
   memcpy(buf, dev-databuf, readcnt);

Shouldn't this be copy_from_user?

   memmove(dev-databuf, dev-databuf+readcnt, 
 dev-databuflen-readcnt);
   dev-databuflen -= readcnt;
   spin_unlock_irq(dev-buflock);


 static ssize_t write_gchar(struct file* file, const char* buf, size_t count, 
 loff_t* ppos)
 {
   struct gchar_dev *dev = (struct gchar_dev *)file-private_data;
   struct usb_request *req;
   int result;
   
   req = alloc_ep_req (dev-in_ep, count);
 
   if (!dev)
   return 0;
   
   if (!dev-configured)
   return 0;

Looks like these tests should go before the alloc_ep_req call.  On the
other hand, I don't see how dev could ever be NULL.

 static loff_t null_lseek(struct file * file, loff_t offset, int orig)
 {
   return file-f_pos = 0;
 }

Isn't there a standard kernel routine to do this for you?


Alan Stern



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course

Re: [linux-usb-devel] Character gadget

2005-10-29 Thread Joshua Wise

Here are a few comments, mixed in with your code.

Thanks!


#define DBUFMAX 65536

This is pretty big for a kernel buffer.  You ought to be able to
use something smaller.

I agree. I dropped it to 8k, which is a nicer size -- It gives me about
seven YMODEM-1k packets.


It's not clear that these values are the best.  It depends on the
characteristics of the transfers you expect.

I'm expecting mostly YMODEM-1k packets that will be acknowledged before more
are transmitted. I dropped buflen to 1536, and I dropped qlen to 4, which
should be more than plenty if I choose to use YMODEM-1k-g.


For portability, this value cannot be predefined.  You have to get
it from the controller driver.

Appropriate code nabbed from zero.c.


if (ep == dev-out_ep) {

This is an unnecessary test.  What other endpoint could it be?

Okay. I left a paranoia test in there anyway, but now the whole thing isn't
if'ed in. Good coding style change mostly, but it helps readability.


req-zero = (req-actual  req-length);

There's no point setting req-zero for an OUT transfer.

Okay. I have no idea what req-zero actually does. I think I grabbed it from
zero.c. Does req-zero mean send a ZLP at the end?


You might as well copy all the data that will fit.  Is there any
reason to leave out an entire packet if it's a few bytes too long?

Nope, you're right. On a real serial FIFO, it'd just overflow. Sounds good
to me.


This next section is all dead code.

Whoops. Removed.


static ssize_t read_gchar(struct file* file, char* buf, size_t count, loff_t 
*ppos)

Isn't buf supposed to be __user?  And ditto for the write_gchar routine?

Changed.


if (!dev-configured)
return -ENXIO;

Whoops!  You're still in TASK_INTERRUPTIBLE.

You are right, I am! That if is gone now, anyway. But, should I be doing
some signal stuff here, or will schedule() do that for me?



memcpy(buf, dev-databuf, readcnt);

Shouldn't this be copy_from_user?

copy_to_user, yeah. Thanks.


if (!dev-configured)
return 0;

Looks like these tests should go before the alloc_ep_req call.  On the
other hand, I don't see how dev could ever be NULL.

if(dev) removed. Configured moved.


static loff_t null_lseek(struct file * file, loff_t offset, int orig)
{
return file-f_pos = 0;
}

Isn't there a standard kernel routine to do this for you?

Dunno. It's simple enough to have here, anyway.

I uploaded my new version to joshuawise.com/char.c again. Thanks!


Alan Stern

Thanks again for your time!
Joshua




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel




---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] Fw: [Bugme-new] [Bug 5525] New: With gentoo-sources-2.6.13-r3 usb scanner doesn't work

2005-10-29 Thread Andrew Morton


Begin forwarded message:

Date: Sat, 29 Oct 2005 13:16:38 -0700
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Bugme-new] [Bug 5525] New: With gentoo-sources-2.6.13-r3 usb scanner 
doesn't work


 http://bugzilla.kernel.org/show_bug.cgi?id=5525

Summary: With gentoo-sources-2.6.13-r3 usb scanner doesn't work
 Kernel Version: 2.6.13


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] [PATCH] Eagle and ADI 930 usb adsl modem driver

2005-10-29 Thread matthieu castet

Hi,

attached is the driver for USB ADSL modems based on the ADI eagle
chipset using the usb_atm infrastructure.

The managing part was taken from bsd ueagle driver, other parts were
written from scratch.

The driver uses the in-kernel firmware loader :
- to load  a first usb firmware when the modem is in pre-firmware state
- to load the dsp firmware that are swapped in host memory.
- to load CMV (configuration and management variables) when the modem
boot. (We can't use options or sysfs for this as there many possible
values. See
https://mail.gna.org/public/eagleusb-dev/2005-04/msg00031.html for a
description of some)
- to load fpga code for 930 chipset.

The device had 4 endpoints :
* 2 for data (use by usbatm). The incoming
endpoint could be iso or bulk. The modem seems buggy and produce lot's
of atm errors when using it in bulk mode for speed  3Mbps, so iso
endpoint is need for speed  3Mbps. At the moment iso endpoint need a
patched usbatm library and for this reason is not included in this patch.

* One bulk endpoint for uploading dsp firmware

* One irq endpoint that notices the driver
   - if we need to upload a page of the dsp firmware
   - an ack for read or write CMV and the value (for the read case).

If order to make the driver cleaner, we design synchronous
(read|write)_cmv :
-send a synchronous control message to the modem
-wait for an ack or a timeout
-return the value if needed.

In order to run these synchronous usb messages we need a kernel thread.



Please comment and consider for inclusion.

The driver has been tested  with sagem fast 800 modems with different 
eagle chipset revision and with ADI 930 since April 2005.


Thanks.

Matthieu

diff -rNu -x '*.ko*' -x '*.mod*' -x '*.o*' linux-2.6.14/drivers/usb/atm.old/Kconfig linux-2.6.14/drivers/usb/atm/Kconfig
--- linux-2.6.14/drivers/usb/atm.old/Kconfig	2005-10-28 02:02:08.0 +0200
+++ linux-2.6.14/drivers/usb/atm/Kconfig	2005-10-30 00:17:33.0 +0200
@@ -44,6 +44,19 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called cxacru.
 
+config USB_UEAGLEATM
+	tristate ADI 930 and eagle USB DSL modem
+	depends on USB_ATM
+	select FW_LOADER
+	help
+	  Say Y here if you have an ADSL USB modem based on the ADI 930
+	  or eagle chipset. In order to use your modem you will need to
+	  install firmwares and CMV (Command Management Variables); see
+	  https://gna.org/projects/ueagleatm/ for details.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called ueagle-atm.
+	  
 config USB_XUSBATM
 	tristate Other USB DSL modem support
 	depends on USB_ATM
diff -rNu -x '*.ko*' -x '*.mod*' -x '*.o*' linux-2.6.14/drivers/usb/atm.old/Makefile linux-2.6.14/drivers/usb/atm/Makefile
--- linux-2.6.14/drivers/usb/atm.old/Makefile	2005-10-28 02:02:08.0 +0200
+++ linux-2.6.14/drivers/usb/atm/Makefile	2005-10-30 00:17:33.0 +0200
@@ -4,5 +4,6 @@
 
 obj-$(CONFIG_USB_CXACRU)	+= cxacru.o
 obj-$(CONFIG_USB_SPEEDTOUCH)	+= speedtch.o
+obj-$(CONFIG_USB_UEAGLEATM)	+= ueagle-atm.o
 obj-$(CONFIG_USB_ATM)		+= usbatm.o
 obj-$(CONFIG_USB_XUSBATM)	+= xusbatm.o
diff -rNu -x '*.ko*' -x '*.mod*' -x '*.o*' linux-2.6.14/drivers/usb/atm.old/ueagle-atm.c linux-2.6.14/drivers/usb/atm/ueagle-atm.c
--- linux-2.6.14/drivers/usb/atm.old/ueagle-atm.c	1970-01-01 01:00:00.0 +0100
+++ linux-2.6.14/drivers/usb/atm/ueagle-atm.c	2005-10-30 00:36:37.0 +0200
@@ -0,0 +1,1607 @@
+/*-
+ * Copyright (c) 2003, 2004
+ *	Damien Bergamini [EMAIL PROTECTED]. All rights reserved.
+ *
+ * Copyright (c) 2005 Matthieu Castet [EMAIL PROTECTED]
+ *
+ * This software is available to you under a choice of one of two
+ * licenses. You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * BSD license below:
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice unmodified, this list of conditions, and the following
+ *disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED 

Re: [linux-usb-devel] Character gadget

2005-10-29 Thread Alan Stern
On Sat, 29 Oct 2005, Joshua Wise wrote:

 req-zero = (req-actual  req-length);
  There's no point setting req-zero for an OUT transfer.
 Okay. I have no idea what req-zero actually does. I think I grabbed it from
 zero.c. Does req-zero mean send a ZLP at the end?

Pretty much.  To be precise, it means The transfer needs to end with a
short packet, so if the length is an exact multiple of the maxpacket size
and isn't 0, add an extra ZLP at the end.

 if (!dev-configured)
 return -ENXIO;
  Whoops!  You're still in TASK_INTERRUPTIBLE.
 You are right, I am! That if is gone now, anyway. But, should I be doing
 some signal stuff here, or will schedule() do that for me?

You should; schedule won't do it for you.  The idea is that when schedule
returns, you should call signal_pending(current) and return -ERESTARTSYS
if the result isn't 0.

  static loff_t null_lseek(struct file * file, loff_t offset, int orig)
  {
 return file-f_pos = 0;
  }
  Isn't there a standard kernel routine to do this for you?
 Dunno. It's simple enough to have here, anyway.

According to LDD3, you can set the function pointer to no_llseek (defined
in linux/fs.h), and you can even go so far as to call
nonseekable_open(inode, filp) in your open method.

 I uploaded my new version to joshuawise.com/char.c again. Thanks!

You're welcome.

Alan Stern



---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] disabling usb input devices

2005-10-29 Thread Lengyel Gabor
Hi!

I've written a kernel module that on certain conditions can disable and 
reenable AT and PS/2 keyboards and mice. But how should I do this properly 
with usb input peripherals? I've read what I could, looked at usbkbd.c, 
usbmouse.c, etc. but could not yet figure it out...
How can I disable/enable usb keyboards and mice from a kernel module?

Thank you in advance,
Gabor Lengyel


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel


[linux-usb-devel] USB 2.0 Bulk Transfer 1024 Bytes fails.

2005-10-29 Thread Jayaprakash Shanmugam
Hi All,

  We have a ISP 1561 based USB host (supports both ohci and ehci) in
our board.  When we have the ohci drivers for this host, we were able
to transfer 1024 bytes of bulk data from the device connected to it. 
But, when we read the bulk data (1024 bytes) with ehci drivers
installed, it returns EOVERFLOW error.  Can any of you help me to fix
this up ?  Is this a limitation with USB 2.0 EHCI drivers ???

Note: I am using kernel 2.6.

Thanks  Regards,
Jayaprakash.


---
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel