Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
4beb3c0a
Commit
4beb3c0a
authored
10 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
Move SLIP prototypes from net.h to new slip.h
parent
01f9dccc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/net/slip.c
+20
-19
20 additions, 19 deletions
drivers/net/slip.c
include/nuttx/net/slip.h
+70
-0
70 additions, 0 deletions
include/nuttx/net/slip.h
with
90 additions
and
19 deletions
drivers/net/slip.c
+
20
−
19
View file @
4beb3c0a
...
...
@@ -58,6 +58,7 @@
#include
<nuttx/net/net.h>
#include
<nuttx/net/netdev.h>
#include
<nuttx/net/ip.h>
#include
<nuttx/net/slip.h>
#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_putc
(
FAR
struct
slip_driver_s
*
priv
,
int
ch
);
static
int
slip_transmit
(
FAR
struct
slip_driver_s
*
priv
);
static
int
slip_txpoll
(
struct
net_driver_s
*
dev
);
static
void
slip_txtask
(
int
argc
,
char
*
argv
[]);
static
int
slip_txpoll
(
FAR
struct
net_driver_s
*
dev
);
static
void
slip_txtask
(
int
argc
,
FAR
char
*
argv
[]);
/* Packet receiver task */
static
int
slip_getc
(
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 */
static
int
slip_ifup
(
struct
net_driver_s
*
dev
);
static
int
slip_ifdown
(
struct
net_driver_s
*
dev
);
static
int
slip_txavail
(
struct
net_driver_s
*
dev
);
static
int
slip_ifup
(
FAR
struct
net_driver_s
*
dev
);
static
int
slip_ifdown
(
FAR
struct
net_driver_s
*
dev
);
static
int
slip_txavail
(
FAR
struct
net_driver_s
*
dev
);
#ifdef CONFIG_NET_IGMP
static
int
slip_addmac
(
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_addmac
(
FAR
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
/****************************************************************************
...
...
@@ -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
;
...
...
@@ -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
;
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
;
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
;
...
...
@@ -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
;
...
...
@@ -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
;
...
...
@@ -850,7 +851,7 @@ static int slip_txavail(struct net_driver_s *dev)
****************************************************************************/
#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
;
...
...
@@ -879,7 +880,7 @@ static int slip_addmac(struct net_driver_s *dev, FAR const uint8_t *mac)
****************************************************************************/
#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
;
...
...
@@ -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
];
const
char
*
argv
[
2
];
FAR
const
char
*
argv
[
2
];
/* Get the interface structure associated with this interface number. */
...
...
This diff is collapsed.
Click to expand it.
include/nuttx/net/slip.h
0 → 100644
+
70
−
0
View file @
4beb3c0a
/****************************************************************************
* 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 */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment