/* <:copyright-BRCM:2015:DUAL/GPL:standard Copyright (c) 2015 Broadcom All Rights Reserved This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation (the "GPL"). This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the GPL is available at http://www.broadcom.com/licenses/GPLv2.php, or by writing to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. :> */ /* * Created on: Nov/2015 * Author: ido@broadcom.com */ #ifndef _RUNNER_H_ #define _RUNNER_H_ #include "port.h" #include "enet.h" #include extern rdpa_system_init_cfg_t init_cfg; extern int wan_port_id; extern sw_ops_t port_runner_sw; extern port_ops_t port_runner_port; #ifdef EPON extern port_ops_t port_runner_epon; #endif #ifdef GPON extern port_ops_t port_runner_gpon; #endif /* runner API implemented by rdp_ring/enet_ring */ extern int runner_ring_create_delete(enetx_channel *chan, int q_id, int size, rdpa_cpu_rxq_cfg_t *rxq_cfg); extern int runner_get_pkt_from_ring(int hw_q_id, rdpa_cpu_rx_info_t *info); static inline bdmf_object_handle _port_rdpa_object_by_port(enetx_port_t *port) { if (!port) return NULL; switch (port->port_type) { case PORT_TYPE_RUNNER_PORT: case PORT_TYPE_G9991_PORT: case PORT_TYPE_RUNNER_GPON: case PORT_TYPE_RUNNER_EPON: return (bdmf_object_handle)port->priv; default: return NULL; } } static inline int _port_rdpa_if_by_port(enetx_port_t *port, rdpa_if *index) { bdmf_object_handle port_obj = _port_rdpa_object_by_port(port); if (port_obj) return rdpa_port_index_get(port_obj, index); return -1; } #endif