master/module.c
changeset 571 deb7fcb92dd7
parent 545 6c4322e118d6
child 572 aef7ea866a41
equal deleted inserted replaced
570:474f9d643372 571:deb7fcb92dd7
    43 #include <linux/init.h>
    43 #include <linux/init.h>
    44 
    44 
    45 #include "globals.h"
    45 #include "globals.h"
    46 #include "master.h"
    46 #include "master.h"
    47 #include "device.h"
    47 #include "device.h"
       
    48 #include "xmldev.h"
    48 
    49 
    49 /*****************************************************************************/
    50 /*****************************************************************************/
    50 
    51 
    51 int __init ec_init_module(void);
    52 int __init ec_init_module(void);
    52 void __exit ec_cleanup_module(void);
    53 void __exit ec_cleanup_module(void);
    54 /*****************************************************************************/
    55 /*****************************************************************************/
    55 
    56 
    56 static int ec_master_count = 1; /**< parameter value, number of masters */
    57 static int ec_master_count = 1; /**< parameter value, number of masters */
    57 static int ec_eoeif_count = 0; /**< parameter value, number of EoE interf. */
    58 static int ec_eoeif_count = 0; /**< parameter value, number of EoE interf. */
    58 static struct list_head ec_masters; /**< list of masters */
    59 static struct list_head ec_masters; /**< list of masters */
    59 static dev_t device_number;
    60 static dev_t device_number; /**< XML character device number */
       
    61 ec_xmldev_t xmldev; /**< XML character device */
    60 
    62 
    61 char *ec_master_version_str = EC_MASTER_VERSION;
    63 char *ec_master_version_str = EC_MASTER_VERSION;
    62 
    64 
    63 /*****************************************************************************/
    65 /*****************************************************************************/
    64 
    66 
   110               (ec_master_t *) kmalloc(sizeof(ec_master_t), GFP_KERNEL))) {
   112               (ec_master_t *) kmalloc(sizeof(ec_master_t), GFP_KERNEL))) {
   111             EC_ERR("Failed to allocate memory for EtherCAT master %i.\n", i);
   113             EC_ERR("Failed to allocate memory for EtherCAT master %i.\n", i);
   112             goto out_free;
   114             goto out_free;
   113         }
   115         }
   114 
   116 
   115         if (ec_master_init(master, i, ec_eoeif_count, device_number))
   117         if (ec_master_init(master, i, ec_eoeif_count))
   116             goto out_free;
   118             goto out_free;
   117 
   119 
   118         list_add_tail(&master->list, &ec_masters);
   120         list_add_tail(&master->list, &ec_masters);
   119     }
   121     }
   120 
   122