From owner-svn-src-all@freebsd.org Mon Mar 6 00:26:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04DB3CFAC7F; Mon, 6 Mar 2017 00:26:50 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EBDC185C; Mon, 6 Mar 2017 00:26:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id n11so52258474wma.0; Sun, 05 Mar 2017 16:26:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=tkDxyB/6S+DwAmmqeA48+fURT5QuQm8Yagx9RFvP3Q4=; b=ds5J3ss4hHtRV8mr8iX1bBsfcgbUYJkDDdd5q4o+VSLbyvYlUKgkGDibi6rTwuNiTa LpGkzr3IL539H/b/Xbyh5jOoBIAKAksP051MpPSR2hh/XB52sEGbJCVSx3c9bBsCF28x wC7U2oacuww7e3dtUujV50lfCRx/m4xshJsG+w1vIU6YqZGGo38uBh52yG61UzDSoH/1 7KWRFS5fMr+XKv1BWEK9byqeETaCASt+4W+w87BNDXj5d4n8+STOn59tEVD61YrZ9VqH 2v/buFYyqGpD2YzlnUQRj0CAgsH1oJ96RuoIjdiw/f1HAg2ovYaF2J4Rg//71bd09VMK IKFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=tkDxyB/6S+DwAmmqeA48+fURT5QuQm8Yagx9RFvP3Q4=; b=q1M0aKagmaY5xiyTgpvJ4pPRkjYFWIFvxbZ+vC1XuCXUUrUxgtR+49SeTARVN034dA Su36gx/HhI9B2Lz1chyynN+x3jCp98DPgOtY15+cZhq98f5MNlLNwaJm/0M+lz0B46mj J6q5qUPEihcedkXXUSUbhQmsxVLhKsiRIDslv9jyatohbSBAsGWo26uMgC0YTCQro0Z7 RXw4CkB3m8C9wwrsX887qFl4pQhKyJKw98HYxqMhGF9JYDSlemntZNKN+g4ZucGiAM3U hY9XUpiDXQ5jXVBbmVaZQI6dlt3b4VpWhcisxUun2fB5F22dNHY6kcBBAd7vac+4jqyT CivQ== X-Gm-Message-State: AMke39mbKTjjvsm6/Gc+IUN4uq47cZO64fznS3ahXweYEL8mGGBc3kCJseeyODbJWPy7z8gL/sXXPsEfJas5ag== X-Received: by 10.28.21.81 with SMTP id 78mr10413104wmv.138.1488760005632; Sun, 05 Mar 2017 16:26:45 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.128.133 with HTTP; Sun, 5 Mar 2017 16:26:45 -0800 (PST) In-Reply-To: References: <201703042307.v24N7sSx021021@repo.freebsd.org> From: Adrian Chadd Date: Sun, 5 Mar 2017 16:26:45 -0800 Message-ID: Subject: Re: svn commit: r314687 - head/sys/dev/iwn To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 00:26:50 -0000 Yeah. I mean, iwn and wpi are almost the same damned firmware API and hardware... kinda silly isn't it? :) I kinda wonder whether we should just unify them. -adrian On 4 March 2017 at 18:05, Andriy Voskoboinyk wrote: > Sun, 05 Mar 2017 02:37:09 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd > : > > Hi! > > Actually, the intention is simpler - redo all the work for wpi(4) here > to bring in everything what it can - ad-hoc, hostap, aes-ccm etc > > >> hihi! >> >> So the eventualy-ish attention is that if someone wanted to finish >> p2p/tdls support they could use this function for either context. But >> it don't think the feature was ever finished, because we don't have >> p2p/tdls support yet. >> >> Well, yet. It's coming. :) >> >> >> >> -adrian >> >> >> On 4 March 2017 at 15:07, Andriy Voskoboinyk wrote: >>> >>> Author: avos >>> Date: Sat Mar 4 23:07:54 2017 >>> New Revision: 314687 >>> URL: https://svnweb.freebsd.org/changeset/base/314687 >>> >>> Log: >>> iwn: drop 'channel' parameter from iwn*_set_txpower() >>> >>> For 4965 just extract 'is_chan_5ghz' flag from the RXON structure >>> (like it was done in r281287); for others it was never used. >>> >>> Tested with Intel 6205, STA mode. >>> >>> Modified: >>> head/sys/dev/iwn/if_iwn.c >>> head/sys/dev/iwn/if_iwnvar.h >>> >>> Modified: head/sys/dev/iwn/if_iwn.c >>> >>> =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=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/dev/iwn/if_iwn.c Sat Mar 4 22:58:34 2017 (r31468= 6) >>> +++ head/sys/dev/iwn/if_iwn.c Sat Mar 4 23:07:54 2017 (r31468= 7) >>> @@ -254,10 +254,8 @@ static void iwn_set_led(struct iwn_softc >>> static int iwn_set_critical_temp(struct iwn_softc *); >>> static int iwn_set_timing(struct iwn_softc *, struct ieee80211_nod= e >>> *); >>> static void iwn4965_power_calibration(struct iwn_softc *, int); >>> -static int iwn4965_set_txpower(struct iwn_softc *, >>> - struct ieee80211_channel *, int); >>> -static int iwn5000_set_txpower(struct iwn_softc *, >>> - struct ieee80211_channel *, int); >>> +static int iwn4965_set_txpower(struct iwn_softc *, int); >>> +static int iwn5000_set_txpower(struct iwn_softc *, int); >>> static int iwn4965_get_rssi(struct iwn_softc *, struct iwn_rx_stat >>> *); >>> static int iwn5000_get_rssi(struct iwn_softc *, struct iwn_rx_stat >>> *); >>> static int iwn_get_noise(const struct iwn_rx_general_stats *); >>> @@ -5510,7 +5508,6 @@ iwn_set_timing(struct iwn_softc *sc, str >>> static void >>> iwn4965_power_calibration(struct iwn_softc *sc, int temp) >>> { >>> - struct ieee80211com *ic =3D &sc->sc_ic; >>> >>> DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__); >>> >>> @@ -5520,7 +5517,7 @@ iwn4965_power_calibration(struct iwn_sof >>> if (abs(temp - sc->temp) >=3D 3) { >>> /* Record temperature of last calibration. */ >>> sc->temp =3D temp; >>> - (void)iwn4965_set_txpower(sc, ic->ic_bsschan, 1); >>> + (void)iwn4965_set_txpower(sc, 1); >>> } >>> } >>> >>> @@ -5530,8 +5527,7 @@ iwn4965_power_calibration(struct iwn_sof >>> * the current temperature and the current voltage. >>> */ >>> static int >>> -iwn4965_set_txpower(struct iwn_softc *sc, struct ieee80211_channel *ch= , >>> - int async) >>> +iwn4965_set_txpower(struct iwn_softc *sc, int async) >>> { >>> /* Fixed-point arithmetic division using a n-bit fractional part. */ >>> #define fdivround(a, b, n) \ >>> @@ -5546,20 +5542,21 @@ iwn4965_set_txpower(struct iwn_softc *sc >>> struct iwn4965_eeprom_chan_samples *chans; >>> const uint8_t *rf_gain, *dsp_gain; >>> int32_t vdiff, tdiff; >>> - int i, c, grp, maxpwr; >>> + int i, is_chan_5ghz, c, grp, maxpwr; >>> uint8_t chan; >>> >>> sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX]; >>> /* Retrieve current channel from last RXON. */ >>> chan =3D sc->rxon->chan; >>> + is_chan_5ghz =3D (sc->rxon->flags & htole32(IWN_RXON_24GHZ)) = =3D=3D 0; >>> DPRINTF(sc, IWN_DEBUG_RESET, "setting TX power for channel %d\n= ", >>> chan); >>> >>> memset(&cmd, 0, sizeof cmd); >>> - cmd.band =3D IEEE80211_IS_CHAN_5GHZ(ch) ? 0 : 1; >>> + cmd.band =3D is_chan_5ghz ? 0 : 1; >>> cmd.chan =3D chan; >>> >>> - if (IEEE80211_IS_CHAN_5GHZ(ch)) { >>> + if (is_chan_5ghz) { >>> maxpwr =3D sc->maxpwr5GHz; >>> rf_gain =3D iwn4965_rf_gain_5ghz; >>> dsp_gain =3D iwn4965_dsp_gain_5ghz; >>> @@ -5681,8 +5678,7 @@ iwn4965_set_txpower(struct iwn_softc *sc >>> } >>> >>> static int >>> -iwn5000_set_txpower(struct iwn_softc *sc, struct ieee80211_channel *ch= , >>> - int async) >>> +iwn5000_set_txpower(struct iwn_softc *sc, int async) >>> { >>> struct iwn5000_cmd_txpower cmd; >>> int cmdid; >>> @@ -6693,7 +6689,7 @@ iwn_config(struct iwn_softc *sc) >>> } >>> >>> /* Configuration has changed, set TX power accordingly. */ >>> - if ((error =3D ops->set_txpower(sc, ic->ic_curchan, 0)) !=3D 0)= { >>> + if ((error =3D ops->set_txpower(sc, 0)) !=3D 0) { >>> device_printf(sc->sc_dev, "%s: could not set TX power\n= ", >>> __func__); >>> return error; >>> @@ -7096,7 +7092,7 @@ iwn_auth(struct iwn_softc *sc, struct ie >>> } >>> >>> /* Configuration has changed, set TX power accordingly. */ >>> - if ((error =3D ops->set_txpower(sc, ni->ni_chan, 1)) !=3D 0) { >>> + if ((error =3D ops->set_txpower(sc, 1)) !=3D 0) { >>> device_printf(sc->sc_dev, >>> "%s: could not set TX power, error %d\n", __func__, >>> error); >>> return error; >>> @@ -7180,7 +7176,7 @@ iwn_run(struct iwn_softc *sc, struct iee >>> } >>> >>> /* Configuration has changed, set TX power accordingly. */ >>> - if ((error =3D ops->set_txpower(sc, ni->ni_chan, 1)) !=3D 0) { >>> + if ((error =3D ops->set_txpower(sc, 1)) !=3D 0) { >>> device_printf(sc->sc_dev, >>> "%s: could not set TX power, error %d\n", __func__, >>> error); >>> return error; >>> >>> Modified: head/sys/dev/iwn/if_iwnvar.h >>> >>> =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=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/dev/iwn/if_iwnvar.h Sat Mar 4 22:58:34 2017 >>> (r314686) >>> +++ head/sys/dev/iwn/if_iwnvar.h Sat Mar 4 23:07:54 2017 >>> (r314687) >>> @@ -206,8 +206,7 @@ struct iwn_ops { >>> uint16_t); >>> int (*get_temperature)(struct iwn_softc *); >>> int (*get_rssi)(struct iwn_softc *, struct >>> iwn_rx_stat *); >>> - int (*set_txpower)(struct iwn_softc *, >>> - struct ieee80211_channel *, int); >>> + int (*set_txpower)(struct iwn_softc *, int); >>> int (*init_gains)(struct iwn_softc *); >>> int (*set_gains)(struct iwn_softc *); >>> int (*add_node)(struct iwn_softc *, struct >>> iwn_node_info *,