summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-02-22 14:40:56 -0300
committerRenato Botelho <renato@netgate.com>2016-02-22 14:40:56 -0300
commit0a3437aa52c010dc2ab10b9778a383fef436382c (patch)
treeb2f879569f9d9deb23e4d7accb103d30a64e1527 /sys/net80211/ieee80211.c
parent6a0f7868a911546f7be04cc546e99cc803686af3 (diff)
downloadFreeBSD-src-0a3437aa52c010dc2ab10b9778a383fef436382c.zip
FreeBSD-src-0a3437aa52c010dc2ab10b9778a383fef436382c.tar.gz
Revert "Importing pfSense patches net80211HEAD.tgz and conf.file.ieee80211.diff"
This reverts commit 6ee75bdd7bf7c20359dd6e38c243586cb062edea.
Diffstat (limited to 'sys/net80211/ieee80211.c')
-rw-r--r--sys/net80211/ieee80211.c38
1 files changed, 11 insertions, 27 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 2fa7e9a..db505ab 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include <sys/socket.h>
#include <net/if.h>
-#include <net/if_var.h>
#include <net/if_dl.h>
#include <net/if_media.h>
#include <net/if_types.h>
@@ -238,7 +237,7 @@ static int
null_transmit(struct ifnet *ifp, struct mbuf *m)
{
m_freem(m);
- if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
+ ifp->if_oerrors++;
return EACCES; /* XXX EIO/EPERM? */
}
@@ -570,9 +569,15 @@ ieee80211_vap_attach(struct ieee80211vap *vap,
ifp->if_baudrate = IF_Mbps(maxrate);
ether_ifattach(ifp, vap->iv_myaddr);
- /* hook output method setup by ether_ifattach */
- vap->iv_output = ifp->if_output;
- ifp->if_output = ieee80211_output;
+ if (vap->iv_opmode == IEEE80211_M_MONITOR) {
+ /* NB: disallow transmit */
+ ifp->if_transmit = null_transmit;
+ ifp->if_output = null_output;
+ } else {
+ /* hook output method setup by ether_ifattach */
+ vap->iv_output = ifp->if_output;
+ ifp->if_output = ieee80211_output;
+ }
/* NB: if_mtu set by ether_ifattach to ETHERMTU */
IEEE80211_LOCK(ic);
@@ -1402,8 +1407,7 @@ ieee80211_media_status(struct ifnet *ifp, struct ifmediareq *imr)
* rate only when running; otherwise we may have a mismatch
* in which case the rate will not be convertible.
*/
- if (vap->iv_state == IEEE80211_S_RUN ||
- vap->iv_state == IEEE80211_S_SLEEP) {
+ if (vap->iv_state == IEEE80211_S_RUN) {
imr->ifm_status |= IFM_ACTIVE;
mode = ieee80211_chan2mode(ic->ic_curchan);
} else
@@ -1747,23 +1751,3 @@ ieee80211_mac_hash(const struct ieee80211com *ic,
return c;
}
#undef mix
-
-char
-ieee80211_channel_type_char(const struct ieee80211_channel *c)
-{
- if (IEEE80211_IS_CHAN_ST(c))
- return 'S';
- if (IEEE80211_IS_CHAN_108A(c))
- return 'T';
- if (IEEE80211_IS_CHAN_108G(c))
- return 'G';
- if (IEEE80211_IS_CHAN_HT(c))
- return 'n';
- if (IEEE80211_IS_CHAN_A(c))
- return 'a';
- if (IEEE80211_IS_CHAN_ANYG(c))
- return 'g';
- if (IEEE80211_IS_CHAN_B(c))
- return 'b';
- return 'f';
-}
OpenPOWER on IntegriCloud