已合并
fix spell err #151
ad_cx创建于 14 天前
fix spell err #151
已合并
ad_cx创建于 14 天前
共 5 个文件变更+113-114
@@ -19,15 +19,15 @@ enum class IdeDaemonPackageType {
19 IDE_DAEMON_BIG_PACKAGE19 IDE_DAEMON_BIG_PACKAGE
20};20};
21 21 
22-enum class IdeLastPacket:int8_t {22+enum class IdeLastPacket : int8_t {
23 IDE_NOT_LAST_PACK = 0,23 IDE_NOT_LAST_PACK = 0,
24 IDE_LAST_PACK = 124 IDE_LAST_PACK = 1
25};25};
26 26 
27struct IdeHdcPacket {27struct IdeHdcPacket {
28 uint32_t len;28 uint32_t len;
29- IdeDaemonPackageType type; // package type : big package,little package29+ IdeDaemonPackageType type; // package type : big package,little package
30- IdeLastPacket isLast; // only 0:is not last package; 1:last package30+ IdeLastPacket isLast; // only 0:is not last package; 1:last package
31 char value[0];31 char value[0];
32};32};
33 33 
@@ -67,7 +67,7 @@ int32_t HdcRead(HDC_SESSION session, IdeRecvBuffT recvBuf, IdeI32Pt recvLen);
67int32_t HdcReadNb(HDC_SESSION session, IdeRecvBuffT recvBuf, IdeI32Pt recvLen);67int32_t HdcReadNb(HDC_SESSION session, IdeRecvBuffT recvBuf, IdeI32Pt recvLen);
68 68 
69/**69/**
70- * @brief Receives data based on HDC sessions in timout mode.70+ * @brief Receives data based on HDC sessions in timeout mode.
71 * @param [in] session : specifies session in used71 * @param [in] session : specifies session in used
72 * @param [in] timeout : max wait time72 * @param [in] timeout : max wait time
73 * @param [out] recvBuf : buffer for receiving data73 * @param [out] recvBuf : buffer for receiving data
@@ -111,8 +111,7 @@ int32_t HdcWriteNb(HDC_SESSION session, IdeSendBuffT buf, int32_t len);
111 * IDE_DAEMON_OK: connect succ111 * IDE_DAEMON_OK: connect succ
112 * IDE_DAEMON_ERROR: connect failed112 * IDE_DAEMON_ERROR: connect failed
113 */113 */
114-int32_t HdcSessionConnect(int32_t peerNode, int32_t peerDevId,114+int32_t HdcSessionConnect(int32_t peerNode, int32_t peerDevId, HDC_CLIENT client, HDC_SESSION *session);
115- HDC_CLIENT client, HDC_SESSION *session);
116 115 
117/**116/**
118 * @brief connect remote hal hdc server117 * @brief connect remote hal hdc server
@@ -125,8 +124,8 @@ int32_t HdcSessionConnect(int32_t peerNode, int32_t peerDevId,
125 * IDE_DAEMON_OK: connect success124 * IDE_DAEMON_OK: connect success
126 * IDE_DAEMON_ERROR: connect failed125 * IDE_DAEMON_ERROR: connect failed
127 */126 */
128-int32_t HalHdcSessionConnect(int32_t peerNode, int32_t peerDevId,127+int32_t HalHdcSessionConnect(int32_t peerNode, int32_t peerDevId, int32_t hostPid, HDC_CLIENT client,
129- int32_t hostPid, HDC_CLIENT client, HDC_SESSION *session);128+ HDC_SESSION *session);
130 129 
131/**130/**
132 * @brief Destroy an HDC session (Client).131 * @brief Destroy an HDC session (Client).
@@ -161,6 +160,6 @@ int32_t IdeGetPidBySession(HDC_SESSION session, IdeI32Pt pid);
161int32_t IdeGetAttrBySession(HDC_SESSION session, int32_t attr, IdeI32Pt value);160int32_t IdeGetAttrBySession(HDC_SESSION session, int32_t attr, IdeI32Pt value);
162int32_t HdcSessionWrite(HDC_SESSION session, IdeSendBuffT buf, int32_t len, int32_t flag);161int32_t HdcSessionWrite(HDC_SESSION session, IdeSendBuffT buf, int32_t len, int32_t flag);
163int32_t HdcStorePackage(const IdeHdcPacket &packet, struct IoVec &ioVec);162int32_t HdcStorePackage(const IdeHdcPacket &packet, struct IoVec &ioVec);
164-}163+} // namespace Adx
165 164 
166#endif165#endif
@@ -20,7 +20,7 @@
20#define QUE_EVENT_TIMEOUT_MS 5000000 /* always wait */20#define QUE_EVENT_TIMEOUT_MS 5000000 /* always wait */
21#define QUE_EVENT_MAX_WAIT_10S 10000000 /* always wait */21#define QUE_EVENT_MAX_WAIT_10S 10000000 /* always wait */
22#else22#else
23-#define QUE_EVENT_TIMEOUT_MS 5000 /* Defualt event timeout */23+#define QUE_EVENT_TIMEOUT_MS 5000 /* Default event timeout */
24#define QUE_EVENT_MAX_WAIT_10S 10000 /* 10s */24#define QUE_EVENT_MAX_WAIT_10S 10000 /* 10s */
25#endif25#endif
26#define QUE_SEND_NORMAL 026#define QUE_SEND_NORMAL 0
@@ -19,25 +19,25 @@ extern "C" {
19#endif19#endif
20#endif /* __cplusplus */20#endif /* __cplusplus */
21 21 
22-#define DEV_DAVINCI_NOT_EXIST 0x6802200122+#define DEV_DAVINCI_NOT_EXIST 0x68022001
23-#define HOST_HDC_NOT_EXIST 0x6802200223+#define HOST_HDC_NOT_EXIST 0x68022002
24-#define HOST_MANAGER_NOT_EXIST 0x6802200324+#define HOST_MANAGER_NOT_EXIST 0x68022003
25-#define HOST_SVM_NOT_EXIST 0x6802200425+#define HOST_SVM_NOT_EXIST 0x68022004
26-#define BOARD_TYPE_RC 126+#define BOARD_TYPE_RC 1
27-#define DSMI_HEALTH_ERROR_LEVEL 327+#define DSMI_HEALTH_ERROR_LEVEL 3
28-#define DEV_PATH_MAX 12828+#define DEV_PATH_MAX 128
29-#define EP_MODE "0xd100"29+#define EP_MODE "0xd100"
30#define DSMI_MAIN_CMD_EX_COMPUTING 0x800030#define DSMI_MAIN_CMD_EX_COMPUTING 0x8000
31#define DSMI_MAIN_CMD_EX_CONTAINER 0x800131#define DSMI_MAIN_CMD_EX_CONTAINER 0x8001
32-#define DSMI_MAIN_CMD_GPIO 0x800232+#define DSMI_MAIN_CMD_GPIO 0x8002
33-#define DSMI_MAIN_CMD_EX_CERT 0x800333+#define DSMI_MAIN_CMD_EX_CERT 0x8003
34-#define VDEV_VM_CONFIG_ITEM 0x800434+#define VDEV_VM_CONFIG_ITEM 0x8004
35#define DSMI_MAIN_CMD_EN_DECRYPTION 0x800535#define DSMI_MAIN_CMD_EN_DECRYPTION 0x8005
36-#define DSMI_MAIN_CMD_PCIE_BANDWIDTH 0x800636+#define DSMI_MAIN_CMD_PCIE_BANDWIDTH 0x8006
37-#define DSMI_MAIN_CMD_HCCS_BANDWIDTH 0X800737+#define DSMI_MAIN_CMD_HCCS_BANDWIDTH 0X8007
38-#define DSMI_MAIN_CMD_HCCS_LINKERR 0X800838+#define DSMI_MAIN_CMD_HCCS_LINKERR 0X8008
39-#define DSMI_MAIN_CMD_PCIE_LINKERR 0X800939+#define DSMI_MAIN_CMD_PCIE_LINKERR 0X8009
40-#define DSMI_MAIN_CMD_URMA_INFO 0x801040+#define DSMI_MAIN_CMD_URMA_INFO 0x8010
41 41 
42typedef enum {42typedef enum {
43 DSMI_CERT_SUB_CMD_INIT_TLS_PUB_KEY = 0,43 DSMI_CERT_SUB_CMD_INIT_TLS_PUB_KEY = 0,
@@ -55,7 +55,7 @@ typedef struct _certs_chain_data {
55} CERTS_CHAIN_DATA;55} CERTS_CHAIN_DATA;
56 56 
57#define CERT_COMMON_NAME_LEN 6457#define CERT_COMMON_NAME_LEN 64
58-#define CERT_ITEM_NAME_LEN 1658+#define CERT_ITEM_NAME_LEN 16
59#define CERT_TIME_LEN 3259#define CERT_TIME_LEN 32
60typedef struct _cert_info {60typedef struct _cert_info {
61 unsigned int alarm_stat;61 unsigned int alarm_stat;
@@ -148,38 +148,38 @@ typedef struct dsmi_chip_pcie_err_rate_stru {
148 unsigned int dl_dcrc_err_num;148 unsigned int dl_dcrc_err_num;
149} PCIE_ERR_RATE_INFO_STU;149} PCIE_ERR_RATE_INFO_STU;
150 150 
151-DLLEXPORT int dsmi_get_pcie_bdf(int device_id,struct tag_pcie_bdfinfo *pcie_idinfo);151+DLLEXPORT int dsmi_get_pcie_bdf(int device_id, struct tag_pcie_bdfinfo *pcie_idinfo);
152 152 
153/**153/**
154-* @ingroup driver154+ * @ingroup driver
155-* @brief Get the pcie err rate of ascend AI processor Hisilicon SOC155+ * @brief Get the pcie err rate of ascend AI processor Hisilicon SOC
156-* @attention NULL156+ * @attention NULL
157-* @param [in] device_id The device id157+ * @param [in] device_id The device id
158-* @param [out] pcie_err_code_info Get the pcie err rate of ascend AI processor Hisilicon SOC158+ * @param [out] pcie_err_code_info Get the pcie err rate of ascend AI processor Hisilicon SOC
159-* @return 0 for success, others for fail159+ * @return 0 for success, others for fail
160-*/160+ */
161 161 
162DLLEXPORT int dsmi_get_pcie_error_rate(int device_id, struct dsmi_chip_pcie_err_rate_stru *pcie_err_code_info);162DLLEXPORT int dsmi_get_pcie_error_rate(int device_id, struct dsmi_chip_pcie_err_rate_stru *pcie_err_code_info);
163 163 
164/**164/**
165-* @ingroup driver165+ * @ingroup driver
166-* @brief clear the pcie err rate of ascend AI processor Hisilicon SOC166+ * @brief clear the pcie err rate of ascend AI processor Hisilicon SOC
167-* @attention NULL167+ * @attention NULL
168-* @param [in] device_id The device id168+ * @param [in] device_id The device id
169-* @return 0 for success, others for fail169+ * @return 0 for success, others for fail
170-*/170+ */
171DLLEXPORT int dsmi_clear_pcie_error_rate(int device_id);171DLLEXPORT int dsmi_clear_pcie_error_rate(int device_id);
172 172 
173-#define ALM_NAME_LEN 16173+#define ALM_NAME_LEN 16
174-#define ALM_EXTRA_LEN 32174+#define ALM_EXTRA_LEN 32
175-#define ALM_REASON_LEN 32175+#define ALM_REASON_LEN 32
176-#define ALM_REPAIR_LEN 32176+#define ALM_REPAIR_LEN 32
177 177 
178struct dsmi_alarm_info_stru {178struct dsmi_alarm_info_stru {
179 unsigned int id;179 unsigned int id;
180 unsigned int level;180 unsigned int level;
181- unsigned int clr_type; /* 0: automatical clear, 1:manaul clear */181+ unsigned int clr_type; /* 0: automatically clear, 1:manual clear */
182- unsigned int moi; /* blackbox code */182+ unsigned int moi; /* blackbox code */
183 unsigned char name[ALM_NAME_LEN];183 unsigned char name[ALM_NAME_LEN];
184 unsigned char extra_info[ALM_EXTRA_LEN];184 unsigned char extra_info[ALM_EXTRA_LEN];
185 unsigned char reason_info[ALM_REASON_LEN];185 unsigned char reason_info[ALM_REASON_LEN];
@@ -187,17 +187,17 @@ struct dsmi_alarm_info_stru {
187};187};
188 188 
189/**189/**
190-* @ingroup driver190+ * @ingroup driver
191-* @brief Get the detailed device alarm info191+ * @brief Get the detailed device alarm info
192-* @attention NULL192+ * @attention NULL
193-* @param [in] device_id The device id193+ * @param [in] device_id The device id
194-* @param [out] alarmcount The number of alarms on the device194+ * @param [out] alarmcount The number of alarms on the device
195-* @param [out] dsmi_alarm_info_stru The detailed alarm info195+ * @param [out] dsmi_alarm_info_stru The detailed alarm info
196-* @return 0 for success, others for fail196+ * @return 0 for success, others for fail
197-*/197+ */
198DLLEXPORT int dsmi_get_device_alarminfo(int device_id, int *alarmcount, struct dsmi_alarm_info_stru *palarminfo);198DLLEXPORT int dsmi_get_device_alarminfo(int device_id, int *alarmcount, struct dsmi_alarm_info_stru *palarminfo);
199 199 
200-#define COMPUTING_POWER_INFO_RESERVE_NUM 3200+#define COMPUTING_POWER_INFO_RESERVE_NUM 3
201 201 
202struct dsmi_computing_power_info {202struct dsmi_computing_power_info {
203 unsigned int data1;203 unsigned int data1;
@@ -205,55 +205,55 @@ struct dsmi_computing_power_info {
205};205};
206 206 
207/**207/**
208-* @ingroup driver208+ * @ingroup driver
209-* @brief Get the DIE ID of the specified device209+ * @brief Get the DIE ID of the specified device
210-* @attention NULL210+ * @attention NULL
211-* @param [in] device_id The device id211+ * @param [in] device_id The device id
212-* @param [out] schedule return n die id infomation212+ * @param [out] schedule return n die id infomation
213-* @return 0 for success, others for fail213+ * @return 0 for success, others for fail
214-* @note Support:Ascend910, Ascend910B214+ * @note Support:Ascend910, Ascend910B
215-*/215+ */
216DLLEXPORT int dsmi_get_device_ndie(int device_id, struct dsmi_soc_die_stru *pdevice_die);216DLLEXPORT int dsmi_get_device_ndie(int device_id, struct dsmi_soc_die_stru *pdevice_die);
217 217 
218/**218/**
219-* @ingroup driver219+ * @ingroup driver
220-* @brief Get the aicore number of the device220+ * @brief Get the aicore number of the device
221-* @attention NULL221+ * @attention NULL
222-* @param [in] device_id The device id222+ * @param [in] device_id The device id
223-* @param [out] aicorenum The number of aicore223+ * @param [out] aicorenum The number of aicore
224-* @return 0 for success, others for fail224+ * @return 0 for success, others for fail
225-* @note Support:Ascend910, Ascend910B225+ * @note Support:Ascend910, Ascend910B
226-*/226+ */
227DLLEXPORT int dsmi_get_computing_power_info(int device_id, int computing_power_type,227DLLEXPORT int dsmi_get_computing_power_info(int device_id, int computing_power_type,
228- struct dsmi_computing_power_info *computing_power_info);228+ struct dsmi_computing_power_info *computing_power_info);
229 229 
230/**230/**
231-* @ingroup driver231+ * @ingroup driver
232-* @brief Query the overall health status of the driver232+ * @brief Query the overall health status of the driver
233-* @attention NULL233+ * @attention NULL
234-* @param [out] phealth234+ * @param [out] phealth
235-* @return 0 for success, others for fail235+ * @return 0 for success, others for fail
236-*/236+ */
237DLLEXPORT int dsmi_get_driver_health(unsigned int *phealth);237DLLEXPORT int dsmi_get_driver_health(unsigned int *phealth);
238 238 
239/**239/**
240-* @ingroup driver240+ * @ingroup driver
241-* @brief Query driver fault code241+ * @brief Query driver fault code
242-* @attention NULL242+ * @attention NULL
243-* @param [in] device_id The device id243+ * @param [in] device_id The device id
244-* @param [out] errorcount Number of error codes244+ * @param [out] errorcount Number of error codes
245-* @param [out] perrorcode error codes245+ * @param [out] perrorcode error codes
246-* @return 0 for success, others for fail246+ * @return 0 for success, others for fail
247-*/247+ */
248DLLEXPORT int dsmi_get_driver_errorcode(int *errorcount, unsigned int *perrorcode);248DLLEXPORT int dsmi_get_driver_errorcode(int *errorcount, unsigned int *perrorcode);
249 249 
250/**250/**
251-* @ingroup driver251+ * @ingroup driver
252-* @pcie hot reset252+ * @pcie hot reset
253-* @attention NULL253+ * @attention NULL
254-* @param [in] device_id The device id254+ * @param [in] device_id The device id
255-* @return 0 for success, others for fail255+ * @return 0 for success, others for fail
256-*/256+ */
257DLLEXPORT int dsmi_pcie_hot_reset(int device_id);257DLLEXPORT int dsmi_pcie_hot_reset(int device_id);
258 258 
259#define MAX_RECORD_ECC_ADDR_COUNT 64259#define MAX_RECORD_ECC_ADDR_COUNT 64
@@ -268,14 +268,14 @@ struct dsmi_multi_ecc_time_data {
268DLLEXPORT int dsmi_get_multi_ecc_time_info(int device_id, struct dsmi_multi_ecc_time_data *multi_ecc_time_data);268DLLEXPORT int dsmi_get_multi_ecc_time_info(int device_id, struct dsmi_multi_ecc_time_data *multi_ecc_time_data);
269 269 
270/**270/**
271-* @ingroup driver271+ * @ingroup driver
272-* @brief Query hbm ecc record info272+ * @brief Query hbm ecc record info
273-* @attention NULL273+ * @attention NULL
274-* @param [in]274+ * @param [in]
275-* @param [out] record info ecc_common_data_s275+ * @param [out] record info ecc_common_data_s
276-* @return 0 for success, others for fail276+ * @return 0 for success, others for fail
277-* @note Support:Ascend910B277+ * @note Support:Ascend910B
278-*/278+ */
279 279 
280struct dsmi_ecc_common_data {280struct dsmi_ecc_common_data {
281 unsigned long long physical_addr;281 unsigned long long physical_addr;
@@ -289,7 +289,7 @@ struct dsmi_ecc_common_data {
289#pragma pack()289#pragma pack()
290 290 
291DLLEXPORT int dsmi_get_multi_ecc_record_info(int device_id, unsigned int *ecc_count, unsigned char read_type,291DLLEXPORT int dsmi_get_multi_ecc_record_info(int device_id, unsigned int *ecc_count, unsigned char read_type,
292- unsigned char module_type, struct dsmi_ecc_common_data *ecc_common_data_s);292+ unsigned char module_type, struct dsmi_ecc_common_data *ecc_common_data_s);
293 293 
294/**294/**
295 * @ingroup driver295 * @ingroup driver
@@ -306,17 +306,17 @@ DLLEXPORT int dsmi_get_multi_ecc_record_info(int device_id, unsigned int *ecc_co
306typedef void (*fault_event_callback)(struct dsmi_event *event);306typedef void (*fault_event_callback)(struct dsmi_event *event);
307 307 
308DLLEXPORT int dsmi_product_get_device_info(unsigned int device_id, DSMI_MAIN_CMD main_cmd, unsigned int sub_cmd,308DLLEXPORT int dsmi_product_get_device_info(unsigned int device_id, DSMI_MAIN_CMD main_cmd, unsigned int sub_cmd,
309- void *buf, unsigned int *size);309+ void *buf, unsigned int *size);
310 310 
311/**311/**
312-* @ingroup driver312+ * @ingroup driver
313-* @brief Get mcu board id 313+ * @brief Get mcu board id
314-* @attention NULL314+ * @attention NULL
315-* @param [in] device_id The device id315+ * @param [in] device_id The device id
316-* @param [out] mcu_board_id mcu board id316+ * @param [out] mcu_board_id mcu board id
317-* @return 0 for success, others for fail317+ * @return 0 for success, others for fail
318-*/318+ */
319-DLLEXPORT int dsmi_product_get_mcu_board_id (unsigned int device_id, unsigned int *mcu_board_id);319+DLLEXPORT int dsmi_product_get_mcu_board_id(unsigned int device_id, unsigned int *mcu_board_id);
320 320 
321#ifdef __cplusplus321#ifdef __cplusplus
322#if __cplusplus322#if __cplusplus
@@ -324,4 +324,4 @@ DLLEXPORT int dsmi_product_get_mcu_board_id (unsigned int device_id, unsigned in
324#endif324#endif
325#endif /* __cplusplus */325#endif /* __cplusplus */
326 326 
327-#endif /* DSMI_COMMON_INTERFACE_CUSTOM_H */327+#endif /* DSMI_COMMON_INTERFACE_CUSTOM_H */
@@ -32,7 +32,7 @@ typedef enum tag_ts_task_type {
32 TS_TASK_TYPE_MEMCPY = 5, /**< memory copy task */32 TS_TASK_TYPE_MEMCPY = 5, /**< memory copy task */
33 TS_TASK_TYPE_MAINTENANCE = 6, /**< such as destroy the event or stream */33 TS_TASK_TYPE_MAINTENANCE = 6, /**< such as destroy the event or stream */
34 TS_TASK_TYPE_CREATE_STREAM = 7, /**< create stream task */34 TS_TASK_TYPE_CREATE_STREAM = 7, /**< create stream task */
35- TS_TASK_TYPE_DATA_DUMP = 8, /**< kernal data dump configure */35+ TS_TASK_TYPE_DATA_DUMP = 8, /**< kernel data dump configure */
36 TS_TASK_TYPE_REMOTE_EVENT_WAIT = 9, /* * wait for event on another device */36 TS_TASK_TYPE_REMOTE_EVENT_WAIT = 9, /* * wait for event on another device */
37 TS_TASK_TYPE_PCTRACE_ENABLE = 10,37 TS_TASK_TYPE_PCTRACE_ENABLE = 10,
38 TS_TASK_TYPE_CREATE_L2_ADDR = 11, /**< create L2 addr info for aicpu kernel */38 TS_TASK_TYPE_CREATE_L2_ADDR = 11, /**< create L2 addr info for aicpu kernel */
@@ -406,7 +406,7 @@ bool hw_dvt_hypervisor_is_valid_gfn(void *__vdavinci, unsigned long gfn);
406/**406/**
407 * hw_dvt_hypervisor_mmio_get - get the mmio address and size of specified bar407 * hw_dvt_hypervisor_mmio_get - get the mmio address and size of specified bar
408 * @dst: return the mmio address to host driver408 * @dst: return the mmio address to host driver
409- * @size: retrun the mmio size to host driver409+ * @size: return the mmio size to host driver
410 * @vdavinci: a vdavinci410 * @vdavinci: a vdavinci
411 * @bar: specify the bar[2/4]411 * @bar: specify the bar[2/4]
412 *412 *