ucore_app.c revision 285830
132725Seivind/*-
27194Swollman * Copyright (c) 2003-2012 Broadcom Corporation
37194Swollman * All Rights Reserved
47194Swollman *
532725Seivind * Redistribution and use in source and binary forms, with or without
67194Swollman * modification, are permitted provided that the following conditions
77194Swollman * are met:
87194Swollman *
97194Swollman * 1. Redistributions of source code must retain the above copyright
107194Swollman *    notice, this list of conditions and the following disclaimer.
117194Swollman * 2. Redistributions in binary form must reproduce the above copyright
127194Swollman *    notice, this list of conditions and the following disclaimer in
137194Swollman *    the documentation and/or other materials provided with the
1432725Seivind *    distribution.
157194Swollman *
167194Swollman * THIS SOFTWARE IS PROVIDED BY BROADCOM ``AS IS'' AND ANY EXPRESS OR
177194Swollman * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
187194Swollman * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1932725Seivind * ARE DISCLAIMED. IN NO EVENT SHALL BROADCOM OR CONTRIBUTORS BE LIABLE
2032725Seivind * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2132725Seivind * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2232352Seivind * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
2332352Seivind * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2432352Seivind * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
257194Swollman * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
267194Swollman * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
277194Swollman *
287194Swollman * $FreeBSD: releng/10.2/sys/mips/nlm/dev/net/ucore/ucore_app.c 233657 2012-03-29 11:46:29Z jchandra $
29 */
30
31#include "ucore.h"
32
33int main(void)
34{
35#if 0
36	volatile unsigned int *pkt =
37	    (volatile unsigned int *) (PACKET_MEMORY + PACKET_DATA_OFFSET);
38	int intf, hw_parser_error, context;
39#endif
40	unsigned int pktrdy;
41	int num_cachelines = 1518 / 64 ; /* pktsize / L3 cacheline size */
42
43
44	/* Spray packets to using distribution vector */
45	while (1) {
46		pktrdy = nlm_read_ucore_rxpktrdy();
47#if 0
48		intf = pktrdy & 0x1f;
49		context = (pktrdy >> 13) & 0x3ff;
50		hw_parser_error = (pktrdy >> 23) & 0x1;
51#endif
52		nlm_ucore_setup_poepktdistr(FWD_DIST_VEC, 0, 0, 0, 0);
53		nlm_ucore_pkt_done(num_cachelines, 0, 0, 0, 0, 0, 0, 0, 0, 0,
54		    0, 0);
55	}
56
57	return (0);
58}
59