Unbind manually PCI device

The question was: How to run simultaneously the e100 driver on eth0 for the LAN, and the ec_e100 driver on eth1 for EtherCAT ?"
The solution was explained in a Greg Kroah-Hartman's article

Summary

Example

Find PCI slots and actual kernel driver
# lspci -Dk
0000:01:06.0 Ethernet controller: Intel Corporation 8255xER/82551IT Fast
Ethernet Controller (rev 10)
	Kernel driver in use: e100
0000:01:07.0 Ethernet controller: Intel Corporation 8255xER/82551IT Fast
Ethernet Controller (rev 10)
	Kernel driver in use: e100
Unbind kernel driver e100 from device 0000:01:07.0
# echo -n "0000:01:07.0" > /sys/bus/pci/drivers/e100/unbind
Load another driver
# /sbin/modprobe ec_master main_devices=00:20:38:01:84:97
# /sbin/modprobe ec_e100
Check the new driver
# lspci -Dk

0000:01:06.0 Ethernet controller: Intel Corporation 8255xER/82551IT Fast
Ethernet Controller (rev 10)
	Kernel driver in use: e100
0000:01:07.0 Ethernet controller: Intel Corporation 8255xER/82551IT Fast
Ethernet Controller (rev 10)
	Kernel driver in use: ec_e100

Updated on April 11th, 2015 by Sebastien BLANCHET