OpenBIC
OpenSource Bridge-IC
pldm_sensor.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLDM_SENSOR_H
18#define PLDM_SENSOR_H
19
20#include <stdlib.h>
21#include "sensor.h"
22#include "pdr.h"
23
24#define PLDM_SENSOR_POLL_STACK_SIZE 3056
25
26#define PLDM_SENSOR_POLL_TIME_DEFAULT_MS 1000
27
28enum {
35};
36
37typedef struct pldm_sensor_info {
39 uint32_t update_time;
42
43typedef struct pldm_sensor_thread {
47
50void pldm_sensor_polling_handler(void *arug0, void *arug1, void *arug2);
51void pldm_sensor_get_reading(sensor_cfg *pldm_sensor_cfg, uint32_t *update_time,
52 int pldm_sensor_count, int thread_id, int sensor_num);
57 int thread_id, int sensor_pdr_index, uint16_t *sensor_id, real32_t *resolution,
58 real32_t *offset, int8_t *unit_modifier, real32_t *poll_time, uint32_t *update_time,
59 uint8_t *type, int *cache, uint8_t *cache_status, char *check_access);
62int plat_pldm_sensor_get_sensor_count(int thread_id);
64int pldm_polling_sensor_reading(pldm_sensor_info *pldm_snr_list, int pldm_sensor_count,
65 int thread_id, int sensor_num);
66
67#endif
float real32_t
Definition: pdr.h:13
PDR_numeric_sensor
Definition: pdr.h:111
uint8_t type
Definition: pldm_base.h:0
uint32_t offset
Definition: pldm_firmware_update.h:0
uint8_t sensor_operational_state
Definition: pldm_monitor.h:2
uint8_t reading[1]
Definition: pldm_monitor.h:3
uint16_t sensor_id
Definition: pldm_monitor.h:0
uint8_t update_time[TIMESTAMP104_SIZE]
Definition: pldm_monitor.h:2
struct pldm_sensor_info pldm_sensor_info
pldm_sensor_info * plat_pldm_sensor_load(int thread_id)
Definition: plat_pldm_sensor.c:9053
int pldm_sensor_get_info_via_sensor_thread_and_sensor_pdr_index(int thread_id, int sensor_pdr_index, uint16_t *sensor_id, real32_t *resolution, real32_t *offset, int8_t *unit_modifier, real32_t *poll_time, uint32_t *update_time, uint8_t *type, int *cache, uint8_t *cache_status, char *check_access)
void pldm_sensor_monitor_init()
uint8_t pldm_sensor_get_reading_from_cache(uint16_t sensor_id, int *reading, uint8_t *sensor_operational_state)
int plat_pldm_sensor_get_sensor_count(int thread_id)
Definition: plat_pldm_sensor.c:9074
void pldm_sensor_get_reading(sensor_cfg *pldm_sensor_cfg, uint32_t *update_time, int pldm_sensor_count, int thread_id, int sensor_num)
int pldm_polling_sensor_reading(pldm_sensor_info *pldm_snr_list, int pldm_sensor_count, int thread_id, int sensor_num)
@ UP_THRESHOLD_CRIT
Definition: pldm_sensor.h:30
@ UP_THRESHOLD_WARN
Definition: pldm_sensor.h:29
@ LOW_THRESHOLD_WARN
Definition: pldm_sensor.h:32
@ LOW_THRESHOLD_FATAL
Definition: pldm_sensor.h:34
@ UP_THRESHOLD_FATAL
Definition: pldm_sensor.h:31
@ LOW_THRESHOLD_CRIT
Definition: pldm_sensor.h:33
struct pldm_sensor_thread pldm_sensor_thread
void pldm_sensor_poll_thread_init()
pldm_sensor_thread * plat_pldm_sensor_load_thread()
Definition: plat_pldm_sensor.c:9048
void pldm_sensor_polling_handler(void *arug0, void *arug1, void *arug2)
bool pldm_sensor_is_interval_ready(pldm_sensor_info *pldm_sensor_list)
int pldm_sensor_polling_pre_check(pldm_sensor_info *pldm_snr_list, int sensor_num)
uint8_t sensor_num
Definition: storage_handler.h:6
Definition: sensor.h:255
Definition: pldm_sensor.h:37
PDR_numeric_sensor pdr_numeric_sensor
Definition: pldm_sensor.h:38
sensor_cfg pldm_sensor_cfg
Definition: pldm_sensor.h:40
uint32_t update_time
Definition: pldm_sensor.h:39
Definition: pldm_sensor.h:43
char * thread_name
Definition: pldm_sensor.h:45
int thread_id
Definition: pldm_sensor.h:44