Skip to content

Commit 7fde6f8

Browse files
jfischer-nonashif
authored andcommitted
usb: function_rndis: align rndis_cmd_pool to request buffer size
Set reasonable range for the request buffer in case RNDIS function is used. Align net_buf size from rndis_cmd_pool to request buffer size since request is copied there before it is queued. Signed-off-by: Johann Fischer <[email protected]>
1 parent 7a8a9b6 commit 7fde6f8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

subsys/usb/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ config USB_DEVICE_BLUETOOTH_BIG_BUF
7474

7575
config USB_REQUEST_BUFFER_SIZE
7676
int "Set buffer size for Standard, Class and Vendor request handlers"
77-
range 256 65536 if USB_DEVICE_NETWORK_RNDIS
77+
range 64 512 if USB_DEVICE_NETWORK_RNDIS
7878
range 8 65536
7979
default 256 if USB_DEVICE_NETWORK_RNDIS
8080
default 266 if (USB_DEVICE_BLUETOOTH && USB_DEVICE_BLUETOOTH_BIG_BUF)

subsys/usb/class/netusb/function_rndis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static struct k_fifo rndis_tx_queue;
3232

3333
/* Serialize RNDIS command queue for later processing */
3434
#define CFG_RNDIS_CMD_BUF_COUNT 2
35-
#define CFG_RNDIS_CMD_BUF_SIZE 512
35+
#define CFG_RNDIS_CMD_BUF_SIZE CONFIG_USB_REQUEST_BUFFER_SIZE
3636
NET_BUF_POOL_DEFINE(rndis_cmd_pool, CFG_RNDIS_CMD_BUF_COUNT,
3737
CFG_RNDIS_CMD_BUF_SIZE, 0, NULL);
3838
static struct k_fifo rndis_cmd_queue;

0 commit comments

Comments
 (0)