This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BIOSUSB request_t

Hello all,

 

I am trying to send requests across the USB using the Jungo BIOSUSB stack, and am being partially successful. I however would like to know the purpose of the sg_list_item_t  in the mem_desc_t. (uw_types.h) . When I perform a request, I am currently passing my own buffer into the request by setting the last parameter in the core_request_alloc(...), but note that the mem_desc_t that holds the passed in value also contains a pointer to a sg_list_item_t, which is defined above the mem_desc_t. Is there any documentation describing the use of this pointer? I am particularly interested in being able to pass in multiple buffers to be transmitted at the same time, and this type appears to be a list pointer, but contains no size element and there is no documentation describing it neither.

 

Peter

 

  • Peter

    The DSP/BIOS USB stack does not support scatter gather buffer list, you need to allocate contigous memory address buffers. The sg_list in mem_desc_t is not used.

    Regards

    Ravi B

     

     

     

  • Morning Ravi,

    I have just received your reply, just as I was about to investigate if the sg_list_item_t could be used to send separate buffers, and thought I'd give it a try none the less...

    Anyway, I have managed to get it to work. with the following extra bits of code:

    ---------------------------------------------------------------------------------------------------------------------------------

             mem_desc.vaddr   = 0;
             mem_desc.paddr   = 0;
             mem_desc.sg_list = &list_items[0];
             list_items[0].vaddr = helloMsg;
             list_items[0].size  = 10;
             list_items[1].vaddr = msg->buffer.begin();
             list_items[1].size  = msg->bytesUsed;

             writeRequest = core_request_alloc( cdcAcmContext->core_context, 10 +  msg->bytesUsed, &mem_desc );

             writeRequest->transfer_size = msg->bytesUsed + 10;

    ---------------------------------------------------------------------------------------------------------------------------------

    helloMsg is a static buffer 10 bytes long, and the msg structure contains a buffer, there is other code required for sending a packet, but only these lines are associated with the use of the list.

    I just thought you (and others reading) may want to know the BIOSUSB does support the scatter buffer list, BUT I wanted to know why you stated it doesn't? and if there are corner cases where the BIOSUSB fails using this mechanism? This mechanism will be very useful to us for concatenating buffers without requiring copying.

     

    Peter Myerscough-Jackopson