Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Modem PPP. More...

Macros

#define MODEM_DEV_PPP_DEFINE(_dev, _name, _init_iface, _prio, _mtu, _buf_size)
 Define a modem PPP module and bind it to a network interface.
#define MODEM_DT_INST_PPP_DEFINE(inst, _name, _init_iface, _prio, _mtu, _buf_size)
 Define a modem PPP module for cellular device tree instance.
#define MODEM_PPP_DEFINE(_name, _init_iface, _prio, _mtu, _buf_size)
 Define a modem PPP module without a device and bind it to a network interface.

Typedefs

typedef void(* modem_ppp_init_iface) (struct net_if *iface)
 L2 network interface init callback.

Functions

int modem_ppp_attach (struct modem_ppp *ppp, struct modem_pipe *pipe)
 Attach pipe to instance and connect.
struct net_ifmodem_ppp_get_iface (struct modem_ppp *ppp)
 Get network interface modem PPP instance is bound to.
void modem_ppp_release (struct modem_ppp *ppp)
 Release pipe from instance.

Detailed Description

Modem PPP.

Since
3.5
Version
1.0.0

Macro Definition Documentation

◆ MODEM_DEV_PPP_DEFINE

#define MODEM_DEV_PPP_DEFINE ( _dev,
_name,
_init_iface,
_prio,
_mtu,
_buf_size )

#include <zephyr/modem/ppp.h>

Value:
extern const struct ppp_api modem_ppp_ppp_api; \
\
static uint8_t _CONCAT(_name, _receive_buf)[_buf_size]; \
static uint8_t _CONCAT(_name, _transmit_buf)[_buf_size]; \
\
static struct modem_ppp _name = { \
.init_iface = _init_iface, \
.receive_buf = _CONCAT(_name, _receive_buf), \
.transmit_buf = _CONCAT(_name, _transmit_buf), \
.buf_size = _buf_size, \
}; \
static const struct modem_ppp_config _CONCAT(_name, _config) = { \
.dev = _dev, \
}; \
\
NET_DEVICE_INIT(_CONCAT(ppp_net_dev_, _name), "modem_ppp_" #_name, \
modem_ppp_init_internal, NULL, &_name, &_CONCAT(_name, _config), _prio, \
&modem_ppp_ppp_api, PPP_L2, NET_L2_GET_CTX_TYPE(PPP_L2), _mtu)
#define NULL
Definition iar_missing_defs.h:20
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
PPP L2 API.
Definition ppp.h:46

Define a modem PPP module and bind it to a network interface.

This macro defines the modem_ppp instance, initializes a PPP L2 network device instance, and binds the modem_ppp instance to the PPP L2 instance.

If underlying cellular device is given, the PPP interface will manage the power state of the cellular device when starting and stopping the PPP.

Parameters
_devCellular device instance for power management or NULL if not used
_nameName of the statically defined modem_ppp instance
_init_ifaceHook for the PPP L2 network interface init function
_prioInitialization priority of the PPP L2 net iface
_mtuMax size of net_pkt data sent and received on PPP L2 net iface
_buf_sizeSize of partial PPP frame transmit and receive buffers

◆ MODEM_DT_INST_PPP_DEFINE

#define MODEM_DT_INST_PPP_DEFINE ( inst,
_name,
_init_iface,
_prio,
_mtu,
_buf_size )

#include <zephyr/modem/ppp.h>

Value:
MODEM_DEV_PPP_DEFINE(DEVICE_DT_INST_GET(inst), _name, _init_iface, _prio, _mtu, _buf_size)
#define DEVICE_DT_INST_GET(inst)
Get a device reference for an instance of a DT_DRV_COMPAT compatible.
Definition device.h:325
#define MODEM_DEV_PPP_DEFINE(_dev, _name, _init_iface, _prio, _mtu, _buf_size)
Define a modem PPP module and bind it to a network interface.
Definition ppp.h:189

Define a modem PPP module for cellular device tree instance.

See also
MODEM_DEV_PPP_DEFINE

◆ MODEM_PPP_DEFINE

#define MODEM_PPP_DEFINE ( _name,
_init_iface,
_prio,
_mtu,
_buf_size )

#include <zephyr/modem/ppp.h>

Value:
MODEM_DEV_PPP_DEFINE(NULL, _name, _init_iface, _prio, _mtu, _buf_size)

Define a modem PPP module without a device and bind it to a network interface.

See also
MODEM_DEV_PPP_DEFINE

Typedef Documentation

◆ modem_ppp_init_iface

typedef void(* modem_ppp_init_iface) (struct net_if *iface)

#include <zephyr/modem/ppp.h>

L2 network interface init callback.

Function Documentation

◆ modem_ppp_attach()

int modem_ppp_attach ( struct modem_ppp * ppp,
struct modem_pipe * pipe )

#include <zephyr/modem/ppp.h>

Attach pipe to instance and connect.

Parameters
pppModem PPP instance
pipePipe to attach to modem PPP instance

◆ modem_ppp_get_iface()

struct net_if * modem_ppp_get_iface ( struct modem_ppp * ppp)

#include <zephyr/modem/ppp.h>

Get network interface modem PPP instance is bound to.

Parameters
pppModem PPP instance
Returns
Pointer to network interface modem PPP instance is bound to

◆ modem_ppp_release()

void modem_ppp_release ( struct modem_ppp * ppp)

#include <zephyr/modem/ppp.h>

Release pipe from instance.

Parameters
pppModem PPP instance