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

custom.h (1348B)


      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_CUSTOM_H__
     11 #define __BCM_CUSTOM_H__
     12 
     13 #include <bcm/types.h>
     14 
     15 #if !defined(BCM_CUSTOM_ARGS_MAX)
     16 #define BCM_CUSTOM_ARGS_MAX     256        
     17 #endif
     18 
     19 #define BCM_CUSTOM_SET          1          
     20 #define BCM_CUSTOM_GET          2          
     21 
     22 /* bcm_custom_cb_t */
     23 typedef int (*bcm_custom_cb_t)(
     24     int unit, 
     25     bcm_port_t port, 
     26     int setget, 
     27     int type, 
     28     int length, 
     29     uint32 *args, 
     30     int *actual_length, 
     31     void *user_data);
     32 
     33 #ifndef BCM_HIDE_DISPATCHABLE
     34 
     35 /* Register a custom callback function. */
     36 extern int bcm_custom_register(
     37     int unit, 
     38     bcm_custom_cb_t func, 
     39     void *user_data);
     40 
     41 /* Register a custom callback function. */
     42 extern int bcm_custom_unregister(
     43     int unit);
     44 
     45 /* Invoke a custom handler for a port */
     46 extern int bcm_custom_port_set(
     47     int unit, 
     48     bcm_port_t port, 
     49     int type, 
     50     int len, 
     51     uint32 *args);
     52 
     53 /* Invoke a custom handler for a port. */
     54 extern int bcm_custom_port_get(
     55     int unit, 
     56     bcm_port_t port, 
     57     int type, 
     58     int max_len, 
     59     uint32 *args, 
     60     int *actual_len);
     61 
     62 #endif /* BCM_HIDE_DISPATCHABLE */
     63 
     64 #endif /* __BCM_CUSTOM_H__ */