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).
This commit is contained in:
Andriy Voskoboinyk 2017-08-27 12:44:56 +00:00
parent 58d8f357c7
commit 5c7083ce99
5 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -85,7 +85,7 @@ r88e_get_power_group(struct rtwn_softc *sc, struct ieee80211_channel *c)
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;

View File

@ -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);

View File

@ -82,7 +82,7 @@ r92c_get_power_group(struct rtwn_softc *sc, struct ieee80211_channel *c)
/* 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++) {

View File

@ -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 *);