From 5ec4296553467ba2b3db36d9a12d787ebf49b55a Mon Sep 17 00:00:00 2001 From: liangchaozhong Date: Fri, 9 Sep 2022 20:58:51 +0800 Subject: [PATCH] move usrsock_dev.c to driver folder Signed-off-by: liangchaozhong --- drivers/Kconfig | 1 + drivers/Makefile | 1 + drivers/usrsock/Kconfig | 28 +++++++++++++++++++++ drivers/usrsock/Make.defs | 34 ++++++++++++++++++++++++++ {net => drivers}/usrsock/usrsock_dev.c | 0 net/usrsock/Make.defs | 2 +- 6 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 drivers/usrsock/Kconfig create mode 100644 drivers/usrsock/Make.defs rename {net => drivers}/usrsock/usrsock_dev.c (100%) diff --git a/drivers/Kconfig b/drivers/Kconfig index 7bf009d10d..9281637274 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -51,3 +51,4 @@ source "drivers/rc/Kconfig" source "drivers/motor/Kconfig" source "drivers/math/Kconfig" source "drivers/segger/Kconfig" +source "drivers/usrsock/Kconfig" diff --git a/drivers/Makefile b/drivers/Makefile index e2e0218490..ddd6e34d43 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -69,6 +69,7 @@ include 1wire/Make.defs include rf/Make.defs include rc/Make.defs include segger/Make.defs +include usrsock/Make.defs ifeq ($(CONFIG_SPECIFIC_DRIVERS),y) -include platform/Make.defs diff --git a/drivers/usrsock/Kconfig b/drivers/usrsock/Kconfig new file mode 100644 index 0000000000..fcc785dbbe --- /dev/null +++ b/drivers/usrsock/Kconfig @@ -0,0 +1,28 @@ +# +# For a description of the syntax of this configuration file, +# see the file kconfig-language.txt in the NuttX tools repository. +# + +if NET_USRSOCK + +menu "Usrsock Driver Support" + +choice + prompt "Select usrsock device interface" + default NET_USRSOCK_DEVICE + +config NET_USRSOCK_DEVICE + bool "/dev/usrsock" + ---help--- + Will export /dev/usrsock device node for usrsock request/response operations + +config NET_USRSOCK_CUSTOM + bool "Customerized interface" + ---help--- + Will send usrsock request or receive usrsock response via other kind of interface + +endchoice + +endmenu + +endif # NET_USRSOCK diff --git a/drivers/usrsock/Make.defs b/drivers/usrsock/Make.defs new file mode 100644 index 0000000000..53ee98c509 --- /dev/null +++ b/drivers/usrsock/Make.defs @@ -0,0 +1,34 @@ +############################################################################ +# drivers/usrsock/Make.defs +# +# 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. +# +############################################################################ + +ifeq ($(CONFIG_NET_USRSOCK),y) + +# Include usrsock device drivers + +ifeq ($(CONFIG_NET_USRSOCK_DEVICE),y) + CSRCS += usrsock_dev.c +endif + +# Include User Socket Driver build support + +DEPPATH += --dep-path usrsock +VPATH += :usrsock + +endif diff --git a/net/usrsock/usrsock_dev.c b/drivers/usrsock/usrsock_dev.c similarity index 100% rename from net/usrsock/usrsock_dev.c rename to drivers/usrsock/usrsock_dev.c diff --git a/net/usrsock/Make.defs b/net/usrsock/Make.defs index e381c442ad..8b0f5cda74 100644 --- a/net/usrsock/Make.defs +++ b/net/usrsock/Make.defs @@ -23,7 +23,7 @@ ifeq ($(CONFIG_NET_USRSOCK),y) NET_CSRCS += usrsock_close.c usrsock_conn.c usrsock_bind.c usrsock_connect.c -NET_CSRCS += usrsock_dev.c usrsock_getpeername.c usrsock_devif.c +NET_CSRCS += usrsock_getpeername.c usrsock_devif.c NET_CSRCS += usrsock_event.c usrsock_getsockname.c usrsock_getsockopt.c NET_CSRCS += usrsock_poll.c usrsock_recvmsg.c usrsock_sendmsg.c NET_CSRCS += usrsock_setsockopt.c usrsock_socket.c usrsock_sockif.c