/* * netip_subsystem_pm.h * * GPL LICENSE SUMMARY * * Copyright(c) 2015-2016 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * 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 for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * The full GNU General Public License is included in this distribution * in the file called LICENSE.GPL. * * Contact Information: * Intel Corporation * 2200 Mission College Blvd. * Santa Clara, CA 97052 * */ #ifndef _NETIP_SUBSYSTEM_SYSFS_H #define _NETIP_SUBSYSTEM_SYSFS_H /** Attributes ID */ typedef enum { NETSS_SERVICE_LEVEL_ATTR, NETSS_SERVICE_STATE_ATTR, NETSS_SERVICE_AVAILABLE_ATTR, NETSS_NETIP_SOFT_OFF_ATTR, NETSS_ENABLE_DEBUG_ATTR, NETSS_SERVICE_READY_ATTR, NETSS_BOOT_HANDSHAKE_DONE_ATTR, NETSS_PORT_MAPPING_ATTR, } netss_attribute_id_t; /** Attributes structure */ typedef struct netss_sysfs_attributes_info { /** Vector representing the requested NetIP and its services power states. This is write-only from user space. */ uint32_t service_level; /** Vector representing the current NetIP and its services power states. This is updated after the service request reply is received.This is read-only from user space. */ uint32_t service_status; /** Vector that represents the ready NetIP services. This is updated during boot time, while handshake is done between cores. This is read-only from user space. */ uint32_t service_ready; /** This is used by power manager while handling the NETIP initiated rest and low battery events. It is used to gracefully turn OFF all the NETIP services. The NETIP subsystem will not be clock gated or suspended. This is read-write from user space. */ uint32_t netip_soft_off; /** Flag to indicate whether to enable or disable the debug prints */ bool enable_debug; /** Vector that represents all available NetIP services. This is updated by the services listed in NetIP properties message, the first message received while handshake is done between cores. This is read-only from user space. */ uint32_t service_available; /** Vector that represents how the four network interfaces are conne cted on the board. This is read-only from user space. */ uint32_t port_mapping; /** to synchronise between the thread that is writing to service_level and thread that is sending message. This lock may be needed only during boot time. */ struct mutex lock; } netss_sysfs_attributes_info_t; uint32_t netss_get_attribute(uint32_t attr_id, uint32_t service_id); int netss_set_attribute(uint32_t attr_id, uint32_t value, uint32_t service_id); #endif