Thx Alan. Maybe you misunderstood my meaning.
In my gadget module(dm320_gadget.ko which your file_storage.ko need to invoke usb_gadget_register_driver) And In my dm320_gadget module,i need to know DMAADDR and DMACOUNT value,which will be assigned to corresponding registers. But the bh->inreq->dma , bh->inreq->length,req->dma ,req->length are in ur module.So i need some global variables to get it. And using these variables in my dm320_gadget module. Which ur opinion of my thinking? If i can't use in that way,how can i get there value? And can i declare usb_request to myself? On Wed, 2006-03-22 at 10:19 -0500, Alan Stern wrote: > On Wed, 22 Mar 2006, Peter Chen wrote: > > > > > Thx,Alan > > > > Follow your answers,I change my program. > > I wonder there are right? > > No, they aren't. You should not need to change file_storage.c at all. > > > Through some global variables,i can get the dma address from > > file_stroage.c: > > /* I will use below 3 variables to assign my corresponding DMAADDR > > registers */ > > dma_addr_t ev_ep0_dma,ev_ep1_in_dma,ev_ep1_out_dma; > > /* I will use below 3 variables to assign my corresponding DMACOUNT > > registers */ > > unsigned ev_ep0_length,ev_ep1_in_length,ev_ep1_out_length; > > You don't need these. The information is already available in the > usb_request structure. > > > //For ep0,at fsg_bind function > > /* Allocate the request and buffer for endpoint 0 */ > > fsg->ep0req = req = usb_ep_alloc_request(fsg->ep0, GFP_KERNEL); > > if (!req) > > goto out; > > req->buf = usb_ep_alloc_buffer(fsg->ep0, EP0_BUFSIZE, > > &req->dma, GFP_KERNEL); > > if (!req->buf) > > goto out; > > ev_ep0_dma=req->dma;//peter > > ev_ep0_length=req->length;//peter > > req->complete = ep0_complete; > > You don't need ev_ep0_dma or ev_ep0_length since you already have req->dma > and req->length. > > > //For ep1_in,at do_read function > > /*my code */ > > ev_ep1_in_dma=bh->dma ;//peter > > ev_ep1_in_length=bh->inreq->length > > You don't need ev_ep1_in_dma or ev_ep1_in_length since you already have > bh->inreq->dma and bh->inreq->length. > > Alan Stern > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > linux-usb-devel@lists.sourceforge.net > To unsubscribe, use the last form field at: > https://lists.sourceforge.net/lists/listinfo/linux-usb-devel > ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel