aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/if_ndis
diff options
context:
space:
mode:
authorRui Paulo <rpaulo@FreeBSD.org>2010-01-05 22:59:59 +0000
committerRui Paulo <rpaulo@FreeBSD.org>2010-01-05 22:59:59 +0000
commitab925d255d0315a5e3403eac3f5882dee30029b4 (patch)
tree72decee7802bcb185efb339b38c4d8f248ebcd7f /sys/dev/if_ndis
parent6846bee277d3f40e9ff132226c414a5cd0a45e5a (diff)
downloadsrc-ab925d255d0315a5e3403eac3f5882dee30029b4.tar.gz
src-ab925d255d0315a5e3403eac3f5882dee30029b4.zip
Notes
Diffstat (limited to 'sys/dev/if_ndis')
-rw-r--r--sys/dev/if_ndis/if_ndis.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index dbcab381abc8..62d0ed150deb 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -189,6 +189,7 @@ static int ndis_set_offload (struct ndis_softc *);
static void ndis_getstate_80211 (struct ndis_softc *);
static void ndis_setstate_80211 (struct ndis_softc *);
static void ndis_auth_and_assoc (struct ndis_softc *, struct ieee80211vap *);
+static void ndis_media_status (struct ifnet *, struct ifmediareq *);
static int ndis_set_cipher (struct ndis_softc *, int);
static int ndis_set_wpa (struct ndis_softc *, void *, int);
static int ndis_add_key (struct ieee80211vap *,
@@ -993,7 +994,7 @@ ndis_vap_create(struct ieee80211com *ic,
vap->iv_newstate = ndis_newstate;
/* complete setup */
- ieee80211_vap_attach(vap, ieee80211_media_change, ieee80211_media_status);
+ ieee80211_vap_attach(vap, ieee80211_media_change, ndis_media_status);
ic->ic_opmode = opmode;
/* install key handing routines */
vap->iv_key_set = ndis_add_key;
@@ -2237,6 +2238,23 @@ ndis_set_wpa(sc, ie, ielen)
}
static void
+ndis_media_status(struct ifnet *ifp, struct ifmediareq *imr)
+{
+ struct ieee80211vap *vap = ifp->if_softc;
+ struct ndis_softc *sc = vap->iv_ic->ic_ifp->if_softc;
+ uint32_t txrate;
+ size_t len;
+
+ if (!NDIS_INITIALIZED(sc))
+ return;
+
+ len = sizeof(txrate);
+ if (ndis_get_info(sc, OID_GEN_LINK_SPEED, &txrate, &len) == 0)
+ vap->iv_bss->ni_txrate = txrate / 5000;
+ ieee80211_media_status(ifp, imr);
+}
+
+static void
ndis_setstate_80211(sc)
struct ndis_softc *sc;
{
@@ -2696,13 +2714,6 @@ ndis_getstate_80211(sc)
bs->nwbx_ssid.ns_ssidlen);
ni->ni_esslen = bs->nwbx_ssid.ns_ssidlen;
- len = sizeof(arg);
- rval = ndis_get_info(sc, OID_GEN_LINK_SPEED, &arg, &len);
- if (rval)
- device_printf(sc->ndis_dev, "get link speed failed: %d\n",
- rval);
- ni->ni_txrate = arg / 5000;
-
if (ic->ic_caps & IEEE80211_C_PMGT) {
len = sizeof(arg);
rval = ndis_get_info(sc, OID_802_11_POWER_MODE, &arg, &len);