Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Aug 2013 12:43:11 +0200
From:      "Cedric GROSS" <cg@cgross.info>
To:        "'Adrian Chadd'" <adrian@freebsd.org>
Cc:        freebsd-wireless@freebsd.org
Subject:   RE: [iwn] Review split 5
Message-ID:  <004801ce9424$15c88780$41599680$@info>
In-Reply-To: <CAJ-VmokKU8tvZqJuEny5WM7%2BKmZUJZkAMFDHsc_6SBvX026Qpg@mail.gmail.com>
References:  <002d01ce9200$88b19dc0$9a14d940$@info>	<CAJ-Vmok5dCaS0Z2SyZTp8h_s268LfU-5u3j-ejHC77TdUhzWnQ@mail.gmail.com>	<000601ce9234$010f07c0$032d1740$@info> <CAJ-VmokKU8tvZqJuEny5WM7%2BKmZUJZkAMFDHsc_6SBvX026Qpg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

------=_NextPart_000_0049_01CE9434.D9515780
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


> -----Message d'origine-----
> De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la =
part
> de Adrian Chadd
> Envoy=E9=A0: jeudi 8 ao=FBt 2013 07:14
> =C0=A0: Cedric GROSS
> Cc=A0: freebsd-wireless@freebsd.org
> Objet=A0: Re: [iwn] Review split 5
>=20
> Hiya!
>=20
> So, you removed sc->broadcast_id and replaced it with
> IWN5000_BROADCAST_ID. You need to undo that and go back to using
> sc->broadcast_id; the broadcast id is different between the 4965 and
> 5000 (and later, I bet.)

Oh.. Year, of course.

>=20
> So please go and fix that!

Done.

>=20
> Thanks,
>=20
>=20
>=20
> -adrian
>=20
> (I'm going to spin up a 4965 now just to check how -HEAD works.)

------=_NextPart_000_0049_01CE9434.D9515780
Content-Type: application/octet-stream;
	name="context.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="context.patch"

Index: sys/dev/iwn/if_iwn.c=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- sys/dev/iwn/if_iwn.c	(revision 254091)=0A=
+++ sys/dev/iwn/if_iwn.c	(working copy)=0A=
@@ -1,4 +1,6 @@=0A=
 /*-=0A=
+ * Copyright (c) 2013 Cedric GROSS <c.gross@kreiz-it.fr>=0A=
+ * Copyright (c) 2011 Intel Corporation=0A=
  * Copyright (c) 2007-2009=0A=
  *	Damien Bergamini <damien.bergamini@free.fr>=0A=
  * Copyright (c) 2008=0A=
@@ -521,6 +523,7 @@=0A=
 	/* Read hardware revision and attach. */=0A=
 	sc->hw_type =3D (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT)=0A=
 	    & IWN_HW_REV_TYPE_MASK;=0A=
+	sc->subdevice_id=3Dpci_get_subdevice(dev);=0A=
 	if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965)=0A=
 		error =3D iwn4965_attach(sc, pci_get_device(dev));=0A=
 	else=0A=
@@ -908,19 +911,27 @@=0A=
 {=0A=
 	struct iwn_vap *ivp;=0A=
 	struct ieee80211vap *vap;=0A=
+	uint8_t mac1[IEEE80211_ADDR_LEN];=0A=
+	struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A=
 =0A=
 	if (!TAILQ_EMPTY(&ic->ic_vaps))		/* only one at a time */=0A=
 		return NULL;=0A=
+=0A=
+	IEEE80211_ADDR_COPY(mac1, mac);=0A=
+=0A=
 	ivp =3D (struct iwn_vap *) malloc(sizeof(struct iwn_vap),=0A=
 	    M_80211_VAP, M_NOWAIT | M_ZERO);=0A=
 	if (ivp =3D=3D NULL)=0A=
 		return NULL;=0A=
 	vap =3D &ivp->iv_vap;=0A=
-	ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac);=0A=
+	ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac1);=0A=
+	ivp->ctx =3D IWN_RXON_BSS_CTX;=0A=
+	IEEE80211_ADDR_COPY(ivp->macaddr, mac1);=0A=
 	vap->iv_bmissthreshold =3D 10;		/* override default */=0A=
 	/* Override with driver methods. */=0A=
 	ivp->iv_newstate =3D vap->iv_newstate;=0A=
 	vap->iv_newstate =3D iwn_newstate;=0A=
+	sc->ivap[IWN_RXON_BSS_CTX] =3D vap;=0A=
 =0A=
 	ieee80211_ratectl_init(vap);=0A=
 	/* Complete setup. */=0A=
@@ -2339,6 +2350,8 @@=0A=
 	IWN_LOCK(sc);=0A=
 	callout_stop(&sc->calib_to);=0A=
 =0A=
+	sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A=
+=0A=
 	switch (nstate) {=0A=
 	case IEEE80211_S_ASSOC:=0A=
 		if (vap->iv_state !=3D IEEE80211_S_RUN)=0A=
@@ -2352,8 +2365,8 @@=0A=
 		 * !AUTH -> AUTH transition requires state reset to handle=0A=
 		 * reassociations correctly.=0A=
 		 */=0A=
-		sc->rxon.associd =3D 0;=0A=
-		sc->rxon.filter &=3D ~htole32(IWN_FILTER_BSS);=0A=
+		sc->rxon->associd =3D 0;=0A=
+		sc->rxon->filter &=3D ~htole32(IWN_FILTER_BSS);=0A=
 		sc->calib.state =3D IWN_CALIB_STATE_INIT;=0A=
 =0A=
 		if ((error =3D iwn_auth(sc, vap)) !=3D 0) {=0A=
@@ -4367,6 +4380,8 @@=0A=
 =0A=
 	DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A=
 =0A=
+	sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A=
+=0A=
 	memset(&node, 0, sizeof node);=0A=
 	IEEE80211_ADDR_COPY(node.macaddr, ifp->if_broadcastaddr);=0A=
 	node.id =3D sc->broadcast_id;=0A=
@@ -4550,8 +4565,9 @@=0A=
 	int i, c, grp, maxpwr;=0A=
 	uint8_t chan;=0A=
 =0A=
+	sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A=
 	/* Retrieve current channel from last RXON. */=0A=
-	chan =3D sc->rxon.chan;=0A=
+	chan =3D sc->rxon->chan;=0A=
 	DPRINTF(sc, IWN_DEBUG_RESET, "setting TX power for channel %d\n",=0A=
 	    chan);=0A=
 =0A=
@@ -4910,8 +4926,8 @@=0A=
 =0A=
 #ifdef notyet=0A=
 	/* XXX Disable RX chains with no antennas connected. */=0A=
-	sc->rxon.rxchain =3D htole16(IWN_RXCHAIN_SEL(sc->chainmask));=0A=
-	(void)iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A=
+	sc->rxon->rxchain =3D htole16(IWN_RXCHAIN_SEL(sc->chainmask));=0A=
+	(void)iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A=
 #endif=0A=
 =0A=
 	/* Enable power-saving mode if requested by user. */=0A=
@@ -5440,21 +5456,22 @@=0A=
 	}=0A=
 =0A=
 	/* Set mode, channel, RX filter and enable RX. */=0A=
-	memset(&sc->rxon, 0, sizeof (struct iwn_rxon));=0A=
-	IEEE80211_ADDR_COPY(sc->rxon.myaddr, IF_LLADDR(ifp));=0A=
-	IEEE80211_ADDR_COPY(sc->rxon.wlap, IF_LLADDR(ifp));=0A=
-	sc->rxon.chan =3D ieee80211_chan2ieee(ic, ic->ic_curchan);=0A=
-	sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A=
+	sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A=
+	memset(sc->rxon, 0, sizeof (struct iwn_rxon));=0A=
+	IEEE80211_ADDR_COPY(sc->rxon->myaddr, IF_LLADDR(ifp));=0A=
+	IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A=
+	sc->rxon->chan =3D ieee80211_chan2ieee(ic, ic->ic_curchan);=0A=
+	sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A=
 	if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan))=0A=
-		sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A=
+		sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A=
 	switch (ic->ic_opmode) {=0A=
 	case IEEE80211_M_STA:=0A=
-		sc->rxon.mode =3D IWN_MODE_STA;=0A=
-		sc->rxon.filter =3D htole32(IWN_FILTER_MULTICAST);=0A=
+		sc->rxon->mode =3D IWN_MODE_STA;=0A=
+		sc->rxon->filter =3D htole32(IWN_FILTER_MULTICAST);=0A=
 		break;=0A=
 	case IEEE80211_M_MONITOR:=0A=
-		sc->rxon.mode =3D IWN_MODE_MONITOR;=0A=
-		sc->rxon.filter =3D htole32(IWN_FILTER_MULTICAST |=0A=
+		sc->rxon->mode =3D IWN_MODE_MONITOR;=0A=
+		sc->rxon->filter =3D htole32(IWN_FILTER_MULTICAST |=0A=
 		    IWN_FILTER_CTL | IWN_FILTER_PROMISC);=0A=
 		break;=0A=
 	default:=0A=
@@ -5461,18 +5478,18 @@=0A=
 		/* Should not get there. */=0A=
 		break;=0A=
 	}=0A=
-	sc->rxon.cck_mask  =3D 0x0f;	/* not yet negotiated */=0A=
-	sc->rxon.ofdm_mask =3D 0xff;	/* not yet negotiated */=0A=
-	sc->rxon.ht_single_mask =3D 0xff;=0A=
-	sc->rxon.ht_dual_mask =3D 0xff;=0A=
-	sc->rxon.ht_triple_mask =3D 0xff;=0A=
+	sc->rxon->cck_mask  =3D 0x0f;	/* not yet negotiated */=0A=
+	sc->rxon->ofdm_mask =3D 0xff;	/* not yet negotiated */=0A=
+	sc->rxon->ht_single_mask =3D 0xff;=0A=
+	sc->rxon->ht_dual_mask =3D 0xff;=0A=
+	sc->rxon->ht_triple_mask =3D 0xff;=0A=
 	rxchain =3D=0A=
 	    IWN_RXCHAIN_VALID(sc->rxchainmask) |=0A=
 	    IWN_RXCHAIN_MIMO_COUNT(2) |=0A=
 	    IWN_RXCHAIN_IDLE_COUNT(2);=0A=
-	sc->rxon.rxchain =3D htole16(rxchain);=0A=
+	sc->rxon->rxchain =3D htole16(rxchain);=0A=
 	DPRINTF(sc, IWN_DEBUG_RESET, "%s: setting configuration\n", __func__);=0A=
-	error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 0);=0A=
+	error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 0);=0A=
 	if (error !=3D 0) {=0A=
 		device_printf(sc->sc_dev, "%s: RXON command failed\n",=0A=
 		    __func__);=0A=
@@ -5543,6 +5560,7 @@=0A=
 =0A=
 	DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A=
 =0A=
+	sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A=
 	buf =3D malloc(IWN_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO);=0A=
 	if (buf =3D=3D NULL) {=0A=
 		device_printf(sc->sc_dev,=0A=
@@ -5584,7 +5602,7 @@=0A=
 	} else {=0A=
 		hdr->flags =3D htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO);=0A=
 		if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965 &&=0A=
-		    sc->rxon.associd && sc->rxon.chan > 14)=0A=
+		    sc->rxon->associd && sc->rxon->chan > 14)=0A=
 			tx->rate =3D htole32(0xd);=0A=
 		else {=0A=
 			/* Send probe requests at 1Mbps. */=0A=
@@ -5643,7 +5661,7 @@=0A=
 	} else if (IEEE80211_IS_CHAN_5GHZ(c)) {=0A=
 		chan->rf_gain =3D 0x3b;=0A=
 		chan->active  =3D htole16(24);=0A=
-		if (sc->rxon.associd)=0A=
+		if (sc->rxon->associd)=0A=
 			chan->passive =3D htole16(78);=0A=
 		else=0A=
 			chan->passive =3D htole16(110);=0A=
@@ -5656,7 +5674,7 @@=0A=
 	} else {=0A=
 		chan->rf_gain =3D 0x28;=0A=
 		chan->active  =3D htole16(36);=0A=
-		if (sc->rxon.associd)=0A=
+		if (sc->rxon->associd)=0A=
 			chan->passive =3D htole16(88);=0A=
 		else=0A=
 			chan->passive =3D htole16(120);=0A=
@@ -5695,31 +5713,32 @@=0A=
 =0A=
 	DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A=
 =0A=
+	sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A=
 	/* Update adapter configuration. */=0A=
-	IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid);=0A=
-	sc->rxon.chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A=
-	sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A=
+	IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A=
+	sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A=
+	sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A=
 	if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A=
-		sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A=
+		sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A=
 	if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A=
-		sc->rxon.flags |=3D htole32(IWN_RXON_SHSLOT);=0A=
+		sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A=
 	if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A=
-		sc->rxon.flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A=
+		sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A=
 	if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A=
-		sc->rxon.cck_mask  =3D 0;=0A=
-		sc->rxon.ofdm_mask =3D 0x15;=0A=
+		sc->rxon->cck_mask  =3D 0;=0A=
+		sc->rxon->ofdm_mask =3D 0x15;=0A=
 	} else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A=
-		sc->rxon.cck_mask  =3D 0x03;=0A=
-		sc->rxon.ofdm_mask =3D 0;=0A=
+		sc->rxon->cck_mask  =3D 0x03;=0A=
+		sc->rxon->ofdm_mask =3D 0;=0A=
 	} else {=0A=
 		/* Assume 802.11b/g. */=0A=
-		sc->rxon.cck_mask  =3D 0x0f;=0A=
-		sc->rxon.ofdm_mask =3D 0x15;=0A=
+		sc->rxon->cck_mask  =3D 0x0f;=0A=
+		sc->rxon->ofdm_mask =3D 0x15;=0A=
 	}=0A=
 	DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x cck %x ofdm %x\n",=0A=
-	    sc->rxon.chan, sc->rxon.flags, sc->rxon.cck_mask,=0A=
-	    sc->rxon.ofdm_mask);=0A=
-	error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A=
+	    sc->rxon->chan, sc->rxon->flags, sc->rxon->cck_mask,=0A=
+	    sc->rxon->ofdm_mask);=0A=
+	error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A=
 	if (error !=3D 0) {=0A=
 		device_printf(sc->sc_dev, "%s: RXON command failed, error %d\n",=0A=
 		    __func__, error);=0A=
@@ -5761,6 +5780,7 @@=0A=
 =0A=
 	DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A=
 =0A=
+	sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A=
 	if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) {=0A=
 		/* Link LED blinks while monitoring. */=0A=
 		iwn_set_led(sc, IWN_LED_LINK, 5, 5);=0A=
@@ -5773,26 +5793,26 @@=0A=
 	}=0A=
 =0A=
 	/* Update adapter configuration. */=0A=
-	IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid);=0A=
-	sc->rxon.associd =3D htole16(IEEE80211_AID(ni->ni_associd));=0A=
-	sc->rxon.chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A=
-	sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A=
+	IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A=
+	sc->rxon->associd =3D htole16(IEEE80211_AID(ni->ni_associd));=0A=
+	sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A=
+	sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A=
 	if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A=
-		sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A=
+		sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A=
 	if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A=
-		sc->rxon.flags |=3D htole32(IWN_RXON_SHSLOT);=0A=
+		sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A=
 	if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A=
-		sc->rxon.flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A=
+		sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A=
 	if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A=
-		sc->rxon.cck_mask  =3D 0;=0A=
-		sc->rxon.ofdm_mask =3D 0x15;=0A=
+		sc->rxon->cck_mask  =3D 0;=0A=
+		sc->rxon->ofdm_mask =3D 0x15;=0A=
 	} else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A=
-		sc->rxon.cck_mask  =3D 0x03;=0A=
-		sc->rxon.ofdm_mask =3D 0;=0A=
+		sc->rxon->cck_mask  =3D 0x03;=0A=
+		sc->rxon->ofdm_mask =3D 0;=0A=
 	} else {=0A=
 		/* Assume 802.11b/g. */=0A=
-		sc->rxon.cck_mask  =3D 0x0f;=0A=
-		sc->rxon.ofdm_mask =3D 0x15;=0A=
+		sc->rxon->cck_mask  =3D 0x0f;=0A=
+		sc->rxon->ofdm_mask =3D 0x15;=0A=
 	}=0A=
 	if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {=0A=
 		htflags |=3D IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode);=0A=
@@ -5809,11 +5829,11 @@=0A=
 		if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan))=0A=
 			htflags |=3D IWN_RXON_HT_HT40MINUS;=0A=
 	}=0A=
-	sc->rxon.flags |=3D htole32(htflags);=0A=
-	sc->rxon.filter |=3D htole32(IWN_FILTER_BSS);=0A=
+	sc->rxon->flags |=3D htole32(htflags);=0A=
+	sc->rxon->filter |=3D htole32(IWN_FILTER_BSS);=0A=
 	DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x\n",=0A=
-	    sc->rxon.chan, sc->rxon.flags);=0A=
-	error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A=
+	    sc->rxon->chan, sc->rxon->flags);=0A=
+	error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A=
 	if (error !=3D 0) {=0A=
 		device_printf(sc->sc_dev,=0A=
 		    "%s: could not update configuration, error %d\n", __func__,=0A=
@@ -6795,6 +6815,25 @@=0A=
 				sc->noise_gain =3D tmp + 1;=0A=
 			}=0A=
 			break;=0A=
+		case IWN_FW_TLV_PAN:=0A=
+			sc->sc_flags |=3D IWN_FLAG_PAN_SUPPORT;=0A=
+			DPRINTF(sc, IWN_DEBUG_RESET,"PAN Support found : %d\n", 1);=0A=
+			break;=0A=
+		case IWN_FW_TLV_FLAGS :=0A=
+			sc->tlv_feature_flags =3D htole32(*ptr);=0A=
+			break;=0A=
+		case IWN_FW_TLV_PBREQ_MAXLEN:=0A=
+		case IWN_FW_TLV_RUNT_EVTLOG_PTR:=0A=
+		case IWN_FW_TLV_RUNT_EVTLOG_SIZE:=0A=
+		case IWN_FW_TLV_RUNT_ERRLOG_PTR:=0A=
+		case IWN_FW_TLV_INIT_EVTLOG_PTR:=0A=
+		case IWN_FW_TLV_INIT_EVTLOG_SIZE:=0A=
+		case IWN_FW_TLV_INIT_ERRLOG_PTR:=0A=
+		case IWN_FW_TLV_WOWLAN_INST:=0A=
+		case IWN_FW_TLV_WOWLAN_DATA:=0A=
+			DPRINTF(sc, IWN_DEBUG_RESET,=0A=
+			    "TLV type %d reconized but not handled\n", le16toh(tlv->type));=0A=
+			break;=0A=
 		default:=0A=
 			DPRINTF(sc, IWN_DEBUG_RESET,=0A=
 			    "TLV type %d not handled\n", le16toh(tlv->type));=0A=
Index: sys/dev/iwn/if_iwnvar.h=0A=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A=
--- sys/dev/iwn/if_iwnvar.h	(revision 254091)=0A=
+++ sys/dev/iwn/if_iwnvar.h	(working copy)=0A=
@@ -2,6 +2,8 @@=0A=
 /*	$OpenBSD: if_iwnvar.h,v 1.18 2010/04/30 16:06:46 damien Exp $	*/=0A=
 =0A=
 /*-=0A=
+ * Copyright (c) 2013 Cedric GROSS <cg@cgross.info>=0A=
+ * Copyright (c) 2011 Intel Corporation=0A=
  * Copyright (c) 2007, 2008=0A=
  *	Damien Bergamini <damien.bergamini@free.fr>=0A=
  * Copyright (c) 2008 Sam Leffler, Errno Consulting=0A=
@@ -18,7 +20,39 @@=0A=
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT =
OF=0A=
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.=0A=
  */=0A=
+enum iwn_rxon_ctx_id {=0A=
+		IWN_RXON_BSS_CTX,=0A=
+		IWN_RXON_PAN_CTX,=0A=
+		IWN_NUM_RXON_CTX=0A=
+};=0A=
 =0A=
+struct iwn_pan_slot {=0A=
+	uint16_t	time;=0A=
+	uint8_t		type;=0A=
+	uint8_t		reserved;=0A=
+} __packed;=0A=
+=0A=
+struct iwn_pan_params_cmd {=0A=
+	uint16_t flags;=0A=
+#define	IWN_PAN_PARAMS_FLG_SLOTTED_MODE	(1 << 3)=0A=
+=0A=
+	uint8_t reserved;=0A=
+	uint8_t num_slots;=0A=
+	struct iwn_pan_slot slots[10];=0A=
+} __packed;=0A=
+=0A=
+struct iwn_led_mode=0A=
+{=0A=
+	uint8_t		led_cur_mode;=0A=
+	uint64_t	led_cur_bt;=0A=
+	uint64_t	led_last_bt;=0A=
+	uint64_t	led_cur_tpt;=0A=
+	uint64_t	led_last_tpt;=0A=
+	uint64_t	led_bt_diff;=0A=
+	int		led_cur_time;=0A=
+	int		led_last_time;=0A=
+};=0A=
+=0A=
 struct iwn_rx_radiotap_header {=0A=
 	struct ieee80211_radiotap_header wr_ihdr;=0A=
 	uint64_t	wr_tsft;=0A=
@@ -191,6 +225,10 @@=0A=
 =0A=
 	int			(*iv_newstate)(struct ieee80211vap *,=0A=
 				    enum ieee80211_state, int);=0A=
+	int			ctx;=0A=
+	int			beacon_int;=0A=
+	uint8_t		macaddr[IEEE80211_ADDR_LEN];=0A=
+=0A=
 };=0A=
 #define	IWN_VAP(_vap)	((struct iwn_vap *)(_vap))=0A=
 =0A=
@@ -210,8 +248,11 @@=0A=
 #define IWN_FLAG_HAS_11N	(1 << 6)=0A=
 #define IWN_FLAG_ENH_SENS	(1 << 7)=0A=
 #define IWN_FLAG_ADV_BTCOEX	(1 << 8)=0A=
+#define IWN_FLAG_PAN_SUPPORT	(1 << 9)=0A=
 =0A=
 	uint8_t 		hw_type;=0A=
+	/* subdevice_id used to adjust configuration */=0A=
+	uint16_t		subdevice_id;=0A=
 =0A=
 	struct iwn_ops		ops;=0A=
 	const char		*fwname;=0A=
@@ -272,7 +313,7 @@=0A=
 	int			calib_cnt;=0A=
 	struct iwn_calib_state	calib;=0A=
 	struct callout		watchdog_to;=0A=
-=0A=
+	struct callout		ct_kill_exit_to;=0A=
 	struct iwn_fw_info	fw;=0A=
 	struct iwn_calib_info	calibcmd[5];=0A=
 	uint32_t		errptr;=0A=
@@ -280,7 +321,12 @@=0A=
 	struct iwn_rx_stat	last_rx_stat;=0A=
 	int			last_rx_valid;=0A=
 	struct iwn_ucode_info	ucode_info;=0A=
-	struct iwn_rxon		rxon;=0A=
+	struct iwn_rxon		rx_on[IWN_NUM_RXON_CTX];=0A=
+	struct iwn_rxon		*rxon;=0A=
+	int			ctx;=0A=
+	struct ieee80211vap	*ivap[IWN_NUM_RXON_CTX];=0A=
+=0A=
+	uint8_t			uc_scan_progress;=0A=
 	uint32_t		rawtemp;=0A=
 	int			temp;=0A=
 	int			noise;=0A=
@@ -295,11 +341,14 @@=0A=
 	char			eeprom_domain[4];=0A=
 	uint32_t		eeprom_crystal;=0A=
 	int16_t			eeprom_temp;=0A=
+	int16_t			eeprom_temp_high;=0A=
 	int16_t			eeprom_voltage;=0A=
 	int8_t			maxpwr2GHz;=0A=
 	int8_t			maxpwr5GHz;=0A=
 	int8_t			maxpwr[IEEE80211_CHAN_MAX];=0A=
 =0A=
+	uint32_t		tlv_feature_flags;=0A=
+=0A=
 	int32_t			temp_off;=0A=
 	uint32_t		int_mask;=0A=
 	uint8_t			ntxchains;=0A=
@@ -309,6 +358,7 @@=0A=
 	uint8_t			chainmask;=0A=
 =0A=
 	int			sc_tx_timer;=0A=
+	int			sc_scan_timer;=0A=
 =0A=
 	struct ieee80211_tx_ampdu *qid2tap[IWN5000_NTXQUEUES];=0A=
 =0A=
@@ -323,9 +373,21 @@=0A=
 	void			(*sc_addba_stop)(struct ieee80211_node *,=0A=
 				    struct ieee80211_tx_ampdu *);=0A=
 =0A=
+	struct	iwn_led_mode sc_led;=0A=
 =0A=
 	struct iwn_rx_radiotap_header sc_rxtap;=0A=
 	struct iwn_tx_radiotap_header sc_txtap;=0A=
+=0A=
+	/* The power save level originally configured by user */=0A=
+	int			desired_pwrsave_level;=0A=
+=0A=
+	/* The current power save level, this may differ from the configured =
value due to=0A=
+	 * thermal throttling etc.=0A=
+	 * */=0A=
+	int			current_pwrsave_level;=0A=
+=0A=
+	/* For specifique params */=0A=
+	struct iwn_base_params *base_params;=0A=
 };=0A=
 =0A=
 #define IWN_LOCK_INIT(_sc) \=0A=

------=_NextPart_000_0049_01CE9434.D9515780--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?004801ce9424$15c88780$41599680$>