Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jan 2019 04:41:50 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r342834 - in stable/12/sys/dev/rtwn: rtl8188e rtl8188e/usb rtl8192c rtl8192c/pci rtl8192c/usb
Message-ID:  <201901070441.x074foej047259@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Mon Jan  7 04:41:50 2019
New Revision: 342834
URL: https://svnweb.freebsd.org/changeset/base/342834

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

Modified:
  stable/12/sys/dev/rtwn/rtl8188e/r88e_rom.c
  stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c
  stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_rom.c
  stable/12/sys/dev/rtwn/rtl8192c/r92c_var.h
  stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/dev/rtwn/rtl8188e/r88e_rom.c
==============================================================================
--- stable/12/sys/dev/rtwn/rtl8188e/r88e_rom.c	Mon Jan  7 04:38:50 2019	(r342833)
+++ stable/12/sys/dev/rtwn/rtl8188e/r88e_rom.c	Mon Jan  7 04:41:50 2019	(r342834)
@@ -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);
 }

Modified: stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c
==============================================================================
--- stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c	Mon Jan  7 04:38:50 2019	(r342833)
+++ stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c	Mon Jan  7 04:41:50 2019	(r342834)
@@ -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>
 
@@ -66,6 +67,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)
 {
 	struct r92c_softc *rs = sc->sc_priv;
@@ -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;

Modified: stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c
==============================================================================
--- stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c	Mon Jan  7 04:38:50 2019	(r342833)
+++ stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c	Mon Jan  7 04:41:50 2019	(r342834)
@@ -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

Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_rom.c
==============================================================================
--- stable/12/sys/dev/rtwn/rtl8192c/r92c_rom.c	Mon Jan  7 04:38:50 2019	(r342833)
+++ stable/12/sys/dev/rtwn/rtl8192c/r92c_rom.c	Mon Jan  7 04:41:50 2019	(r342834)
@@ -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++) {

Modified: stable/12/sys/dev/rtwn/rtl8192c/r92c_var.h
==============================================================================
--- stable/12/sys/dev/rtwn/rtl8192c/r92c_var.h	Mon Jan  7 04:38:50 2019	(r342833)
+++ stable/12/sys/dev/rtwn/rtl8192c/r92c_var.h	Mon Jan  7 04:41:50 2019	(r342834)
@@ -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 */

Modified: stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c
==============================================================================
--- stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c	Mon Jan  7 04:38:50 2019	(r342833)
+++ stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c	Mon Jan  7 04:41:50 2019	(r342834)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901070441.x074foej047259>