tx.h (3374B)
1 /* 2 * 3 * 4 * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file. 5 * 6 * Copyright 2007-2020 Broadcom Inc. All rights reserved. 7 * 8 * DO NOT EDIT THIS FILE! 9 * This file is auto-generated. 10 * Edits to this file will be lost when it is regenerated. 11 */ 12 13 #ifndef __BCM_TX_H__ 14 #define __BCM_TX_H__ 15 16 #include <bcm/pkt.h> 17 18 /* Setup a packet for default transmit on the given unit. */ 19 typedef int (*bcm_tx_pkt_setup_f)( 20 int unit, 21 bcm_pkt_t *tx_pkt); 22 23 /* Function prototype to send out a packet. */ 24 typedef int (*bcm_tx_f)( 25 int unit, 26 bcm_pkt_t *tx_pkt, 27 void *cookie); 28 29 /* Function prototype to send out an array of packets. */ 30 typedef int (*bcm_tx_array_f)( 31 int unit, 32 bcm_pkt_t **pkt_array, 33 int count, 34 bcm_pkt_cb_f all_done_cb, 35 void *cookie); 36 37 /* Function prototype to send out a list of packets. */ 38 typedef int (*bcm_tx_list_f)( 39 int unit, 40 bcm_pkt_t *pkt_list, 41 bcm_pkt_cb_f all_done_cb, 42 void *cookie); 43 44 #ifndef BCM_HIDE_DISPATCHABLE 45 46 /* Initialize the BCM TX software module. */ 47 extern int bcm_tx_init( 48 int unit); 49 50 /* Transmit one or more packets. */ 51 extern int bcm_tx( 52 int unit, 53 bcm_pkt_t *tx_pkt, 54 void *cookie); 55 56 /* Transmit one or more packets. */ 57 extern int bcm_tx_array( 58 int unit, 59 bcm_pkt_t **pkt, 60 int count, 61 bcm_pkt_cb_f all_done_cb, 62 void *cookie); 63 64 /* Transmit one or more packets. */ 65 extern int bcm_tx_list( 66 int unit, 67 bcm_pkt_t *pkt, 68 bcm_pkt_cb_f all_done_cb, 69 void *cookie); 70 71 /* Set up a packet for transmit. */ 72 extern int bcm_tx_pkt_setup( 73 int unit, 74 bcm_pkt_t *tx_pkt); 75 76 /* 77 * Update a packet based on a look up of the Layer 2 Forwarding Database 78 * (deprecated, unimplemented). 79 */ 80 extern int bcm_tx_pkt_l2_map( 81 int unit, 82 bcm_pkt_t *pkt, 83 bcm_mac_t dest_mac, 84 int vid); 85 86 #endif /* BCM_HIDE_DISPATCHABLE */ 87 88 /* 89 * TX Tunneling: 90 * 91 * This is the prototype to forward a packet to a remote CPU for transmit 92 * on a remote device. A function of this type may be registered with BCM 93 * TX to allow automatic forwarding to remote unit numbers. 94 */ 95 #if defined(BCM_RPC_SUPPORT) 96 typedef int (*bcm_tx_cpu_tunnel_f)( 97 bcm_pkt_t *pkt, 98 int dest_unit, 99 int remote_port, 100 uint32 flags, 101 bcm_cpu_tunnel_mode_t mode); 102 #endif 103 104 #if defined(BCM_RPC_SUPPORT) 105 /* Encapsulate and forward a packet to a different CPU. */ 106 extern int bcm_tx_cpu_tunnel_get( 107 bcm_tx_cpu_tunnel_f *f); 108 #endif 109 110 #if defined(BCM_RPC_SUPPORT) 111 /* Encapsulate and forward a packet to a different CPU. */ 112 extern int bcm_tx_cpu_tunnel_set( 113 bcm_tx_cpu_tunnel_f f); 114 #endif 115 116 #if defined(BCM_RPC_SUPPORT) 117 /* Encapsulate and forward a packet to a different CPU. */ 118 extern int bcm_tx_cpu_tunnel( 119 bcm_pkt_t *pkt, 120 int dest_unit, 121 int remote_port, 122 uint32 flags, 123 bcm_cpu_tunnel_mode_t mode); 124 #endif 125 126 #if defined(BCM_RPC_SUPPORT) 127 /* DEPRECATED: bcm_tx_tunnel. Use bcm_tx_cpu_tunnel */ 128 #define bcm_tx_tunnel bcm_tx_cpu_tunnel 129 #endif 130 131 #ifndef BCM_HIDE_DISPATCHABLE 132 133 #if defined(BROADCOM_DEBUG) 134 /* bcm_tx_dv_dump */ 135 extern int bcm_tx_dv_dump( 136 int unit, 137 void *dv_p); 138 #endif 139 140 #if defined(BROADCOM_DEBUG) 141 /* bcm_tx_show */ 142 extern int bcm_tx_show( 143 int unit); 144 #endif 145 146 #endif /* BCM_HIDE_DISPATCHABLE */ 147 148 #endif /* __BCM_TX_H__ */