mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
Move SLIP prototypes from net.h to new slip.h
This commit is contained in:
+20
-19
@@ -58,6 +58,7 @@
|
|||||||
#include <nuttx/net/net.h>
|
#include <nuttx/net/net.h>
|
||||||
#include <nuttx/net/netdev.h>
|
#include <nuttx/net/netdev.h>
|
||||||
#include <nuttx/net/ip.h>
|
#include <nuttx/net/ip.h>
|
||||||
|
#include <nuttx/net/slip.h>
|
||||||
|
|
||||||
#if defined(CONFIG_NET) && defined(CONFIG_NET_SLIP)
|
#if defined(CONFIG_NET) && defined(CONFIG_NET_SLIP)
|
||||||
|
|
||||||
@@ -201,23 +202,23 @@ static void slip_semtake(FAR struct slip_driver_s *priv);
|
|||||||
static void slip_write(FAR struct slip_driver_s *priv, const uint8_t *buffer, int len);
|
static void slip_write(FAR struct slip_driver_s *priv, const uint8_t *buffer, int len);
|
||||||
static void slip_putc(FAR struct slip_driver_s *priv, int ch);
|
static void slip_putc(FAR struct slip_driver_s *priv, int ch);
|
||||||
static int slip_transmit(FAR struct slip_driver_s *priv);
|
static int slip_transmit(FAR struct slip_driver_s *priv);
|
||||||
static int slip_txpoll(struct net_driver_s *dev);
|
static int slip_txpoll(FAR struct net_driver_s *dev);
|
||||||
static void slip_txtask(int argc, char *argv[]);
|
static void slip_txtask(int argc, FAR char *argv[]);
|
||||||
|
|
||||||
/* Packet receiver task */
|
/* Packet receiver task */
|
||||||
|
|
||||||
static int slip_getc(FAR struct slip_driver_s *priv);
|
static int slip_getc(FAR struct slip_driver_s *priv);
|
||||||
static inline void slip_receive(FAR struct slip_driver_s *priv);
|
static inline void slip_receive(FAR struct slip_driver_s *priv);
|
||||||
static int slip_rxtask(int argc, char *argv[]);
|
static int slip_rxtask(int argc, FAR char *argv[]);
|
||||||
|
|
||||||
/* NuttX callback functions */
|
/* NuttX callback functions */
|
||||||
|
|
||||||
static int slip_ifup(struct net_driver_s *dev);
|
static int slip_ifup(FAR struct net_driver_s *dev);
|
||||||
static int slip_ifdown(struct net_driver_s *dev);
|
static int slip_ifdown(FAR struct net_driver_s *dev);
|
||||||
static int slip_txavail(struct net_driver_s *dev);
|
static int slip_txavail(FAR struct net_driver_s *dev);
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
static int slip_addmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
static int slip_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||||
static int slip_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac);
|
static int slip_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@@ -418,7 +419,7 @@ static int slip_transmit(FAR struct slip_driver_s *priv)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int slip_txpoll(struct net_driver_s *dev)
|
static int slip_txpoll(FAR struct net_driver_s *dev)
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
||||||
|
|
||||||
@@ -452,7 +453,7 @@ static int slip_txpoll(struct net_driver_s *dev)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void slip_txtask(int argc, char *argv[])
|
static void slip_txtask(int argc, FAR char *argv[])
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv;
|
FAR struct slip_driver_s *priv;
|
||||||
unsigned int index = *(argv[1]) - '0';
|
unsigned int index = *(argv[1]) - '0';
|
||||||
@@ -641,7 +642,7 @@ static inline void slip_receive(FAR struct slip_driver_s *priv)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int slip_rxtask(int argc, char *argv[])
|
static int slip_rxtask(int argc, FAR char *argv[])
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv;
|
FAR struct slip_driver_s *priv;
|
||||||
unsigned int index = *(argv[1]) - '0';
|
unsigned int index = *(argv[1]) - '0';
|
||||||
@@ -759,7 +760,7 @@ static int slip_rxtask(int argc, char *argv[])
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int slip_ifup(struct net_driver_s *dev)
|
static int slip_ifup(FAR struct net_driver_s *dev)
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
||||||
|
|
||||||
@@ -789,7 +790,7 @@ static int slip_ifup(struct net_driver_s *dev)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int slip_ifdown(struct net_driver_s *dev)
|
static int slip_ifdown(FAR struct net_driver_s *dev)
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
||||||
|
|
||||||
@@ -815,7 +816,7 @@ static int slip_ifdown(struct net_driver_s *dev)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static int slip_txavail(struct net_driver_s *dev)
|
static int slip_txavail(FAR struct net_driver_s *dev)
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
||||||
|
|
||||||
@@ -850,7 +851,7 @@ static int slip_txavail(struct net_driver_s *dev)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
static int slip_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
|
static int slip_addmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
||||||
|
|
||||||
@@ -879,7 +880,7 @@ static int slip_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_NET_IGMP
|
#ifdef CONFIG_NET_IGMP
|
||||||
static int slip_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
|
static int slip_rmmac(FAR struct net_driver_s *dev, FAR const uint8_t *mac)
|
||||||
{
|
{
|
||||||
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
FAR struct slip_driver_s *priv = (FAR struct slip_driver_s *)dev->d_private;
|
||||||
|
|
||||||
@@ -911,11 +912,11 @@ static int slip_rmmac(struct net_driver_s *dev, FAR const uint8_t *mac)
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int slip_initialize(int intf, const char *devname)
|
int slip_initialize(int intf, FAR const char *devname)
|
||||||
{
|
{
|
||||||
struct slip_driver_s *priv;
|
FAR struct slip_driver_s *priv;
|
||||||
char buffer[8];
|
char buffer[8];
|
||||||
const char *argv[2];
|
FAR const char *argv[2];
|
||||||
|
|
||||||
/* Get the interface structure associated with this interface number. */
|
/* Get the interface structure associated with this interface number. */
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* include/nuttx/net/pkt.h
|
||||||
|
* Definitions for use with AF_PACKET sockets
|
||||||
|
*
|
||||||
|
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||||
|
* Author: Daniel Laszlo Sitzer <dlsitzer@gmail.com>
|
||||||
|
*
|
||||||
|
* Includes some definitions that a compatible with the LGPL GNU C Library
|
||||||
|
* header file of the same name.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in
|
||||||
|
* the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||||
|
* used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||||
|
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||||
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||||
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||||
|
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||||
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __INCLUDE_NUTTX_NET_PKT_H
|
||||||
|
#define __INCLUDE_NUTTX_NET_PKT_H
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Included Files
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <nuttx/net/netconfig.h>
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Type Definitions
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Data
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Public Function Prototypes
|
||||||
|
****************************************************************************/
|
||||||
|
/* This function provides the interface between Ethernet device drivers and
|
||||||
|
* packet socket logic. All frames that are received should be provided to
|
||||||
|
* pkt_input() prior to other routing.
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct net_driver_s; /* Forward reference */
|
||||||
|
int pkt_input(FAR struct net_driver_s *dev);
|
||||||
|
|
||||||
|
#endif /* __INCLUDE_NUTTX_NET_PKT_H */
|
||||||
Reference in New Issue
Block a user