master/ethernet.c
author Florian Pose <fp@igh-essen.com>
Tue, 25 Apr 2006 12:04:04 +0000
changeset 204 5ab50514d9b2
parent 203 c1f305e339c6
child 208 b7797f8a813d
permissions -rw-r--r--
Locking callback interface.
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     1
/******************************************************************************
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     2
 *
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     3
 *  $Id$
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
     4
 *
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     5
 *  Copyright (C) 2006  Florian Pose, Ingenieurgemeinschaft IgH
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     6
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     7
 *  This file is part of the IgH EtherCAT Master.
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     8
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
     9
 *  The IgH EtherCAT Master is free software; you can redistribute it
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    10
 *  and/or modify it under the terms of the GNU General Public License
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    11
 *  as published by the Free Software Foundation; version 2 of the License.
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    12
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    13
 *  The IgH EtherCAT Master is distributed in the hope that it will be
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    14
 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    16
 *  GNU General Public License for more details.
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    17
 *
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    18
 *  You should have received a copy of the GNU General Public License
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    19
 *  along with the IgH EtherCAT Master; if not, write to the Free Software
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    20
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    21
 *
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    22
 *****************************************************************************/
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    23
199
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    24
/**
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    25
   \file
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    26
   Ethernet-over-EtherCAT (EoE).
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    27
*/
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    28
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    29
/*****************************************************************************/
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    30
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    31
#include "../include/ecrt.h"
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    32
#include "globals.h"
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    33
#include "master.h"
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    34
#include "slave.h"
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    35
#include "mailbox.h"
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    36
#include "ethernet.h"
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    37
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    38
/*****************************************************************************/
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    39
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    40
/**
203
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    41
   Contains the private data of an EoE net_device.
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    42
*/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    43
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    44
typedef struct
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    45
{
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    46
    struct net_device_stats stats; /**< device statistics */
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    47
    ec_eoe_t *eoe; /**< pointer to parent eoe object */
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    48
}
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    49
ec_eoedev_priv_t;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    50
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    51
/*****************************************************************************/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    52
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    53
void ec_eoedev_init(struct net_device *);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    54
int ec_eoedev_open(struct net_device *);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    55
int ec_eoedev_stop(struct net_device *);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    56
int ec_eoedev_tx(struct sk_buff *, struct net_device *);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    57
struct net_device_stats *ec_eoedev_stats(struct net_device *);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    58
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    59
/*****************************************************************************/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    60
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    61
/**
199
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
    62
   EoE constructor.
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    63
*/
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
    64
203
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    65
int ec_eoe_init(ec_eoe_t *eoe, ec_slave_t *slave)
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    66
{
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    67
    ec_eoedev_priv_t *priv;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    68
    int result;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    69
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    70
    eoe->slave = slave;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    71
    eoe->rx_state = EC_EOE_IDLE;
203
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    72
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    73
    if (!(eoe->dev =
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    74
          alloc_netdev(sizeof(ec_eoedev_priv_t), "eoe%d", ec_eoedev_init))) {
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    75
        EC_ERR("Unable to allocate net_device for EoE object!\n");
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    76
        goto out_return;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    77
    }
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    78
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    79
    // set EoE object reference
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    80
    priv = netdev_priv(eoe->dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    81
    priv->eoe = eoe;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    82
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    83
    // connect the net_device to the kernel
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    84
    if ((result = register_netdev(eoe->dev))) {
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    85
        EC_ERR("Unable to register net_device: error %i\n", result);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    86
        goto out_free;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    87
    }
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    88
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    89
    return 0;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    90
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    91
 out_free:
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    92
    free_netdev(eoe->dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    93
    eoe->dev = NULL;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    94
 out_return:
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
    95
    return -1;
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    96
}
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    97
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    98
/*****************************************************************************/
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
    99
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   100
/**
199
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
   101
   EoE destructor.
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   102
*/
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   103
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   104
void ec_eoe_clear(ec_eoe_t *eoe)
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   105
{
203
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   106
    if (eoe->dev) {
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   107
        unregister_netdev(eoe->dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   108
        free_netdev(eoe->dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   109
    }
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   110
}
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   111
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   112
/*****************************************************************************/
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   113
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   114
/**
199
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
   115
   Runs the EoE state machine.
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   116
*/
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   117
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   118
void ec_eoe_run(ec_eoe_t *eoe)
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   119
{
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   120
    uint8_t *data;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   121
    ec_master_t *master;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   122
    size_t rec_size;
146
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   123
#if 0
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   124
    unsigned int i;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   125
    uint8_t fragment_number;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   126
    uint8_t complete_size;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   127
    uint8_t frame_number;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   128
    uint8_t last_fragment;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   129
#endif
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   130
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   131
    master = eoe->slave->master;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   132
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   133
    if (eoe->rx_state == EC_EOE_IDLE) {
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   134
        ec_slave_mbox_prepare_check(eoe->slave);
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   135
        ec_master_queue_command(master, &eoe->slave->mbox_command);
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   136
        eoe->rx_state = EC_EOE_CHECKING;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   137
        return;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   138
    }
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   139
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   140
    if (eoe->rx_state == EC_EOE_CHECKING) {
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   141
        if (eoe->slave->mbox_command.state != EC_CMD_RECEIVED) {
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   142
            master->stats.eoe_errors++;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   143
            eoe->rx_state = EC_EOE_IDLE;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   144
            return;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   145
        }
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   146
        if (!ec_slave_mbox_check(eoe->slave)) {
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   147
            eoe->rx_state = EC_EOE_IDLE;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   148
            return;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   149
        }
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   150
        ec_slave_mbox_prepare_fetch(eoe->slave);
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   151
        ec_master_queue_command(master, &eoe->slave->mbox_command);
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   152
        eoe->rx_state = EC_EOE_FETCHING;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   153
        return;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   154
    }
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   155
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   156
    if (eoe->rx_state == EC_EOE_FETCHING) {
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   157
        if (eoe->slave->mbox_command.state != EC_CMD_RECEIVED) {
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   158
            master->stats.eoe_errors++;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   159
            eoe->rx_state = EC_EOE_IDLE;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   160
            return;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   161
        }
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   162
        if (!(data = ec_slave_mbox_fetch(eoe->slave, 0x02, &rec_size))) {
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   163
            master->stats.eoe_errors++;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   164
            eoe->rx_state = EC_EOE_IDLE;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   165
            return;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   166
        }
146
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   167
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   168
#if 0
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   169
        fragment_number = EC_READ_U16(data + 2) & 0x003F;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   170
        complete_size = (EC_READ_U16(data + 2) >> 6) & 0x003F;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   171
        frame_number = (EC_READ_U16(data + 2) >> 12) & 0x0003;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   172
        last_fragment = (EC_READ_U16(data + 2) >> 15) & 0x0001;
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   173
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   174
        EC_DBG("EOE %s received, fragment: %i, complete size: %i (0x%02X),"
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   175
               " frame %i%s\n",
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   176
               fragment_number ? "fragment" : "initiate", fragment_number,
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   177
               (complete_size - 31) / 32, complete_size, frame_number,
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   178
               last_fragment ? ", last fragment" : "");
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   179
        EC_DBG("");
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   180
        for (i = 0; i < rec_size - 2; i++) {
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   181
            printk("%02X ", data[i + 2]);
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   182
            if ((i + 1) % 16 == 0) {
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   183
                printk("\n");
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   184
                EC_DBG("");
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   185
            }
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   186
        }
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   187
        printk("\n");
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   188
#endif
73a5f7dd3024 Versuche mit EoE.
Florian Pose <fp@igh-essen.com>
parents: 145
diff changeset
   189
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   190
        eoe->rx_state = EC_EOE_IDLE;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   191
        return;
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   192
    }
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   193
}
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   194
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   195
/*****************************************************************************/
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   196
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   197
/**
199
04ecf40fc2e9 Doxygen added interface modules and file documentation.
Florian Pose <fp@igh-essen.com>
parents: 197
diff changeset
   198
   Prints EoE object information.
197
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   199
*/
b9a6e2c22745 GPLv2 License and enhanced Doxygen output.
Florian Pose <fp@igh-essen.com>
parents: 195
diff changeset
   200
145
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   201
void ec_eoe_print(const ec_eoe_t *eoe)
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   202
{
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   203
    EC_INFO("  EoE slave %i\n", eoe->slave->ring_position);
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   204
    EC_INFO("    RX State %i\n", eoe->rx_state);
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   205
}
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   206
11a82e4fd31b Mailbox-Interface ausgelagert, erster EOE-Ansatz.
Florian Pose <fp@igh-essen.com>
parents:
diff changeset
   207
/*****************************************************************************/
203
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   208
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   209
/**
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   210
   Initializes a net_device structure for an EoE object.
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   211
*/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   212
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   213
void ec_eoedev_init(struct net_device *dev /**< pointer to the net_device */)
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   214
{
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   215
    ec_eoedev_priv_t *priv;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   216
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   217
    // initialize net_device
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   218
    ether_setup(dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   219
    dev->open = ec_eoedev_open;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   220
    dev->stop = ec_eoedev_stop;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   221
    dev->hard_start_xmit = ec_eoedev_tx;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   222
    dev->get_stats = ec_eoedev_stats;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   223
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   224
    // initialize private data
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   225
    priv = netdev_priv(dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   226
    memset(priv, 0, sizeof(ec_eoedev_priv_t));
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   227
}
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   228
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   229
/*****************************************************************************/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   230
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   231
/**
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   232
   Opens the virtual network device.
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   233
*/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   234
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   235
int ec_eoedev_open(struct net_device *dev /**< EoE net_device */)
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   236
{
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   237
    ec_eoedev_priv_t *priv = netdev_priv(dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   238
    netif_start_queue(dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   239
    EC_INFO("%s (slave %i) opened.\n", dev->name,
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   240
            priv->eoe->slave->ring_position);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   241
    return 0;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   242
}
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   243
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   244
/*****************************************************************************/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   245
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   246
/**
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   247
   Stops the virtual network device.
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   248
*/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   249
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   250
int ec_eoedev_stop(struct net_device *dev /**< EoE net_device */)
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   251
{
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   252
    ec_eoedev_priv_t *priv = netdev_priv(dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   253
    netif_stop_queue(dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   254
    EC_INFO("%s (slave %i) stopped.\n", dev->name,
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   255
            priv->eoe->slave->ring_position);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   256
    return 0;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   257
}
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   258
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   259
/*****************************************************************************/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   260
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   261
/**
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   262
   Transmits data via the virtual network device.
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   263
*/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   264
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   265
int ec_eoedev_tx(struct sk_buff *skb, /**< transmit socket buffer */
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   266
                 struct net_device *dev /**< EoE net_device */
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   267
                 )
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   268
{
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   269
    ec_eoedev_priv_t *priv = netdev_priv(dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   270
    priv->stats.tx_packets++;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   271
    dev_kfree_skb(skb);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   272
    EC_INFO("EoE device sent %i octets.\n", skb->len);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   273
    return 0;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   274
}
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   275
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   276
/*****************************************************************************/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   277
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   278
/**
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   279
   Gets statistics about the virtual network device.
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   280
*/
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   281
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   282
struct net_device_stats *ec_eoedev_stats(struct net_device *dev
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   283
                                         /**< EoE net_device */)
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   284
{
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   285
    ec_eoedev_priv_t *priv = netdev_priv(dev);
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   286
    return &priv->stats;
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   287
}
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   288
c1f305e339c6 EoE net_device implementation.
Florian Pose <fp@igh-essen.com>
parents: 199
diff changeset
   289
/*****************************************************************************/