65 " at " __DATE__ " " __TIME__ |
65 " at " __DATE__ " " __TIME__ |
66 |
66 |
67 /*****************************************************************************/ |
67 /*****************************************************************************/ |
68 |
68 |
69 static int ec_master_count = 1; /**< parameter value, number of masters */ |
69 static int ec_master_count = 1; /**< parameter value, number of masters */ |
70 static int ec_eoe_devices = 0; /**< parameter value, number of EoE interf. */ |
70 static int ec_eoeif_count = 0; /**< parameter value, number of EoE interf. */ |
71 static struct list_head ec_masters; /**< list of masters */ |
71 static struct list_head ec_masters; /**< list of masters */ |
72 |
72 |
73 /*****************************************************************************/ |
73 /*****************************************************************************/ |
74 |
74 |
75 /** \cond */ |
75 /** \cond */ |
76 |
76 |
77 module_param(ec_master_count, int, S_IRUGO); |
77 module_param(ec_master_count, int, S_IRUGO); |
78 module_param(ec_eoe_devices, int, S_IRUGO); |
78 module_param(ec_eoeif_count, int, S_IRUGO); |
79 |
79 |
80 MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>"); |
80 MODULE_AUTHOR("Florian Pose <fp@igh-essen.com>"); |
81 MODULE_DESCRIPTION("EtherCAT master driver module"); |
81 MODULE_DESCRIPTION("EtherCAT master driver module"); |
82 MODULE_LICENSE("GPL"); |
82 MODULE_LICENSE("GPL"); |
83 MODULE_VERSION(COMPILE_INFO); |
83 MODULE_VERSION(COMPILE_INFO); |
84 MODULE_PARM_DESC(ec_master_count, "number of EtherCAT masters to initialize"); |
84 MODULE_PARM_DESC(ec_master_count, "number of EtherCAT masters to initialize"); |
85 MODULE_PARM_DESC(ec_eoe_devices, "number of EoE devices per master"); |
85 MODULE_PARM_DESC(ec_eoeif_count, "number of EoE interfaces per master"); |
86 |
86 |
87 /** \endcond */ |
87 /** \endcond */ |
88 |
88 |
89 /*****************************************************************************/ |
89 /*****************************************************************************/ |
90 |
90 |
115 (ec_master_t *) kmalloc(sizeof(ec_master_t), GFP_KERNEL))) { |
115 (ec_master_t *) kmalloc(sizeof(ec_master_t), GFP_KERNEL))) { |
116 EC_ERR("Failed to allocate memory for EtherCAT master %i.\n", i); |
116 EC_ERR("Failed to allocate memory for EtherCAT master %i.\n", i); |
117 goto out_free; |
117 goto out_free; |
118 } |
118 } |
119 |
119 |
120 if (ec_master_init(master, i, ec_eoe_devices)) |
120 if (ec_master_init(master, i, ec_eoeif_count)) |
121 goto out_free; |
121 goto out_free; |
122 |
122 |
123 if (kobject_add(&master->kobj)) { |
123 if (kobject_add(&master->kobj)) { |
124 EC_ERR("Failed to add kobj.\n"); |
124 EC_ERR("Failed to add kobj.\n"); |
125 kobject_put(&master->kobj); // free master |
125 kobject_put(&master->kobj); // free master |