So as the title suggests, Is there a way I can disable and re-enable PCI devices or on-board devices on Linux using Terminal like the disable and enable device functions in Windows' Device Manager. I want to do that everytime my PC boots up because there is an issue with the on-board ethernet controller causing it to stop working until I disable and re-enable it using Device Manager (that's on Windows), but for linux I have to boot into Recovery Mode and enable Networking for the on-board ethernet controller to work.
Here are some basic technical information about my PC in case they might be useful:
PC model: Dell Optiplex 7010 Mini-tower 3rd gen
Linux distro: ubuntu linux 20.04 lts booted in uefi boot mode.
ethernet controller name: Intel(R) 82579LM Gigabit Network Connection (as reported by Windows' Device Manager)
Dmesg command returns "e1000e: device probe failed with error -3"
I have tried disabling and re-enabling the e1000e module with no luck, have also tried going to /sys/dev/pci/network/enabled (where network is the ID of the on-board ethernet controller) and echoing 0 and 1 but still no success.
I also have tried reinstalling Linux distribution and building drivers from source (The e1000e drivers from Intel website) but still with no luck. I also have tried many solutions written on Google but with no luck too.
lspci -vv
command outputs the device information like this:
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (Lewisville) (rev 04)
DeviceName: Onboard LAN
Subsystem: Dell 82579LM Gigabit Network Connection (Lewisville)
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 27
Region 0: Memory at f7c00000 (32-bit, non-prefetchable) [size=128K]
Region 1: Memory at f7c38000 (32-bit, non-prefetchable) [size=4K]
Region 2: I/O ports at f060 [size=32]
Capabilities: [c8] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee00298 Data: 0000
Capabilities: [e0] PCI Advanced Features
AFCap: TP+ FLR+
AFCtrl: FLR-
AFStatus: TP-
Kernel driver in use: e1000e
Kernel modules: e1000e