hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/***
 *
 *  stack/rtdev_mgr.c - device error manager
 *
 *  Copyright (C) 2002 Ulrich Marx <marx@kammer.uni-hannover.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */
 
#include <linux/netdevice.h>
 
#include <rtdev.h>
#include <rtdm/net.h>
#include <rtnet_internal.h>
 
/***
 *  rtnetif_err_rx: will be called from the  driver
 *
 *
 *  @rtdev - the network-device
 */
void rtnetif_err_rx(struct rtnet_device *rtdev)
{
}
 
/***
 *  rtnetif_err_tx: will be called from the  driver
 *
 *
 *  @rtdev - the network-device
 */
void rtnetif_err_tx(struct rtnet_device *rtdev)
{
}
 
/***
 *  do_rtdev_task
 */
/*static void do_rtdev_task(int mgr_id)
{
    struct rtnet_msg msg;
    struct rtnet_mgr *mgr = (struct rtnet_mgr *)mgr_id;
 
    while (1) {
        rt_mbx_receive(&(mgr->mbx), &msg, sizeof(struct rtnet_msg));
        if (msg.rtdev) {
            rt_printk("RTnet: error on rtdev %s\n", msg.rtdev->name);
        }
    }
}*/
 
/***
 *  rt_rtdev_connect
 */
void rt_rtdev_connect(struct rtnet_device *rtdev, struct rtnet_mgr *mgr)
{
   /*    rtdev->rtdev_mbx=&(mgr->mbx);*/
}
 
/***
 *  rt_rtdev_disconnect
 */
void rt_rtdev_disconnect(struct rtnet_device *rtdev)
{
   /*    rtdev->rtdev_mbx=NULL;*/
}
 
/***
 *  rt_rtdev_mgr_start
 */
int rt_rtdev_mgr_start(struct rtnet_mgr *mgr)
{
   return /*(rt_task_resume(&(mgr->task)))*/ 0;
}
 
/***
 *  rt_rtdev_mgr_stop
 */
int rt_rtdev_mgr_stop(struct rtnet_mgr *mgr)
{
   return /*(rt_task_suspend(&(mgr->task)))*/ 0;
}
 
/***
 *  rt_rtdev_mgr_init
 */
int rt_rtdev_mgr_init(struct rtnet_mgr *mgr)
{
   int ret = 0;
 
   /*    if ( (ret=rt_mbx_init (&(mgr->mbx), sizeof(struct rtnet_msg))) )
        return ret;
    if ( (ret=rt_task_init(&(mgr->task), &do_rtdev_task, (int)mgr, 4096, RTNET_RTDEV_PRIORITY, 0, 0)) )
        return ret;
    if ( (ret=rt_task_resume(&(mgr->task))) )
        return ret;*/
 
   return (ret);
}
 
/***
 *  rt_rtdev_mgr_delete
 */
void rt_rtdev_mgr_delete(struct rtnet_mgr *mgr)
{
   /*    rt_task_delete(&(mgr->task));
    rt_mbx_delete(&(mgr->mbx));*/
}
 
EXPORT_SYMBOL_GPL(rtnetif_err_rx);
EXPORT_SYMBOL_GPL(rtnetif_err_tx);
 
EXPORT_SYMBOL_GPL(rt_rtdev_connect);
EXPORT_SYMBOL_GPL(rt_rtdev_disconnect);