From owner-freebsd-wireless@FreeBSD.ORG Mon Aug 5 17:23:44 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 08AB6C6E for ; Mon, 5 Aug 2013 17:23:44 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6080E29D9 for ; Mon, 5 Aug 2013 17:23:43 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id AC5767D2 for ; Mon, 5 Aug 2013 19:23:40 +0200 (CEST) From: "Cedric GROSS" To: Subject: [iwn] Review split 5 Date: Mon, 5 Aug 2013 19:23:39 +0200 Message-ID: <002d01ce9200$88b19dc0$9a14d940$@info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_002E_01CE9211.4C3A6DC0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6SAIZdljfO0IPRSRigV5IKf5HFEA== Content-Language: fr X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Aug 2013 17:23:44 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_002E_01CE9211.4C3A6DC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, Here is another split. This one update if_iwnvar.h with new structure for later but also modify iwn_softc for context selection. Context will be used later when PAN context will be set in next diff. uCode TLV detection has been updated also. Cedric ------=_NextPart_000_002E_01CE9211.4C3A6DC0 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 253965)=0A= +++ sys/dev/iwn/if_iwn.c (working copy)=0A= @@ -1,4 +1,6 @@=0A= /*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + * Copyright (c) 2011 Intel Corporation=0A= * Copyright (c) 2007-2009=0A= * Damien Bergamini =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= @@ -894,19 +897,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= @@ -2325,6 +2336,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= @@ -2338,8 +2351,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= @@ -3681,7 +3694,7 @@=0A= =0A= if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||=0A= type !=3D IEEE80211_FC0_TYPE_DATA)=0A= - tx->id =3D sc->broadcast_id;=0A= + tx->id =3D IWN5000_ID_BROADCAST;=0A= else=0A= tx->id =3D wn->id;=0A= =0A= @@ -3712,7 +3725,7 @@=0A= tx->data_ntries =3D 15;=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= tx->rate =3D iwn_rate_to_plcp(sc, ni, rate);=0A= - if (tx->id =3D=3D sc->broadcast_id) {=0A= + if (tx->id =3D=3D IWN5000_ID_BROADCAST) {=0A= /* Group or management frame. */=0A= tx->linkq =3D 0;=0A= /* XXX Alternate between antenna A and B? */=0A= @@ -3919,7 +3932,7 @@=0A= =0A= tx->len =3D htole16(totlen);=0A= tx->tid =3D 0;=0A= - tx->id =3D sc->broadcast_id;=0A= + tx->id =3D IWN5000_ID_BROADCAST;=0A= tx->rts_ntries =3D params->ibp_try1;=0A= tx->data_ntries =3D params->ibp_try0;=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= @@ -4353,9 +4366,11 @@=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= + node.id =3D IWN5000_ID_BROADCAST;=0A= DPRINTF(sc, IWN_DEBUG_RESET, "%s: adding broadcast node\n", __func__);=0A= if ((error =3D ops->add_node(sc, &node, async)) !=3D 0)=0A= return error;=0A= @@ -4364,7 +4379,7 @@=0A= txant =3D IWN_LSB(sc->txchainmask);=0A= =0A= memset(&linkq, 0, sizeof linkq);=0A= - linkq.id =3D sc->broadcast_id;=0A= + linkq.id =3D IWN5000_ID_BROADCAST;=0A= linkq.antmsk_1stream =3D txant;=0A= linkq.antmsk_2stream =3D IWN_ANT_AB;=0A= linkq.ampdu_max =3D 64;=0A= @@ -4536,8 +4551,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= @@ -4896,8 +4912,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= @@ -5426,21 +5442,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= @@ -5447,18 +5464,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= @@ -5529,6 +5546,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= @@ -5560,7 +5578,7 @@=0A= =0A= tx =3D (struct iwn_cmd_data *)(hdr + 1);=0A= tx->flags =3D htole32(IWN_TX_AUTO_SEQ);=0A= - tx->id =3D sc->broadcast_id;=0A= + tx->id =3D IWN5000_ID_BROADCAST;=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= =0A= if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) {=0A= @@ -5570,7 +5588,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= @@ -5629,7 +5647,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= @@ -5642,7 +5660,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= @@ -5681,31 +5699,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= @@ -5747,6 +5766,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= @@ -5759,26 +5779,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= @@ -5795,11 +5815,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= @@ -6781,6 +6801,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 253965)=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 =0A= + * Copyright (c) 2011 Intel Corporation=0A= * Copyright (c) 2007, 2008=0A= * Damien Bergamini =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_002E_01CE9211.4C3A6DC0--