OpenBIC
OpenSource Bridge-IC
kcs.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 KCS_H
18#define KCS_H
19
20#ifdef CONFIG_IPMI_KCS_ASPEED
21
22#include <stdbool.h>
23#include <stdint.h>
24#include <zephyr.h>
25
26#define KCS_POLL_STACK_SIZE 4096
27#define KCS_POLLING_INTERVAL 100
28#define KCS_BUFF_SIZE 256
29#define KCS_MAX_CHANNEL_NUM 0x0F
30
31#define CMD_SYS_INFO_FW_VERSION 0x01
32#define CMD_DIMM_LOCATION 0x01
33#define KCS_TASK_NAME_LEN 32
34
35typedef struct _kcs_dev {
36 const struct device *dev;
37 uint8_t index;
38 k_tid_t task_tid;
39 K_KERNEL_STACK_MEMBER(task_stack, KCS_POLL_STACK_SIZE);
40 uint8_t task_name[KCS_TASK_NAME_LEN];
41 struct k_thread task_thread;
42} kcs_dev;
43
44struct kcs_request {
45 uint8_t netfn;
46 uint8_t cmd;
47 uint8_t data[0];
48};
49
50struct kcs_response {
51 uint8_t netfn;
52 uint8_t cmd;
53 uint8_t cmplt_code;
54 uint8_t data[0];
55};
56
57void kcs_device_init(char **config, uint8_t size);
58void kcs_write(uint8_t index, uint8_t *buf, uint32_t buf_sz);
59bool get_kcs_ok();
60void reset_kcs_ok();
61
62#endif
63
64#endif
const struct device * dev
Definition: hal_peci.c:28
K_KERNEL_STACK_MEMBER(wdt_thread_stack, WDT_THREAD_STACK_SIZE)
uint8_t netfn
Definition: ipmb.h:1
uint8_t cmd
Definition: isl69259.c:1
uint8_t data[]
Definition: isl69259.c:2
uint16_t size
Definition: pldm_oem.h:0