staging/fwserial: Remove bandwidth limit logic
[firefly-linux-kernel-4.4.55.git] / drivers / staging / fwserial / fwserial.h
index caa1c1ea82d5f783782efd263f2f60500a68062b..e157318cb7da260379cebd06476ff06ec889efb5 100644 (file)
@@ -351,7 +351,6 @@ struct fw_serial {
 #define TTY_DEV_NAME               "fwtty"     /* ttyFW was taken           */
 static const char tty_dev_name[] =  TTY_DEV_NAME;
 static const char loop_dev_name[] = "fwloop";
-extern bool limit_bw;
 
 struct tty_driver *fwtty_driver;
 
@@ -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
- * 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 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);
-       if (limit_bw)
-               return max_async[speed];
-       else
-               return 1 << (speed + 9);
+       return 1 << (speed + 9);
 }
 
 #endif /* _FIREWIRE_FWSERIAL_H */