Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2008 18:01:52 GMT
From:      "Randall R. Stewart" <rrs@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 135812 for review
Message-ID:  <200802201801.m1KI1q0O075859@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=135812

Change 135812 by rrs@rrs-mips2-jnpr on 2008/02/20 18:00:53

	s9indent of file.

Affected files ...

.. //depot/projects/mips2-jnpr/src/sys/dev/rgmii/octeon_rgmx.c#5 edit

Differences ...

==== //depot/projects/mips2-jnpr/src/sys/dev/rgmii/octeon_rgmx.c#5 (text+ko) ====

@@ -194,8 +194,10 @@
 static void octeon_rgmx_stop(struct rgmx_softc_dev *sc);
 static void octeon_rgmx_config_speed(u_int port, u_int);
 static void octeon_dump_rgmx_stats(u_int port);
+
 #ifdef __not_used__
 static void rgmx_timer_periodic(void);
+
 #endif
 static void octeon_rgmx_enable_RED_all(int, int);
 
@@ -217,6 +219,7 @@
 
 /* Standard driver entry points.  These can be static.  */
 static void octeon_rgmx_init(void *);
+
 /* static driver_intr_t rgmx_intr; */
 static int octeon_rgmx_ioctl(struct ifnet *, u_long, caddr_t);
 static void octeon_rgmx_output_start(struct ifnet *);
@@ -272,7 +275,7 @@
 
 
 
-static u_int 
+static u_int
 get_rgmx_port_ordinal(u_int port)
 {
 	u_int idx;
@@ -299,7 +302,7 @@
 
 
 
-static void 
+static void
 octeon_rgmx_init_sc(struct rgmx_softc_dev *sc, device_t dev, u_int port, u_int num_devices)
 {
 	int ii;
@@ -329,7 +332,7 @@
 
 }
 
-static int 
+static int
 octeon_rgmx_init_ifnet(struct rgmx_softc_dev *sc)
 {
 	struct ifnet *ifp;
@@ -355,14 +358,14 @@
 	ifp->if_capenable = ifp->if_capabilities;
 	ifp->if_init = octeon_rgmx_init;
 	ifp->if_linkmib = NULL;
-	/*&sc->mibdata; */
+	/* &sc->mibdata; */
 	ifp->if_linkmiblen = 0;
-	/*sizeof(sc->mibdata);*/
+	/* sizeof(sc->mibdata); */
 	/*
 	 * Set fixed interface flags.
 	 */
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-	/*|IFF_NEEDSGIANT; */
+	/* |IFF_NEEDSGIANT; */
 	if (ifp->if_snd.ifq_maxlen == 0)
 		ifp->if_snd.ifq_maxlen = ifqmaxlen;
 
@@ -385,7 +388,7 @@
 /* ------------------------------------------------------------------- *
  *                      rgmii_identify()                               *
  * ------------------------------------------------------------------- */
-static void 
+static void
 rgmii_identify(driver_t * drv, device_t parent)
 {
 	BUS_ADD_CHILD(parent, 0, "rgmii", 0);
@@ -395,7 +398,7 @@
 /* ------------------------------------------------------------------- *
  *                      rgmii_probe()                                  *
  * ------------------------------------------------------------------- */
-static int 
+static int
 rgmii_probe(device_t dev)
 {
 	if (device_get_unit(dev) != 0)
@@ -410,7 +413,7 @@
 /* ------------------------------------------------------------------- *
  *                      rgmii_attach()                                 *
  * ------------------------------------------------------------------- */
-static int 
+static int
 rgmii_attach(device_t dev)
 {
 	struct rgmx_softc_dev *sc;
@@ -585,20 +588,21 @@
 
 #ifdef __not_used__
 static void octeon_dump_pow_stats(void);
+
 #endif
 
 
 #ifdef	OCTEON_RGMX_SCHEDULED_ISRS
 
 
-static void 
+static void
 octeon_rgmx_isr_link(void *context, int pending)
 {
 	octeon_line_status_loop(NULL);
 }
 
 
-static void 
+static void
 octeon_rgmx_isr_rxtx(void *context, int pending)
 {
 	octeon_rx_loop(NULL);
@@ -615,7 +619,7 @@
 #define OCTEON_RGMX_POW_TIME_THR_INTS 1
 
 
-static int 
+static int
 octeon_rgmx_intr_fast(void *arg)
 {
 
@@ -676,7 +680,7 @@
  * Also note that the  RGMX_LOCK/UNLOCK code will have to checked/added, since that is new and
  * was not supported with this model.
  */
-static int 
+static int
 octeon_rgmx_intr(void *arg)
 {
 	int flag = 0;
@@ -785,7 +789,7 @@
 
 #define DEBUG_RX 1
 
-static void 
+static void
 octeon_rgmx_rx_process_work(octeon_wqe_t * work, u_int port)
 {
 	struct rgmx_softc_dev *sc;
@@ -803,8 +807,8 @@
 	data_start = octeon_pow_pktptr_to_kbuffer(work->packet_ptr);
 
 #ifdef DEBUG_RX2
-	    printf(" WQE 0x%p: port:%u  ", work, port);
-	    printf(" Grp: %u, %x  Tag: %x    type: %u 0x%x\n",
+	printf(" WQE 0x%p: port:%u  ", work, port);
+	printf(" Grp: %u, %x  Tag: %x    type: %u 0x%x\n",
 	    work->grp, work->grp, work->tag, work->tag_type, work->tag_type);
 #endif
 
@@ -858,7 +862,12 @@
 
 					mbuf = octeon_rgmx_build_new_rx_mbuf(ifp, new_data_start, len);
 					if (mbuf) {
-					  /*printf(" Passing pkt to ifp: pkt_len: %u len: %u ", mbuf->m_pkthdr.len, mbuf->m_len); */
+						/*
+						 * printf(" Passing pkt to
+						 * ifp: pkt_len: %u len: %u
+						 * ", mbuf->m_pkthdr.len,
+						 * mbuf->m_len);
+						 */
 #ifdef DEBUG_RX_PKT_DUMP
 
 						dc = mtod(mbuf, u_char *);
@@ -913,7 +922,7 @@
 
 #endif
 
-static void 
+static void
 octeon_rx_loop(void *unused)
 {
 	u_int core_id;
@@ -996,7 +1005,7 @@
 }
 
 
-static u_int 
+static u_int
 octeon_rgmx_pko_xmit_packet(struct rgmx_softc_dev *sc, void *out_buff, u_int len, u_int checksum)
 {
 	octeon_pko_command_word0_t pko_cmd;
@@ -1008,14 +1017,12 @@
 	int queue = 0;
 
 	/*
-	 * we should randomize queue 
-         * based on core num. Using same
-	 * queue 0 for this
-	 * port, by all cores on is less efficient.
+	 * we should randomize queue based on core num. Using same queue 0
+	 * for this port, by all cores on is less efficient.
 	 */
 	/*
-	 * Prepare the PKO buffer and command word. Cmd Buf Word 0
-	 * No FAU Set #-segs and #-bytes
+	 * Prepare the PKO buffer and command word. Cmd Buf Word 0 No FAU
+	 * Set #-segs and #-bytes
 	 */
 	pko_cmd.word64 = 0;
 	pko_cmd.bits.segs = 1;
@@ -1031,10 +1038,10 @@
 	pko_pkt_word.bits.addr = OCTEON_PTR2PHYS(out_buff);
 	pko_pkt_word.bits.pool = OCTEON_FPA_TX_PACKET_POOL;
 	pko_pkt_word.bits.size = 2048;
-	/*dummy.Actual len is above. */
+	/* dummy.Actual len is above. */
 
 #ifdef DEBUG_TX
-	    printf(" PKO: 0x%llX  0x%llX ", pko_cmd.word64, pko_pkt_word.word64);
+	printf(" PKO: 0x%llX  0x%llX ", pko_cmd.word64, pko_pkt_word.word64);
 #endif
 
 	/*
@@ -1114,7 +1121,7 @@
 
 static void octeon_rgmx_xmit_mark_buffers_done(struct rgmx_softc_dev *sc, u_int n);
 
-static void 
+static void
 octeon_rgmx_xmit_mark_buffers_done(struct rgmx_softc_dev *sc, u_int n)
 {
 	struct mbuf *m;
@@ -1129,7 +1136,7 @@
 			IF_DEQUEUE(&sc->tx_pending_queue, m);
 			if (!m) {
 				break;
-				/*Queue became empty now.Break out. */
+				/* Queue became empty now.Break out. */
 			}
 			/*
 			 * Return the mbuf to system.
@@ -1139,7 +1146,7 @@
 	}
 	if (!i) {
 		return;
-		/*Nothing removed from queue. */
+		/* Nothing removed from queue. */
 	}
 	/*
 	 * The transmitter is no more active. Reset output active flag and
@@ -1160,7 +1167,7 @@
  *
  * Drop all packets queued at ifnet layer.
  */
-static void 
+static void
 octeon_rgmx_output_flush(struct ifnet *ifp)
 {
 	struct mbuf *m;
@@ -1189,7 +1196,7 @@
  *
  * Start output on interface.
  */
-static void 
+static void
 octeon_rgmx_output_start(struct ifnet *ifp)
 {
 	struct rgmx_softc_dev *sc = ifp->if_softc;
@@ -1206,7 +1213,7 @@
  *
  * Start output on interface.  Assume Driver locked
  */
-static void 
+static void
 octeon_rgmx_output_start_locked(struct ifnet *ifp)
 {
 	struct rgmx_softc_dev *sc = ifp->if_softc;
@@ -1290,14 +1297,14 @@
 
 #ifdef DEBUG_TX_PKT_DUMP
 		{
-		  int ii;
-		  u_char *dc = out_buff;
+			int ii;
+			u_char *dc = out_buff;
 
-		  printf("\n");
-		  printf("Out: ");
-		  for (ii = 0; ii < len; ii++)
-		    printf(" %X", dc[ii]);
-		  printf("\n");
+			printf("\n");
+			printf("Out: ");
+			for (ii = 0; ii < len; ii++)
+				printf(" %X", dc[ii]);
+			printf("\n");
 		}
 #endif
 
@@ -1329,7 +1336,7 @@
 	 * outgoing packets in the transmission buffer.
 	 */
 	ifp->if_oerrors++;
-	/*sc->mibdata.dot3StatsInternalMacTransmitErrors++;*/
+	/* sc->mibdata.dot3StatsInternalMacTransmitErrors++; */
 	ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 	return;
 }
@@ -1344,7 +1351,7 @@
  * Initialize Octeon hardware components. To get the RGMX going.
  *
  */
-static void 
+static void
 octeon_config_hw_units_pre_ports(void)
 {
 
@@ -1408,7 +1415,7 @@
 
 
 
-static void 
+static void
 octeon_config_hw_units_port(struct rgmx_softc_dev *sc, u_int port)
 {
 	const u_int priorities[8] = {8, 8, 8, 8, 8, 8, 8, 8};
@@ -1460,8 +1467,8 @@
 	struct {
 		uint64_t rsvd3:4;
 		uint64_t thr_freq:28;
- 	                 /*R / O */
-		         uint64_t rsvd2:4;
+		/* R / O */
+		uint64_t rsvd2:4;
 		uint64_t thr_period:20;
 		uint64_t rsvd:8;
 	}      bits;
@@ -1515,7 +1522,7 @@
 }     octeon_pow_inpt_q_grp_qos;
 
 
-static void 
+static void
 octeon_config_hw_units_post_ports(void)
 {
 
@@ -1535,10 +1542,10 @@
 
 #else
 	thr.bits.ds_thr = thr.bits.iq_thr = 1;
-	/*Only if doing
-	 *absolute queue - cnt interrupts.
+	/*
+	 * Only if doing absolute queue - cnt interrupts.
 	 */
-		    oct_write64(OCTEON_POW_WORKQUEUE_INT_THRESHOLD(OCTEON_POW_RX_GROUP_NUM), thr.word64);
+	oct_write64(OCTEON_POW_WORKQUEUE_INT_THRESHOLD(OCTEON_POW_RX_GROUP_NUM), thr.word64);
 #endif
 
 	ciu_enable_interrupts(OCTEON_CORE_ID, OCTEON_RGMX_CIU_INTX, OCTEON_RGMX_CIU_ENX,
@@ -1560,7 +1567,7 @@
 
 
 
-static void 
+static void
 octeon_rgmx_config_pip(u_int port)
 {
 	octeon_pip_gbl_cfg_t pip_config;
@@ -1625,7 +1632,7 @@
  * octeon_rgmx_stop_port
  *
  */
-static u_int 
+static u_int
 octeon_rgmx_stop_port(u_int port)
 {
 	int interface = INTERFACE(port);
@@ -1640,7 +1647,7 @@
 	return (last_enabled);
 }
 
-static void 
+static void
 octeon_rgmx_start_port(u_int port)
 {
 	int interface = INTERFACE(port);
@@ -1653,7 +1660,7 @@
 }
 
 
-static void 
+static void
 octeon_rgmx_stop(struct rgmx_softc_dev *sc)
 {
 	octeon_rgmx_stop_port(sc->port);
@@ -1667,7 +1674,7 @@
 
 
 /* Change the media selection.  */
-static int 
+static int
 octeon_rgmx_medchange(struct ifnet *ifp)
 {
 	struct rgmx_softc_dev *sc = ifp->if_softc;
@@ -1708,7 +1715,7 @@
 }
 
 
-static void 
+static void
 octeon_rgmx_medstat(struct ifnet *ifp, struct ifmediareq *ifm)
 {
 	/*
@@ -1716,7 +1723,7 @@
 	 */
 }
 
-static int 
+static int
 octeon_rgmx_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
 {
 	struct rgmx_softc_dev *sc = ifp->if_softc;
@@ -1813,7 +1820,7 @@
  * Initialize the rgmx driver for this instance
  * Initialize device.
  */
-static void 
+static void
 octeon_rgmx_mark_ready(struct rgmx_softc_dev *sc)
 {
 
@@ -1843,7 +1850,7 @@
 }
 
 
-static void 
+static void
 octeon_rgmx_init(void *xsc)
 {
 
@@ -1860,7 +1867,7 @@
 
 
 
-static void 
+static void
 octeon_rgmx_config_speed(u_int port, u_int report_link)
 {
 	int index = INDEX(port);
@@ -1949,7 +1956,7 @@
 	if (link_status.bits.status != old_link_status.bits.status) {
 
 #define DEBUG_LINESTATUS
-		    if (link_status.bits.status) {
+		if (link_status.bits.status) {
 #ifdef DEBUG_LINESTATUS
 			printf(" %u/%u: Interface is now alive\n", iface, port);
 #endif
@@ -1969,14 +1976,14 @@
 
 
 
-static void 
+static void
 octeon_dump_rgmx_stats(u_int port)
 {
 
 }
 
 #ifdef _not_used_
-static void 
+static void
 rgmx_timer_periodic(void)
 {
 	u_int port;
@@ -2032,9 +2039,10 @@
 		octeon_rgmx_config_speed(port, 1);
 	}
 }
+
 #endif
 #ifdef _not_used_
-static void 
+static void
 octeon_dump_pow_stats(void)
 {
 	octeon_rgmx_pow_nos_cnt nos_cnt;
@@ -2082,12 +2090,13 @@
 			printf(" Grp-%u:  %u ", i, inpt_q_grp.bits.iq_cnt);
 	}
 }
+
 #endif
 
 /* ------------------------------------------------------------------- *
  *                      octeon_line_status_loop()                      *
  * ------------------------------------------------------------------- */
-static void 
+static void
 octeon_line_status_loop(void *unused)
 {
 	struct rgmx_softc_dev *sc;
@@ -2106,15 +2115,15 @@
 
 #define DEBUG_RGMX_DUMP
 #ifdef DEBUG_RGMX_DUMP
-	    static int count = 0;
+	static int count = 0;
 
 	if (++count > 5) {
 		count = 0;
-		/*octeon_dump_fpa_pool(OCTEON_FPA_RX_PACKET_POOL);*/
-		/*octeon_dump_fpa_pool(OCTEON_FPA_WQE_RX_POOL);*/
-		/*octeon_dump_fpa_pool(OCTEON_FPA_TX_PACKET_POOL);*/
+		/* octeon_dump_fpa_pool(OCTEON_FPA_RX_PACKET_POOL); */
+		/* octeon_dump_fpa_pool(OCTEON_FPA_WQE_RX_POOL); */
+		/* octeon_dump_fpa_pool(OCTEON_FPA_TX_PACKET_POOL); */
 		octeon_dump_rgmx_stats(16);
-		/*octeon_dump_pow_stats();*/
+		/* octeon_dump_pow_stats(); */
 	}
 #endif
 }
@@ -2129,7 +2138,7 @@
  * Program the ethernet HW address
  *
  */
-static void 
+static void
 octeon_rgmx_set_mac(u_int port)
 {
 	struct rgmx_softc_dev *sc;
@@ -2170,7 +2179,7 @@
 /* ------------------------------------------------------------------- *
  *                      octeon_config_rgmii_port()                     *
  * ------------------------------------------------------------------- */
-static void 
+static void
 octeon_config_rgmii_port(u_int port)
 {
 	u_int iface = INTERFACE(port);
@@ -2205,7 +2214,7 @@
 
 
 
-static void 
+static void
 octeon_rgmx_enable_RED_queue(int queue, int slow_drop, int all_drop)
 {
 	octeon_rgmx_ipd_queue_red_marks_t red_marks;
@@ -2230,7 +2239,7 @@
 }
 
 
-static void 
+static void
 octeon_rgmx_enable_RED_all(int slow_drop, int all_drop)
 {
 
@@ -2270,7 +2279,7 @@
 /* ------------------------------------------------------------------- *
  *                    octeon_has_4ports()                                 *
  * ------------------------------------------------------------------- */
-static int 
+static int
 octeon_has_4ports(void)
 {
 	u_int chipid;
@@ -2300,7 +2309,7 @@
  * We will not support  detachment for now. But keep adding good code that will be used
  * someday.
  */
-static void 
+static void
 octeon_rgmx_free_intr(struct rgmx_softc_dev *sc)
 {
 	device_t dev = sc->sc_dev;
@@ -2323,6 +2332,7 @@
 #endif
 
 }
+
 #endif
 
 static device_method_t rgmii_methods[] = {



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