openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

txbeacon.h (2518B)


      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_TXBEACON_H__
     11 #define __BCM_TXBEACON_H__
     12 
     13 #include <bcm/types.h>
     14 #include <bcm/pkt.h>
     15 
     16 /* bcm_txbeacon_t flags definitions */
     17 #define BCM_TXBEACON_WITH_ID    (1 << 0)   /* Set if TX Beacon structure has ID */
     18 #define BCM_TXBEACON_AUTOSTART  (1 << 1)   /* Set if uCs should start beacon on
     19                                               loss of keepalive */
     20 
     21 /* Unique packet ID shared with uCs. */
     22 typedef uint32 bcm_txbeacon_pkt_id_t;
     23 
     24 /* Tx Beacon basic data structure. */
     25 typedef struct bcm_txbeacon_s {
     26     uint32 flags;                   /* Flags indicating action of API */
     27     uint16 len;                     /* length of packet in bytes. NOTE: IN/OUT */
     28     uint16 maxlen;                  /* maximum length in case of modification.
     29                                        NOTE: IN/OUT */
     30     bcm_txbeacon_pkt_id_t pkt_id;   /* Packet ID from the uC.  NOTE: IN/OUT */
     31     uint16 port;                    /* port to send packet to */
     32     uint16 interval;                /* interval to send packet in mSeconds */
     33     uint16 count;                   /* Number of packets to send or 0 (forever) */
     34     uint8 *pkt_data;                /* Pointer to packet NOTE: IN/OUT */
     35 } bcm_txbeacon_t;
     36 
     37 /* tx beacon traverse callback */
     38 typedef int (*bcm_txbeacon_traverse_cb_t)(
     39     int unit, 
     40     bcm_txbeacon_t *tx, 
     41     void *user_data);
     42 
     43 #ifndef BCM_HIDE_DISPATCHABLE
     44 
     45 /* Traverse the tx beacon packets */
     46 extern int bcm_txbeacon_traverse(
     47     int unit, 
     48     bcm_txbeacon_traverse_cb_t trav_fn, 
     49     void *user_data);
     50 
     51 /* Init routine for TX beacon */
     52 extern int bcm_txbeacon_init(
     53     int unit, 
     54     int uC);
     55 
     56 /* Add a packet for TX beacon */
     57 extern int bcm_txbeacon_pkt_setup(
     58     int unit, 
     59     bcm_txbeacon_t *txbeacon);
     60 
     61 /* Remove this packet from the txbeacon list */
     62 extern int bcm_txbeacon_destroy(
     63     int unit, 
     64     bcm_txbeacon_pkt_id_t pkt_id);
     65 
     66 /* Lookup packet beacon info structure */
     67 extern int bcm_txbeacon_pkt_get(
     68     int unit, 
     69     bcm_txbeacon_t *txbeacon);
     70 
     71 /* Start beacon for this packet or all */
     72 extern int bcm_txbeacon_start(
     73     int unit, 
     74     bcm_txbeacon_pkt_id_t pkt_id);
     75 
     76 /* Start beacon for this packet or all */
     77 extern int bcm_txbeacon_stop(
     78     int unit, 
     79     bcm_txbeacon_pkt_id_t pkt_id);
     80 
     81 #endif /* BCM_HIDE_DISPATCHABLE */
     82 
     83 #endif /* __BCM_TXBEACON_H__ */