master/master.c
changeset 321 64e20e6e9d0b
parent 318 5f35e74124d1
child 325 7833cf70c4f2
equal deleted inserted replaced
320:71d559ec66d7 321:64e20e6e9d0b
    98    \return 0 in case of success, else < 0
    98    \return 0 in case of success, else < 0
    99 */
    99 */
   100 
   100 
   101 int ec_master_init(ec_master_t *master, /**< EtherCAT master */
   101 int ec_master_init(ec_master_t *master, /**< EtherCAT master */
   102                    unsigned int index, /**< master index */
   102                    unsigned int index, /**< master index */
   103                    unsigned int eoe_devices /**< number of EoE devices */
   103                    unsigned int eoeif_count /**< number of EoE interfaces */
   104                    )
   104                    )
   105 {
   105 {
   106     ec_eoe_t *eoe, *next_eoe;
   106     ec_eoe_t *eoe, *next_eoe;
   107     unsigned int i;
   107     unsigned int i;
   108 
   108 
   128         EC_ERR("Failed to create master workqueue.\n");
   128         EC_ERR("Failed to create master workqueue.\n");
   129         goto out_return;
   129         goto out_return;
   130     }
   130     }
   131 
   131 
   132     // create EoE handlers
   132     // create EoE handlers
   133     for (i = 0; i < eoe_devices; i++) {
   133     for (i = 0; i < eoeif_count; i++) {
   134         if (!(eoe = (ec_eoe_t *) kmalloc(sizeof(ec_eoe_t), GFP_KERNEL))) {
   134         if (!(eoe = (ec_eoe_t *) kmalloc(sizeof(ec_eoe_t), GFP_KERNEL))) {
   135             EC_ERR("Failed to allocate EoE-Object.\n");
   135             EC_ERR("Failed to allocate EoE-Object.\n");
   136             goto out_clear_eoe;
   136             goto out_clear_eoe;
   137         }
   137         }
   138         if (ec_eoe_init(eoe)) {
   138         if (ec_eoe_init(eoe)) {