PERFORCE change 139345 for review

Sam Leffler sam at FreeBSD.org
Fri Apr 4 16:38:24 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=139345

Change 139345 by sam at sam_ebb on 2008/04/04 16:38:01

	hack raw xmit path to handle mgt frames; still get firmware
	errors negotiating wpa

Affected files ...

.. //depot/projects/vap/sys/dev/iwi/if_iwi.c#15 edit

Differences ...

==== //depot/projects/vap/sys/dev/iwi/if_iwi.c#15 (text+ko) ====

@@ -157,6 +157,8 @@
 static void	iwi_write_ibssnode(struct iwi_softc *, const u_int8_t [], int);
 static int	iwi_tx_start(struct ifnet *, struct mbuf *,
 		    struct ieee80211_node *, int);
+static int	iwi_raw_xmit(struct ieee80211_node *, struct mbuf *,
+		    const struct ieee80211_bpf_params *);
 static void	iwi_start(struct ifnet *);
 static void	iwi_watchdog(void *);
 static int	iwi_ioctl(struct ifnet *, u_long, caddr_t);
@@ -402,6 +404,7 @@
 	ic->ic_node_alloc = iwi_node_alloc;
 	sc->sc_node_free = ic->ic_node_free;
 	ic->ic_node_free = iwi_node_free;
+	ic->ic_raw_xmit = iwi_raw_xmit;
 	ic->ic_scan_start = iwi_scan_start;
 	ic->ic_scan_end = iwi_scan_end;
 	ic->ic_set_channel = iwi_set_channel;
@@ -1872,6 +1875,49 @@
 	return 0;
 }
 
+static int
+iwi_raw_xmit(struct ieee80211_node *ni, struct mbuf *m,
+	const struct ieee80211_bpf_params *params)
+{
+	struct ieee80211com *ic = ni->ni_ic;
+	struct ifnet *ifp = ic->ic_ifp;
+	struct iwi_softc *sc = ifp->if_softc;
+	int ac;
+	IWI_LOCK_DECL;
+
+	IWI_LOCK(sc);
+
+	/* prevent management frames from being sent if we're not ready */
+	if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+		IWI_UNLOCK(sc);
+		m_freem(m);
+		ieee80211_free_node(ni);
+		return ENETDOWN;
+	}
+	ac = M_WME_GETAC(m);
+	if (sc->txq[ac].queued > IWI_TX_RING_COUNT - 8) {
+		ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+		IWI_UNLOCK(sc);
+		m_freem(m);
+		ieee80211_free_node(ni);
+		return ENOBUFS;		/* XXX */
+	}
+
+	BPF_MTAP(ifp, m);
+
+	/* XXX honor params */
+	if (iwi_tx_start(ifp, m, ni, ac) != 0) {
+		ieee80211_free_node(ni);
+		ifp->if_oerrors++;
+		IWI_UNLOCK(sc);
+		return EIO;
+	}
+
+	IWI_UNLOCK(sc);
+
+	return 0;
+}
+
 static void
 iwi_start(struct ifnet *ifp)
 {


More information about the p4-projects mailing list