bge: Zero out the status block during initialization
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 29 Jun 2012 08:26:35 +0000 (16:26 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Fri, 29 Jun 2012 08:26:35 +0000 (16:26 +0800)
Obtained-from: FreeBSD 209741

sys/dev/netif/bge/if_bge.c

index 20c2350..c0ad9fd 100644 (file)
@@ -1629,12 +1629,11 @@ bge_blockinit(struct bge_softc *sc)
        }
 
        /* Set up address of status block */
+       bzero(sc->bge_ldata.bge_status_block, BGE_STATUS_BLK_SZ);
        CSR_WRITE_4(sc, BGE_HCC_STATUSBLK_ADDR_HI,
            BGE_ADDR_HI(sc->bge_ldata.bge_status_block_paddr));
        CSR_WRITE_4(sc, BGE_HCC_STATUSBLK_ADDR_LO,
            BGE_ADDR_LO(sc->bge_ldata.bge_status_block_paddr));
-       sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx = 0;
-       sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx = 0;
 
        /*
         * Set up status block partail update size.