On Thu, 21 Mar 2013, victor yeo wrote:
> Hi,
>
> On Wed, Mar 20, 2013 at 10:22 PM, Alan Stern <[email protected]>
> wrote:
> > On Wed, 20 Mar 2013, victor yeo wrote:
> >
> >> Thanks, i add processing the pending data from FIFO after queue was
> >> called. The UDC driver can process the SCSI INQUIRY command and SCSI
> >> READ FORMAT CAPACITIES command now.
> >>
> >> In the processing of SCSI READ FORMAT CAPACITIES command, there is
> >> attention condition. Then the bulk transfer stops completely and
> >> control transfer is repeated.
> >
> > What control transfer?
>
> those get descriptor requests.
You might make better progress if you use a Linux-based host for your
testing. Then you could use usbmon on the host to see what's
happening.
> >> How can i solve it?
> >
> > First you have to figure out why it isn't working. What does the
> > debugging information show?
>
> Here is some debugging information:
>
> receive GET_DESCRIPTOR, 80, 6 index 0 value 200 len 20
> receive SET_CONFIGURATION, 0, 9 index 0 value 1 len 0
> set curlun->unit_attention_data to SS_NO_SENSE
> do_set_config() is called because of FSG_STATE_CONFIG_CHANGE
> do_set_interface() is called
> set curlun->unit_attention_data to SS_RESET_OCCURRED
> receive *UNKNOWN*, a1, fe index 0 value 0 len 1
> receive SCSI Inquiry
> receive SCSI read format capacities, get attention condition,
> curlun->unit_attention_data is 062900 (SS_RESET_OCCURRED)
Up to this point, everything is normal. We need to see what happens
next.
> The gadget code is able to process SCSI Inquiry because it does not
> fulfill the if-condition:
>
> if (curlun && curlun->unit_attention_data != SS_NO_SENSE &&
> fsg->cmnd[0] != INQUIRY &&
> fsg->cmnd[0] != REQUEST_SENSE) {
Yes, I know. I wrote that code.
> Why is curlun->unit_attention_data set to SS_RESET_OCCURRED?
Because the gadget gets reset when it receives a Set-Config request.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html