master/device.c
changeset 533 acdd1f9ef7ab
parent 493 b17c95eac6b2
child 539 7bb92fca28ef
--- a/master/device.c	Fri Jan 12 12:50:52 2007 +0000
+++ b/master/device.c	Fri Jan 12 14:28:33 2007 +0000
@@ -57,16 +57,15 @@
 int ec_device_init(ec_device_t *device, /**< EtherCAT device */
                    ec_master_t *master, /**< master owning the device */
                    struct net_device *net_dev, /**< net_device structure */
-                   ec_isr_t isr, /**< pointer to device's ISR */
-                   struct module *module /**< pointer to the owning module */
+                   ec_pollfunc_t poll, /**< pointer to device's poll function */
+                   struct module *module /**< the device's module */
                    )
 {
     struct ethhdr *eth;
 
     device->master = master;
     device->dev = net_dev;
-    device->isr = isr;
-    device->module = module;
+    device->poll = poll;
 
     device->open = 0;
     device->link_state = 0; // down
@@ -146,7 +145,7 @@
     }
 
     // device could have received frames before
-    for (i = 0; i < 4; i++) ec_device_call_isr(device);
+    for (i = 0; i < 4; i++) ec_device_poll(device);
 
     device->link_state = 0;
     device->tx_count = 0;
@@ -228,17 +227,17 @@
 /*****************************************************************************/
 
 /**
-   Calls the interrupt service routine of the assigned net_device.
+   Calls the poll function of the assigned net_device.
    The master itself works without using interrupts. Therefore the processing
    of received data and status changes of the network device has to be
    done by the master calling the ISR "manually".
 */
 
-void ec_device_call_isr(ec_device_t *device /**< EtherCAT device */)
-{
-    device->cycles_isr = get_cycles();
-    device->jiffies_isr = jiffies;
-    if (likely(device->isr)) device->isr(0, device->dev, NULL);
+void ec_device_poll(ec_device_t *device /**< EtherCAT device */)
+{
+    device->cycles_poll = get_cycles();
+    device->jiffies_poll = jiffies;
+    device->poll(device->dev);
 }
 
 /******************************************************************************