Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

driver: ctrl_timeoutをモジュールパラメーターに追加 #3

Merged
merged 1 commit into from
Sep 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion driver/px4_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static int px4_usb_init_bridge(struct device *dev, struct usb_device *usb_dev,
bus->dev = dev;
bus->type = ITEDTV_BUS_USB;
bus->usb.dev = usb_dev;
bus->usb.ctrl_timeout = 3000;
bus->usb.ctrl_timeout = px4_usb_params.ctrl_timeout;
bus->usb.streaming.urb_buffer_size = 188 * px4_usb_params.urb_max_packets;
bus->usb.streaming.urb_num = px4_usb_params.max_urbs;
bus->usb.streaming.no_dma = px4_usb_params.no_dma;
Expand Down
7 changes: 7 additions & 0 deletions driver/px4_usb_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,19 @@
#include <linux/module.h>

struct px4_usb_param_set px4_usb_params = {
.ctrl_timeout = 3000,
.xfer_packets = 816,
.urb_max_packets = 816,
.max_urbs = 6,
.no_dma = false
};

module_param_named(ctrl_timeout, px4_usb_params.ctrl_timeout,
int, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(ctrl_timeout,
"Time in msecs to wait for the message to complete " \
"before timing out (if 0 the wait is forever). (default: 3000)");

module_param_named(xfer_packets, px4_usb_params.xfer_packets,
uint, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
MODULE_PARM_DESC(xfer_packets,
Expand Down
1 change: 1 addition & 0 deletions driver/px4_usb_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <linux/types.h>

struct px4_usb_param_set {
int ctrl_timeout;
unsigned int xfer_packets;
unsigned int urb_max_packets;
unsigned int max_urbs;
Expand Down