PERFORCE change 169828 for review
Yohanes Nugroho
yohanes at FreeBSD.org
Mon Oct 26 15:16:39 UTC 2009
http://p4web.freebsd.org/chv.cgi?CH=169828
Change 169828 by yohanes at econa on 2009/10/26 15:16:38
clean up comments
Affected files ...
.. //depot/projects/str91xx/src/sys/arm/econa/if_ece.c#9 edit
.. //depot/projects/str91xx/src/sys/arm/econa/if_ecevar.h#2 edit
Differences ...
==== //depot/projects/str91xx/src/sys/arm/econa/if_ece.c#9 (text+ko) ====
@@ -548,7 +548,7 @@
return (ENXIO);
}
- /* Allocate a busdma tag for mbufs. */
+ /* Allocate a busdma tag for mbufs. Alignment is 2 bytes */
error = bus_dma_tag_create(sc->sc_parent_tag, /* parent */
16, 0, /* alignment, boundary */
BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
@@ -778,7 +778,9 @@
eth_rx_desc_t *descrx;
int i;
int error;
+
+ /*create parent tag for tx and rx*/
error = bus_dma_tag_create(
bus_get_dma_tag(sc->dev), /* parent */
@@ -832,7 +834,6 @@
ece_activate(device_t dev)
{
struct ece_softc *sc;
- //int rid;
int err;
uint32_t mac_port_config;
uint32_t cpu_port_config;
@@ -1412,8 +1413,6 @@
fssd = (fssd_curr - (uint32_t)sc->ring_paddr_rx)>>4;
-// printf("fssd = %d\n", fssd);
-
desc = sc->rx_desc[sc->last_rx].desc;
if (fssd > sc->last_rx) {
@@ -1433,7 +1432,6 @@
sc->dmamap_ring_rx,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
- //printf("starting to read\n");
for (i= 0; i<rxcount; i++) {
/* Get status */
@@ -1539,17 +1537,20 @@
if (sc->tx_cons==sc->tx_prod) return;
+ /*prepare to read the ring (owner bit)*/
bus_dmamap_sync(sc->dmatag_ring_tx,
sc->dmamap_ring_tx,
BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
-
while (sc->tx_cons!=sc->tx_prod) {
desc = sc->tx_desc[sc->tx_cons].desc;
if (desc->cown != 0) {
struct tx_desc_info *td = &(sc->tx_desc[sc->tx_cons]);
+ /*we are finished with this descriptor*/
+ /*sync*/
bus_dmamap_sync(sc->dmatag_data_tx, td->dmamap,
BUS_DMASYNC_POSTWRITE);
+ /*and unload, so we can reuse */
bus_dmamap_unload(sc->dmatag_data_tx, td->dmamap);
m_freem(td->buff);
td->buff = 0;
@@ -1585,7 +1586,6 @@
}
-
static void
ece_intr_qf(void *xsc)
{
==== //depot/projects/str91xx/src/sys/arm/econa/if_ecevar.h#2 (text+ko) ====
@@ -113,9 +113,12 @@
bus_dmamap_t dmamap_ring_tx;
bus_dmamap_t dmamap_ring_rx;
+
+ /*dma tag for ring*/
bus_dma_tag_t dmatag_ring_tx;
bus_dma_tag_t dmatag_ring_rx;
+ /*dma tag for data*/
bus_dma_tag_t dmatag_data_tx;
bus_dma_tag_t dmatag_data_rx;
@@ -126,13 +129,16 @@
/*ring physical address*/
bus_addr_t ring_paddr_tx;
bus_addr_t ring_paddr_rx;
-
+
+ /*index of last received descritor*/
uint32_t last_rx;
struct rx_desc_info rx_desc[ECE_MAX_RX_BUFFERS];
- uint32_t tx_prod;
+ /* tx producer index */
+ uint32_t tx_prod;
+ /* tx consumer index */
uint32_t tx_cons;
- /*ring index*/
+ /* tx ring index*/
uint32_t desc_curr_tx;
struct tx_desc_info tx_desc[ECE_MAX_TX_BUFFERS];
More information about the p4-projects
mailing list