sonic-buildimage/platform/broadcom/saibcm-modules/sdklt/linux/knetcb/psample-cb.h
hari-selvam d993444883
[sflow]: Unblocked psample_*() function calls in BRCM ESW platforms for proper functionality of sflow feature (#12918)
*Replaced BRCM SDK's psample support flag(PSAMPLE_SUPPORT) with linux kernel psample module support config flag(CONFIG_PSAMPLE) in saibcm-modules.
*Replaced BUILD_PSAMPLE conditioanl check with CONFIG_PSAMPLE to build psample callback library(psample-cb.o), only if psample config is enabled in linux kernel.
*Cleaned up PSAMPLE_SUPPORT related commented code.

Signed-off-by: haris@celestica.com

Signed-off-by: haris@celestica.com
2022-12-07 17:14:34 -08:00

57 lines
1.4 KiB
C

/*
* Copyright 2017 Broadcom
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation (the "GPL").
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 (GPLv2) for more details.
*
* You should have received a copy of the GNU General Public License
* version 2 (GPLv2) along with this source code.
*/
/*
* $Id: psample_cb.h $
* $Copyright: (c) 2019 Broadcom Corp.
* All Rights Reserved.$
*/
#ifndef __PSAMPLE_CB_H__
#define __PSAMPLE_CB_H__
#include <lkm/lkm.h>
#include <linux/netdevice.h>
#define PSAMPLE_CB_NAME "psample"
extern int
psample_init(void);
extern int
psample_cleanup(void);
extern struct sk_buff*
psample_rx_cb(struct sk_buff *skb);
/* psample data per interface */
typedef struct {
struct list_head list;
struct net_device *dev;
uint16_t id;
uint8_t port;
uint16_t vlan;
uint16_t qnum;
uint32_t sample_rate;
uint32_t sample_size;
} psample_netif_t;
extern int
psample_netif_create_cb(struct net_device *dev);
extern int
psample_netif_destroy_cb(struct net_device *dev);
#endif /* __PSAMPLE_CB_H__ */