Re: [linux-usb-devel] Printer Gadget / Device Class Driver

2007-04-24 Thread Craig W. Nadler
Here is an update version of my printer gadget driver for the Linux 2.6.20.7 kernel. http://nadler.us/src/g_printer_2.6.20.7.patch Best Regards, Craig Nadler diff -Nru a/Documentation/usb/gadget_printer.txt b/Documentation/usb/gadget_printer.txt --- a/Documentation/usb/gadget_printer.txt

Re: [linux-usb-devel] Printer Gadget / Device Class Driver

2007-04-24 Thread David Brownell
Thanks for refreshing that, Craig. I was cleaning out some mail and found previous versions. Maybe it's finally time to merge. :) On Monday 23 April 2007, Craig W. Nadler wrote: diff -Nru a/Documentation/usb/gadget_printer.txt b/Documentation/usb/gadget_printer.txt ---

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Wael Adel
On 4/23/07, Alan Stern [EMAIL PROTECTED] wrote: On Mon, 23 Apr 2007, nesta wrote: hi all, i have 2 questions: 1) i make simple while loop,at the host side, in which i m receiving the data using the read function of usb-skeleton module,it is as follows:

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 11:46 schrieb Wael Adel: retval = usb_submit_urb(urb, GFP_KERNEL); if (retval) { err(%s - failed submitting write urb, error %d, __FUNCTION__, retval); goto error; } if (buf != NULL) {   

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Wael Adel
On 4/24/07, Oliver Neukum [EMAIL PROTECTED] wrote: Am Dienstag, 24. April 2007 11:46 schrieb Wael Adel: retval = usb_submit_urb(urb, GFP_KERNEL); if (retval) { err(%s - failed submitting write urb, error %d, __FUNCTION__, retval); goto

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 12:06 schrieb Wael Adel: On 4/24/07, Oliver Neukum [EMAIL PROTECTED] wrote: Am Dienstag, 24. April 2007 11:46 schrieb Wael Adel:         retval = usb_submit_urb(urb, GFP_KERNEL);         if (retval) {                 err(%s - failed submitting write urb,

[linux-usb-devel] How to verify the existence of USB device

2007-04-24 Thread Babu, Narendra (GE Healthcare)
Hi All, I am a application developer on Linux. Currently I am working on an USB application where I need to check whether the device is connected or not. Description: Linux kernel version 2.4 Whenever a USB device is getting connected, hotplug will recognize this and mount it on to a

Re: [linux-usb-devel] How to verify the existence of USB device

2007-04-24 Thread Samuel Ortiz
Babu, Narendra (GE Healthcare) wrote: Hi All, I am a application developer on Linux. Currently I am working on an USB application where I need to check whether the device is connected or not. Description: Linux kernel version 2.4 Whenever a USB device is getting connected,

Re: [linux-usb-devel] How to verify the existence of USB device

2007-04-24 Thread Babu, Narendra (GE Healthcare)
Hi Samuel, Thanks for the reply. You are right. We are getting the hotplug event when the device is removed. But the problem is, when this event is triggered I am not getting the device node info (like /dev/sda1). Any idea how to get this device node information at script level during device

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Wael Adel
On 4/24/07, Oliver Neukum [EMAIL PROTECTED] wrote: Am Dienstag, 24. April 2007 12:06 schrieb Wael Adel: On 4/24/07, Oliver Neukum [EMAIL PROTECTED] wrote: Am Dienstag, 24. April 2007 11:46 schrieb Wael Adel: retval = usb_submit_urb(urb, GFP_KERNEL); if (retval) {

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 13:19 schrieb Wael Adel: so these are the required modifications required to wait until the urb is finished then i can transfer the read data to the user-space

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Wael Adel
Dear Oliver forgive me for my many questions but here are the modificaions that u adviced me to do but i think there is still something wrong because when the gadget sends hello for example to the host, my computer is hanging so what is the error ,i m gonna be made: here is the last code for

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 14:58 schrieb Wael Adel: Dear Oliver forgive me for my many questions but here are the No problem. Only those who refuse to ask are foolish. modificaions that u adviced me to do but i think there is still something wrong because when the gadget sends hello for

[linux-usb-devel] [patch]a lockless method to alter pm count

2007-04-24 Thread Oliver Neukum
Hi, some drivers'll need a lockless method to alter the pm count in order to take locks by themselves in correct order. Regards Oliver Signed-off-by: Oliver Neukum [EMAIL PROTECTED] -- --- a/include/linux/usb.h 2007-04-24 14:12:23.0 +0200 +++

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Wael Adel
On 4/24/07, Oliver Neukum [EMAIL PROTECTED] wrote: Am Dienstag, 24. April 2007 14:58 schrieb Wael Adel: Dear Oliver forgive me for my many questions but here are the No problem. Only those who refuse to ask are foolish. modificaions that u adviced me to do but i think there is still

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 15:18 schrieb Wael Adel: On 4/24/07, Oliver Neukum [EMAIL PROTECTED] wrote: Am Dienstag, 24. April 2007 14:58 schrieb Wael Adel: Dear Oliver forgive me for my many questions but here are the No problem. Only those who refuse to ask are foolish.

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Wael Adel
i have tried the driver now on a small application in which i print what i receive from the gadget so when the gadget sends hello for example, the application just prints some noise characters. i thinks that copy_to_user does not work right or its location should be adjusted? does copy_to_user

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 16:35 schrieb Wael Adel: have tried the driver now on a small application in which i print what i receive from the gadget so when the gadget sends hello for example, the application just prints some noise characters. Are you sure the callbacks don't report errors

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Wael Adel
Actaully i have returned again to usb_bulk_msg with timeout set to zero so it Builds a bulk urb, sends it off and waits forever until it is completed. and here is my simple application that uses the skeleton module: *

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 19:18 schrieb Wael Adel: also the sending side of the gadget is closed ? so how can i solve this.i dont want the phrase of insize is -1 to be printed . i just want the output to be insize is 5 hello then it stops printing until the gadget sends another thing

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 19:28 schrieb Wael Adel: My crystal ball is damp today. Please send the source. here is the total source code of the host side: I need your driver code. From your description of the output it is clear that you are getting errors on subsequent reads. As you

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Wael Adel
here it is the read part of the skeleton driver: static ssize_t skel_read(struct file *file, char *buffer, size_t count, loff_t *ppos) { struct usb_skel *dev; int retval = -1; int bytes_read; dev = (struct usb_skel *)file-private_data; /* do a

[linux-usb-devel] [PATCH 3b/6] USB: remove references to dev.power.power_state

2007-04-24 Thread Alan Stern
This revised patch (as891b) removes two unnecessary references to intf-dev.power.power_state from usb-storage, and replaces a reference to root_hub-dev.power.power_state with a check of hcd-state. This is in preparation for the removal of dev.power.power_state, which is already deprecated.

Re: [linux-usb-devel] how can i make the skeleton read function blocking function?

2007-04-24 Thread Alan Stern
On Mon, 23 Apr 2007, Wael Adel wrote: bu when the gadget really sends a word like hello host for example, the host really receives it but still printing the phrase of insize is 64 i.e the output is as follows: insize is 64 hello host insize is 64 insize is 64 and it

Re: [linux-usb-devel] Is libusb dead?

2007-04-24 Thread Alan Stern
On Mon, 23 Apr 2007, Greg KH wrote: On the other hand, maybe it doesn't really matter. Looking again, I see the device's directory in sysfs contains a symlink to the class device: lrwxrwxrwx 1 root root 0 Apr 23 18:11 usb1/usb_device:usbdev1.1 -

Re: [linux-usb-devel] [patch]a lockless method to alter pm count

2007-04-24 Thread Alan Stern
On Tue, 24 Apr 2007, Oliver Neukum wrote: Hi, some drivers'll need a lockless method to alter the pm count in order to take locks by themselves in correct order. (Minor comment: Acquiring the lock yourself to alter the pm count isn't quite the same as doing it locklessly.) Can you give an

Re: [linux-usb-devel] [patch]a lockless method to alter pm count

2007-04-24 Thread Oliver Neukum
Am Dienstag, 24. April 2007 21:47 schrieb Alan Stern: On Tue, 24 Apr 2007, Oliver Neukum wrote: Hi, some drivers'll need a lockless method to alter the pm count in order to take locks by themselves in correct order. (Minor comment: Acquiring the lock yourself to alter the pm count

Re: [linux-usb-devel] [1/3] 2.6.21-rc7: known regressions (v2)

2007-04-24 Thread Adrian Bunk
On Tue, Apr 24, 2007 at 05:14:28PM -0700, Greg KH wrote: On Tue, Apr 24, 2007 at 11:32:53AM +0200, Wolfgang Erig wrote: On Mon, Apr 23, 2007 at 03:18:19PM -0700, Greg KH wrote: On Mon, Apr 23, 2007 at 11:48:47PM +0200, Adrian Bunk wrote: This email lists some known regressions in Linus'

[linux-usb-devel] RFC/patch: authorizing (or not) devices to connect to the system

2007-04-24 Thread Inaky Perez-Gonzalez
Hi All As part of the work for Wireless USB, I need to introduce in the USB stack the concept of unauthorized vs authorized device. The first one is one that cannot be really used until we move it to authorized, but at least we have some knowledge of it. I've been toying with some patches to

[linux-usb-devel] RFC/patch 1/6: wusb: add authorization control for devices

2007-04-24 Thread Inaky Perez-Gonzalez
# HG changeset patch # User Inaky Perez-Gonzalez [EMAIL PROTECTED] # Date 1177378585 25200 # Node ID caf1be8549a3874d10978af31930b587566dd4f1 # Parent 67b01ce175a4afd1881bec0177a7fcba02bda61f wusb: add authorization control for devices This patch introduces 'struct usb_device'-authorized.

[linux-usb-devel] RFC/patch 2/6: wusb: unauth devices don't query descriptors

2007-04-24 Thread Inaky Perez-Gonzalez
# HG changeset patch # User Inaky Perez-Gonzalez [EMAIL PROTECTED] # Date 1177378641 25200 # Node ID 862192faf844ea7c9ed50e7b189019ef601324a2 # Parent caf1be8549a3874d10978af31930b587566dd4f1 wusb: unauth devices don't query descriptors This patch introduces 'struct usb_device'-wusb that is set

Re: [linux-usb-devel] [1/3] 2.6.21-rc7: known regressions (v2)

2007-04-24 Thread Greg KH
On Wed, Apr 25, 2007 at 02:29:58AM +0200, Adrian Bunk wrote: On Tue, Apr 24, 2007 at 05:14:28PM -0700, Greg KH wrote: On Tue, Apr 24, 2007 at 11:32:53AM +0200, Wolfgang Erig wrote: On Mon, Apr 23, 2007 at 03:18:19PM -0700, Greg KH wrote: On Mon, Apr 23, 2007 at 11:48:47PM +0200, Adrian

[linux-usb-devel] RFC/patch 3/6: usb: move initialization of wusb and auth defaults to usb_alloc_dev()

2007-04-24 Thread Inaky Perez-Gonzalez
# HG changeset patch # User Inaky Perez-Gonzalez [EMAIL PROTECTED] # Date 1177445170 25200 # Node ID ea995fd510552dfce57a0283205277950655024b # Parent 862192faf844ea7c9ed50e7b189019ef601324a2 usb: move initialization of wusb and auth defaults to usb_alloc_dev() Initialize early the authorization

[linux-usb-devel] RFC/patch 4/6: usb: fix string collection for unauth devices

2007-04-24 Thread Inaky Perez-Gonzalez
# HG changeset patch # User Inaky Perez-Gonzalez [EMAIL PROTECTED] # Date 1177452430 25200 # Node ID 4a813201f50ac479b26852a2591588e2260e7a9d # Parent ea995fd510552dfce57a0283205277950655024b usb: fix string collection for unauth devices diff -r ea995fd51055 -r 4a813201f50a

[linux-usb-devel] RFC/patch 4/6: usb: stablish a per-host default device authorization state

2007-04-24 Thread Inaky Perez-Gonzalez
# HG changeset patch # User Inaky Perez-Gonzalez [EMAIL PROTECTED] # Date 1177452551 25200 # Node ID a1f71724f48c863b6b84d2bc56d9035edc8284bc # Parent 4a813201f50ac479b26852a2591588e2260e7a9d usb: stablish a per-host default device authorization state By poking in

[linux-usb-devel] RFC/patch 5/6: usb: split usb_new_device for clarity and refactoring

2007-04-24 Thread Inaky Perez-Gonzalez
# HG changeset patch # User Inaky Perez-Gonzalez [EMAIL PROTECTED] # Date 1177458827 25200 # Node ID 79751b058ef127578c4830644d575d8f474d2f43 # Parent a1f71724f48c863b6b84d2bc56d9035edc8284bc usb: split usb_new_device for clarity and refactoring This patch takes hub.c:usb_new_device() and splits

[linux-usb-devel] RFC/patch 6/6: usb: add hooks up be able to authorize/deauthorize a device from sysfs

2007-04-24 Thread Inaky Perez-Gonzalez
# HG changeset patch # User Inaky Perez-Gonzalez [EMAIL PROTECTED] # Date 1177462041 25200 # Node ID 65c5954e4e34e3f7a965cd8e402cc61bd88cb305 # Parent 79751b058ef127578c4830644d575d8f474d2f43 usb: add hooks up be able to authorize/deauthorize a device from sysfs diff -r 79751b058ef1 -r

Re: [linux-usb-devel] RFC/patch: authorizing (or not) devices to connect to the system

2007-04-24 Thread Eric Blossom
On Tue, Apr 24, 2007 at 05:46:16PM -0700, Inaky Perez-Gonzalez wrote: Hi All As part of the work for Wireless USB, I need to introduce in the USB stack the concept of unauthorized vs authorized device. The first one is one that cannot be really used until we move it to authorized, but at

Re: [linux-usb-devel] [1/3] 2.6.21-rc7: known regressions (v2)

2007-04-24 Thread Adrian Bunk
On Tue, Apr 24, 2007 at 05:51:11PM -0700, Greg KH wrote: On Wed, Apr 25, 2007 at 02:29:58AM +0200, Adrian Bunk wrote: On Tue, Apr 24, 2007 at 05:14:28PM -0700, Greg KH wrote: On Tue, Apr 24, 2007 at 11:32:53AM +0200, Wolfgang Erig wrote: On Mon, Apr 23, 2007 at 03:18:19PM -0700, Greg KH

Re: [linux-usb-devel] RFC/patch 1/6: wusb: add authorization control for devices

2007-04-24 Thread David Brownell
On Tuesday 24 April 2007, Inaky Perez-Gonzalez wrote: This patch introduces 'struct usb_device'-authorized. Devices with that bit set can be used in the system (drivers are allow to attach). Devices that don't will have the usb_probe routine aborting driver binding. This is needed for

Re: [linux-usb-devel] RFC/patch 5/6: usb: split usb_new_device for clarity and refactoring

2007-04-24 Thread David Brownell
On Tuesday 24 April 2007, Inaky Perez-Gonzalez wrote: This patch takes hub.c:usb_new_device() and splits it in three parts: ... When a device is authorized connection, we need to run through the hoops we didn't run when it was connected but not authorized, which is basically parsing the

Re: [linux-usb-devel] RFC/patch: authorizing (or not) devices to connect to the system

2007-04-24 Thread David Brownell
On Tuesday 24 April 2007, Inaky Perez-Gonzalez wrote: I've been toying with some patches to implement this concept also in a generic way so that it could be used to implement a control mechanism for locking down systems (like for example, don't connect this kind of hw, because policy won't

Re: [linux-usb-devel] RFC/patch: authorizing (or not) devices to connect to the system

2007-04-24 Thread David Brownell
On Tuesday 24 April 2007, Eric Blossom wrote: On Tue, Apr 24, 2007 at 05:46:16PM -0700, Inaky Perez-Gonzalez wrote: Hi All As part of the work for Wireless USB, I need to introduce in the USB stack the concept of unauthorized vs authorized device. The first one is one that cannot be

Re: [linux-usb-devel] RFC/patch 6/6: usb: add hooks up be able to authorize/deauthorize a device from sysfs

2007-04-24 Thread David Brownell
Again, what wireless USB talked about (last I read the specs!) was purely an *AUTHENTICATION* step ... which I'd exect to work by relying on the access key retention keystore mechanism. At which point the standard key management operations would handle all of this stuff. I'd really hate to see