Queuing request on EP0 two times in f_acm (and other composite functions)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I've been investigating the USB Composite Gadget framework.  I'm having
hard time with functions' setup function: in particular with queuing
requests on EP0.  For instance, in f_acm.c we see at the end of
acm_setup() function[1] (debug stripped):

#v+
358    if (value >= 0) {
362        req->zero = 0;
363        req->length = value;
364        value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC);
368    }
371    return value;
#v-

However, in composite.c we can see[2]:

#v+
831    if (value >= 0) {
832        req->length = value;
833        req->zero = value < w_length;
834        value = usb_ep_queue(gadget->ep0, req, GFP_ATOMIC);
835        if (value < 0) {
837            req->status = 0;
838            composite_setup_complete(gadget->ep0, req);
839        }
840    }
#v-

So, does that mean that the request is queued two times? If so, is it an
error or should work fine?

The question arose while I was trying to port file_storage.c to a gadget
function so that it can be used in a multifunction gadget.  I'm having
problem in coping with EP0 -- what should I do with queuing in file
storage to make the function work? I've created some code which compiles
and does not crash the kernel but it produces some warnings in a lower
lever (USB controller driver).

_______________________________________________________________
[1] http://lxr.linux.no/#linux+v2.6.30/drivers/usb/gadget/f_acm.c#L358
[2] http://lxr.linux.no/#linux+v2.6.30/drivers/usb/gadget/composite.c#L831

--
Best regards,                                            _     _
 .o. | Liege of Serenly Enlightened Majesty of         o' \,=./ `o
 ..o | Computer Science,  Michał "mina86" Nazarewicz      (o o)
 ooo +-<m.nazarewicz@xxxxxxxxxxx>-<mina86@xxxxxxxxxx>-ooO--(_)--Ooo--

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux