Re: [linux-usb-devel] I have puzzled about usb_request struct for udc driver

2006-05-18 Thread Peter Chen


 
 Sounds like you have bugs to fix in your controller driver.
 
 I advise folks to get g_zero working first; it's simpler, and unlike
 the file_storage gadget it doesn't use the deferred response mode.
 That way you can get the basic driver behavior to work correctly before
 going on to fancier things (like queue lengths greater than one, the
 deferred response mode, and so forth).
 
 - Dave
 

thx dave

When i use g_zero instead of file_storage,i get the host mesg is:

hub 1-0:1.0: debounce: port 8: total 1500ms stable 0ms status 0x0
hub 1-0:1.0: connect-debounce failed, port 8 disabled
hub 2-0:1.0: state 5 ports 3 chg  evt 0008
ohci_hcd :00:03.0: GetStatus roothub.portstatus [2] = 0x00010101 CSC
PPS CCS
hub 2-0:1.0: port 3, status 0101, change 0001, 12 Mb/s
hub 2-0:1.0: debounce: port 3: total 100ms stable 100ms status 0x101
ohci_hcd :00:03.0: GetStatus roothub.portstatus [2] = 0x00100103
PRSC PPS PES CCS
usb 2-3: new full speed USB device using ohci_hcd and address 3
ohci_hcd :00:03.0: GetStatus roothub.portstatus [2] = 0x00100103
PRSC PPS PES CCS
usb 2-3: new device strings: Mfr=25, Product=42, SerialNumber=101
usb 2-3: default language 0x0409
usb 2-3: Product: Gadget Zero
usb 2-3: hotplug
usb 2-3: configuration #3 chosen from 2 choices
usb 2-3: adding 2-3:3.0 (config #3, interface 0)
usb 2-3:3.0: hotplug
usbserial_generic 2-3:3.0: usb_probe_interface
usbserial_generic 2-3:3.0: usb_probe_interface - got id
usbtest 2-3:3.0: usb_probe_interface
usbtest 2-3:3.0: usb_probe_interface - got id
usbtest 2-3:3.0: Linux gadget zero
usbtest 2-3:3.0: full speed {control in/out bulk-in bulk-out} tests
(+alt)

What it means?It means my bus enumeration is right?


Besides,i met another problem:

I find when i do set_configuration,the set configuration execution is
delayed,that causes my USB_BULK_GET_MAX_LUN_REQUEST can't be executed
rightly(as fsg-config is 0 ).And the clear halt for ep1(
CLEAR_FAETURE)is not right either.Then,i get fsg full speed config #1
that means the SET_CONFIGURATION is right.but then,the host would not
send USB_BULK_GET_MAX_LUN_REQUEST any more.However,at that time,the
file_storage thinks the bus enumeration is finished,it begins to do scsi
command,and attempts to read my ep1_out,my ep1 fifo's data is not right
then.
That's my thinking for it,is it right?

if it is right,then how can i let set configuration finish before the
host sends USB_BULK_GET_MAX_LUN_REQUEST command?









---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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] I have puzzled about usb_request struct for udc driver

2006-05-18 Thread Alan Stern
On Thu, 18 May 2006, Peter Chen wrote:

 I find when i do set_configuration,the set configuration execution is
 delayed,that causes my USB_BULK_GET_MAX_LUN_REQUEST can't be executed
 rightly(as fsg-config is 0 ).And the clear halt for ep1(
 CLEAR_FAETURE)is not right either.Then,i get fsg full speed config #1
 that means the SET_CONFIGURATION is right.but then,the host would not
 send USB_BULK_GET_MAX_LUN_REQUEST any more.However,at that time,the
 file_storage thinks the bus enumeration is finished,it begins to do scsi
 command,and attempts to read my ep1_out,my ep1 fifo's data is not right
 then.
 That's my thinking for it,is it right?

Your thinking is right but your udc driver is wrong.

 if it is right,then how can i let set configuration finish before the
 host sends USB_BULK_GET_MAX_LUN_REQUEST command?

When your udc driver calls fsg_setup, it should NAK the status stage of
the control transfer until the gadget driver calls usb_ep_queue().  That
will happen after set_configuration is finished.  The host will wait until 
you stop sending NAK before it proceeds with Get-Max-LUN.

Alan Stern



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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] I have puzzled about usb_request struct for udc driver

2006-05-16 Thread Alan Stern
On Tue, 16 May 2006, Peter Chen wrote:

 Hi,all
 
  When i develop udc driver,i can assign some values for the struct
 of usb_request through fsg-setup(file_storage.c) at bus enumeration
  But,as far as other ep's tx/rx are conterned,how to ensure the req
 is not NULL when the other ep's interrupt comes.Usually,we see
 req = list_entry(ep-queue.next,struct xxx_request, queue);
 And obvious,here the req is not NULL.But i don't know when the req is
 assigned.

req is assigned when the gadget driver calls ep-ops-queue().

Sometimes req _will_ be NULL when a bulk endpoint's interrupt comes.  
This is normal.  When it happens your udc driver should send back NAK.

 Besides,I have a problem now.When i finished set_configuration,my
 program is crashed,I look at the code of file_storage,and find 
 it executes the get_next_command,it reads data from my ep1 fifo.i know
 it will executes get_next_command when finish bus enumeration,and do
 scsi command.Then what causes my program invokes the get_next_command?

get_next_command() is called by fsg_main_thread().  That's the _only_ 
place where it is called.

  I
 think i can't finish the bus enumeration.
 
 the crash messages are below:(it repeats over and over)
 
 
**INT RESET**
 dm320_ep_queue:829 ep1_out queue req c0724460, len 64 buf c02f8000
 invalid CBW: len 64 sig 0x
 received_cbw:2979 received_cbw...
 halt_bulk_in_endpoint:2317 halt_bulk_in_endpoint front

Evidently you still have bugs in your udc driver.  It does not copy the 
bulk data from the USB bus into req-buf.

Alan Stern



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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] I have puzzled about usb_request struct for udc driver

2006-05-16 Thread David Brownell
On Monday 15 May 2006 6:50 pm, Peter Chen wrote:

 And obvious,here the req is not NULL.But i don't know when the req is
 assigned.

You've asked variants of this question before, as I recall, but don't
seem to have absorbed the answer:  there are no requests in the endpoint's
queue until the gadget driver isssues a usb_ep_queue() call.  Then the
controller driver processes the requests in FIFO order, and issues the
completion callbacks as each one finishes.


 Besides,I have a problem now.When i finished set_configuration,my
 program is crashed,I look at the code of file_storage,and find 
 it executes the get_next_command,it reads data from my ep1 fifo.i know
 it will executes get_next_command when finish bus enumeration,and do
 scsi command.Then what causes my program invokes the get_next_command?I
 think i can't finish the bus enumeration.

Sounds like you have bugs to fix in your controller driver.

I advise folks to get g_zero working first; it's simpler, and unlike
the file_storage gadget it doesn't use the deferred response mode.
That way you can get the basic driver behavior to work correctly before
going on to fancier things (like queue lengths greater than one, the
deferred response mode, and so forth).

- Dave




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
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] I have puzzled about usb_request struct for udc driver

2006-05-15 Thread Peter Chen

Hi,all

 When i develop udc driver,i can assign some values for the struct
of usb_request through fsg-setup(file_storage.c) at bus enumeration
 But,as far as other ep's tx/rx are conterned,how to ensure the req
is not NULL when the other ep's interrupt comes.Usually,we see
req = list_entry(ep-queue.next,struct xxx_request, queue);
And obvious,here the req is not NULL.But i don't know when the req is
assigned.

Besides,I have a problem now.When i finished set_configuration,my
program is crashed,I look at the code of file_storage,and find 
it executes the get_next_command,it reads data from my ep1 fifo.i know
it will executes get_next_command when finish bus enumeration,and do
scsi command.Then what causes my program invokes the get_next_command?I
think i can't finish the bus enumeration.

the crash messages are below:(it repeats over and over)


   **INT RESET**
dm320_ep_queue:829 ep1_out queue req c0724460, len 64 buf c02f8000
invalid CBW: len 64 sig 0x
received_cbw:2979 received_cbw...
halt_bulk_in_endpoint:2317 halt_bulk_in_endpoint front


thx.




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel