Author: hselasky
Date: Wed Sep 14 15:16:53 2011
New Revision: 225556
URL: http://svn.freebsd.org/changeset/base/225556

Log:
  Reduce USB memory usage during enumeration.
  
  We are allocating some kilobytes of extra memory during USB device 
enumeration.
  This does not change alot under FreeBSD, but makes sense for various embedded
  operating systems using the FreeBSD USB stack, which have less memory
  resources available.
  
  Approved by:  re (kib)
  MFC after:    1 week

Modified:
  head/sys/dev/usb/usb_msctest.c

Modified: head/sys/dev/usb/usb_msctest.c
==============================================================================
--- head/sys/dev/usb/usb_msctest.c      Wed Sep 14 14:37:54 2011        
(r225555)
+++ head/sys/dev/usb/usb_msctest.c      Wed Sep 14 15:16:53 2011        
(r225556)
@@ -182,6 +182,7 @@ static const struct usb_config bbb_confi
                .endpoint = UE_ADDR_ANY,
                .direction = UE_DIR_OUT,
                .bufsize = sizeof(struct bbb_cbw),
+               .flags = {.ext_buffer = 1,},
                .callback = &bbb_command_callback,
                .timeout = 4 * USB_MS_HZ,       /* 4 seconds */
        },
@@ -191,7 +192,7 @@ static const struct usb_config bbb_confi
                .endpoint = UE_ADDR_ANY,
                .direction = UE_DIR_IN,
                .bufsize = BULK_SIZE,
-               .flags = {.proxy_buffer = 1,.short_xfer_ok = 1,},
+               .flags = {.ext_buffer = 1,.proxy_buffer = 1,.short_xfer_ok = 
1,},
                .callback = &bbb_data_read_callback,
                .timeout = 4 * USB_MS_HZ,       /* 4 seconds */
        },
@@ -210,7 +211,7 @@ static const struct usb_config bbb_confi
                .endpoint = UE_ADDR_ANY,
                .direction = UE_DIR_OUT,
                .bufsize = BULK_SIZE,
-               .flags = {.proxy_buffer = 1,},
+               .flags = {.ext_buffer = 1,.proxy_buffer = 1,},
                .callback = &bbb_data_write_callback,
                .timeout = 4 * USB_MS_HZ,       /* 4 seconds */
        },
@@ -229,7 +230,7 @@ static const struct usb_config bbb_confi
                .endpoint = UE_ADDR_ANY,
                .direction = UE_DIR_IN,
                .bufsize = sizeof(struct bbb_csw),
-               .flags = {.short_xfer_ok = 1,},
+               .flags = {.ext_buffer = 1,.short_xfer_ok = 1,},
                .callback = &bbb_status_callback,
                .timeout = 1 * USB_MS_HZ,       /* 1 second  */
        },
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to