Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Dec 2015 14:17:28 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r291695 - head/sys/dev/usb/wlan
Message-ID:  <201512031417.tB3EHSZB019181@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Thu Dec  3 14:17:28 2015
New Revision: 291695
URL: https://svnweb.freebsd.org/changeset/base/291695

Log:
  urtwn(4): move duplicate code from urtwn_(r92c/r88e)_dma_init()
  to urtwn_dma_init() (noop).
  
  Reviewed by:	kevlo
  Approved by:	adrian (mentor, implicit)
  Differential Revision:	https://reviews.freebsd.org/D4271

Modified:
  head/sys/dev/usb/wlan/if_urtwn.c

Modified: head/sys/dev/usb/wlan/if_urtwn.c
==============================================================================
--- head/sys/dev/usb/wlan/if_urtwn.c	Thu Dec  3 13:29:20 2015	(r291694)
+++ head/sys/dev/usb/wlan/if_urtwn.c	Thu Dec  3 14:17:28 2015	(r291695)
@@ -2748,8 +2748,23 @@ fail:
 static __inline int
 urtwn_dma_init(struct urtwn_softc *sc)
 {
+	int error;
+
+	/* Initialize LLT table. */
+	error = urtwn_llt_init(sc);
+	if (error != 0)
+		return (error);
+
+	error = sc->sc_dma_init(sc);
+	if (error != 0)
+		return (error);
 
-	return sc->sc_dma_init(sc);
+	/* Set Tx/Rx transfer page size. */
+	urtwn_write_1(sc, R92C_PBP,
+	    SM(R92C_PBP_PSRX, R92C_PBP_128) |
+	    SM(R92C_PBP_PSTX, R92C_PBP_128));
+
+	return (0);
 }
 
 static int
@@ -2757,12 +2772,6 @@ urtwn_r92c_dma_init(struct urtwn_softc *
 {
 	int hashq, hasnq, haslq, nqueues, nqpages, nrempages;
 	uint32_t reg;
-	int error;
-
-	/* Initialize LLT table. */
-	error = urtwn_llt_init(sc);
-	if (error != 0)
-		return (error);
 
 	/* Get Tx queues to USB endpoints mapping. */
 	hashq = hasnq = haslq = 0;
@@ -2825,10 +2834,6 @@ urtwn_r92c_dma_init(struct urtwn_softc *
 	/* Set Tx/Rx transfer page boundary. */
 	urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x27ff);
 
-	/* Set Tx/Rx transfer page size. */
-	urtwn_write_1(sc, R92C_PBP,
-	    SM(R92C_PBP_PSRX, R92C_PBP_128) |
-	    SM(R92C_PBP_PSTX, R92C_PBP_128));
 	return (0);
 }
 
@@ -2838,12 +2843,6 @@ urtwn_r88e_dma_init(struct urtwn_softc *
 	struct usb_interface *iface;
 	uint32_t reg;
 	int nqueues;
-	int error;
-
-	/* Initialize LLT table. */
-	error = urtwn_llt_init(sc);
-	if (error != 0)
-		return (error);
 
 	/* Get Tx queues to USB endpoints mapping. */
 	iface = usbd_get_iface(sc->sc_udev, 0);
@@ -2875,11 +2874,6 @@ urtwn_r88e_dma_init(struct urtwn_softc *
 	/* Set Tx/Rx transfer page boundary. */
 	urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x23ff);
 
-	/* Set Tx/Rx transfer page size. */
-	urtwn_write_1(sc, R92C_PBP,
-	    SM(R92C_PBP_PSRX, R92C_PBP_128) |
-	    SM(R92C_PBP_PSTX, R92C_PBP_128));
-
 	return (0);
 }
 



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