Re: Insufficient memory reserved for xfer->dma_page_ptr?
This setting worked! Thanks Aman On 02/20/2013 09:51 AM, Hans Petter Selasky wrote: On Wednesday 20 February 2013 15:44:12 Aman Sawrup wrote: Hi Hans, If I understand correctly, I need to set bufsize in struct usb_config as follows: [UMASS_T_BBB_DATA_READ] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .frames = 128, .bufsize = UMASS_BULK_SIZE * 128, .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, .callback = &umass_t_bbb_data_read_callback, .timeout = 0, /* overwritten later */ }, Thanks Aman Yes, that is correct: "* 128" Do you see any problems using this setting? Also note that unless you specify ext_buffer in flags, the USB API will allocate a buffer for you. --HPS ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: Insufficient memory reserved for xfer->dma_page_ptr?
On Wednesday 20 February 2013 15:44:12 Aman Sawrup wrote: > Hi Hans, > > If I understand correctly, I need to set bufsize in struct usb_config as > follows: > > [UMASS_T_BBB_DATA_READ] = { > .type = UE_BULK, > .endpoint = UE_ADDR_ANY, > .direction = UE_DIR_IN, > .frames = 128, > .bufsize = UMASS_BULK_SIZE * 128, > .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, > UMASS_USB_FLAGS}, .callback = &umass_t_bbb_data_read_callback, > .timeout = 0, /* overwritten later */ > }, > > Thanks > Aman Yes, that is correct: "* 128" Do you see any problems using this setting? Also note that unless you specify ext_buffer in flags, the USB API will allocate a buffer for you. --HPS ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: Insufficient memory reserved for xfer->dma_page_ptr?
Hi Hans, If I understand correctly, I need to set bufsize in struct usb_config as follows: [UMASS_T_BBB_DATA_READ] = { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, .frames = 128, .bufsize = UMASS_BULK_SIZE * 128, .flags = {.proxy_buffer = 1,.short_xfer_ok = 1, UMASS_USB_FLAGS}, .callback = &umass_t_bbb_data_read_callback, .timeout = 0, /* overwritten later */ }, Thanks Aman On 02/20/2013 02:36 AM, Hans Petter Selasky wrote: On Tuesday 19 February 2013 23:26:19 Aman Sawrup wrote: I believe the amount of memory reserved needs to be much higher. For example, if sizeof(struct usb_page) is 16 bytes, then for n_frbuffers of 128 and parm->bufsize of 131072, we need the following amount of memory reserved: parm->bufsize / USB_PAGE_SIZE * n_frbuffers * sizeof(struct usb_page) = 131072 / 4096 * 128 * 16 = 65536 Hi, The parm->bufsize is shared for all frbuffers, so the formula should be correct. In your computation you assume that parm->bufsize gives the maximum for each frbuffer. That is not the case. That means, when you configure bufsize, you must not exceed that size as a total when setting up frames. This include all transfer types. I think there are asserts for that so you should get a panic fairly quickly. --HPS ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"
Re: Insufficient memory reserved for xfer->dma_page_ptr?
On Tuesday 19 February 2013 23:26:19 Aman Sawrup wrote: > I believe the amount of memory reserved needs to be much higher. For > example, if sizeof(struct usb_page) is 16 bytes, then for n_frbuffers of > 128 and parm->bufsize of 131072, we need the following amount of memory > reserved: > > parm->bufsize / USB_PAGE_SIZE * n_frbuffers * sizeof(struct usb_page) > = 131072 / 4096 * 128 * 16 > = 65536 Hi, The parm->bufsize is shared for all frbuffers, so the formula should be correct. In your computation you assume that parm->bufsize gives the maximum for each frbuffer. That is not the case. That means, when you configure bufsize, you must not exceed that size as a total when setting up frames. This include all transfer types. I think there are asserts for that so you should get a panic fairly quickly. --HPS ___ freebsd-usb@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-usb To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"