summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/net/if_cdce.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2010-09-02 03:55:08 +0000
committerthompsa <thompsa@FreeBSD.org>2010-09-02 03:55:08 +0000
commited73c843fd286a1bc4ea634cc77bd415474c9551 (patch)
tree3d83bea8992766adc3b1e20d844f293aa2a093f6 /sys/dev/usb/net/if_cdce.c
parent4b6a0266b17bae233b11c0019a17601b04a7fb9c (diff)
downloadFreeBSD-src-ed73c843fd286a1bc4ea634cc77bd415474c9551.zip
FreeBSD-src-ed73c843fd286a1bc4ea634cc77bd415474c9551.tar.gz
Fix setting of the rx_max and tx_max variables. If the expected buffer size is
greater than 65535 bytes then the CDC driver might not work as expected, which is not likely with the existing USB speeds. Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/net/if_cdce.c')
-rw-r--r--sys/dev/usb/net/if_cdce.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c
index b5e7fd4..b8e7b98 100644
--- a/sys/dev/usb/net/if_cdce.c
+++ b/sys/dev/usb/net/if_cdce.c
@@ -312,14 +312,14 @@ cdce_ncm_init(struct cdce_softc *sc)
/* Read correct set of parameters according to device mode */
if (usbd_get_mode(sc->sc_ue.ue_udev) == USB_MODE_HOST) {
- sc->sc_ncm.rx_max = UGETW(temp.dwNtbInMaxSize);
- sc->sc_ncm.tx_max = UGETW(temp.dwNtbOutMaxSize);
+ sc->sc_ncm.rx_max = UGETDW(temp.dwNtbInMaxSize);
+ sc->sc_ncm.tx_max = UGETDW(temp.dwNtbOutMaxSize);
sc->sc_ncm.tx_remainder = UGETW(temp.wNdpOutPayloadRemainder);
sc->sc_ncm.tx_modulus = UGETW(temp.wNdpOutDivisor);
sc->sc_ncm.tx_struct_align = UGETW(temp.wNdpOutAlignment);
} else {
- sc->sc_ncm.rx_max = UGETW(temp.dwNtbOutMaxSize);
- sc->sc_ncm.tx_max = UGETW(temp.dwNtbInMaxSize);
+ sc->sc_ncm.rx_max = UGETDW(temp.dwNtbOutMaxSize);
+ sc->sc_ncm.tx_max = UGETDW(temp.dwNtbInMaxSize);
sc->sc_ncm.tx_remainder = UGETW(temp.wNdpInPayloadRemainder);
sc->sc_ncm.tx_modulus = UGETW(temp.wNdpInDivisor);
sc->sc_ncm.tx_struct_align = UGETW(temp.wNdpInAlignment);
OpenPOWER on IntegriCloud