]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - packages/devs/eth/mcf52xx/mcf5272/v2_0/include/if_mcf5272_private_data.h
Initial revision
[karo-tx-redboot.git] / packages / devs / eth / mcf52xx / mcf5272 / v2_0 / include / if_mcf5272_private_data.h
1 #ifndef _IF_MCF5272_PRIVATE_DATA_H_
2 #define _IF_MCF5272_PRIVATE_DATA_H_
3 //==========================================================================
4 //####ECOSGPLCOPYRIGHTBEGIN####
5 // -------------------------------------------
6 // This file is part of eCos, the Embedded Configurable Operating System.
7 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
8 //
9 // eCos is free software; you can redistribute it and/or modify it under
10 // the terms of the GNU General Public License as published by the Free
11 // Software Foundation; either version 2 or (at your option) any later version.
12 //
13 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
14 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 // for more details.
17 //
18 // You should have received a copy of the GNU General Public License along
19 // with eCos; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
21 //
22 // As a special exception, if other files instantiate templates or use macros
23 // or inline functions from this file, or you compile this file and link it
24 // with other works to produce a work based on this file, this file does not
25 // by itself cause the resulting work to be covered by the GNU General Public
26 // License. However the source code for this file must still be made available
27 // in accordance with section (3) of the GNU General Public License.
28 //
29 // This exception does not invalidate any other reasons why a work based on
30 // this file might be covered by the GNU General Public License.
31 //
32 // Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
33 // at http://sources.redhat.com/ecos/ecos-license/
34 // -------------------------------------------
35 //####ECOSGPLCOPYRIGHTEND####
36 //==========================================================================
37
38 #include <cyg/hal/drv_api.h>
39 #include <cyg/io/eth/netdev.h>
40 #include <cyg/io/eth/eth_drv.h>
41 #include <cyg/devs/eth/if_mcf5272.h>
42 #include <cyg/devs/eth/nbuf.h>
43
44 /*      Device driver private data.                                         */
45
46 struct MCF5272_fec_priv_data_t
47 {
48
49     buf_info_t nbuffer;
50
51     /*   Diagnositc supplement variables.                                   */
52
53     struct
54     {
55         unsigned int old_tx_pk_cnt;
56         unsigned int old_rx_pk_cnt;
57         unsigned int old_tx_bytes_cnt;
58         unsigned int old_rx_bytes_cnt;
59     }diag_info_sup;
60
61     /*   1 second alarm variables                                           */
62
63     cyg_handle_t alarm_h;
64     cyg_alarm   alarm;
65     cyg_handle_t counter_h;
66
67     /*   Diagnostic counters                                                */
68
69     MCF5272_FEC_DIAG    diag_counters;
70
71     /*   This flag is set if the device is operational                      */
72
73     enum eth_drv_status_t operational;
74
75     /*   Unknown, Half Duplex or Full duplex.                               */
76
77     enum eth_drv_mode_t duplex;
78
79     /*   Ethernet bandwidth.                                                */
80
81     u32_t   speed;
82
83     /*   Temporary packet buffer.                                           */
84
85     eth_frame_hdr pkt_buf;
86
87 };
88 typedef struct MCF5272_fec_priv_data_t MCF5272_fec_priv_data_t;
89
90 #define PMCF5272_FEC_DATA(_SC_) \
91     ((MCF5272_fec_priv_data_t*)(((struct eth_drv_sc*)(_SC_))->driver_private))
92 #define PBUF_INFO(_SC_) \
93     (&(((MCF5272_fec_priv_data_t*)((_SC_)->driver_private))->nbuffer))
94
95 #endif /* _IF_MCF5272_PRIVATE_DATA_H_ */
96