devices/8139too-2.6.13-ethercat.c
changeset 533 acdd1f9ef7ab
parent 497 04552130dd54
child 535 4c8edc04fe24
equal deleted inserted replaced
532:092ac0fa23fe 533:acdd1f9ef7ab
   707 			       struct net_device *dev);
   707 			       struct net_device *dev);
   708 static int rtl8139_poll(struct net_device *dev, int *budget);
   708 static int rtl8139_poll(struct net_device *dev, int *budget);
   709 #ifdef CONFIG_NET_POLL_CONTROLLER
   709 #ifdef CONFIG_NET_POLL_CONTROLLER
   710 static void rtl8139_poll_controller(struct net_device *dev);
   710 static void rtl8139_poll_controller(struct net_device *dev);
   711 #endif
   711 #endif
       
   712 /* EtherCAT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
       
   713 void ec_poll(struct net_device *);
       
   714 /* EtherCAT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
   712 irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
   715 irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
   713                                struct pt_regs *regs);
   716                                struct pt_regs *regs);
   714 static int rtl8139_close (struct net_device *dev);
   717 static int rtl8139_close (struct net_device *dev);
   715 static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
   718 static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd);
   716 static struct net_device_stats *rtl8139_get_stats (struct net_device *dev);
   719 static struct net_device_stats *rtl8139_get_stats (struct net_device *dev);
  2335 	spin_unlock(&tp->rx_lock);
  2338 	spin_unlock(&tp->rx_lock);
  2336 
  2339 
  2337 	return !done;
  2340 	return !done;
  2338 }
  2341 }
  2339 
  2342 
       
  2343 /* EtherCAT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
       
  2344 
       
  2345 void ec_poll(struct net_device *dev)
       
  2346 {
       
  2347     rtl8139_interrupt(0, dev, NULL);
       
  2348 }
       
  2349 
       
  2350 /* EtherCAT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*/
       
  2351 
  2340 /* The interrupt handler does all of the Rx thread work and cleans up
  2352 /* The interrupt handler does all of the Rx thread work and cleans up
  2341    after the Tx thread. */
  2353    after the Tx thread. */
  2342 irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
  2354 irqreturn_t rtl8139_interrupt (int irq, void *dev_instance,
  2343                                struct pt_regs *regs)
  2355                                struct pt_regs *regs)
  2344 {
  2356 {
  2901 	}
  2913 	}
  2902 
  2914 
  2903 	if (rtl_ec_net_dev) {
  2915 	if (rtl_ec_net_dev) {
  2904 		printk(KERN_INFO "Registering EtherCAT device...\n");
  2916 		printk(KERN_INFO "Registering EtherCAT device...\n");
  2905 		if (!(rtl_ec_dev = ecdev_register(ec_device_master_index,
  2917 		if (!(rtl_ec_dev = ecdev_register(ec_device_master_index,
  2906 			rtl_ec_net_dev, rtl8139_interrupt, THIS_MODULE))) {
  2918 			rtl_ec_net_dev, ec_poll, THIS_MODULE))) {
  2907 			printk(KERN_ERR "Failed to register EtherCAT device!\n");
  2919 			printk(KERN_ERR "Failed to register EtherCAT device!\n");
  2908 			goto out_pci;
  2920 			goto out_pci;
  2909 		}
  2921 		}
  2910 
  2922 
  2911 		printk(KERN_INFO "Opening EtherCAT device...\n");
  2923 		printk(KERN_INFO "Opening EtherCAT device...\n");