Index: share/man/man4/smsc.4 =================================================================== --- share/man/man4/smsc.4 +++ share/man/man4/smsc.4 @@ -72,6 +72,23 @@ .It SMSC LAN951x Ethernet adapters with integrated USB hub .El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va hw.usb.smsc.turbo_mode +Disable or enable +.Dq turbo mode +which allows multiple frames to be received +in each transaction. +This increases throughput at the cost of latency and jitter. +Disabling it by be useful for timekeeping or VoIP applications. +Default is +.Dq Li 1 +(enabled). +.El .Sh SEE ALSO .Xr arp 4 , .Xr intro 4 , Index: sys/dev/usb/net/if_smsc.c =================================================================== --- sys/dev/usb/net/if_smsc.c +++ sys/dev/usb/net/if_smsc.c @@ -112,14 +112,19 @@ #include +SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW, 0, "USB smsc"); + #ifdef USB_DEBUG static int smsc_debug = 0; -SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW, 0, "USB smsc"); SYSCTL_INT(_hw_usb_smsc, OID_AUTO, debug, CTLFLAG_RWTUN, &smsc_debug, 0, "Debug level"); #endif +static int smsc_turbo_mode = 1; +SYSCTL_INT(_hw_usb_smsc, OID_AUTO, turbo_mode, CTLFLAG_RDTUN, &smsc_turbo_mode, 1, + "Turbo mode"); + /* * Various supported device vendors/products. */ @@ -1398,10 +1403,13 @@ * Burst capability is the number of URBs that can be in a burst of data/ * ethernet frames. */ - if (usbd_get_speed(sc->sc_ue.ue_udev) == USB_SPEED_HIGH) - burst_cap = 37; - else - burst_cap = 128; + if (smsc_turbo_mode) { + if (usbd_get_speed(sc->sc_ue.ue_udev) == USB_SPEED_HIGH) + burst_cap = 37; + else + burst_cap = 128; + } else + burst_cap = 0; smsc_write_reg(sc, SMSC_BURST_CAP, burst_cap); @@ -1427,7 +1435,8 @@ /* The following setings are used for 'turbo mode', a.k.a multiple frames * per Rx transaction (again info taken form Linux driver). */ - reg_val |= (SMSC_HW_CFG_MEF | SMSC_HW_CFG_BCE); + if (smsc_turbo_mode) + reg_val |= (SMSC_HW_CFG_MEF | SMSC_HW_CFG_BCE); smsc_write_reg(sc, SMSC_HW_CFG, reg_val);