IEEE80211_DPRINTF(("%s: DS to DS\n", __func__));
IEEE80211_DPRINTF(("%s: discard DS to DS frame\n", __func__));
ieee80211_decap(struct ifnet *ifp, struct mbuf *m){	struct ether_header *eh;	struct ieee80211_frame wh;	struct llc *llc;	if (m->m_len < sizeof(wh) + sizeof(*llc)) {		m = m_pullup(m, sizeof(wh) + sizeof(*llc));		if (m == NULL)			return NULL;	}	memcpy(&wh, mtod(m, caddr_t), sizeof(wh));	llc = (struct llc *)(mtod(m, caddr_t) + sizeof(wh));	if (llc->llc_dsap == LLC_SNAP_LSAP && llc->llc_ssap == LLC_SNAP_LSAP &&	    llc->llc_control == LLC_UI && llc->llc_snap.org_code[0] == 0 &&	    llc->llc_snap.org_code[1] == 0 && llc->llc_snap.org_code[2] == 0) {		m_adj(m, sizeof(wh) + sizeof(struct llc) - sizeof(*eh));		llc = NULL;	} else {		m_adj(m, sizeof(wh) - sizeof(*eh));	}	eh = mtod(m, struct ether_header *);	switch (wh.i_fc[1] & IEEE80211_FC1_DIR_MASK) {	case IEEE80211_FC1_DIR_NODS:		IEEE80211_ADDR_COPY(eh->ether_dhost, wh.i_addr1);		IEEE80211_ADDR_COPY(eh->ether_shost, wh.i_addr2);		break;	case IEEE80211_FC1_DIR_TODS:		IEEE80211_ADDR_COPY(eh->ether_dhost, wh.i_addr3);		IEEE80211_ADDR_COPY(eh->ether_shost, wh.i_addr2);		break;	case IEEE80211_FC1_DIR_FROMDS:		IEEE80211_ADDR_COPY(eh->ether_dhost, wh.i_addr1);		IEEE80211_ADDR_COPY(eh->ether_shost, wh.i_addr3);		break;	case IEEE80211_FC1_DIR_DSTODS:		/* not yet supported */		IEEE80211_DPRINTF(("%s: DS to DS\n", __func__));		m_freem(m);		return NULL;	}#ifdef ALIGNED_POINTER	if (!ALIGNED_POINTER(mtod(m, caddr_t) + sizeof(*eh), u_int32_t)) {		struct mbuf *n, *n0, **np;		caddr_t newdata;		int off, pktlen;		n0 = NULL;		np = &n0;		off = 0;		pktlen = m->m_pkthdr.len;		while (pktlen > off) {			if (n0 == NULL) {				MGETHDR(n, M_DONTWAIT, MT_DATA);				if (n == NULL) {					m_freem(m);					return NULL;				}#if defined(__FreeBSD__)				M_MOVE_PKTHDR(n, m);#elif defined(__OpenBSD__)				M_DUP_PKTHDR(n, m);#else				M_COPY_PKTHDR(n, m);#endif				n->m_len = MHLEN;			} else {				MGET(n, M_DONTWAIT, MT_DATA);				if (n == NULL) {					m_freem(m);					m_freem(n0);					return NULL;				}				n->m_len = MLEN;			}			if (pktlen - off >= MINCLSIZE) {				MCLGET(n, M_DONTWAIT);				if (n->m_flags & M_EXT)					n->m_len = n->m_ext.ext_size;			}			if (n0 == NULL) {				newdata =				    (caddr_t)ALIGN(n->m_data + sizeof(*eh)) -				    sizeof(*eh);				n->m_len -= newdata - n->m_data;				n->m_data = newdata;			}			if (n->m_len > pktlen - off)				n->m_len = pktlen - off;			m_copydata(m, off, n->m_len, mtod(n, caddr_t));			off += n->m_len;			*np = n;			np = &n->m_next;		}		m_freem(m);		m = n0;	}#endif /* ALIGNED_POINTER */	if (llc != NULL) {		eh = mtod(m, struct ether_header *);		eh->ether_type = htons(m->m_pkthdr.len - sizeof(*eh));	}	return m;}