ONLP
Open Network Linux Platform APIs
ledi.h
Go to the documentation of this file.
1 /************************************************************
2  * <bsn.cl fy=2014 v=onl>
3  *
4  * Copyright 2014, 2015 Big Switch Networks, Inc.
5  *
6  * Licensed under the Eclipse Public License, Version 1.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.eclipse.org/legal/epl-v10.html
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific
16  * language governing permissions and limitations under the
17  * License.
18  *
19  * </bsn.cl>
20  ********************************************************/
28 #ifndef __ONLP_LEDI_H__
29 #define __ONLP_LEDI_H__
30 
31 #include <onlp/led.h>
32 
36 int onlp_ledi_sw_init(void);
37 
42 int onlp_ledi_hw_init(uint32_t flags);
43 
50 int onlp_ledi_sw_denit(void);
51 
57 
64 
71 
77 int onlp_ledi_caps_get(onlp_oid_id_t id, uint32_t* rv);
78 
86 
93 int onlp_ledi_char_set(onlp_oid_id_t id, char c);
94 
96 #define ONLP_LED_INFO_ENTRY_INIT(_id, _desc, _parent, _caps) \
97  { \
98  { \
99  .id = ONLP_LED_ID_CREATE(_id), \
100  .description = _desc, \
101  .poid = ONLP_OID_CHASSIS, \
102  .status = ONLP_OID_STATUS_FLAG_PRESENT, \
103  }, \
104  .caps = _caps, \
105  }
106 
108 #define ONLP_CHASSIS_LED_INFO_ENTRY_INIT(_id, _desc, _caps) \
109  ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_OID_CHASSIS, _caps)
110 
112 #define ONLP_PSU_LED_INFO_ENTRY_INIT(_id, _desc, _psu_id, _caps) \
113  ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_PSU_ID_CREATE(_psu_id), _caps)
114 
116 #define ONLP_FAN_LED_INFO_ENTRY_INIT(_id, _desc, _fan_id, _caps) \
117  ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_FAN_ID_CREATE(_fan_id), _caps)
118 
119 #endif /* __ONLP_LED_H__ */
120 /* @} */
int onlp_ledi_info_get(onlp_oid_id_t id, onlp_led_info_t *rv)
Get the information for the given LED.
int onlp_ledi_char_set(onlp_oid_id_t id, char c)
Set the LED character.
int onlp_ledi_id_validate(onlp_oid_id_t id)
Validate an LED id.
uint32_t onlp_oid_id_t
Definition: oids.h:55
int onlp_ledi_sw_init(void)
Software initialization of the LED module.
int onlp_ledi_caps_get(onlp_oid_id_t id, uint32_t *rv)
Get the caps for the given LED.
enum onlp_led_mode_e onlp_led_mode_t
int onlp_ledi_hw_init(uint32_t flags)
Hardware initialization of the LED module.
int onlp_ledi_mode_set(onlp_oid_id_t id, onlp_led_mode_t mode)
Set the LED mode.
int onlp_ledi_sw_denit(void)
Deinitialize the led software module.
LED Management.
Definition: led.h:83
Definition: oids.h:296
int onlp_ledi_hdr_get(onlp_oid_id_t id, onlp_oid_hdr_t *rv)
Get the LED header.