WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
oal_netbuf_data.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved.
3 * Description: The Header File For oal_netbuf_data.c
4 * Create: 2022-04-14
5 */
6
7#ifndef __OAL_NETBUF_DATA_H__
8#define __OAL_NETBUF_DATA_H__
9#include "oal_netbuf_ext.h"
10#include "dmac_ext_if_device.h"
11
12#ifdef __cplusplus
13#if __cplusplus
14extern "C" {
15#endif
16#endif
17
18static INLINE__ osal_u8 *oal_netbuf_tx_data(const oal_netbuf_stru *netbuf)
19{
20 mac_tx_ctl_stru *tx_ctl = (mac_tx_ctl_stru *)oal_netbuf_cb_const(netbuf);
21 return oal_netbuf_header(netbuf) + tx_ctl->frame_header_length;
22}
23
24static INLINE__ const osal_u8 *oal_netbuf_tx_data_const(const oal_netbuf_stru *netbuf)
25{
26 mac_tx_ctl_stru *tx_ctl = (mac_tx_ctl_stru *)oal_netbuf_cb_const(netbuf);
27 return oal_netbuf_header(netbuf) + tx_ctl->frame_header_length;
28}
29
30static INLINE__ osal_u8 *oal_netbuf_rx_data(const oal_netbuf_stru *netbuf)
31{
32 mac_rx_ctl_stru *rx_ctl = (mac_rx_ctl_stru *)oal_netbuf_cb_const(netbuf);
33 return oal_netbuf_header(netbuf) + rx_ctl->mac_header_len;
34}
35
36static INLINE__ const osal_u8 *oal_netbuf_rx_data_const(const oal_netbuf_stru *netbuf)
37{
38 mac_rx_ctl_stru *rx_ctl = (mac_rx_ctl_stru *)oal_netbuf_cb_const(netbuf);
39 return oal_netbuf_header_const(netbuf) + rx_ctl->mac_header_len;
40}
41
42static INLINE__ osal_u16 oal_netbuf_rx_frame_len(oal_netbuf_stru *netbuf)
43{
44 mac_rx_ctl_stru *rx_ctl = (mac_rx_ctl_stru *)oal_netbuf_cb(netbuf);
45 return rx_ctl->frame_len;
46}
47
48static INLINE__ osal_u16 oal_netbuf_rx_header_len(oal_netbuf_stru *netbuf)
49{
50 mac_rx_ctl_stru *rx_ctl = (mac_rx_ctl_stru *)oal_netbuf_cb(netbuf);
51 return rx_ctl->mac_header_len;
52}
53
54#ifdef __cplusplus
55#if __cplusplus
56}
57#endif
58#endif
59#endif
#define INLINE__
Definition osal_list.h:25
unsigned char osal_u8
Definition osal_types.h:11
unsigned short osal_u16
Definition osal_types.h:12
Definition hal_common_ops_device_rom.h:978
osal_u16 frame_len
Definition hal_common_ops_device_rom.h:998
osal_u8 mac_header_len
Definition hal_common_ops_device_rom.h:994
Definition dmac_ext_if_device_rom.h:98
osal_u8 frame_header_length
Definition dmac_ext_if_device_rom.h:108
Definition oal_skbuff.h:82