Fixed debug interfaces.

This commit is contained in:
Florian Pose 2006-10-31 15:32:57 +00:00
parent cbe660aa68
commit 2b0041da50
2 changed files with 20 additions and 1 deletions

View File

@ -56,7 +56,7 @@ AC_MSG_RESULT($LINUX_SOURCE_DIR)
# Debug interface
#------------------------------------------------------------------------------
AC_ARG_ENABLE([debug-if],
AC_ARG_ENABLE([dbg-if],
AS_HELP_STRING([--enable-dbg-if],
[Create a debug interface for each master @<:@NO@:>@]),
[

View File

@ -49,6 +49,7 @@
// net_device functions
int ec_dbgdev_open(struct net_device *);
int ec_dbgdev_stop(struct net_device *);
int ec_dbgdev_tx(struct sk_buff *, struct net_device *);
struct net_device_stats *ec_dbgdev_stats(struct net_device *);
/*****************************************************************************/
@ -74,6 +75,7 @@ int ec_debug_init(ec_debug_t *dbg /**< debug object */)
// initialize net_device
dbg->dev->open = ec_dbgdev_open;
dbg->dev->stop = ec_dbgdev_stop;
dbg->dev->hard_start_xmit = ec_dbgdev_tx;
dbg->dev->get_stats = ec_dbgdev_stats;
// initialize private data
@ -176,6 +178,23 @@ int ec_dbgdev_stop(struct net_device *dev /**< debug net_device */)
/*****************************************************************************/
/**
Transmits data via the virtual network device.
*/
int ec_dbgdev_tx(struct sk_buff *skb, /**< transmit socket buffer */
struct net_device *dev /**< EoE net_device */
)
{
ec_debug_t *dbg = *((ec_debug_t **) netdev_priv(dev));
dev_kfree_skb(skb);
dbg->stats.tx_dropped++;
return 0;
}
/*****************************************************************************/
/**
Gets statistics about the virtual network device.
*/