Re: [linux-usb-devel] Removing Gadget File Storage module

2007-05-29 Thread Ragner N Magalhães
On 5/28/07, Alan Stern [EMAIL PROTECTED] wrote:
 On Mon, 28 May 2007, Ragner N Magalhães wrote:

  Hi all,
   I am working with OMAP H2 and when I run rmmod g_file_storage, it
  stay waiting some thing and not terminate ...
 
   Somebody know some thing about this ?

 Which version of the Linux kernel are you using?

I am using the last omap git tree from
http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git


 If you enable debugging in g_file_storage, what shows up in the dmesg
 log?
...
udc: OMAP UDC driver, version: 4 October 2004 (iso) (dma)
bus platform: add driver omap_udc
platform: Matched Device omap_udc with Driver omap_udc
platform: Probing driver omap_udc with device omap_udc
udc: OMAP UDC rev 3.6, Mini-AB
udc: hmc mode 19, isp1301_omap transceiver
udc: fifo mode 3, 392 bytes not used
DEV: registering device: ID = 'gadget'
PM: Adding info for No Bus:gadget
bound device 'omap_udc' to driver 'omap_udc'
platform: Bound Device omap_udc to Driver omap_udc
DEV: registering device: ID = 'vcs2'
PM: Adding info for No Bus:vcs2
DEV: registering device: ID = 'vcsa2'
PM: Adding info for No Bus:vcsa2
DEV: registering device: ID = 'vcs1'
PM: Adding info for No Bus:vcs1
DEV: registering device: ID = 'vcsa1'
PM: Adding info for No Bus:vcsa1
DEV: registering device: ID = 'gadget-lun0'
PM: Adding info for No Bus:gadget-lun0
g_file_storage gadget: File-backed Storage Gadget, version: 28 November 2005
g_file_storage gadget: Number of LUNs=1
g_file_storage gadget: transport=Bulk-only (x50)
g_file_storage gadget: protocol=Transparent SCSI (x06)
g_file_storage gadget: VendorID=x0525, ProductID=xa4a5, Release=x0308
g_file_storage gadget: removable=1, stall=1, buflen=16384
g_file_storage gadget: I/O thread pid: 957
otg: b_idle, SWITCH to gadget, ctrl 098021
isp1301_omap 1-002d: ready for dual-role USB ...
tps65010: battery charging
udc: USB reset done, gadget g_file_storage
g_file_storage gadget: suspend
g_file_storage gadget: resume
udc: USB reset done, gadget g_file_storage
g_file_storage gadget: suspend
g_file_storage gadget: resume
udc: USB reset done, gadget g_file_storage
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 00 01 00 00 40 00
g_file_storage gadget: get device descriptor
g_file_storage gadget: ep0-in, length 18:
 0:  12 01 00 02 00 00 00 40  25 05 a5 a4 08 03 01 02
10:  03 01
udc: USB reset done, gadget g_file_storage
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 00 01 00 00 12 00
g_file_storage gadget: get device descriptor
g_file_storage gadget: ep0-in, length 18:
 0:  12 01 00 02 00 00 00 40  25 05 a5 a4 08 03 01 02
10:  03 01
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 00 06 00 00 0a 00
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 00 06 00 00 0a 00
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 00 06 00 00 0a 00
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 00 02 00 00 09 00
g_file_storage gadget: get configuration descriptor
g_file_storage gadget: ep0-in, length 9:
 0:  09 02 23 00 01 01 04 e0  01
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 00 02 00 00 23 00
g_file_storage gadget: get configuration descriptor
g_file_storage gadget: ep0-in, length 35:
 0:  09 02 23 00 01 01 04 e0  01 03 09 03 09 04 00 00
10:  02 08 06 50 05 07 05 81  02 40 00 00 07 05 02 02
20:  40 00 00
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 00 03 00 00 ff 00
g_file_storage gadget: get string descriptor
g_file_storage gadget: ep0-in, length 4:
 0:  04 03 09 04
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 02 03 09 04 ff 00
g_file_storage gadget: get string descriptor
g_file_storage gadget: ep0-in, length 54:
 0:  36 03 46 00 69 00 6c 00  65 00 2d 00 62 00 61 00
10:  63 00 6b 00 65 00 64 00  20 00 53 00 74 00 6f 00
20:  72 00 61 00 67 00 65 00  20 00 47 00 61 00 64 00
30:  67 00 65 00 74 00
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 01 03 09 04 ff 00
g_file_storage gadget: get string descriptor
g_file_storage gadget: ep0-in, length 106:
 0:  6a 03 4c 00 69 00 6e 00  75 00 78 00 20 00 32 00
10:  2e 00 36 00 2e 00 32 00  32 00 2d 00 72 00 63 00
20:  32 00 2d 00 6f 00 6d 00  61 00 70 00 31 00 2d 00
30:  67 00 61 00 38 00 62 00  32 00 38 00 39 00 39 00
40:  65 00 2d 00 64 00 69 00  72 00 74 00 79 00 20 00
50:  77 00 69 00 74 00 68 00  20 00 6f 00 6d 00 61 00
60:  70 00 5f 00 75 00 64 00  63 00
g_file_storage gadget: ep0-setup, length 8:
 0:  80 06 03 03 09 04 ff 00
g_file_storage gadget: get string descriptor
g_file_storage gadget: ep0-in, length 26:
 0:  1a 03 33 00 32 00 33 00  38 00 32 00 30 00 34 00
10:  45 00 36 00 46 00 37 00  36 00
g_file_storage gadget: ep0-setup, length 8:
 0:  00 09 01 00 00 00 00 00
g_file_storage gadget: set configuration
g_file_storage gadget: suspend
g_file_storage gadget: resume
tps65010: battery discharging
g_file_storage gadget: unbind
DEV

[linux-usb-devel] Removing Gadget File Storage module

2007-05-28 Thread Ragner N Magalhães
Hi all,
 I am working with OMAP H2 and when I run rmmod g_file_storage, it
stay waiting some thing and not terminate ...

 Somebody know some thing about this ?

Thanks,

-- 
Ragner N Magalhães

Instituto Nokia de Tecnologia - INdT
Open Source Mobile Research Center - OSMRC
Linux Kernel Team

E-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
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] Removing Gadget File Storage module

2007-05-28 Thread Ragner N Magalhães
Hi,

On 5/28/07, José Luís [EMAIL PROTECTED] wrote:
 Hi Ragner,

 Try unmount the /media/mmc* volumes before remove the module.
 []'s

I am not mounting /media/mmc*

I think that is some thing with signal arrives at
sleep_thread(struct fsg_dev *fsg) function ...
called by fsg_main_thread(void *fsg_) ...


 José Luís

 --
 José Luís do Nascimento
 Mestrando em Engenharia Elétrica
 Laboratório de Sistemas Embarcados e Computação Pervasiva
 Centro de Engenharia Elétrica e Informática - CEEI
 Universidade Federal de Campina Grande - UFCG
 [EMAIL PROTECTED]

Thanks,

-- 
Ragner N Magalhães

Instituto Nokia de Tecnologia - INdT
Open Source Mobile Research Center - OSMRC
Linux Kernel Team

E-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
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] [PATCH 0/6] Composite Gadget Support

2007-05-22 Thread Ragner N Magalhães
On 5/20/07, Alan Stern [EMAIL PROTECTED] wrote:
 On Sat, 19 May 2007, Ragner Magalhaes wrote:

  The following series implements USB Composite Gadget Support.
 
  [PATCH 1/6] USB gadget driver.
  [PATCH 2/6] Composite gadget driver.
  [PATCH 3/6] Composite gadget driver upgrade.
  [PATCH 4/6] Kconfig modifications for USB Composite gadget support.
  [PATCH 5/6] Composite File Storage gadget support.
  [PATCH 6/6] Composite Ether gadget support.
 
  The Composite Gadget can handle one or two configurations.
  When the first usb_function modprobe'ed has two configurations
  the Composite Gadget will have two configurations, for the
  other functions modprobe'ed after will be used the selected or
  standard configuration only, their interfaces will be part
  of the Composite's Configurations.
  Then exchanging configs in the Composite will only affect the
  first function.
  In case the first modprobe'ed function has only one configure,
  the Composite Gadget WILL have only one configuration.
  This behavior is useful when modprobe'ing g_ether as the first
  usb_function due to the RNDIS and CDC Configurations.

 How does this patchset differ from your earlier versions?


You has sent for me comments about ep0 complete function, see below:

---

From: Alan Stern

This looks a lot cleaner than your earlier attempts. However in
several places you took out code without adding any sort of
replacement. For example, here:

-static void ep0_complete(struct usb_ep *ep, struct usb_request *req)
-{
- struct fsg_dev  *fsg = ep-driver_data;
-
- if (req-actual  0)
- dump_msg(fsg, fsg-ep0req_name, req-buf, req-actual);


- if (req-status || req-actual != req-length)
- DBG(fsg, %s -- %d, %u/%u\n, __FUNCTION__,
- req-status, req-actual, req-length);


- if (req-status == -ECONNRESET) // Request was cancelled
- usb_ep_fifo_flush(ep);
-
- if (req-status == 0  req-context)
- ((fsg_routine_t) (req-context))(fsg);


-}

Your modified driver doesn't call dump_msg(), DBG(), or the function
pointer stored in req-context.
---

Now for specific function request, use own ep0 complete function, e.g.
when it is TYPE_CLASS request.
When it is general request, e.g. DT_DEVICE request, use the
composite's ep0 complete.

I implemented dump_msg() function in the composite layer too.


 Alan Stern



Best regards,

-- 
Ragner N Magalhães

Instituto Nokia de Tecnologia - INdT
Open Source Mobile Research Center - OSMRC
Linux Kernel Team

E-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
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] [patch] usb video class support

2007-03-21 Thread Ragner N Magalhães
Em Qua, 2007-03-21 às 12:44 -0700, ext Greg KH escreveu:
 On Tue, Mar 20, 2007 at 03:09:38PM -0400, Ragner Magalhaes wrote:
 
  USB Video Class Support
  
  This patch holds USB constants and structures defined
  by the USB Device Class Definition for Video Devices.
 
 Do you have a driver that uses these structures and defines?
I'm researching to implement a gadget cam ...
and the USB Video Class Support(my patch) is the
base for the usb gadget cam driver ...

 
 I don't see much use for adding this information if it's not even going
 to be included by any file just yet :(
I published this patch now for that somebody can help me later.

 
 thanks,
 
 greg k-h
Best regards,

-- 
Ragner N Magalhães

Instituto Nokia de Tecnologia - INdT
Open Source Mobile Research Center - OSMRC

E-mail: [EMAIL PROTECTED]


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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] [patch] usb video class support

2007-03-20 Thread Ragner N Magalhães
Em Seg, 2007-03-19 às 20:59 +, ext Paulo Marques escreveu:
 Ragner Magalhaes wrote:
  
  
  
  USB Video Class Support
  
  The following patch implements USB Video Class 1.1 as defined at
  USB Device Class Definition for Video Devices, available at:
 
 Are you aware of all the owrk done by Laurent Pinchart at:
 
 http://linux-uvc.berlios.de/
 
 ???
I did not know, but the documentation of it is the same one that I used
to implement this patch.
The USB Video Class specification at
http://www.usb.org/developers/devclass_docs
 
 If this based on the same driver?
As I already said, this patch is based on the USB Video Class
specification at 
http://www.usb.org/developers/devclass_docs and the 
http://linux-uvc.berlios.de/#documentation is the same.
 


-- 
Ragner N Magalhães

Instituto Nokia de Tecnologia - INdT
Open Source Mobile Research Center - OSMRC


E-mail: [EMAIL PROTECTED]


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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] [patch] usb video class support

2007-03-20 Thread Ragner N Magalhães
Em Seg, 2007-03-19 às 15:09 -0700, ext David Brownell escreveu:
 On Monday 19 March 2007 1:29 pm, Ragner Magalhaes wrote:
  The following patch implements USB Video Class 1.1 as defined at
  USB Device Class Definition for Video Devices, available at:
 
 No it doesn't ... it declares on-the-wire *structures* passed.
 There's not one line of implementation code there ... either host
 side, or peripheral side.  So at least, the comment is wrong.  :)
Okay ...
 
 This needs some review against the spec.  I know that several folk
 have been looking at providing implementations, so I'm glad to see
 the common struct declarations, but I'd like to see feedback from
 people who've started such coding... and code sharing, e.g. with
 the Berlios stuff.
 
 USB_CC_VIDEO doesn't belong in this file; linux/usb/ch9.h already
 defines USB_CLASS_VIDEO anyway.  Likewise with USB_CS_* and ch9.h
 USB_DT_CS_* symbols ...
Fixing ...
 
 I see a lot of *_UNDEFINED symbols, which seem dubious.  If it's
 not defined, then it shouldn't be defined!  Wouldn't want to see
 anyone assume that if a value doesn't match those *_UNDEFINED
 symbols, it must accordingly be defined, for example.
 
But this lot of *_UNDEFINED are defined at USB_Video_Class_1.1.pdf.
Looks in page 48 of the SUB Video Class specification the description 
of the field bFunctionProtocol for example.

You can also look the chapter Appendix A. Video Device Class Codes in
page 122 where these *_UNDEFINED are defined.

But case this is really unnecessary I can remove all these *_UNDEFINED
and to substitute for an only one (USB_DT_FIELD_UNDEFINED 0x00) ...

 - Dave

Best regards,
-- 
Ragner N Magalhães

Instituto Nokia de Tecnologia - INdT
Open Source Mobile Research Center - OSMRC

E-mail: [EMAIL PROTECTED]


-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT  business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.phpp=sourceforgeCID=DEVDEV
___
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] [patch] usb video class support

2007-03-20 Thread Ragner N Magalhães
USB Video Class Support

This patch holds USB constants and structures defined
by the USB Device Class Definition for Video Devices.
 
Signed-off-by: Ragner N Magalhaes [EMAIL PROTECTED]
---

Index: 2.6-dev/include/linux/usb/video.h
===
--- /dev/null   1970-01-01 00:00:00.0 +
+++ 2.6-dev/include/linux/usb/video.h   2007-03-20 14:17:56.0
-0400
@@ -0,0 +1,423 @@
+/*
+ * linux/usb/video.h -- USB Video definitions.
+ *
+ * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT
+ * Developed for INdT by Ragner N Magalhaes
+ * Ragner N Magalhaes [EMAIL PROTECTED]
+ *
+ * This software is distributed under the terms of the GNU General
Public
+ * License (GPL) version 2, as published by the Free Software
Foundation.
+ *
+ * This file holds USB constants and structures defined
+ * by the USB Device Class Definition for Video Devices.
+ * Comments below reference relevant sections of that document:
+ *
+ * http://www.usb.org/developers/devclass_docs/USB_Video_Class_1_1.zip
+ */
+
+#ifndef __LINUX_USB_VIDEO_H
+#define __LINUX_USB_VIDEO_H
+
+#include linux/types.h
+
+/* Video Interface Subclass Codes */
+#define USB_SC_VIDEOCONTROL0x01
+#define USB_SC_VIDEOSTREAMING  0x02
+#define USB_SC_INTERFACE_COLLECTION0x03
+
+/* Video Interface Protocol Codes */
+#define USB_PROTOCOL_UNDEFINED 0x00
+
+/* Video Class-Specific VC Interface Descriptor Subtypes */
+#define USB_VC_HEADER  0x01
+#define USB_VC_INPUT_TERMINAL  0x02
+#define USB_VC_OUTPUT_TERMINAL 0x03
+#define USB_VC_SELECTOR_UNIT   0x04
+#define USB_VC_PROCESSING_UNIT 0x05
+#define USB_VC_EXTERNSION_UNIT 0x06
+
+/* Video Class-Specific VS Interface Descriptor Subtype */
+#define USB_VS_INPUT_HEADER0x01
+#define USB_VS_OUTPUT_HEADER   0x02
+#define USB_VS_STILL_IMAGE_FRAME   0x03
+#define USB_VS_FORMAT_UNCOMPRESSED 0x04
+#define USB_VS_FRAME_UNCOMPRESSED  0x05
+#define USB_VS_FORMAT_MJPEG0x06
+#define USB_VS_FRAME_MJPEG 0x07
+/* Reserved 0x08 */
+/* Reserved 0x09 */
+#define USB_VS_FORMAT_MPEG2TS  0x0a
+/* Reserved 0x0B */
+#define USB_VS_FORMAT_DV   0x0c
+#define USB_VS_COLORFORMAT 0x0d
+/* Reserved 0x0e */
+/* Reserved 0x0f */
+#define USB_VS_FORMAT_FRAME_BASED  0x10
+#define USB_VS_FRAME_FRAME_BASED   0x11
+#define USB_VS_FORMAT_STREAM_BASED 0x12
+
+/* Video Class-Specific Endpoint Descriptor Subtype */
+#define USB_EP_GENERAL 0x01
+#define USB_EP_ENDPOINT0x02
+#define USB_EP_INTERRUPT   0x03
+
+/* Video Class-Specific Request Codes */
+#define USB_REQ_SET_CUR0x01
+#define USB_REQ_GET_CUR0x81
+#define USB_REQ_GET_MIN0x82
+#define USB_REQ_GET_MAX0x83
+#define USB_REQ_GET_RES0x84
+#define USB_REQ_GET_LEN0x85
+#define USB_REQ_GET_INFO   0x86
+#define USB_REQ_GET_DEF0x87
+
+/* VideoControl Interface Control Selectors */
+#define USB_VC_VID_POWER_MOD_CONTROL   0x01
+#define USB_VC_REQ_ERROR_CODE_CONTROL  0x02
+/* Reserved 0x03 */
+
+/* Selector Unit Control Selectors */
+#define USB_INPUT_SELECT_CONTROL   0x01
+
+/* Camera Terminal Controls Selectors */
+#define USB_CT_SCANNING_MOD_CONTROL0x01
+#define USB_CT_AE_MOD_CONTROL  0x02
+#define USB_CT_AE_PRIORITY_CONTROL 0x03
+#define USB_CT_EXPO_TIME_ABS_CONTROL   0x04
+#define USB_CT_EXPO_TIME_REL_CONTROL   0x05
+#define USB_CT_FOCUS_ABS_CONTROL   0x06
+#define USB_CT_FOCUS_REL_CONTROL   0x07
+#define USB_CT_IRIS_ABS_CONTROL0x08
+#define USB_CT_IRIS_REL_CONTROL0x0a
+#define USB_CT_ZOOM_ABS_CONTROL0x0b
+#define USB_CT_ZOOM_REL_CONTROL0x0c
+#define USB_CT_PANTILT_ABS_CONTROL 0x0d
+#define USB_CT_PANTILT_REL_CONTROL 0x0e
+#define USB_CT_ROLL_ABS_CONTROL0x0f
+#define USB_CT_ROLL_REL_CONTROL0x10
+#define USB_CT_PRIVACY_CONTROL 0x11
+
+/* Processing Unit Control Selectors */
+#define USB_PU_BL_CMPENSATION_CONTROL  0x01
+#define USB_PU_BRIGHTNESS_CONTROL  0x02
+#define USB_PU_CONTRAST_CONTROL0x03
+#define USB_PU_GAIN_CONTROL0x04
+#define USB_PU_POWER_LINE_FREQ_CONTROL 0x05
+#define USB_PU_HUE_CONTROL 0x06
+#define USB_PU_SATURATION_CONTROL  0x07
+#define USB_PU_SHARPNESS_CONTROL   0x08
+#define USB_PU_GAMMA_CONTROL   0x09
+#define USB_PU_WT_BL_TMP_CONTROL   0x0a
+#define USB_PU_WT_BL_TMP_AUT_CONTROL   0x0b
+#define USB_PU_WT_BL_CMP_CONTROL   0x0c
+#define USB_PU_WT_BL_CMP_AUT_CONTROL   0x0d
+#define USB_PU_DIG_MULT_CONTROL0x0e
+#define USB_PU_DIG_MULT_LIM_CONTROL0x0f
+#define USB_PU_HUE_AUTO_CONTROL0x10
+#define USB_PU_ANALOG_V_STAND_CONTROL  0x11
+#define USB_PU_ANALOG_LCK_STAT_CONTROL 0x12
+
+/* VideoStream Interface Control