devices/e100-2.6.31-ethercat.c
changeset 2589 2b9c78543663
parent 1928 e9d5929829ba
equal deleted inserted replaced
2415:af21f0bdc7c9 2589:2b9c78543663
  1200 
  1200 
  1201 	if (nic->flags & multicast_all)
  1201 	if (nic->flags & multicast_all)
  1202 		config->multicast_all = 0x1;		/* 1=accept, 0=no */
  1202 		config->multicast_all = 0x1;		/* 1=accept, 0=no */
  1203 
  1203 
  1204 	/* disable WoL when up */
  1204 	/* disable WoL when up */
  1205 	if (nic->ecdev || 
  1205 	if (nic->ecdev ||
  1206 			(netif_running(nic->netdev) || !(nic->flags & wol_magic)))
  1206 			(netif_running(nic->netdev) || !(nic->flags & wol_magic)))
  1207 		config->magic_packet_disable = 0x1;	/* 1=off, 0=on */
  1207 		config->magic_packet_disable = 0x1;	/* 1=off, 0=on */
  1208 
  1208 
  1209 	if (nic->mac >= mac_82558_D101_A4) {
  1209 	if (nic->mac >= mac_82558_D101_A4) {
  1210 		config->fc_disable = 0x1;	/* 1=Tx fc off, 0=Tx fc on */
  1210 		config->fc_disable = 0x1;	/* 1=Tx fc off, 0=Tx fc on */
  2969 	pci_pme_active(pdev, false);
  2969 	pci_pme_active(pdev, false);
  2970 
  2970 
  2971 	// offer device to EtherCAT master module
  2971 	// offer device to EtherCAT master module
  2972 	nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE);
  2972 	nic->ecdev = ecdev_offer(netdev, e100_ec_poll, THIS_MODULE);
  2973 	if (nic->ecdev) {
  2973 	if (nic->ecdev) {
  2974 		if (ecdev_open(nic->ecdev)) {
  2974 		err = ecdev_open(nic->ecdev);
       
  2975 		if (err) {
  2975 			ecdev_withdraw(nic->ecdev);
  2976 			ecdev_withdraw(nic->ecdev);
  2976 			goto err_out_free;
  2977 			goto err_out_free;
  2977 		}
  2978 		}
  2978 	} else {
  2979 	} else {
  2979 		strcpy(netdev->name, "eth%d");
  2980 		strcpy(netdev->name, "eth%d");
  3214 
  3215 
  3215 static int __init e100_init_module(void)
  3216 static int __init e100_init_module(void)
  3216 {
  3217 {
  3217 	printk(KERN_INFO DRV_NAME " " DRV_DESCRIPTION " " DRV_VERSION
  3218 	printk(KERN_INFO DRV_NAME " " DRV_DESCRIPTION " " DRV_VERSION
  3218 			", master " EC_MASTER_VERSION "\n");
  3219 			", master " EC_MASTER_VERSION "\n");
  3219  
  3220 
  3220  	return pci_register_driver(&e100_driver);
  3221  	return pci_register_driver(&e100_driver);
  3221 }
  3222 }
  3222 
  3223 
  3223 static void __exit e100_cleanup_module(void)
  3224 static void __exit e100_cleanup_module(void)
  3224 {
  3225 {