PERFORCE change 140799 for review
Sam Leffler
sam at FreeBSD.org
Mon Apr 28 17:56:46 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=140799
Change 140799 by sam at sam_ebb on 2008/04/28 17:56:19
o track api change for ieee80211_plcp2rate
o use ieee80211_rate2plcp instead of private function now that
it follows the IEEE spec and not ralink's private encoding for
CCK rates
o use PLCP service definitions added to ieee80211.h
(slight name change)
o re-enable device reset code
Affected files ...
.. //depot/projects/vap/sys/dev/bwi/bwimac.c#5 edit
.. //depot/projects/vap/sys/dev/bwi/if_bwi.c#9 edit
Differences ...
==== //depot/projects/vap/sys/dev/bwi/bwimac.c#5 (text+ko) ====
@@ -1437,7 +1437,7 @@
default:
panic("unsupported modtype %u\n", modtype);
}
- ofs += (bwi_rate2plcp(rs->rs_rates[i]) & 0xf) * 2;
+ ofs += 2*(ieee80211_rate2plcp(rs->rs_rates[i], modtype) & 0xf);
MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, ofs + 0x20,
MOBJ_READ_2(mac, BWI_COMM_MOBJ, ofs));
==== //depot/projects/vap/sys/dev/bwi/if_bwi.c#9 (text+ko) ====
@@ -2864,33 +2864,6 @@
}
/* XXX does not belong here */
-uint8_t
-bwi_rate2plcp(uint8_t rate)
-{
- rate &= IEEE80211_RATE_VAL;
-
- switch (rate) {
- case 2: return 0xa;
- case 4: return 0x14;
- case 11: return 0x37;
- case 22: return 0x6e;
- case 44: return 0xdc;
-
- case 12: return 0xb;
- case 18: return 0xf;
- case 24: return 0xa;
- case 36: return 0xe;
- case 48: return 0x9;
- case 72: return 0xd;
- case 96: return 0x8;
- case 108: return 0xc;
-
- default:
- panic("unsupported rate %u\n", rate);
- }
-}
-
-/* XXX does not belong here */
#define IEEE80211_OFDM_PLCP_RATE_MASK __BITS(3, 0)
#define IEEE80211_OFDM_PLCP_LEN_MASK __BITS(16, 5)
@@ -2899,17 +2872,12 @@
{
uint32_t plcp;
- plcp = __SHIFTIN(bwi_rate2plcp(rate), IEEE80211_OFDM_PLCP_RATE_MASK) |
+ plcp = __SHIFTIN(ieee80211_rate2plcp(rate, IEEE80211_T_OFDM),
+ IEEE80211_OFDM_PLCP_RATE_MASK) |
__SHIFTIN(pkt_len, IEEE80211_OFDM_PLCP_LEN_MASK);
*plcp0 = htole32(plcp);
}
-#define IEEE80211_DS_PLCP_SERVICE_LOCKED 0x04
-#define IEEE80211_DS_PLCL_SERVICE_PBCC 0x08
-#define IEEE80211_DS_PLCP_SERVICE_LENEXT5 0x20
-#define IEEE80211_DS_PLCP_SERVICE_LENEXT6 0x40
-#define IEEE80211_DS_PLCP_SERVICE_LENEXT7 0x80
-
static __inline void
bwi_ds_plcp_header(struct ieee80211_ds_plcp_hdr *plcp, int pkt_len,
uint8_t rate)
@@ -2919,7 +2887,7 @@
pkt_bitlen = pkt_len * NBBY;
len = howmany(pkt_bitlen * 2, rate);
- service = IEEE80211_DS_PLCP_SERVICE_LOCKED;
+ service = IEEE80211_PLCP_SERVICE_LOCKED;
if (rate == (11 * 2)) {
int pkt_bitlen1;
@@ -2929,10 +2897,10 @@
*/
pkt_bitlen1 = len * 11;
if (pkt_bitlen1 - pkt_bitlen >= NBBY)
- service |= IEEE80211_DS_PLCP_SERVICE_LENEXT7;
+ service |= IEEE80211_PLCP_SERVICE_LENEXT7;
}
- plcp->i_signal = bwi_rate2plcp(rate);
+ plcp->i_signal = ieee80211_rate2plcp(rate, IEEE80211_T_CCK);
plcp->i_service = service;
plcp->i_length = htole16(len);
/* NOTE: do NOT touch i_crc */
@@ -3803,13 +3771,13 @@
plcp = le32toh(*plcp0);
plcp_rate = __SHIFTOUT(plcp, IEEE80211_OFDM_PLCP_RATE_MASK);
- return ieee80211_plcp2rate(plcp_rate, 1);
+ return ieee80211_plcp2rate(plcp_rate, IEEE80211_T_OFDM);
}
static __inline uint8_t
bwi_ds_plcp2rate(const struct ieee80211_ds_plcp_hdr *hdr)
{
- return ieee80211_plcp2rate(hdr->i_signal, 0);
+ return ieee80211_plcp2rate(hdr->i_signal, IEEE80211_T_DS);
}
static void
@@ -4054,8 +4022,8 @@
struct ifnet *ifp = sc->sc_ifp;
if_printf(ifp, "%s begin, help!\n", __func__);
+ bwi_init_statechg(xsc, 0);
#if 0
- bwi_init_statechg(xsc, 0);
bwi_start_locked(ifp);
#endif
}
More information about the p4-projects
mailing list