1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

rtwn(4): rename set_name -> set_rom_opts method and reuse it for RTL8188E*

MFC after:	4 days
This commit is contained in:
Andriy Voskoboinyk 2019-01-02 06:03:19 +00:00
parent 0db82209dc
commit a163403b62
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=342681
6 changed files with 20 additions and 10 deletions

View File

@ -81,5 +81,6 @@ r88e_parse_rom(struct rtwn_softc *sc, uint8_t *buf)
__func__,rs->regulatory);
sc->thermal_meter = rom->thermal_meter;
IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->macaddr);
rtwn_r92c_set_rom_opts(sc, buf);
}

View File

@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$");
#include <dev/rtwn/rtl8192c/usb/r92cu_tx_desc.h>
#include <dev/rtwn/rtl8188e/r88e_priv.h>
#include <dev/rtwn/rtl8188e/r88e_rom_image.h> /* for 'macaddr' field */
#include <dev/rtwn/rtl8188e/usb/r88eu.h>
@ -65,6 +66,14 @@ static struct rtwn_r88e_txpwr r88e_txpwr;
void r88eu_attach(struct rtwn_usb_softc *);
static void
r88eu_set_macaddr(struct rtwn_softc *sc, uint8_t *buf)
{
struct r88e_rom *rom = (struct r88e_rom *)buf;
IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->macaddr);
}
static void
r88e_postattach(struct rtwn_softc *sc)
{
@ -93,7 +102,7 @@ r88eu_attach_private(struct rtwn_softc *sc)
rs->rs_tx_enable_ampdu = r88e_tx_enable_ampdu;
rs->rs_tx_setup_hwseq = r88e_tx_setup_hwseq;
rs->rs_tx_setup_macid = r88e_tx_setup_macid;
rs->rs_set_name = rtwn_nop_softc; /* not used */
rs->rs_set_rom_opts = r88eu_set_macaddr;
rs->rf_read_delay[0] = 10;
rs->rf_read_delay[1] = 100;

View File

@ -92,7 +92,7 @@ r92ce_postattach(struct rtwn_softc *sc)
}
static void
r92ce_set_name(struct rtwn_softc *sc)
r92ce_set_name(struct rtwn_softc *sc, uint8_t *buf)
{
struct r92c_softc *rs = sc->sc_priv;
@ -117,7 +117,7 @@ r92ce_attach_private(struct rtwn_softc *sc)
rs->rs_tx_enable_ampdu = r92c_tx_enable_ampdu;
rs->rs_tx_setup_hwseq = r92c_tx_setup_hwseq;
rs->rs_tx_setup_macid = r92c_tx_setup_macid;
rs->rs_set_name = r92ce_set_name;
rs->rs_set_rom_opts = r92ce_set_name;
/* XXX TODO: test with net80211 ratectl! */
#ifndef RTWN_WITHOUT_UCODE

View File

@ -96,7 +96,7 @@ r92c_parse_rom(struct rtwn_softc *sc, uint8_t *buf)
__func__, rs->regulatory);
/* Need to be set before postinit() (but after preinit()). */
rtwn_r92c_set_name(sc);
rtwn_r92c_set_rom_opts(sc, buf);
r92c_set_chains(sc);
for (j = 0; j < R92C_GROUP_2G; j++) {

View File

@ -58,7 +58,7 @@ struct r92c_softc {
void (*rs_tx_enable_ampdu)(void *, int);
void (*rs_tx_setup_hwseq)(void *);
void (*rs_tx_setup_macid)(void *, int);
void (*rs_set_name)(struct rtwn_softc *);
void (*rs_set_rom_opts)(struct rtwn_softc *, uint8_t *);
int rf_read_delay[3];
uint32_t rf_chnlbw[R92C_MAX_CHAINS];
@ -77,7 +77,7 @@ struct r92c_softc {
((R92C_SOFTC(_sc)->rs_tx_setup_hwseq)((_buf)))
#define rtwn_r92c_tx_setup_macid(_sc, _buf, _id) \
((R92C_SOFTC(_sc)->rs_tx_setup_macid)((_buf), (_id)))
#define rtwn_r92c_set_name(_sc) \
((R92C_SOFTC(_sc)->rs_set_name)((_sc)))
#define rtwn_r92c_set_rom_opts(_sc, _buf) \
((R92C_SOFTC(_sc)->rs_set_rom_opts)((_sc), (_buf)))
#endif /* R92C_VAR_H */

View File

@ -94,7 +94,7 @@ r92cu_postattach(struct rtwn_softc *sc)
}
static void
r92cu_set_name(struct rtwn_softc *sc)
r92cu_set_name(struct rtwn_softc *sc, uint8_t *buf)
{
struct r92c_softc *rs = sc->sc_priv;
@ -124,7 +124,7 @@ r92cu_attach_private(struct rtwn_softc *sc)
rs->rs_tx_enable_ampdu = r92c_tx_enable_ampdu;
rs->rs_tx_setup_hwseq = r92c_tx_setup_hwseq;
rs->rs_tx_setup_macid = r92c_tx_setup_macid;
rs->rs_set_name = r92cu_set_name;
rs->rs_set_rom_opts = r92cu_set_name;
#ifndef RTWN_WITHOUT_UCODE
rs->rs_c2h_timeout = hz;