Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2012 05:17:59 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r233503 - stable/7/sys/dev/fxp
Message-ID:  <201203260517.q2Q5Hxvs016939@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Mon Mar 26 05:17:59 2012
New Revision: 233503
URL: http://svn.freebsd.org/changeset/base/233503

Log:
  MFC r232951,232953,233158:
  r232951:
    fxp(4) does not handle deferred dma map loading.  Tell
    bus_dmamap_load(9) that it should return immediately with error
    when there are insufficient mapping resources.
  
  r232953:
    Fix white space nits.
  
  r233158:
    Do not change current media when driver is already running.  If
    driver is running driver would have already completed flow control
    configuration.  This change removes unnecessary media changes in
    controller reconfiguration cases such that it does not trigger link
    reestablishment for configuration change requests like promiscuous
    mode change.
  
    Reported by:	Many
    Tested by:	Mike Tancsa <mike <> sentex dot net>

Modified:
  stable/7/sys/dev/fxp/if_fxp.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/fxp/if_fxp.c
==============================================================================
--- stable/7/sys/dev/fxp/if_fxp.c	Mon Mar 26 05:15:44 2012	(r233502)
+++ stable/7/sys/dev/fxp/if_fxp.c	Mon Mar 26 05:17:59 2012	(r233503)
@@ -236,11 +236,11 @@ static int		fxp_ioctl(struct ifnet *ifp,
 			    caddr_t data);
 static void 		fxp_watchdog(struct fxp_softc *sc);
 static void		fxp_add_rfabuf(struct fxp_softc *sc,
-    			    struct fxp_rx *rxp);
+			    struct fxp_rx *rxp);
 static void		fxp_discard_rfabuf(struct fxp_softc *sc,
-    			    struct fxp_rx *rxp);
+			    struct fxp_rx *rxp);
 static int		fxp_new_rfabuf(struct fxp_softc *sc,
-    			    struct fxp_rx *rxp);
+			    struct fxp_rx *rxp);
 static int		fxp_mc_addrs(struct fxp_softc *sc);
 static void		fxp_mc_setup(struct fxp_softc *sc);
 static uint16_t		fxp_eeprom_getword(struct fxp_softc *sc, int offset,
@@ -272,7 +272,7 @@ static int		sysctl_hw_fxp_int_delay(SYSC
 static void 		fxp_scb_wait(struct fxp_softc *sc);
 static void		fxp_scb_cmd(struct fxp_softc *sc, int cmd);
 static void		fxp_dma_wait(struct fxp_softc *sc,
-    			    volatile uint16_t *status, bus_dma_tag_t dmat,
+			    volatile uint16_t *status, bus_dma_tag_t dmat,
 			    bus_dmamap_t map);
 
 static device_method_t fxp_methods[] = {
@@ -682,7 +682,8 @@ fxp_attach(device_t dev)
 		goto fail;
 	}
 	error = bus_dmamap_load(sc->fxp_stag, sc->fxp_smap, sc->fxp_stats,
-	    sizeof(struct fxp_stats), fxp_dma_map_addr, &sc->stats_addr, 0);
+	    sizeof(struct fxp_stats), fxp_dma_map_addr, &sc->stats_addr,
+	    BUS_DMA_NOWAIT);
 	if (error) {
 		device_printf(dev, "could not load the stats DMA buffer\n");
 		goto fail;
@@ -706,7 +707,7 @@ fxp_attach(device_t dev)
 
 	error = bus_dmamap_load(sc->cbl_tag, sc->cbl_map,
 	    sc->fxp_desc.cbl_list, FXP_TXCB_SZ, fxp_dma_map_addr,
-	    &sc->fxp_desc.cbl_addr, 0);
+	    &sc->fxp_desc.cbl_addr, BUS_DMA_NOWAIT);
 	if (error) {
 		device_printf(dev, "could not load TxCB DMA buffer\n");
 		goto fail;
@@ -730,7 +731,8 @@ fxp_attach(device_t dev)
 		goto fail;
 	}
 	error = bus_dmamap_load(sc->mcs_tag, sc->mcs_map, sc->mcsp,
-	    sizeof(struct fxp_cb_mcs), fxp_dma_map_addr, &sc->mcs_addr, 0);
+	    sizeof(struct fxp_cb_mcs), fxp_dma_map_addr, &sc->mcs_addr,
+	    BUS_DMA_NOWAIT);
 	if (error) {
 		device_printf(dev,
 		    "can't load the multicast setup DMA buffer\n");
@@ -901,7 +903,7 @@ fxp_attach(device_t dev)
 		FXP_LOCK(sc);
 		/* Clear wakeup events. */
 		CSR_WRITE_1(sc, FXP_CSR_PMDR, CSR_READ_1(sc, FXP_CSR_PMDR));
-		fxp_init_body(sc, 1);
+		fxp_init_body(sc, 0);
 		fxp_stop(sc);
 		FXP_UNLOCK(sc);
 	}
@@ -1542,7 +1544,7 @@ fxp_encap(struct fxp_softc *sc, struct m
 		}
 		*m_head = m;
 		error = bus_dmamap_load_mbuf_sg(sc->fxp_txmtag, txp->tx_map,
-	    	    *m_head, segs, &nseg, 0);
+		    *m_head, segs, &nseg, 0);
 		if (error != 0) {
 			m_freem(*m_head);
 			*m_head = NULL;
@@ -2042,7 +2044,7 @@ fxp_update_stats(struct fxp_softc *sc)
 			 */
 			sc->rx_idle_secs++;
 		}
-		ifp->if_ierrors += 
+		ifp->if_ierrors +=
 		    le32toh(sp->rx_crc_errors) +
 		    le32toh(sp->rx_alignment_errors) +
 		    le32toh(sp->rx_rnr_errors) +
@@ -2169,7 +2171,7 @@ fxp_stop(struct fxp_softc *sc)
 	txp = sc->fxp_desc.tx_list;
 	if (txp != NULL) {
 		for (i = 0; i < FXP_NTXCB; i++) {
- 			if (txp[i].tx_mbuf != NULL) {
+			if (txp[i].tx_mbuf != NULL) {
 				bus_dmamap_sync(sc->fxp_txmtag, txp[i].tx_map,
 				    BUS_DMASYNC_POSTWRITE);
 				bus_dmamap_unload(sc->fxp_txmtag,
@@ -2801,7 +2803,7 @@ fxp_ioctl(struct ifnet *ifp, u_long comm
 			if (((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) &&
 			    ((ifp->if_flags ^ sc->if_flags) &
 			    (IFF_PROMISC | IFF_ALLMULTI | IFF_LINK0)) != 0)
-				fxp_init_body(sc, 1);
+				fxp_init_body(sc, 0);
 			else if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
 				fxp_init_body(sc, 1);
 		} else {
@@ -2907,7 +2909,7 @@ fxp_ioctl(struct ifnet *ifp, u_long comm
 			reinit++;
 		}
 		if (reinit > 0 && ifp->if_flags & IFF_UP)
-			fxp_init_body(sc, 1);
+			fxp_init_body(sc, 0);
 		FXP_UNLOCK(sc);
 		VLAN_CAPABILITIES(ifp);
 		break;



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