Page MenuHomeFreeBSD

D35752.id107906.diff
No OneTemporary

D35752.id107906.diff

diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c
--- a/sys/dev/wtap/if_wtap.c
+++ b/sys/dev/wtap/if_wtap.c
@@ -88,7 +88,6 @@
{
int err = 0;
struct mbuf *m;
- struct ifnet *ifp;
struct wtap_softc *sc;
uint8_t buf[1024];
struct epoch_tracker et;
@@ -106,22 +105,13 @@
MGETHDR(m, M_NOWAIT, MT_DATA);
m_copyback(m, 0, buf_len, buf);
- CURVNET_SET(TD_TO_VNET(curthread));
NET_EPOCH_ENTER(et);
- CK_STAILQ_FOREACH(ifp, &V_ifnet, if_link) {
- printf("ifp->if_xname = %s\n", ifp->if_xname);
- if(strcmp(devtoname(dev), ifp->if_xname) == 0){
- printf("found match, correspoding wtap = %s\n",
- ifp->if_xname);
- sc = (struct wtap_softc *)ifp->if_softc;
- printf("wtap id = %d\n", sc->id);
- wtap_inject(sc, m);
- }
- }
+ sc = (struct wtap_softc *)dev->si_drv1;
+ printf("wtap id = %d\n", sc->id);
+ wtap_inject(sc, m);
NET_EPOCH_EXIT(et);
- CURVNET_RESTORE();
return(err);
}
@@ -345,7 +335,8 @@
ieee80211_vap_attach(vap, ieee80211_media_change,
ieee80211_media_status, mac);
avp->av_dev = make_dev(&wtap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
- "%s", (const char *)sc->name);
+ "%s", (const char *)vap->iv_ifp->if_xname);
+ avp->av_dev->si_drv1 = sc;
/* TODO this is a hack to force it to choose the rate we want */
ni = ieee80211_ref_node(vap->iv_bss);
@@ -446,7 +437,6 @@
struct ieee80211com *ic = &sc->sc_ic;
struct mbuf *m;
struct ieee80211_node *ni;
- int type;
struct wtap_buf *bf;
#if 0
@@ -487,10 +477,10 @@
/*
* Sending station is known, dispatch directly.
*/
- type = ieee80211_input(ni, m, 1<<7, 10);
+ ieee80211_input(ni, m, 1<<7, 10);
ieee80211_free_node(ni);
} else {
- type = ieee80211_input_all(ic, m, 1<<7, 10);
+ ieee80211_input_all(ic, m, 1<<7, 10);
}
NET_EPOCH_EXIT(et);
diff --git a/sys/dev/wtap/if_wtap_module.c b/sys/dev/wtap/if_wtap_module.c
--- a/sys/dev/wtap/if_wtap_module.c
+++ b/sys/dev/wtap/if_wtap_module.c
@@ -143,7 +143,6 @@
GID_WHEEL,0600,(const char *)"wtapctl");
hal = (struct wtap_hal *)malloc(sizeof(struct wtap_hal),
M_WTAP, M_NOWAIT | M_ZERO);
- bzero(hal, sizeof(struct wtap_hal));
init_hal(hal);
diff --git a/sys/dev/wtap/wtap_hal/hal.c b/sys/dev/wtap/wtap_hal/hal.c
--- a/sys/dev/wtap/wtap_hal/hal.c
+++ b/sys/dev/wtap/wtap_hal/hal.c
@@ -69,7 +69,6 @@
hal->hal_md = (struct wtap_medium *)malloc(sizeof(struct wtap_medium),
M_WTAP, M_NOWAIT | M_ZERO);
- bzero(hal->hal_md, sizeof(struct wtap_medium));
init_medium(hal->hal_md);
/* register event handler for packets */
@@ -181,11 +180,10 @@
hal->hal_devs[id] = (struct wtap_softc *)malloc(
sizeof(struct wtap_softc), M_WTAP, M_NOWAIT | M_ZERO);
- bzero(hal->hal_devs[id], sizeof(struct wtap_softc));
hal->hal_devs[id]->sc_md = hal->hal_md;
hal->hal_devs[id]->id = id;
snprintf(hal->hal_devs[id]->name, sizeof(hal->hal_devs[id]->name),
- "wlan%d", id);
+ "wtap%d", id);
mtx_init(&hal->hal_devs[id]->sc_mtx, "wtap_softc mtx", NULL,
MTX_DEF | MTX_RECURSE);

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 1, 4:42 PM (3 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29119840
Default Alt Text
D35752.id107906.diff (2 KB)

Event Timeline