aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/if_ural.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/dev/usb/if_ural.c b/sys/dev/usb/if_ural.c
index 85a55cf78ba21..57230035f3b83 100644
--- a/sys/dev/usb/if_ural.c
+++ b/sys/dev/usb/if_ural.c
@@ -1050,12 +1050,11 @@ ural_setup_tx_desc(struct ural_softc *sc, struct ural_tx_desc *desc,
* Long PLCP LENGTH field.
* From IEEE Std 802.11b-1999, pp. 16.
*/
- plcp_length = (8 * len * 2) / rate;
- remainder = (8 * len * 2) % rate;
- if (remainder != 0) {
- if (rate == 22 && (rate - remainder) / 16 != 0)
+ plcp_length = (16 * len + rate - 1) / rate;
+ if (rate == 22) {
+ remainder = (16 * len) % 22;
+ if (remainder != 0 && remainder < 7)
desc->plcp_service |= RAL_PLCP_LENGEXT;
- plcp_length++;
}
desc->plcp_length = htole16(plcp_length);
}