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

bcm-knet.h (3594B)


      1 /*
      2  * Copyright 2017 Broadcom
      3  * 
      4  * This program is free software; you can redistribute it and/or modify
      5  * it under the terms of the GNU General Public License, version 2, as
      6  * published by the Free Software Foundation (the "GPL").
      7  * 
      8  * This program is distributed in the hope that it will be useful, but
      9  * WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     11  * General Public License version 2 (GPLv2) for more details.
     12  * 
     13  * You should have received a copy of the GNU General Public License
     14  * version 2 (GPLv2) along with this source code.
     15  */
     16 /*
     17  * $Id: bcm-knet.h,v 1.4 Broadcom SDK $
     18  * $Copyright: (c) 2005 Broadcom Corp.
     19  * All Rights Reserved.$
     20  */
     21 #ifndef __LINUX_BCM_KNET_H__
     22 #define __LINUX_BCM_KNET_H__
     23 
     24 #ifndef __KERNEL__
     25 #include <stdint.h>
     26 #endif
     27 
     28 typedef struct  {
     29     int rc;
     30     int len;
     31     int bufsz;
     32     int reserved;
     33     uint64_t buf;
     34 } bkn_ioctl_t;
     35 
     36 #ifdef __KERNEL__
     37 
     38 /*
     39  * Call-back interfaces for other Linux kernel drivers.
     40  */
     41 #include <linux/skbuff.h>
     42 
     43 typedef struct {
     44     uint32 netif_user_data;
     45     uint32 filter_user_data;
     46     uint16 dcb_type;
     47     int port;
     48 } knet_skb_cb_t;
     49 
     50 #define KNET_SKB_CB(_skb) ((knet_skb_cb_t *)_skb->cb)
     51 
     52 typedef struct sk_buff *
     53 (*knet_skb_cb_f)(struct sk_buff *skb, int dev_no, void *meta);
     54 
     55 typedef int
     56 (*knet_filter_cb_f)(uint8_t *pkt, int size, int dev_no, void *meta,
     57                     int chan, kcom_filter_t *filter);
     58 
     59 typedef int
     60 (*knet_hw_tstamp_enable_cb_f)(int dev_no, int port);
     61 
     62 typedef int
     63 (*knet_hw_tstamp_tx_time_get_cb_f)(int dev_no, int port, uint8_t *pkt, uint64_t *ts);
     64 
     65 typedef int
     66 (*knet_hw_tstamp_tx_meta_get_cb_f)(int dev_no, struct sk_buff *skb, uint32_t **md);
     67 
     68 typedef int
     69 (*knet_hw_tstamp_ptp_clock_index_cb_f)(int dev_no);
     70 
     71 typedef int
     72 (*knet_hw_tstamp_rx_time_upscale_cb_f)(int dev_no, uint64_t *ts);
     73 
     74 extern int
     75 bkn_rx_skb_cb_register(knet_skb_cb_f rx_cb);
     76 
     77 extern int
     78 bkn_rx_skb_cb_unregister(knet_skb_cb_f rx_cb);
     79 
     80 extern int
     81 bkn_tx_skb_cb_register(knet_skb_cb_f tx_cb);
     82 
     83 extern int
     84 bkn_tx_skb_cb_unregister(knet_skb_cb_f tx_cb);
     85 
     86 extern int
     87 bkn_filter_cb_register(knet_filter_cb_f filter_cb);
     88 
     89 extern int
     90 bkn_filter_cb_unregister(knet_filter_cb_f filter_cb);
     91 
     92 extern int
     93 bkn_hw_tstamp_enable_cb_register(knet_hw_tstamp_enable_cb_f hw_tstamp_enable_cb);
     94 
     95 extern int
     96 bkn_hw_tstamp_enable_cb_unregister(knet_hw_tstamp_enable_cb_f hw_tstamp_enable_cb);
     97 
     98 extern int
     99 bkn_hw_tstamp_disable_cb_register(knet_hw_tstamp_enable_cb_f hw_tstamp_disable_cb);
    100 
    101 extern int
    102 bkn_hw_tstamp_disable_cb_unregister(knet_hw_tstamp_enable_cb_f hw_tstamp_disable_cb);
    103 
    104 extern int
    105 bkn_hw_tstamp_tx_time_get_cb_register(knet_hw_tstamp_tx_time_get_cb_f hw_tstamp_tx_time_get_cb);
    106 
    107 extern int
    108 bkn_hw_tstamp_tx_time_get_cb_unregister(knet_hw_tstamp_tx_time_get_cb_f hw_tstamp_tx_time_get_cb);
    109 
    110 extern int
    111 bkn_hw_tstamp_tx_meta_get_cb_register(knet_hw_tstamp_tx_meta_get_cb_f hw_tstamp_tx_meta_get_cb);
    112 
    113 extern int
    114 bkn_hw_tstamp_tx_meta_get_cb_unregister(knet_hw_tstamp_tx_meta_get_cb_f hw_tstamp_tx_meta_get_cb);
    115 
    116 extern int
    117 bkn_hw_tstamp_ptp_clock_index_cb_register(knet_hw_tstamp_ptp_clock_index_cb_f hw_tstamp_ptp_clock_index_cb);
    118 
    119 extern int
    120 bkn_hw_tstamp_ptp_clock_index_cb_unregister(knet_hw_tstamp_ptp_clock_index_cb_f hw_tstamp_ptp_clock_index_cb);
    121 
    122 extern int
    123 bkn_hw_tstamp_rx_time_upscale_cb_register(knet_hw_tstamp_rx_time_upscale_cb_f hw_tstamp_rx_time_upscale_cb);
    124 
    125 extern int
    126 bkn_hw_tstamp_rx_time_upscale_cb_unregister(knet_hw_tstamp_rx_time_upscale_cb_f hw_tstamp_rx_time_upscale_cb);
    127 
    128 #endif
    129 
    130 #endif /* __LINUX_BCM_KNET_H__ */