equal
deleted
inserted
replaced
57 /** |
57 /** |
58 Debug constructor. |
58 Debug constructor. |
59 Initializes the debug object, creates a net_device and registeres it. |
59 Initializes the debug object, creates a net_device and registeres it. |
60 */ |
60 */ |
61 |
61 |
62 int ec_debug_init(ec_debug_t *dbg /**< debug object */) |
62 int ec_debug_init( |
|
63 ec_debug_t *dbg, /**< debug object */ |
|
64 const char *name /**< interface name */ |
|
65 ) |
63 { |
66 { |
64 int result; |
67 int result; |
65 |
68 |
66 dbg->opened = 0; |
69 dbg->opened = 0; |
67 memset(&dbg->stats, 0, sizeof(struct net_device_stats)); |
70 memset(&dbg->stats, 0, sizeof(struct net_device_stats)); |
68 |
71 |
69 if (!(dbg->dev = |
72 if (!(dbg->dev = |
70 alloc_netdev(sizeof(ec_debug_t *), "ec%d", ether_setup))) { |
73 alloc_netdev(sizeof(ec_debug_t *), name, ether_setup))) { |
71 EC_ERR("Unable to allocate net_device for debug object!\n"); |
74 EC_ERR("Unable to allocate net_device for debug object!\n"); |
72 goto out_return; |
75 goto out_return; |
73 } |
76 } |
74 |
77 |
75 // initialize net_device |
78 // initialize net_device |