提交 74009001 编写于 作者: W w00371129 提交者: public tcshversion

TicketNo:AR000E0MHS

Description: wpa_supplicant 2.9 and hostapd 2.9 adapt liteos code style fix.
Team:OTHERS
Feature or Bugfix:Feature
Binary Source:No
PrivateCode(Yes/No):Yes

Change-Id: Ib4158736f6a9c97763c30e89f99d3d1ff75c1920
Reviewed-on: http://mgit-tm.rnd.huawei.com/9114944Tested-by: Npublic jenkins <public_jenkins@notesmail.huawei.com>
Reviewed-by: Nmapeiwen 00421780 <mapeiwen2@huawei.com>
上级 50cb07dc
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved.
* Description: base data type
* Author: duxiaobo
* Create: 2020-4-27
*/
#ifndef __MESSAGE_CONFIG_H__
#define __MESSAGE_CONFIG_H__
......
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved.
* Description: base data type
* Author: duxiaobo
* Create: 2020-4-27
*/
#ifndef __MESSAGEDISPATCHER_H__
#define __MESSAGEDISPATCHER_H__
#include "stdint.h"
......
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved.
* Description: base data type
* Author: duxiaobo
* Create: 2020-4-27
*/
#ifndef __MESSAGE_ROUTER_H__
#define __MESSAGE_ROUTER_H__
#include "message_config.h"
......@@ -28,20 +35,20 @@ ErrorCode StartMessageRouter(uint8_t nodesConfig);
ErrorCode ShutdownMessageRouter(void);
ErrorCode RegistDispatcher(DispatcherID dispatcherID, MessageDispatcher* config);
ErrorCode RegistDispatcher(DispatcherID dispatcherID, MessageDispatcher *config);
ErrorCode RegistNewDispatcher(DispatcherID dispatcherID, DispatcherConfig* config);
ErrorCode RegistNewDispatcher(DispatcherID dispatcherID, DispatcherConfig *config);
/*
dispatcherID: 要绑定到的DispatcherID
mapper:服务的消息映射
*/
ErrorCode RegistService(DispatcherID dispatcherID, struct MassageMapper* mapper);
ErrorCode RegistService(DispatcherID dispatcherID, struct MassageMapper *mapper);
ErrorCode RegistRemoteService(DispatcherID dispatcherID, struct MassageMapper* mapper);
ErrorCode RegistRemoteService(DispatcherID dispatcherID, struct MassageMapper *mapper);
ErrorCode UnregistRemoteService(ServiceID serviceID);
ErrorCode RouteMessage(MessageContext* context);
ErrorCode RouteMessage(MessageContext *context);
/*
commandID : 消息的唯一标识
......@@ -63,26 +70,26 @@ ErrorCode SendOneWayMessage(ServiceID sender, ServiceID receiver, uint32_t comma
/*
调换发送方与接收方,发送响应消息。
*/
ErrorCode SendResponse(MessageContext* context);
ErrorCode SendResponse(MessageContext *context);
typedef struct MessageNode_ {
enum MessageNodeType type;
ErrorCode (*Init)(struct MessageNode_*);
ErrorCode (*Deinit)(struct MessageNode_*);
ErrorCode (*DispatchMessage)(struct MessageNode_*, DispatcherID dispatcherID, MessageContext* context);
void (*Destory)(struct MessageNode_*);
ErrorCode (*Init)(struct MessageNode_ *);
ErrorCode (*Deinit)(struct MessageNode_ *);
ErrorCode (*DispatchMessage)(struct MessageNode_ *, DispatcherID dispatcherID, MessageContext *context);
void (*Destory)(struct MessageNode_ *);
} MessageNode;
typedef struct LocalMessageNode_ {
MessageNode baseNodeOps;
MessageDispatcher* dispatchers[MESSAGE_ENGINE_MAX_DISPATCHER];
MessageDispatcher *dispatchers[MESSAGE_ENGINE_MAX_DISPATCHER];
} LocalMessageNode;
typedef struct RemoteMessageNode_ {
MessageNode baseNodeOps;
ErrorCode (*RegistRemoteService)(struct RemoteMessageNode_*, const struct MassageMapper* mapper);
ErrorCode (*UnregistRemoteService)(struct RemoteMessageNode_*, const ServiceID serviceID);
void* privateData;
ErrorCode (*RegistRemoteService)(struct RemoteMessageNode_ *, const struct MassageMapper *mapper);
ErrorCode (*UnregistRemoteService)(struct RemoteMessageNode_ *, const ServiceID serviceID);
void *privateData;
} RemoteMessageNode;
#define MESSAGE_DEVICE "/dev/wifi_msg"
......@@ -97,11 +104,11 @@ enum IOCTL_CMD {
};
#ifdef KERNEL_SERVER_SUPPORT
ErrorCode CreateKernelServerNode(MessageNode * *node);
ErrorCode CreateKernelServerNode(MessageNode **node);
#endif
#ifdef USERSPACE_CLIENT_SUPPORT
ErrorCode CreateUserspaceClientNode(MessageNode * *node);
ErrorCode CreateUserspaceClientNode(MessageNode **node);
#endif
#ifdef __cplusplus
......
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved.
* Description: base data type
* Author: duxiaobo
* Create: 2020-4-27
*/
#ifndef __MESSAGE_TYPES_H__
#define __MESSAGE_TYPES_H__
#include "stdint.h"
// TODO: change to HW security lib
#include "string.h"
typedef uint8_t ServiceID;
typedef int32_t ErrorCode;
......
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2019-2020. All rights reserved.
* Description: base data type
* Author: duxiaobo
* Create: 2020-4-27
*/
#ifndef __SIDECAR_H__
#define __SIDECAR_H__
#include "message_router.h"
......
......@@ -17,7 +17,6 @@
****************************************************************************/
#include "common.h"
//#include "src/utils/eloop.h"
#ifdef CONFIG_DRIVER_HISILICON
#include "drivers/driver_hisi_ioctl.h"
#endif /* CONFIG_DRIVER_HISILICON */
......@@ -31,7 +30,6 @@ struct l2_packet_data {
void *rx_callback_ctx;
int l2_hdr; /* whether to include layer 2 (Ethernet) header data
* buffers */
//void *eloop_event;
};
int l2_packet_get_own_addr(const struct l2_packet_data *l2, u8 *addr)
......@@ -40,7 +38,6 @@ int l2_packet_get_own_addr(const struct l2_packet_data *l2, u8 *addr)
if ((l2 == NULL) || (addr == NULL))
return -1;
if (memcpy_s(addr, sizeof(l2->own_addr), l2->own_addr, sizeof(l2->own_addr)) != EOK){
//if (memcpy(addr, l2->own_addr, sizeof(l2->own_addr)) != EOK){
return -1;
}
return 0;
......@@ -55,8 +52,6 @@ int l2_packet_send(const struct l2_packet_data *l2, const u8 *dst_addr, u16 prot
if (l2 == NULL)
return -1;
#ifdef CONFIG_DRIVER_HISILICON
printf("\r\n hisi_eapol_packet_send buf addr=%p, len=%d \r\n ", buf, len);
PrintBuffer(buf, len);
ret = hisi_eapol_packet_send(l2->ifname, l2->own_addr, dst_addr, (unsigned char *)buf, len);
#endif /* CONFIG_DRIVER_HISILICON */
......@@ -75,7 +70,6 @@ void l2_packet_receive(void *eloop_ctx, void *sock_ctx)
hisi_rx_eapol_stru st_rx_eapol;
unsigned char *puc_src;
//eloop_read_event(l2->eloop_event, 0);
/* Callback is called only once per multiple packets, drain all of them */
printf("\r\n hisi_eapol_packet_receive2 \r\n ");
while (HISI_SUCC == hisi_eapol_packet_receive(l2->ifname, &st_rx_eapol)) {
......@@ -102,7 +96,6 @@ static void l2_packet_eapol_callback(void *ctx, void *context)
struct l2_packet_data *l2 = (struct l2_packet_data *)context;
(void)ctx;
//eloop_post_event(l2->eloop_event, NULL, 1);
printf("l2_packet_eapol_callback");
l2_packet_receive(l2, NULL);
}
......@@ -134,15 +127,6 @@ struct l2_packet_data * l2_packet_init(
#ifdef CONFIG_DRIVER_HISILICON
(void)hisi_eapol_enable(l2->ifname, l2_packet_eapol_callback, l2);
#endif /* CONFIG_DRIVER_HISILICON */
// (void)eloop_register_event(&l2->eloop_event, sizeof(l2->eloop_event),
// l2_packet_receive, l2, NULL);
// if (l2->eloop_event == NULL) {
//#ifdef CONFIG_DRIVER_HISILICON
// (void)hisi_eapol_disable(l2->ifname);
//#endif /* CONFIG_DRIVER_HISILICON */
// os_free(l2);
// return NULL;
//}
#ifdef CONFIG_DRIVER_HISILICON
(void)hisi_ioctl_get_own_mac(l2->ifname, (char *)l2->own_addr);
#endif /* CONFIG_DRIVER_HISILICON */
......@@ -166,13 +150,9 @@ void l2_packet_deinit(struct l2_packet_data *l2)
if (l2 == NULL)
return;
//if (l2->eloop_event != NULL) {
// (void)eloop_unregister_event(l2->eloop_event, sizeof(l2->eloop_event));
#ifdef CONFIG_DRIVER_HISILICON
(void)hisi_eapol_disable(l2->ifname);
#endif /* CONFIG_DRIVER_HISILICON */
//}
os_free(l2);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册