svn commit: r322949 - in head/sys/dev/rtwn: rtl8188e rtl8192c

Andriy Voskoboinyk avos at FreeBSD.org
Sun Aug 27 12:44:57 UTC 2017


Author: avos
Date: Sun Aug 27 12:44:56 2017
New Revision: 322949
URL: https://svnweb.freebsd.org/changeset/base/322949

Log:
  rtwn(4): change type for Tx power values (RTL8192C / RTL8188EU).
  
  Tx power values can easily fit into uint8_t + only 8 bits are written
  to registers; values may overflow only in case if ROM contains
  malformed data (but limit is checked anyway).
  
  Tested with RTL8188CUS, dev.rtwn.1.debug=0x2000 (no changes).

Modified:
  head/sys/dev/rtwn/rtl8188e/r88e.h
  head/sys/dev/rtwn/rtl8188e/r88e_chan.c
  head/sys/dev/rtwn/rtl8192c/r92c.h
  head/sys/dev/rtwn/rtl8192c/r92c_chan.c
  head/sys/dev/rtwn/rtl8192c/r92c_var.h

Modified: head/sys/dev/rtwn/rtl8188e/r88e.h
==============================================================================
--- head/sys/dev/rtwn/rtl8188e/r88e.h	Sun Aug 27 12:24:25 2017	(r322948)
+++ head/sys/dev/rtwn/rtl8188e/r88e.h	Sun Aug 27 12:44:56 2017	(r322949)
@@ -49,7 +49,7 @@ uint8_t	r88e_temp_read(struct rtwn_softc *);
 
 /* r88e_chan.c */
 void	r88e_get_txpower(struct rtwn_softc *, int,
-	    struct ieee80211_channel *, uint16_t[]);
+	    struct ieee80211_channel *, uint8_t[]);
 void	r88e_set_bw20(struct rtwn_softc *, uint8_t);
 void	r88e_set_gain(struct rtwn_softc *, uint8_t);
 

Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c
==============================================================================
--- head/sys/dev/rtwn/rtl8188e/r88e_chan.c	Sun Aug 27 12:24:25 2017	(r322948)
+++ head/sys/dev/rtwn/rtl8188e/r88e_chan.c	Sun Aug 27 12:44:56 2017	(r322949)
@@ -85,7 +85,7 @@ r88e_get_power_group(struct rtwn_softc *sc, struct iee
 
 void
 r88e_get_txpower(struct rtwn_softc *sc, int chain,
-    struct ieee80211_channel *c, uint16_t power[RTWN_RIDX_COUNT])
+    struct ieee80211_channel *c, uint8_t power[RTWN_RIDX_COUNT])
 {
 	struct r92c_softc *rs = sc->sc_priv;
 	const struct rtwn_r88e_txpwr *rt = rs->rs_txpwr;

Modified: head/sys/dev/rtwn/rtl8192c/r92c.h
==============================================================================
--- head/sys/dev/rtwn/rtl8192c/r92c.h	Sun Aug 27 12:24:25 2017	(r322948)
+++ head/sys/dev/rtwn/rtl8192c/r92c.h	Sun Aug 27 12:44:56 2017	(r322949)
@@ -55,7 +55,7 @@ uint8_t	r92c_temp_read(struct rtwn_softc *);
 
 /* r92c_chan.c */
 void	r92c_get_txpower(struct rtwn_softc *, int,
-	    struct ieee80211_channel *, uint16_t[]);
+	    struct ieee80211_channel *, uint8_t[]);
 void	r92c_set_bw20(struct rtwn_softc *, uint8_t);
 void	r92c_set_chan(struct rtwn_softc *, struct ieee80211_channel *);
 void	r92c_set_gain(struct rtwn_softc *, uint8_t);

Modified: head/sys/dev/rtwn/rtl8192c/r92c_chan.c
==============================================================================
--- head/sys/dev/rtwn/rtl8192c/r92c_chan.c	Sun Aug 27 12:24:25 2017	(r322948)
+++ head/sys/dev/rtwn/rtl8192c/r92c_chan.c	Sun Aug 27 12:44:56 2017	(r322949)
@@ -82,7 +82,7 @@ r92c_get_power_group(struct rtwn_softc *sc, struct iee
 /* XXX recheck */
 void
 r92c_get_txpower(struct rtwn_softc *sc, int chain,
-    struct ieee80211_channel *c, uint16_t power[RTWN_RIDX_COUNT])
+    struct ieee80211_channel *c, uint8_t power[RTWN_RIDX_COUNT])
 {
 	struct r92c_softc *rs = sc->sc_priv;
 	struct rtwn_r92c_txpwr *rt = rs->rs_txpwr;
@@ -158,7 +158,7 @@ r92c_get_txpower(struct rtwn_softc *sc, int chain,
 
 static void
 r92c_write_txpower(struct rtwn_softc *sc, int chain,
-    uint16_t power[RTWN_RIDX_COUNT])
+    uint8_t power[RTWN_RIDX_COUNT])
 {
 	uint32_t reg;
 
@@ -221,7 +221,7 @@ r92c_write_txpower(struct rtwn_softc *sc, int chain,
 static void
 r92c_set_txpower(struct rtwn_softc *sc, struct ieee80211_channel *c)
 {
-	uint16_t power[RTWN_RIDX_COUNT];
+	uint8_t power[RTWN_RIDX_COUNT];
 	int i;
 
 	for (i = 0; i < sc->ntxchains; i++) {

Modified: head/sys/dev/rtwn/rtl8192c/r92c_var.h
==============================================================================
--- head/sys/dev/rtwn/rtl8192c/r92c_var.h	Sun Aug 27 12:24:25 2017	(r322948)
+++ head/sys/dev/rtwn/rtl8192c/r92c_var.h	Sun Aug 27 12:44:56 2017	(r322949)
@@ -53,7 +53,7 @@ struct r92c_softc {
 
 	void		(*rs_set_bw20)(struct rtwn_softc *, uint8_t);
 	void		(*rs_get_txpower)(struct rtwn_softc *, int,
-			    struct ieee80211_channel *, uint16_t[]);
+			    struct ieee80211_channel *, uint8_t[]);
 	void		(*rs_set_gain)(struct rtwn_softc *, uint8_t);
 	void		(*rs_tx_enable_ampdu)(void *, int);
 	void		(*rs_tx_setup_hwseq)(void *);


More information about the svn-src-head mailing list