Commit 06b8f14d authored by Peter Hurley's avatar Peter Hurley Committed by Greg Kroah-Hartman

staging/fwserial: Remove bandwidth limit logic

Self-limiting asynchronous bandwidth (via reducing the payload)
is not necessary and does not work, because
 1) asynchronous traffic will absorb all available bandwidth (less that
    being used for isochronous traffic)
 2) isochronous arbitration always wins.
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b360cb97
...@@ -40,12 +40,10 @@ static int num_ttys = 4; /* # of std ttys to create per fw_card */ ...@@ -40,12 +40,10 @@ static int num_ttys = 4; /* # of std ttys to create per fw_card */
/* - doubles as loopback port index */ /* - doubles as loopback port index */
static bool auto_connect = true; /* try to VIRT_CABLE to every peer */ static bool auto_connect = true; /* try to VIRT_CABLE to every peer */
static bool create_loop_dev = true; /* create a loopback device for each card */ static bool create_loop_dev = true; /* create a loopback device for each card */
bool limit_bw; /* limit async bandwidth to 20% of max */
module_param_named(ttys, num_ttys, int, S_IRUGO | S_IWUSR); module_param_named(ttys, num_ttys, int, S_IRUGO | S_IWUSR);
module_param_named(auto, auto_connect, bool, S_IRUGO | S_IWUSR); module_param_named(auto, auto_connect, bool, S_IRUGO | S_IWUSR);
module_param_named(loop, create_loop_dev, bool, S_IRUGO | S_IWUSR); module_param_named(loop, create_loop_dev, bool, S_IRUGO | S_IWUSR);
module_param(limit_bw, bool, S_IRUGO | S_IWUSR);
/* /*
* Threshold below which the tty is woken for writing * Threshold below which the tty is woken for writing
...@@ -2940,4 +2938,3 @@ MODULE_DEVICE_TABLE(ieee1394, fwserial_id_table); ...@@ -2940,4 +2938,3 @@ MODULE_DEVICE_TABLE(ieee1394, fwserial_id_table);
MODULE_PARM_DESC(ttys, "Number of ttys to create for each local firewire node"); MODULE_PARM_DESC(ttys, "Number of ttys to create for each local firewire node");
MODULE_PARM_DESC(auto, "Auto-connect a tty to each firewire node discovered"); MODULE_PARM_DESC(auto, "Auto-connect a tty to each firewire node discovered");
MODULE_PARM_DESC(loop, "Create a loopback device, fwloop<n>, with ttys"); MODULE_PARM_DESC(loop, "Create a loopback device, fwloop<n>, with ttys");
MODULE_PARM_DESC(limit_bw, "Limit bandwidth utilization to 20%.");
...@@ -351,7 +351,6 @@ struct fw_serial { ...@@ -351,7 +351,6 @@ struct fw_serial {
#define TTY_DEV_NAME "fwtty" /* ttyFW was taken */ #define TTY_DEV_NAME "fwtty" /* ttyFW was taken */
static const char tty_dev_name[] = TTY_DEV_NAME; static const char tty_dev_name[] = TTY_DEV_NAME;
static const char loop_dev_name[] = "fwloop"; static const char loop_dev_name[] = "fwloop";
extern bool limit_bw;
struct tty_driver *fwtty_driver; struct tty_driver *fwtty_driver;
...@@ -370,18 +369,16 @@ static inline void fwtty_bind_console(struct fwtty_port *port, ...@@ -370,18 +369,16 @@ static inline void fwtty_bind_console(struct fwtty_port *port,
/* /*
* Returns the max send async payload size in bytes based on the unit device * Returns the max send async payload size in bytes based on the unit device
* link speed - if set to limit bandwidth to max 20%, use lookup table * link speed. Self-limiting asynchronous bandwidth (via reducing the payload)
* is not necessary and does not work, because
* 1) asynchronous traffic will absorb all available bandwidth (less that
* being used for isochronous traffic)
* 2) isochronous arbitration always wins.
*/ */
static inline int link_speed_to_max_payload(unsigned speed) static inline int link_speed_to_max_payload(unsigned speed)
{ {
static const int max_async[] = { 307, 614, 1229, 2458, };
BUILD_BUG_ON(ARRAY_SIZE(max_async) - 1 != SCODE_800);
speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_800); speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_800);
if (limit_bw) return 1 << (speed + 9);
return max_async[speed];
else
return 1 << (speed + 9);
} }
#endif /* _FIREWIRE_FWSERIAL_H */ #endif /* _FIREWIRE_FWSERIAL_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment