Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Prepend 'sp_' to the name of the fields, so that they ca...
details: https://anonhg.NetBSD.org/src/rev/66d1f9e837d9
branches: trunk
changeset: 358795:66d1f9e837d9
user: maxv <maxv%NetBSD.org@localhost>
date: Tue Jan 16 18:42:43 2018 +0000
description:
Prepend 'sp_' to the name of the fields, so that they can easily be found
via NXR or grep.
diffstat:
sys/dev/ic/bwfm.c | 38 ++++++++--------
sys/net80211/ieee80211_input.c | 90 +++++++++++++++++++++---------------------
sys/net80211/ieee80211_node.c | 80 +++++++++++++++++++------------------
sys/net80211/ieee80211_node.h | 34 +++++++-------
4 files changed, 122 insertions(+), 120 deletions(-)
diffs (truncated from 538 to 300 lines):
diff -r 22f37551bdf7 -r 66d1f9e837d9 sys/dev/ic/bwfm.c
--- a/sys/dev/ic/bwfm.c Tue Jan 16 16:54:54 2018 +0000
+++ b/sys/dev/ic/bwfm.c Tue Jan 16 18:42:43 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bwfm.c,v 1.9 2018/01/16 14:23:15 maxv Exp $ */
+/* $NetBSD: bwfm.c,v 1.10 2018/01/16 18:42:43 maxv Exp $ */
/* $OpenBSD: bwfm.c,v 1.5 2017/10/16 22:27:16 patrick Exp $ */
/*
* Copyright (c) 2010-2016 Broadcom Corporation
@@ -1672,41 +1672,41 @@
/* Build scan result */
memset(&scan, 0, sizeof(scan));
- scan.tstamp = (uint8_t *)&tsf;
- scan.bintval = le16toh(bss->beacon_period);
- scan.capinfo = le16toh(bss->capability);
- scan.bchan = ieee80211_chan2ieee(ic, ic->ic_curchan);
- scan.chan = scan.bchan;
- scan.rates = rates;
- scan.ssid = ssid;
+ scan.sp_tstamp = (uint8_t *)&tsf;
+ scan.sp_bintval = le16toh(bss->beacon_period);
+ scan.sp_capinfo = le16toh(bss->capability);
+ scan.sp_bchan = ieee80211_chan2ieee(ic, ic->ic_curchan);
+ scan.sp_chan = scan.sp_bchan;
+ scan.sp_rates = rates;
+ scan.sp_ssid = ssid;
for (frm = sfrm; frm < efrm; frm += frm[1] + 2) {
switch (frm[0]) {
case IEEE80211_ELEMID_COUNTRY:
- scan.country = frm;
+ scan.sp_country = frm;
break;
case IEEE80211_ELEMID_FHPARMS:
if (ic->ic_phytype == IEEE80211_T_FH) {
if (frm + 6 >= efrm)
break;
- scan.fhdwell = le16dec(&frm[2]);
- scan.chan = IEEE80211_FH_CHAN(frm[4], frm[5]);
- scan.fhindex = frm[6];
+ scan.sp_fhdwell = le16dec(&frm[2]);
+ scan.sp_chan = IEEE80211_FH_CHAN(frm[4], frm[5]);
+ scan.sp_fhindex = frm[6];
}
break;
case IEEE80211_ELEMID_DSPARMS:
if (ic->ic_phytype != IEEE80211_T_FH) {
if (frm + 2 >= efrm)
break;
- scan.chan = frm[2];
+ scan.sp_chan = frm[2];
}
break;
case IEEE80211_ELEMID_TIM:
- scan.tim = frm;
- scan.timoff = frm - sfrm;
+ scan.sp_tim = frm;
+ scan.sp_timoff = frm - sfrm;
break;
case IEEE80211_ELEMID_XRATES:
- scan.xrates = frm;
+ scan.sp_xrates = frm;
break;
case IEEE80211_ELEMID_ERP:
if (frm + 1 >= efrm)
@@ -1715,10 +1715,10 @@
ic->ic_stats.is_rx_elem_toobig++;
break;
}
- scan.erp = frm[2];
+ scan.sp_erp = frm[2];
break;
case IEEE80211_ELEMID_RSN:
- scan.wpa = frm;
+ scan.sp_wpa = frm;
break;
case IEEE80211_ELEMID_VENDOR:
if (frm + 1 >= efrm)
@@ -1726,7 +1726,7 @@
if (frm + frm[1] + 2 >= efrm)
break;
if (bwfm_iswpaoui(frm))
- scan.wpa = frm;
+ scan.sp_wpa = frm;
break;
}
if (frm + 1 >= efrm)
diff -r 22f37551bdf7 -r 66d1f9e837d9 sys/net80211/ieee80211_input.c
--- a/sys/net80211/ieee80211_input.c Tue Jan 16 16:54:54 2018 +0000
+++ b/sys/net80211/ieee80211_input.c Tue Jan 16 18:42:43 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ieee80211_input.c,v 1.106 2018/01/16 16:54:54 maxv Exp $ */
+/* $NetBSD: ieee80211_input.c,v 1.107 2018/01/16 18:42:43 maxv Exp $ */
/*
* Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_input.c,v 1.81 2005/08/10 16:22:29 sam Exp $");
#endif
#ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.106 2018/01/16 16:54:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_input.c,v 1.107 2018/01/16 18:42:43 maxv Exp $");
#endif
#ifdef _KERNEL_OPT
@@ -1931,7 +1931,7 @@
ieee80211_init_neighbor(ic, ni, wh, scan, 0);
} else {
/* Record TSF for potential resync. */
- memcpy(ni->ni_tstamp.data, scan->tstamp, sizeof(ni->ni_tstamp));
+ memcpy(ni->ni_tstamp.data, scan->sp_tstamp, sizeof(ni->ni_tstamp));
}
ni->ni_rssi = rssi;
@@ -2046,11 +2046,11 @@
*/
IEEE80211_VERIFY_LENGTH(efrm - frm, 12);
memset(&scan, 0, sizeof(scan));
- scan.tstamp = frm; frm += 8;
- scan.bintval = le16toh(*(u_int16_t *)frm); frm += 2;
- scan.capinfo = le16toh(*(u_int16_t *)frm); frm += 2;
- scan.bchan = ieee80211_chan2ieee(ic, ic->ic_curchan);
- scan.chan = scan.bchan;
+ scan.sp_tstamp = frm; frm += 8;
+ scan.sp_bintval = le16toh(*(u_int16_t *)frm); frm += 2;
+ scan.sp_capinfo = le16toh(*(u_int16_t *)frm); frm += 2;
+ scan.sp_bchan = ieee80211_chan2ieee(ic, ic->ic_curchan);
+ scan.sp_chan = scan.sp_bchan;
while (frm + 1 < efrm) {
IEEE80211_VERIFY_LENGTH(efrm - frm, frm[1] + 2);
@@ -2058,22 +2058,22 @@
switch (*frm) {
case IEEE80211_ELEMID_SSID:
/* no length check needed */
- scan.ssid = frm;
+ scan.sp_ssid = frm;
break;
case IEEE80211_ELEMID_RATES:
/* no length check needed */
- scan.rates = frm;
+ scan.sp_rates = frm;
break;
case IEEE80211_ELEMID_COUNTRY:
/* XXX: we don't do anything with this? */
- scan.country = frm;
+ scan.sp_country = frm;
break;
case IEEE80211_ELEMID_FHPARMS:
IEEE80211_VERIFY_LENGTH(frm[1], 5);
if (ic->ic_phytype == IEEE80211_T_FH) {
- scan.fhdwell = LE_READ_2(&frm[2]);
- scan.chan = IEEE80211_FH_CHAN(frm[4], frm[5]);
- scan.fhindex = frm[6];
+ scan.sp_fhdwell = LE_READ_2(&frm[2]);
+ scan.sp_chan = IEEE80211_FH_CHAN(frm[4], frm[5]);
+ scan.sp_fhindex = frm[6];
}
break;
case IEEE80211_ELEMID_DSPARMS:
@@ -2083,13 +2083,13 @@
*/
IEEE80211_VERIFY_LENGTH(frm[1], 1);
if (ic->ic_phytype != IEEE80211_T_FH)
- scan.chan = frm[2];
+ scan.sp_chan = frm[2];
break;
case IEEE80211_ELEMID_TIM:
/* XXX ATIM? */
IEEE80211_VERIFY_LENGTH(frm[1], 5);
- scan.tim = frm;
- scan.timoff = frm - mtod(m0, u_int8_t *);
+ scan.sp_tim = frm;
+ scan.sp_timoff = frm - mtod(m0, u_int8_t *);
break;
case IEEE80211_ELEMID_IBSSPARMS:
break;
@@ -2100,7 +2100,7 @@
ic->ic_stats.is_rx_elem_toobig++;
break;
}
- scan.xrates = frm;
+ scan.sp_xrates = frm;
break;
case IEEE80211_ELEMID_ERP:
if (frm[1] != 1) {
@@ -2109,18 +2109,18 @@
ic->ic_stats.is_rx_elem_toobig++;
break;
}
- scan.erp = frm[2];
+ scan.sp_erp = frm[2];
break;
case IEEE80211_ELEMID_RSN:
/* no length check needed */
- scan.wpa = frm;
+ scan.sp_wpa = frm;
break;
case IEEE80211_ELEMID_VENDOR:
/* no length check needed */
if (iswpaoui(frm))
- scan.wpa = frm;
+ scan.sp_wpa = frm;
else if (iswmeparam(frm) || iswmeinfo(frm))
- scan.wme = frm;
+ scan.sp_wme = frm;
/* XXX Atheros OUI support */
break;
default:
@@ -2133,24 +2133,24 @@
frm += frm[1] + 2;
}
- IEEE80211_VERIFY_ELEMENT(scan.rates, IEEE80211_RATE_MAXSIZE);
- IEEE80211_VERIFY_ELEMENT(scan.ssid, IEEE80211_NWID_LEN);
+ IEEE80211_VERIFY_ELEMENT(scan.sp_rates, IEEE80211_RATE_MAXSIZE);
+ IEEE80211_VERIFY_ELEMENT(scan.sp_ssid, IEEE80211_NWID_LEN);
if (
#if IEEE80211_CHAN_MAX < 255
- scan.chan > IEEE80211_CHAN_MAX ||
+ scan.sp_chan > IEEE80211_CHAN_MAX ||
#endif
- isclr(ic->ic_chan_active, scan.chan)) {
+ isclr(ic->ic_chan_active, scan.sp_chan)) {
IEEE80211_DISCARD(ic,
IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT,
wh, ieee80211_mgt_subtype_name[subtype >>
IEEE80211_FC0_SUBTYPE_SHIFT],
- "invalid channel %u", scan.chan);
+ "invalid channel %u", scan.sp_chan);
ic->ic_stats.is_rx_badchan++;
return;
}
- if (scan.chan != scan.bchan &&
+ if (scan.sp_chan != scan.sp_bchan &&
ic->ic_phytype != IEEE80211_T_FH) {
/*
* Frame was received on a channel different from the
@@ -2166,25 +2166,25 @@
IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT,
wh, ieee80211_mgt_subtype_name[subtype >>
IEEE80211_FC0_SUBTYPE_SHIFT],
- "for off-channel %u", scan.chan);
+ "for off-channel %u", scan.sp_chan);
ic->ic_stats.is_rx_chanmismatch++;
return;
}
- if (!(IEEE80211_BINTVAL_MIN <= scan.bintval &&
- scan.bintval <= IEEE80211_BINTVAL_MAX)) {
+ if (!(IEEE80211_BINTVAL_MIN <= scan.sp_bintval &&
+ scan.sp_bintval <= IEEE80211_BINTVAL_MAX)) {
IEEE80211_DISCARD(ic,
IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT,
wh, ieee80211_mgt_subtype_name[subtype >>
IEEE80211_FC0_SUBTYPE_SHIFT],
- "bogus beacon interval", scan.bintval);
+ "bogus beacon interval", scan.sp_bintval);
ic->ic_stats.is_rx_badbintval++;
return;
}
if (ni != ic->ic_bss) {
ni = ieee80211_refine_node_for_beacon(ic, ni,
- &ic->ic_channels[scan.chan], scan.ssid);
+ &ic->ic_channels[scan.sp_chan], scan.sp_ssid);
}
/*
@@ -2206,29 +2206,29 @@
((ic->ic_flags & IEEE80211_F_SCAN) == 0 ||
IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_bssid))) {
/* record tsf of last beacon */
- memcpy(ni->ni_tstamp.data, scan.tstamp, sizeof(ni->ni_tstamp));
+ memcpy(ni->ni_tstamp.data, scan.sp_tstamp, sizeof(ni->ni_tstamp));
- if (ni->ni_erp != scan.erp) {
+ if (ni->ni_erp != scan.sp_erp) {
IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC,
"[%s] erp change: was 0x%x, now 0x%x\n",
ether_snprintf(ebuf, sizeof(ebuf),
- wh->i_addr2), ni->ni_erp, scan.erp);
+ wh->i_addr2), ni->ni_erp, scan.sp_erp);
if (ic->ic_curmode == IEEE80211_MODE_11G &&
(ni->ni_erp & IEEE80211_ERP_USE_PROTECTION))
ic->ic_flags |= IEEE80211_F_USEPROT;
else
ic->ic_flags &= ~IEEE80211_F_USEPROT;
- ni->ni_erp = scan.erp;
+ ni->ni_erp = scan.sp_erp;
/* XXX statistic */
}
- if ((ni->ni_capinfo ^ scan.capinfo) & IEEE80211_CAPINFO_SHORT_SLOTTIME) {
+ if ((ni->ni_capinfo ^ scan.sp_capinfo) & IEEE80211_CAPINFO_SHORT_SLOTTIME) {
IEEE80211_DPRINTF(ic, IEEE80211_MSG_ASSOC,
"[%s] capabilities change: before 0x%x,"
Home |
Main Index |
Thread Index |
Old Index