equal
deleted
inserted
replaced
159 Unregisteres the net_device and frees allocated memory. |
159 Unregisteres the net_device and frees allocated memory. |
160 */ |
160 */ |
161 |
161 |
162 void ec_eoe_clear(ec_eoe_t *eoe /**< EoE handler */) |
162 void ec_eoe_clear(ec_eoe_t *eoe /**< EoE handler */) |
163 { |
163 { |
164 unregister_netdev(eoe->dev); |
164 unregister_netdev(eoe->dev); // possibly calls close callback |
165 free_netdev(eoe->dev); |
165 free_netdev(eoe->dev); |
166 |
166 |
167 // empty transmit queue |
167 // empty transmit queue |
168 ec_eoe_flush(eoe); |
168 ec_eoe_flush(eoe); |
169 |
169 |
646 netif_stop_queue(dev); |
646 netif_stop_queue(dev); |
647 eoe->tx_queue_active = 0; |
647 eoe->tx_queue_active = 0; |
648 eoe->opened = 0; |
648 eoe->opened = 0; |
649 ec_eoe_flush(eoe); |
649 ec_eoe_flush(eoe); |
650 EC_INFO("%s stopped.\n", dev->name); |
650 EC_INFO("%s stopped.\n", dev->name); |
651 if (!eoe->slave) |
651 if (eoe->slave) |
652 EC_WARN("Device %s is not coupled to any EoE slave!\n", dev->name); |
|
653 else { |
|
654 ec_slave_request_state(eoe->slave, EC_SLAVE_STATE_PREOP); |
652 ec_slave_request_state(eoe->slave, EC_SLAVE_STATE_PREOP); |
655 } |
|
656 return 0; |
653 return 0; |
657 } |
654 } |
658 |
655 |
659 /*****************************************************************************/ |
656 /*****************************************************************************/ |
660 |
657 |