xiaoxiang781216 commented on code in PR #20686: URL: https://github.com/apache/nuttx/pull/20686#discussion_r4283987582
########## include/nuttx/mm/net_buf.h: ########## @@ -0,0 +1,866 @@ +/**************************************************************************** + * include/nuttx/mm/net_buf.h + * + * Copyright (c) ByteDance Ltd. and/or its affiliates. + * + * Author: chao an <[email protected]> + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * include/nuttx/mm/net_buf.h + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_MM_NET_BUF_H +#define __INCLUDE_NUTTX_MM_NET_BUF_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <stddef.h> +#include <stdint.h> +#include <stdbool.h> +#include <nuttx/list.h> +#include <nuttx/spinlock.h> +#include <nuttx/semaphore.h> + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/* Alignment for buffer definitions */ + +#if CONFIG_NET_BUF_ALIGNMENT == 0 +# define __net_buf_align __attribute__((aligned(sizeof(void *)))) +#else +# define __net_buf_align \ + __attribute__((aligned(CONFIG_NET_BUF_ALIGNMENT))) +#endif + +/* Flag indicating external data ownership */ + +#define NET_BUF_EXTERNAL_DATA (1 << 0) + +/**************************************************************************** + * Public Type Definitions + ****************************************************************************/ + +/** + * Simple network buffer representation. + * + * This is a simpler variant of the net_buf object (in fact net_buf uses + * net_buf_simple internally). It doesn't provide any kind of reference + * counting, user data, dynamic allocation, or in general the ability to + * pass through kernel objects such as FIFOs. + */ + +struct net_buf_simple Review Comment: why not use iob? ########## net/Kconfig: ########## @@ -438,6 +390,7 @@ source "net/netlink/Kconfig" source "net/tcp/Kconfig" source "net/udp/Kconfig" source "net/bluetooth/Kconfig" +source "net/bt/Kconfig" Review Comment: but what's relationship with the original bluetooth stack? it isn't good to contain two Bluetooth stacks with the incompatible public API in the kernel space. ########## boards/sim/sim/sim/configs/bt/defconfig: ########## @@ -0,0 +1,158 @@ +############################################################################ +# boards/sim/sim/sim/configs/bt/defconfig +# +# Copyright (c) ByteDance Ltd. and/or its affiliates. Review Comment: remove ALL company copyright -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
