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

staging/fwserial: Simplify max payload calculation

Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5d110d92
......@@ -377,8 +377,8 @@ static inline void fwtty_bind_console(struct fwtty_port *port,
*/
static inline int link_speed_to_max_payload(unsigned speed)
{
speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_800);
return 1 << (speed + 9);
/* Max async payload is 4096 - see IEEE 1394-2008 tables 6-4, 16-18 */
return min(512 << speed, 4096);
}
#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