1/* 2 ************************************************************************** 3 * Copyright (c) 2014, The Linux Foundation. All rights reserved. 4 * Permission to use, copy, modify, and/or distribute this software for 5 * any purpose with or without fee is hereby granted, provided that the 6 * above copyright notice and this permission notice appear in all copies. 7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 13 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 ************************************************************************** 15 */ 16 17 /** 18 * nss_data_plane 19 * Data plane used for communication between qca-nss-drv & qca-nss-gmac 20 */ 21 22#ifndef __NSS_DATA_PLANE_H 23#define __NSS_DATA_PLANE_H 24 25#include <nss_api_if.h> 26 27/* 28 * nss_data_plane_param 29 * Holds the information that is going to pass to gmac as a cookie 30 */ 31struct nss_data_plane_param { 32 int if_num; /* gmac interface number */ 33 struct net_device *dev; /* net_device instance of this gmac */ 34 struct nss_ctx_instance *nss_ctx; /* which nss core */ 35 int notify_open; /* This gmac interface has been opened or not */ 36 int enabled; /* This gmac is enabled or not */ 37 uint32_t features; /* skb types supported by this interface */ 38}; 39 40/* 41 * nss_data_plane_set_enabled 42 * Mark this data plane enabled, so when nss_init complete, we can call register_to_nss_gmac 43 */ 44void nss_data_plane_set_enabled(int if_num); 45 46/* 47 * nss_data_plane_register_to_nss_gmac() 48 * Called from nss_init, this keeps the data_plane_ops to be static 49 */ 50bool nss_data_plane_register_to_nss_gmac(struct nss_ctx_instance *nss_ctx, int if_num); 51 52/* 53 * nss_data_plane_unregister_from_nss_gmac() 54 * Called from nss_remove to ask gmac to restore to slowpath data plane 55 */ 56void nss_data_plane_unregister_from_nss_gmac(int if_num); 57#endif 58