PERFORCE change 139302 for review
Andrew Thompson
thompsa at FreeBSD.org
Thu Apr 3 22:12:42 UTC 2008
http://perforce.freebsd.org/chv.cgi?CH=139302
Change 139302 by thompsa at thompsa_burger on 2008/04/03 22:12:02
Add raw frame tx support.
Submitted via: vapified wpi(4) w/ WPA
Affected files ...
.. //depot/projects/vap/sys/dev/wpi/if_wpi.c#15 edit
Differences ...
==== //depot/projects/vap/sys/dev/wpi/if_wpi.c#15 (text+ko) ====
@@ -197,6 +197,8 @@
static int wpi_tx_data(struct wpi_softc *, struct mbuf *,
struct ieee80211_node *, int);
static void wpi_start(struct ifnet *);
+static int wpi_raw_xmit(struct ieee80211_node *, struct mbuf *,
+ const struct ieee80211_bpf_params *);
static void wpi_scan_start(struct ieee80211com *);
static void wpi_scan_end(struct ieee80211com *);
static void wpi_set_channel(struct ieee80211com *);
@@ -666,6 +668,7 @@
/* override default methods */
ic->ic_node_alloc = wpi_node_alloc;
ic->ic_newassoc = wpi_newassoc;
+ ic->ic_raw_xmit = wpi_raw_xmit;
ic->ic_wme.wme_update = wpi_wme_update;
ic->ic_scan_start = wpi_scan_start;
ic->ic_scan_end = wpi_scan_end;
@@ -2026,6 +2029,46 @@
}
static int
+wpi_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 wpi_softc *sc = ifp->if_softc;
+
+ /* prevent management frames from being sent if we're not ready */
+ if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+ m_freem(m);
+ ieee80211_free_node(ni);
+ return ENETDOWN;
+ }
+ WPI_LOCK(sc);
+
+ /* management frames go into ring 0 */
+ if (sc->txq[0].queued > sc->txq[0].count - 8) {
+ ifp->if_drv_flags |= IFF_DRV_OACTIVE;
+ m_freem(m);
+ WPI_UNLOCK(sc);
+ ieee80211_free_node(ni);
+ return ENOBUFS; /* XXX */
+ }
+
+ ifp->if_opackets++;
+ if (wpi_tx_data(sc, m, ni, 0) != 0)
+ goto bad;
+ sc->sc_tx_timer = 5;
+ callout_reset(&sc->watchdog_to, hz, wpi_watchdog, sc);
+
+ WPI_UNLOCK(sc);
+ return 0;
+bad:
+ ifp->if_oerrors++;
+ WPI_UNLOCK(sc);
+ ieee80211_free_node(ni);
+ return EIO; /* XXX */
+}
+
+static int
wpi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
struct wpi_softc *sc = ifp->if_softc;
More information about the p4-projects
mailing list