gomesjj / r8152

USB NIC Driver for ESXi 5.1/5.5/6.0/6.5/6.7 based on the Realtek r8152 source code
47 stars 17 forks source link

fixes for building 2.06 driver for ESXi 6+ #2

Open acjohnson opened 4 years ago

acjohnson commented 4 years ago

Fixes the original issue reported by @CueDev in #1

acjohnson commented 4 years ago

(...merge me)

michelhandleitnl commented 4 years ago

Hi Aaron,

Can you help me with altering the driver for the Club USB-A 3.1 GEN 1 TO RJ45 2.5Gb adapter. It would be great if we have support for 2.5 Gb usb adapters in the homelab on esxi. Bus 002 Device 002: ID 0bda:8156 Realtek Semiconductor Corp. It is not working on esxi 6.7, fragment of vmkernel.log: 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: New USB device found, idVendor=0bda, idProduct=8156 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: Product: USB 10/100/1G/2.5G LAN 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: Manufacturer: Realtek 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: SerialNumber: 000000001 2020-04-23T10:31:34.764Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: add ep 0x83, slot id 5, new drop flags = 0x0, new add flags = 0x80 2020-04-23T10:31:34.764Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for udev 0x4307c35d9640 2020-04-23T10:31:34.764Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: New Input Control Context: 2020-04-23T10:31:34.765Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: Output context after successful config ep cmd: 2020-04-23T10:31:34.765Z cpu3:2097584)<6>usb 2-1: usbfs: registered usb0205 2020-04-23T10:31:34.765Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: clear port warm(BH) reset change, actual port 0 status = 0x1203 2020-04-23T10:31:34.765Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: clear port connect change, actual port 0 status = 0x2a0 2020-04-23T10:31:34.913Z cpu2:2097538)<6>xhci_hcd 0000:00:14.0: xhci_hub_status_data: stopping port polling. 2020-04-23T10:31:34.913Z cpu2:2097538)<6>xhci_hcd 0000:00:14.0: xhci_hub_status_data: stopping port polling. 2020-04-23T10:31:37.360Z cpu2:2097554)<6>usb usb1: suspended

Thanks in Advance,

Michel

gomesjj commented 4 years ago

Hi Aaron,

Can you help me with altering the driver for the Club USB-A 3.1 GEN 1 TO RJ45 2.5Gb adapter. It would be great if we have support for 2.5 Gb usb adapters in the homelab on esxi. Bus 002 Device 002: ID 0bda:8156 Realtek Semiconductor Corp. It is not working on esxi 6.7, fragment of vmkernel.log: 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: New USB device found, idVendor=0bda, idProduct=8156 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: Product: USB 10/100/1G/2.5G LAN 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: Manufacturer: Realtek 2020-04-23T10:31:34.764Z cpu3:2097584)<6>usb 2-1: SerialNumber: 000000001 2020-04-23T10:31:34.764Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: add ep 0x83, slot id 5, new drop flags = 0x0, new add flags = 0x80 2020-04-23T10:31:34.764Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: xhci_check_bandwidth called for udev 0x4307c35d9640 2020-04-23T10:31:34.764Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: New Input Control Context: 2020-04-23T10:31:34.765Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: Output context after successful config ep cmd: 2020-04-23T10:31:34.765Z cpu3:2097584)<6>usb 2-1: usbfs: registered usb0205 2020-04-23T10:31:34.765Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: clear port warm(BH) reset change, actual port 0 status = 0x1203 2020-04-23T10:31:34.765Z cpu3:2097584)<6>xhci_hcd 0000:00:14.0: clear port connect change, actual port 0 status = 0x2a0 2020-04-23T10:31:34.913Z cpu2:2097538)<6>xhci_hcd 0000:00:14.0: xhci_hub_status_data: stopping port polling. 2020-04-23T10:31:34.913Z cpu2:2097538)<6>xhci_hcd 0000:00:14.0: xhci_hub_status_data: stopping port polling. 2020-04-23T10:31:37.360Z cpu2:2097554)<6>usb usb1: suspended

Thanks in Advance,

Michel

Hi Michael,

I do not have access to the hardware, so wouldn't be able to test such set-up.

Regards'

Jose

michelhandleitnl commented 4 years ago

Hi Jose,

I think it has to do by the missing of 50-usb-realtek-net.rules. This needs to be included but I don't have a clue how to do that. The Realtek device is detected by you're driver but not as a nic but as a filesystem. The file underneath seems to solve that problem, only I don't know if it needs to be compiled/linked into the driver or if it is a file that needs to exist on an esxi host on a my unknown location.

_This is used to change the default configuration of Realtek USB ethernet adapters

ACTION!="add", GOTO="usb_realtek_net_end"
SUBSYSTEM!="usb", GOTO="usb_realtek_net_end"
ENV{DEVTYPE}!="usb_device", GOTO="usb_realtek_net_end"

# Modify this to change the default value
ENV{REALTEK_NIC_MODE}="1"

# Realtek
ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}"
ATTR{idVendor}=="0bda", ATTR{idProduct}=="8153", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}"
ATTR{idVendor}=="0bda", ATTR{idProduct}=="8152", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}"_
gomesjj commented 4 years ago

Hi Jose,

I think it has to do by the missing of 50-usb-realtek-net.rules. This needs to be included but I don't have a clue how to do that. The Realtek device is detected by you're driver but not as a nic but as a filesystem. The file underneath seems to solve that problem, only I don't know if it needs to be compiled/linked into the driver or if it is a file that needs to exist on an esxi host on a my unknown location.

_This is used to change the default configuration of Realtek USB ethernet adapters

ACTION!="add", GOTO="usb_realtek_net_end"
SUBSYSTEM!="usb", GOTO="usb_realtek_net_end"
ENV{DEVTYPE}!="usb_device", GOTO="usb_realtek_net_end"

# Modify this to change the default value
ENV{REALTEK_NIC_MODE}="1"

# Realtek
ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}"
ATTR{idVendor}=="0bda", ATTR{idProduct}=="8153", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}"
ATTR{idVendor}=="0bda", ATTR{idProduct}=="8152", ATTR{bConfigurationValue}!="$env{REALTEK_NIC_MODE}", ATTR{bConfigurationValue}="$env{REALTEK_NIC_MODE}"_

The rules file (50-usb-realtek-net.rules) is for use with Linux distros with "udev" support, so you cannot use it with ESXi. As far as I can tell, the rules file is not required anyway, unless you want to change the default mode.

What's important, however, is that device ID 0x8156 is only available on the latest version of the driver (2.12.0). Furthermore, the new adapter requires functionality available on the latest Linux kernel, which I believe is not available for the ESXi kernel shim.

Note also that any Linux based drivers are not supported on ESXi version 7 (latest), as the drivers have all been ported to a BSD base.

llxiaoyuan commented 1 year ago

Thank you for your code, I compiled successfully and got r8152.o and vmklinux_module.o, how to use them on esxi ?