PERFORCE change 130002 for review
Rafal Jaworowski
raj at FreeBSD.org
Sun Dec 2 03:52:44 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=130002
Change 130002 by raj at raj_mimi on 2007/12/02 11:51:43
Minor style cleanups and cosmetic changes
Affected files ...
.. //depot/projects/e500/sys/dev/tsec/if_tsec.c#3 edit
.. //depot/projects/e500/sys/powerpc/booke/trap_subr.S#3 edit
Differences ...
==== //depot/projects/e500/sys/dev/tsec/if_tsec.c#3 (text+ko) ====
@@ -25,6 +25,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+ * Freescale integrated Three-Speed Ethernet Controller (TSEC) driver.
+ */
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/endian.h>
@@ -237,7 +241,7 @@
*/
/*
- * XXX kluge - use circumstancial evidence to program ECNTRL
+ * XXX kludge - use circumstancial evidence to program ECNTRL
* correctly. Ideally we need some board information to guide
* us here.
*/
@@ -308,7 +312,7 @@
/* Step 16: Initialize FIFO_PAUSE_CTRL */
TSEC_WRITE(sc, TSEC_REG_FIFO_PAUSE_CTRL, TSEC_FIFO_PAUSE_CTRL_EN);
-
+
/*
* Step 17: Initialize transmit/receive descriptor rings.
* Initialize TBASE and RBASE.
@@ -351,12 +355,12 @@
/* Step 21: Mask all CAM interrupts */
TSEC_WRITE(sc, TSEC_REG_MON_CAM1, 0xffffffff);
TSEC_WRITE(sc, TSEC_REG_MON_CAM2, 0xffffffff);
-
+
/* Step 22: Enable Rx and Tx */
val = TSEC_READ(sc, TSEC_REG_MACCFG1);
val |= (TSEC_MACCFG1_RX_EN | TSEC_MACCFG1_TX_EN);
TSEC_WRITE(sc, TSEC_REG_MACCFG1, val);
-
+
/* Step 23: Reset TSEC counters for Tx and Rx rings */
TSEC_TX_RX_COUNTERS_INIT(sc);
@@ -377,7 +381,7 @@
char *macbufp;
char *curmac;
int i;
-
+
TSEC_GLOBAL_LOCK_ASSERT(sc);
KASSERT((ETHER_ADDR_LEN <= sizeof(macbuf)),
@@ -812,7 +816,7 @@
(*vaddr) = NULL;
return (ENXIO);
}
-
+
error = bus_dmamem_alloc(*dtag, vaddr, BUS_DMA_NOWAIT | BUS_DMA_ZERO,
dmap);
if (error) {
@@ -822,7 +826,7 @@
(*vaddr) = NULL;
return (ENXIO);
}
-
+
error = bus_dmamap_load(*dtag, *dmap, *vaddr, dsize, tsec_map_dma_addr,
raddr, BUS_DMA_NOWAIT);
if (error) {
@@ -891,7 +895,7 @@
if (id == 0)
return (ENXIO);
- device_set_desc(dev, "eTSEC ethernet controller");
+ device_set_desc(dev, "TSEC Ethernet Controller");
return (BUS_PROBE_DEFAULT);
}
@@ -935,7 +939,7 @@
/* Stop DMA engine if enabled by firmware */
tsec_dma_ctl(sc, 0);
-
+
/* Reset MAC */
tsec_reset_mac(sc);
@@ -1275,14 +1279,14 @@
TSEC_GLOBAL_LOCK_ASSERT(sc);
ifp = sc->tsec_ifp;
-
+
/* Stop PHY tick engine */
callout_stop(&sc->tsec_tick_ch);
/* Disable interface and watchdog timer */
ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
ifp->if_timer = 0;
-
+
/* Disable all interrupts and stop DMA */
tsec_intrs_ctl(sc, 0);
tsec_dma_ctl(sc, 0);
@@ -1298,7 +1302,7 @@
TSEC_FREE_TX_MAP(sc, mapp);
m_freem(m0);
}
-
+
/* Disable Rx and Tx */
tmpval = TSEC_READ(sc, TSEC_REG_MACCFG1);
tmpval &= ~(TSEC_MACCFG1_RX_EN | TSEC_MACCFG1_TX_EN);
@@ -1338,7 +1342,7 @@
for (count = 0; /* count < TSEC_RX_NUM_DESC */; count++) {
rx_desc = TSEC_GET_CUR_RX_DESC(sc);
flags = rx_desc->flags;
-
+
/* Check if there is anything to receive */
if ((flags & TSEC_RXBD_E) ||
(count >= TSEC_RX_NUM_DESC)) {
@@ -1370,7 +1374,7 @@
/* Ok... process frame */
length = rx_desc->length - ETHER_CRC_LEN;
i = TSEC_GET_CUR_RX_DESC_CNT(sc);
-
+
m = rx_data[i].mbuf;
if (tsec_new_rxbuf(sc->tsec_rx_mtag, rx_data[i].map,
@@ -1395,7 +1399,7 @@
bus_dmamap_sync(sc->tsec_rx_dtag, sc->tsec_rx_dmap, BUS_DMASYNC_PREREAD |
BUS_DMASYNC_PREWRITE);
-
+
TSEC_RECEIVE_UNLOCK(sc);
/* Push it now */
@@ -1497,7 +1501,7 @@
if (eflags & TSEC_IEVENT_EBERR)
if_printf(ifp, "System bus error occurred during"
" a DMA transaction (flags: 0x%x)\n", eflags);
-
+
/* Check transmitter errors */
if (eflags & TSEC_IEVENT_TXE) {
ifp->if_oerrors++;
@@ -1587,7 +1591,7 @@
device_printf(dev, "Trying to write to an alien PHY(%d)\n", phy);
sc = tsec0_sc;
-
+
TSEC_WRITE(sc, TSEC_REG_MIIMADD, (phy << 8) | reg);
TSEC_WRITE(sc, TSEC_REG_MIIMCON, value);
@@ -1643,7 +1647,7 @@
}
TSEC_WRITE(sc, TSEC_REG_MACCFG2, tmp);
- /* XXX kluge - use circumstantial evidence for reduced mode. */
+ /* XXX kludge - use circumstantial evidence for reduced mode. */
id = TSEC_READ(sc, TSEC_REG_ID2);
if (id & 0xffff) {
ecntrl = TSEC_READ(sc, TSEC_REG_ECNTRL) & ~TSEC_ECNTRL_R100M;
==== //depot/projects/e500/sys/powerpc/booke/trap_subr.S#3 (text+ko) ====
@@ -65,7 +65,7 @@
* NOTICE: This is not a standalone file. to use it, #include it in
* your port's locore.S, like so:
*
- * #include <powerpc/e500/trap_subr.S>
+ * #include <powerpc/booke/trap_subr.S>
*/
/*
More information about the p4-projects
mailing list