|
1 /****************************************************************************** |
|
2 * |
|
3 * $Id$ |
|
4 * |
|
5 * Copyright (C) 2006 Florian Pose, Ingenieurgemeinschaft IgH |
|
6 * |
|
7 * This file is part of the IgH EtherCAT Master. |
|
8 * |
|
9 * The IgH EtherCAT Master is free software; you can redistribute it |
|
10 * and/or modify it under the terms of the GNU General Public License |
|
11 * as published by the Free Software Foundation; either version 2 of the |
|
12 * License, or (at your option) any later version. |
|
13 * |
|
14 * The IgH EtherCAT Master is distributed in the hope that it will be |
|
15 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17 * GNU General Public License for more details. |
|
18 * |
|
19 * You should have received a copy of the GNU General Public License |
|
20 * along with the IgH EtherCAT Master; if not, write to the Free Software |
|
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|
22 * |
|
23 * The right to use EtherCAT Technology is granted and comes free of |
|
24 * charge under condition of compatibility of product made by |
|
25 * Licensee. People intending to distribute/sell products based on the |
|
26 * code, have to sign an agreement to guarantee that products using |
|
27 * software based on IgH EtherCAT master stay compatible with the actual |
|
28 * EtherCAT specification (which are released themselves as an open |
|
29 * standard) as the (only) precondition to have the right to use EtherCAT |
|
30 * Technology, IP and trade marks. |
|
31 * |
|
32 *****************************************************************************/ |
|
33 |
|
34 /** |
|
35 \file |
|
36 Dummy EtherCAT master driver module. |
|
37 */ |
|
38 |
|
39 /*****************************************************************************/ |
|
40 |
|
41 #include <linux/module.h> |
|
42 //#include <linux/kernel.h> |
|
43 //#include <linux/init.h> |
|
44 |
|
45 #include "../master/globals.h" |
|
46 #include "../include/ecrt.h" |
|
47 |
|
48 /*****************************************************************************/ |
|
49 |
|
50 int __init ec_init_module(void); |
|
51 void __exit ec_cleanup_module(void); |
|
52 |
|
53 char *ec_master_version_str = EC_MASTER_VERSION; |
|
54 |
|
55 /*****************************************************************************/ |
|
56 |
|
57 /** \cond */ |
|
58 |
|
59 MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>"); |
|
60 MODULE_DESCRIPTION("DUMMY EtherCAT master driver module"); |
|
61 MODULE_LICENSE("GPL"); |
|
62 MODULE_VERSION(EC_MASTER_VERSION); |
|
63 |
|
64 /** \endcond */ |
|
65 |
|
66 /*****************************************************************************/ |
|
67 |
|
68 /** |
|
69 * Module initialization. |
|
70 * Initializes \a ec_master_count masters. |
|
71 * \return 0 on success, else < 0 |
|
72 */ |
|
73 |
|
74 int __init ec_init_module(void) |
|
75 { |
|
76 EC_INFO("Master DUMMY driver %s\n", EC_MASTER_VERSION); |
|
77 return 0; |
|
78 } |
|
79 |
|
80 /*****************************************************************************/ |
|
81 |
|
82 /** |
|
83 Module cleanup. |
|
84 Clears all master instances. |
|
85 */ |
|
86 |
|
87 void __exit ec_cleanup_module(void) |
|
88 { |
|
89 EC_INFO("Master DUMMY module cleaned up.\n"); |
|
90 } |
|
91 |
|
92 /****************************************************************************** |
|
93 * Realtime interface |
|
94 *****************************************************************************/ |
|
95 |
|
96 unsigned int ecrt_version_magic(void) |
|
97 { |
|
98 return ECRT_VERSION_MAGIC; |
|
99 } |
|
100 |
|
101 /*****************************************************************************/ |
|
102 |
|
103 ec_master_t *ecrt_request_master(unsigned int master_index |
|
104 /**< master index */ |
|
105 ) |
|
106 { |
|
107 EC_INFO("Requesting DUMMY master %u...\n", master_index); |
|
108 return (void *) master_index + 1; |
|
109 } |
|
110 |
|
111 /*****************************************************************************/ |
|
112 |
|
113 /** |
|
114 Releases a reserved EtherCAT master. |
|
115 \ingroup RealtimeInterface |
|
116 */ |
|
117 |
|
118 void ecrt_release_master(ec_master_t *master /**< EtherCAT master */) |
|
119 { |
|
120 EC_INFO("Released DUMMY master %u.\n", (unsigned int) master - 1); |
|
121 } |
|
122 |
|
123 /*****************************************************************************/ |
|
124 |
|
125 /** \cond */ |
|
126 |
|
127 module_init(ec_init_module); |
|
128 module_exit(ec_cleanup_module); |
|
129 |
|
130 EXPORT_SYMBOL(ecrt_request_master); |
|
131 EXPORT_SYMBOL(ecrt_release_master); |
|
132 EXPORT_SYMBOL(ecrt_version_magic); |
|
133 |
|
134 /** \endcond */ |
|
135 |
|
136 /*****************************************************************************/ |