IgH EtherCAT Master  1.6.2
debug.c File Reference

Ethernet interface for debugging purposes. More...

Go to the source code of this file.

Functions

int ec_dbgdev_open (struct net_device *dev)
 Opens the virtual network device. More...
 
int ec_dbgdev_stop (struct net_device *dev)
 Stops the virtual network device. More...
 
int ec_dbgdev_tx (struct sk_buff *skb, struct net_device *dev)
 Transmits data via the virtual network device. More...
 
struct net_device_stats * ec_dbgdev_stats (struct net_device *dev)
 Gets statistics about the virtual network device. More...
 
int ec_debug_init (ec_debug_t *dbg, ec_device_t *device, const char *name)
 Debug interface constructor. More...
 
void ec_debug_clear (ec_debug_t *dbg)
 Debug interface destructor. More...
 
void ec_debug_register (ec_debug_t *dbg, const struct net_device *net_dev)
 Register debug interface. More...
 
void ec_debug_unregister (ec_debug_t *dbg)
 Unregister debug interface. More...
 
void ec_debug_send (ec_debug_t *dbg, const uint8_t *data, size_t size)
 Sends frame data to the interface. More...
 

Variables

static const struct net_device_ops ec_dbg_netdev_ops
 Device operations for debug interfaces. More...
 

Detailed Description

Ethernet interface for debugging purposes.

Definition in file debug.c.

Function Documentation

◆ ec_dbgdev_open()

int ec_dbgdev_open ( struct net_device *  dev)

Opens the virtual network device.

Returns
Always zero (success).
Parameters
devdebug net_device

Definition at line 198 of file debug.c.

◆ ec_dbgdev_stop()

int ec_dbgdev_stop ( struct net_device *  dev)

Stops the virtual network device.

Returns
Always zero (success).
Parameters
devdebug net_device

Definition at line 215 of file debug.c.

◆ ec_dbgdev_tx()

int ec_dbgdev_tx ( struct sk_buff *  skb,
struct net_device *  dev 
)

Transmits data via the virtual network device.

Returns
Always zero (success).
Parameters
skbtransmit socket buffer
devEoE net_device

Definition at line 232 of file debug.c.

◆ ec_dbgdev_stats()

struct net_device_stats * ec_dbgdev_stats ( struct net_device *  dev)

Gets statistics about the virtual network device.

Returns
Statistics.
Parameters
devdebug net_device

Definition at line 250 of file debug.c.

◆ ec_debug_init()

int ec_debug_init ( ec_debug_t dbg,
ec_device_t device,
const char *  name 
)

Debug interface constructor.

Initializes the debug object, creates a net_device and registeres it.

Return values
0Success.
<0Error code.
Parameters
dbgDebug object.
deviceEtherCAT device.
nameInterface name.

Definition at line 64 of file debug.c.

◆ ec_debug_clear()

void ec_debug_clear ( ec_debug_t dbg)

Debug interface destructor.

Unregisters the net_device and frees allocated memory.

Parameters
dbgdebug object

Definition at line 103 of file debug.c.

◆ ec_debug_register()

void ec_debug_register ( ec_debug_t dbg,
const struct net_device *  net_dev 
)

Register debug interface.

Parameters
dbgdebug object
net_dev'Real' Ethernet device.

Definition at line 115 of file debug.c.

◆ ec_debug_unregister()

void ec_debug_unregister ( ec_debug_t dbg)

Unregister debug interface.

Parameters
dbgdebug object

Definition at line 144 of file debug.c.

◆ ec_debug_send()

void ec_debug_send ( ec_debug_t dbg,
const uint8_t *  data,
size_t  size 
)

Sends frame data to the interface.

Parameters
dbgdebug object
dataframe data
sizesize of the frame data

Definition at line 159 of file debug.c.

Variable Documentation

◆ ec_dbg_netdev_ops

const struct net_device_ops ec_dbg_netdev_ops
static
Initial value:
=
{
.ndo_open = ec_dbgdev_open,
.ndo_stop = ec_dbgdev_stop,
.ndo_start_xmit = ec_dbgdev_tx,
.ndo_get_stats = ec_dbgdev_stats,
}
int ec_dbgdev_tx(struct sk_buff *, struct net_device *)
Transmits data via the virtual network device.
Definition: debug.c:232
int ec_dbgdev_stop(struct net_device *)
Stops the virtual network device.
Definition: debug.c:215
struct net_device_stats * ec_dbgdev_stats(struct net_device *)
Gets statistics about the virtual network device.
Definition: debug.c:250
int ec_dbgdev_open(struct net_device *)
Opens the virtual network device.
Definition: debug.c:198

Device operations for debug interfaces.

Definition at line 47 of file debug.c.