ieee80211_adhoc.c (244078) | ieee80211_adhoc.c (245928) |
---|---|
1/*- 2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> 27#ifdef __FreeBSD__ | 1/*- 2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 */ 25 26#include <sys/cdefs.h> 27#ifdef __FreeBSD__ |
28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_adhoc.c 244078 2012-12-10 07:00:46Z adrian $"); | 28__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_adhoc.c 245928 2013-01-26 00:37:54Z adrian $"); |
29#endif 30 31/* 32 * IEEE 802.11 IBSS mode support. 33 */ 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 646 unchanged lines hidden (view full) --- 683adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, 684 int subtype, int rssi, int nf) 685{ 686 struct ieee80211vap *vap = ni->ni_vap; 687 struct ieee80211com *ic = ni->ni_ic; 688 struct ieee80211_frame *wh; 689 uint8_t *frm, *efrm, *sfrm; 690 uint8_t *ssid, *rates, *xrates; | 29#endif 30 31/* 32 * IEEE 802.11 IBSS mode support. 33 */ 34#include "opt_inet.h" 35#include "opt_wlan.h" 36 --- 646 unchanged lines hidden (view full) --- 683adhoc_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, 684 int subtype, int rssi, int nf) 685{ 686 struct ieee80211vap *vap = ni->ni_vap; 687 struct ieee80211com *ic = ni->ni_ic; 688 struct ieee80211_frame *wh; 689 uint8_t *frm, *efrm, *sfrm; 690 uint8_t *ssid, *rates, *xrates; |
691 int ht_state_change = 0; |
|
691 692 wh = mtod(m0, struct ieee80211_frame *); 693 frm = (uint8_t *)&wh[1]; 694 efrm = mtod(m0, uint8_t *) + m0->m_len; 695 switch (subtype) { 696 case IEEE80211_FC0_SUBTYPE_PROBE_RESP: 697 case IEEE80211_FC0_SUBTYPE_BEACON: { 698 struct ieee80211_scanparams scan; --- 44 unchanged lines hidden (view full) --- 743 ieee80211_init_neighbor(ni, wh, &scan); 744 } else { 745 /* 746 * Record tsf for potential resync. 747 */ 748 memcpy(ni->ni_tstamp.data, scan.tstamp, 749 sizeof(ni->ni_tstamp)); 750 } | 692 693 wh = mtod(m0, struct ieee80211_frame *); 694 frm = (uint8_t *)&wh[1]; 695 efrm = mtod(m0, uint8_t *) + m0->m_len; 696 switch (subtype) { 697 case IEEE80211_FC0_SUBTYPE_PROBE_RESP: 698 case IEEE80211_FC0_SUBTYPE_BEACON: { 699 struct ieee80211_scanparams scan; --- 44 unchanged lines hidden (view full) --- 744 ieee80211_init_neighbor(ni, wh, &scan); 745 } else { 746 /* 747 * Record tsf for potential resync. 748 */ 749 memcpy(ni->ni_tstamp.data, scan.tstamp, 750 sizeof(ni->ni_tstamp)); 751 } |
752 /* 753 * This isn't enabled yet - otherwise it would 754 * update the HT parameters and channel width 755 * from any node, which could lead to lots of 756 * strange behaviour if the 11n nodes aren't 757 * exactly configured to match. 758 */ 759#if 0 760 if (scan.htcap != NULL && scan.htinfo != NULL && 761 (vap->iv_flags_ht & IEEE80211_FHT_HT)) { 762 if (ieee80211_ht_updateparams(ni, 763 scan.htcap, scan.htinfo)) 764 ht_state_change = 1; 765 } 766#endif |
|
751 if (ni != NULL) { 752 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); 753 ni->ni_noise = nf; 754 } | 767 if (ni != NULL) { 768 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi); 769 ni->ni_noise = nf; 770 } |
771 if (ht_state_change) 772 ieee80211_update_chw(ic); |
|
755 } 756 break; 757 } 758 759 case IEEE80211_FC0_SUBTYPE_PROBE_REQ: 760 if (vap->iv_state != IEEE80211_S_RUN) { 761 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, 762 wh, NULL, "wrong state %s", --- 160 unchanged lines hidden --- | 773 } 774 break; 775 } 776 777 case IEEE80211_FC0_SUBTYPE_PROBE_REQ: 778 if (vap->iv_state != IEEE80211_S_RUN) { 779 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, 780 wh, NULL, "wrong state %s", --- 160 unchanged lines hidden --- |