backported the link_speed method