diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index 753b5954765b..b981a28f3fc1 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $NetBSD: atw.c,v 1.80 2004/10/30 18:08:36 thorpej Exp $ */ +/* $NetBSD: atw.c,v 1.81 2004/12/27 01:51:49 mycroft Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.80 2004/10/30 18:08:36 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.81 2004/12/27 01:51:49 mycroft Exp $"); #include "bpfilter.h" @@ -3539,7 +3539,7 @@ atw_start(struct ifnet *ifp) * probably strip FCS just in case it sticks around in * bridged packets. */ - hh->atw_service = IEEE80211_PLCP_SERVICE; /* XXX guess */ + hh->atw_service = 0x00; /* XXX guess */ hh->atw_paylen = htole16(m0->m_pkthdr.len - sizeof(struct atw_frame)); diff --git a/sys/dev/ic/rtw.c b/sys/dev/ic/rtw.c index c6bf913193bf..8e5238ad009e 100644 --- a/sys/dev/ic/rtw.c +++ b/sys/dev/ic/rtw.c @@ -1,4 +1,4 @@ -/* $NetBSD: rtw.c,v 1.24 2004/12/26 22:59:41 dyoung Exp $ */ +/* $NetBSD: rtw.c,v 1.25 2004/12/27 01:51:49 mycroft Exp $ */ /*- * Copyright (c) 2004, 2005 David Young. All rights reserved. * @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.24 2004/12/26 22:59:41 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rtw.c,v 1.25 2004/12/27 01:51:49 mycroft Exp $"); #include "bpfilter.h" @@ -2740,7 +2740,7 @@ rtw_start(struct ifnet *ifp) ctl1 = LSHIFT(d0->d_plcp_len, RTW_TXCTL1_LENGTH_MASK) | LSHIFT(d0->d_rts_dur, RTW_TXCTL1_RTSDUR_MASK); - if ((d0->d_plcp_svc & IEEE80211_PLCP_SERVICE_LENEXT) != 0) + if (d0->d_residue) ctl1 |= RTW_TXCTL1_LENGEXT; /* TBD fragmentation */ diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h index b10bea933d69..85e228bd238a 100644 --- a/sys/net80211/ieee80211.h +++ b/sys/net80211/ieee80211.h @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211.h,v 1.9 2004/12/23 05:25:41 dyoung Exp $ */ +/* $NetBSD: ieee80211.h,v 1.10 2004/12/27 01:51:49 mycroft Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002-2004 Sam Leffler, Errno Consulting @@ -53,9 +53,6 @@ struct ieee80211_plcp_hdr { } __attribute__((__packed__)); #define IEEE80211_PLCP_SFD 0xF3A0 -#define IEEE80211_PLCP_SERVICE 0x00 -#define IEEE80211_PLCP_SERVICE_PBCC 0x08 /* PBCC encoded */ -#define IEEE80211_PLCP_SERVICE_LENEXT 0x80 /* length extension bit */ /* * generic definitions for IEEE 802.11 frames @@ -614,7 +611,7 @@ struct ieee80211_duration { uint16_t d_rts_dur; uint16_t d_data_dur; uint16_t d_plcp_len; - uint8_t d_plcp_svc; + uint8_t d_residue; /* unused octets in time slot */ }; /* One Time Unit (TU) is 1Kus = 1024 microseconds. */ diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 7e61e18bed30..48faf64bf3d2 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -1,4 +1,4 @@ -/* $NetBSD: ieee80211_output.c,v 1.19 2004/12/23 06:08:52 dyoung Exp $ */ +/* $NetBSD: ieee80211_output.c,v 1.20 2004/12/27 01:51:49 mycroft Exp $ */ /*- * Copyright (c) 2001 Atsushi Onoe * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting @@ -35,7 +35,7 @@ #ifdef __FreeBSD__ __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.10 2004/04/02 23:25:39 sam Exp $"); #else -__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.19 2004/12/23 06:08:52 dyoung Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.20 2004/12/27 01:51:49 mycroft Exp $"); #endif #include "opt_inet.h" @@ -308,31 +308,24 @@ ieee80211_compute_duration1(int len, uint32_t flags, int rate, /* RTS is always sent at 1 Mb/s. (XXX Really?) */ d->d_rts_plcp_len = sizeof(struct ieee80211_frame_rts) * 8; #endif - d->d_plcp_svc = 0; + d->d_residue = 0; + data_dur = (bitlen * 2) / rate; switch (rate) { case 2: /* 1 Mb/s */ case 4: /* 2 Mb/s */ - data_dur = (bitlen * 2) / rate; - /* 1 - 2 Mb/s WLAN: send ACK/CTS at 1 Mb/s */ cts = IEEE80211_DUR_DS_SLOW_CTS; ack = IEEE80211_DUR_DS_SLOW_ACK; break; - case 44: /* 22 Mb/s */ - d->d_plcp_svc = IEEE80211_PLCP_SERVICE_PBCC; - /*FALLTHROUGH*/ case 11: /* 5.5 Mb/s */ case 22: /* 11 Mb/s */ + case 44: /* 22 Mb/s */ remainder = (bitlen * 2) % rate; - - if (remainder != 0) - data_dur = (bitlen * 2) / rate + 1; - else - data_dur = (bitlen * 2) / rate; - - if (rate == 22 && remainder <= 6) - d->d_plcp_svc |= IEEE80211_PLCP_SERVICE_LENEXT; + if (remainder != 0) { + data_dur++; + d->d_residue = (rate - remainder) / 16; + } /* 5.5 - 11 Mb/s WLAN: send ACK/CTS at 2 Mb/s */ cts = IEEE80211_DUR_DS_FAST_CTS;