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