1224110Sjchandra/*- 2224110Sjchandra * Copyright 2003-2011 Netlogic Microsystems (Netlogic). All rights 3224110Sjchandra * reserved. 4224110Sjchandra * 5224110Sjchandra * Redistribution and use in source and binary forms, with or without 6224110Sjchandra * modification, are permitted provided that the following conditions are 7224110Sjchandra * met: 8224110Sjchandra * 9224110Sjchandra * 1. Redistributions of source code must retain the above copyright 10224110Sjchandra * notice, this list of conditions and the following disclaimer. 11224110Sjchandra * 2. Redistributions in binary form must reproduce the above copyright 12224110Sjchandra * notice, this list of conditions and the following disclaimer in 13224110Sjchandra * the documentation and/or other materials provided with the 14224110Sjchandra * distribution. 15224110Sjchandra * 16224110Sjchandra * THIS SOFTWARE IS PROVIDED BY Netlogic Microsystems ``AS IS'' AND 17224110Sjchandra * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18224110Sjchandra * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19224110Sjchandra * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE 20224110Sjchandra * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21224110Sjchandra * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22224110Sjchandra * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23224110Sjchandra * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24224110Sjchandra * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25224110Sjchandra * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 26224110Sjchandra * THE POSSIBILITY OF SUCH DAMAGE. 27224110Sjchandra * 28225394Sjchandra * NETLOGIC_BSD 29224110Sjchandra * $FreeBSD: releng/10.3/sys/mips/nlm/msgring.h 233545 2012-03-27 14:05:12Z jchandra $ 30225394Sjchandra */ 31224110Sjchandra 32233542Sjchandra#ifndef _NLM_MSGRING_H 33233542Sjchandra#define _NLM_MSGRING_H 34227783Sjchandra#define CMS_DEFAULT_CREDIT 50 35233545Sjchandra/* 36233545Sjchandra * packets are sent to VC 0 of a thread 37233545Sjchandra * freebacks are sent to VC 3 of a thread 38233545Sjchandra */ 39233545Sjchandra#define XLPGE_RX_VC 0 40233545Sjchandra#define XLPGE_FB_VC 3 41233545Sjchandra 42233542Sjchandraextern uint32_t xlp_msg_thread_mask; 43227783Sjchandra 44233542Sjchandrastruct nlm_fmn_msg; 45224110Sjchandratypedef void (*msgring_handler)(int, int, int, int, struct nlm_fmn_msg *, void *); 46233542Sjchandra 47224110Sjchandraint register_msgring_handler(int startb, int endb, msgring_handler action, 48224110Sjchandra void *arg); 49227783Sjchandraint xlp_handle_msg_vc(u_int vcmask, int max_msgs); 50227783Sjchandravoid xlp_msgring_cpu_init(int, int, int); 51227783Sjchandravoid xlp_cms_enable_intr(int , int , int , int); 52233542Sjchandra#endif /* _NLM_MSGRING_H */ 53