From owner-svn-src-all@freebsd.org Fri Oct 23 07:42:57 2015 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 A6049A1962C; Fri, 23 Oct 2015 07:42:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54EAEE8A; Fri, 23 Oct 2015 07:42:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9N7guUF072281; Fri, 23 Oct 2015 07:42:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9N7guJR072278; Fri, 23 Oct 2015 07:42:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201510230742.t9N7guJR072278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 23 Oct 2015 07:42:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289799 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Fri, 23 Oct 2015 07:42:57 -0000 Author: avos Date: Fri Oct 23 07:42:56 2015 New Revision: 289799 URL: https://svnweb.freebsd.org/changeset/base/289799 Log: urtwn(4): fix the RSSI calculation for RTL8188EU. This change also reverts r252405 (causes integer underflow). Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D3820 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Fri Oct 23 07:40:43 2015 (r289798) +++ head/sys/dev/usb/wlan/if_urtwn.c Fri Oct 23 07:42:56 2015 (r289799) @@ -86,7 +86,6 @@ SYSCTL_INT(_hw_usb_urtwn, OID_AUTO, debu "Debug level"); #endif -#define URTWN_RSSI(r) (r) - 110 #define IEEE80211_HAS_ADDR4(wh) IEEE80211_IS_DSTODS(wh) /* various supported device vendors/products */ @@ -641,11 +640,6 @@ urtwn_rx_frame(struct urtwn_softc *sc, u rssi = urtwn_get_rssi(sc, rate, &stat[1]); /* Update our average RSSI. */ urtwn_update_avgrssi(sc, rate, rssi); - /* - * Convert the RSSI to a range that will be accepted - * by net80211. - */ - rssi = URTWN_RSSI(rssi); } m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); @@ -792,10 +786,12 @@ tr_setup: (struct ieee80211_frame_min *)wh); nf = URTWN_NOISE_FLOOR; if (ni != NULL) { - (void)ieee80211_input(ni, m, rssi, nf); + (void)ieee80211_input(ni, m, rssi - nf, nf); ieee80211_free_node(ni); - } else - (void)ieee80211_input_all(ic, m, rssi, nf); + } else { + (void)ieee80211_input_all(ic, m, rssi - nf, + nf); + } m = next; } URTWN_LOCK(sc); Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Fri Oct 23 07:40:43 2015 (r289798) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Fri Oct 23 07:42:56 2015 (r289799) @@ -975,22 +975,22 @@ struct r92c_rx_cck { struct r88e_rx_cck { uint8_t path_agc[2]; + uint8_t chan; + uint8_t reserved1; uint8_t sig_qual; uint8_t agc_rpt; uint8_t rpt_b; - uint8_t reserved1; + uint8_t reserved2; uint8_t noise_power; uint8_t path_cfotail[2]; uint8_t pcts_mask[2]; uint8_t stream_rxevm[2]; uint8_t path_rxsnr[2]; uint8_t noise_power_db_lsb; - uint8_t reserved2[3]; + uint8_t reserved3[3]; uint8_t stream_csi[2]; uint8_t stream_target_csi[2]; uint8_t sig_evm; - uint8_t reserved3; - uint8_t reserved4; } __packed; /* Tx MAC descriptor. */