|
| 1 | +<Linux device driver for Realtek Ethernet controllers> |
| 2 | + |
| 3 | + This is the Linux device driver released for Realtek 2.5 Gigabit Ethernet controllers with PCI-Express interface. |
| 4 | + |
| 5 | +<Requirements> |
| 6 | + |
| 7 | + - Kernel source tree (supported Linux kernel 2.6.x and 2.4.x) |
| 8 | + - For linux kernel 2.4.x, this driver supports 2.4.20 and latter. |
| 9 | + - Compiler/binutils for kernel compilation |
| 10 | + |
| 11 | +<Quick install with proper kernel settings> |
| 12 | + Unpack the tarball : |
| 13 | + # tar vjxf r8125-9.aaa.bb.tar.bz2 |
| 14 | + |
| 15 | + Change to the directory: |
| 16 | + # cd r8125-9.aaa.bb |
| 17 | + |
| 18 | + If you are running the target kernel, then you should be able to do : |
| 19 | + |
| 20 | + # ./autorun.sh (as root or with sudo) |
| 21 | + |
| 22 | + You can check whether the driver is loaded by using following commands. |
| 23 | + |
| 24 | + # lsmod | grep r8125 |
| 25 | + # ifconfig -a |
| 26 | + |
| 27 | + If there is a device name, ethX, shown on the monitor, the linux |
| 28 | + driver is loaded. Then, you can use the following command to activate |
| 29 | + the ethX. |
| 30 | + |
| 31 | + # ifconfig ethX up |
| 32 | + |
| 33 | + ,where X=0,1,2,... |
| 34 | + |
| 35 | +<Set the network related information> |
| 36 | + 1. Set manually |
| 37 | + a. Set the IP address of your machine. |
| 38 | + |
| 39 | + # ifconfig ethX "the IP address of your machine" |
| 40 | + |
| 41 | + b. Set the IP address of DNS. |
| 42 | + |
| 43 | + Insert the following configuration in /etc/resolv.conf. |
| 44 | + |
| 45 | + nameserver "the IP address of DNS" |
| 46 | + |
| 47 | + c. Set the IP address of gateway. |
| 48 | + |
| 49 | + # route add default gw "the IP address of gateway" |
| 50 | + |
| 51 | + 2. Set by doing configurations in /etc/sysconfig/network-scripts |
| 52 | + /ifcfg-ethX for Redhat and Fedora, or /etc/sysconfig/network |
| 53 | + /ifcfg-ethX for SuSE. There are two examples to set network |
| 54 | + configurations. |
| 55 | + |
| 56 | + a. Fixed IP address: |
| 57 | + DEVICE=eth0 |
| 58 | + BOOTPROTO=static |
| 59 | + ONBOOT=yes |
| 60 | + TYPE=ethernet |
| 61 | + NETMASK=255.255.255.0 |
| 62 | + IPADDR=192.168.1.1 |
| 63 | + GATEWAY=192.168.1.254 |
| 64 | + BROADCAST=192.168.1.255 |
| 65 | + |
| 66 | + b. DHCP: |
| 67 | + DEVICE=eth0 |
| 68 | + BOOTPROTO=dhcp |
| 69 | + ONBOOT=yes |
| 70 | + |
| 71 | +<Modify the MAC address> |
| 72 | + There are two ways to modify the MAC address of the NIC. |
| 73 | + 1. Use ifconfig: |
| 74 | + |
| 75 | + # ifconfig ethX hw ether YY:YY:YY:YY:YY:YY |
| 76 | + |
| 77 | + ,where X is the device number assigned by Linux kernel, and |
| 78 | + YY:YY:YY:YY:YY:YY is the MAC address assigned by the user. |
| 79 | + |
| 80 | + 2. Use ip: |
| 81 | + |
| 82 | + # ip link set ethX address YY:YY:YY:YY:YY:YY |
| 83 | + |
| 84 | + ,where X is the device number assigned by Linux kernel, and |
| 85 | + YY:YY:YY:YY:YY:YY is the MAC address assigned by the user. |
| 86 | + |
| 87 | +<Force Link Status> |
| 88 | + |
| 89 | + 1. Force the link status when insert the driver. |
| 90 | + |
| 91 | + If the user is in the path ~/r8125, the link status can be forced |
| 92 | + to one of the 5 modes as following command. |
| 93 | + |
| 94 | + # insmod ./src/r8125.ko speed=SPEED_MODE duplex=DUPLEX_MODE autoneg=NWAY_OPTION |
| 95 | + |
| 96 | + ,where |
| 97 | + SPEED_MODE = 1000 for 1000Mbps |
| 98 | + = 100 for 100Mbps |
| 99 | + = 10 for 10Mbps |
| 100 | + DUPLEX_MODE = 0 for half-duplex |
| 101 | + = 1 for full-duplex |
| 102 | + NWAY_OPTION = 0 for auto-negotiation off (true force) |
| 103 | + = 1 for auto-negotiation on (nway force) |
| 104 | + For example: |
| 105 | + |
| 106 | + # insmod ./src/r8125.ko speed=100 duplex=0 autoneg=1 |
| 107 | + |
| 108 | + will force PHY to operate in 100Mpbs Half-duplex(nway force). |
| 109 | + |
| 110 | + 2. Force the link status by using ethtool. |
| 111 | + a. Insert the driver first. |
| 112 | + b. Make sure that ethtool exists in /sbin. |
| 113 | + c. Force the link status as the following command. |
| 114 | + |
| 115 | + 2.5G before kernel v4.10 |
| 116 | + # ethtool -s eth0 autoneg on advertise 0x802f |
| 117 | + |
| 118 | + 2.5G for kernel v4.10 and later |
| 119 | + # ethtool -s eth0 autoneg on advertise 0x80000000002f |
| 120 | + |
| 121 | + # ethtool -s eth0 autoneg on advertise 0x002f (1G) |
| 122 | + # ethtool -s eth0 autoneg on advertise 0x000f (100M full) |
| 123 | + # ethtool -s eth0 autoneg on advertise 0x0003 (10M full) |
| 124 | + |
| 125 | +<Jumbo Frame> |
| 126 | + Transmitting Jumbo Frames, whose packet size is bigger than 1500 bytes, please change mtu by the following command. |
| 127 | + |
| 128 | + # ifconfig ethX mtu MTU |
| 129 | + |
| 130 | + , where X=0,1,2,..., and MTU is configured by user. |
| 131 | + |
| 132 | + RTL8125 supports Jumbo Frame size up to 9 kBytes. |
| 133 | + |
| 134 | +<EEE> |
| 135 | + Get/Set device EEE status |
| 136 | + |
| 137 | + Get EEE device status |
| 138 | + # ethtool --show-eee enp1s0 |
| 139 | + |
| 140 | + Set EEE device status |
| 141 | + # ethtool --set-eee enp1s0 eee on tx-lpi on tx-timer 1546 advertise 0x0008 (100M full) |
| 142 | + # ethtool --set-eee enp1s0 eee on tx-lpi on tx-timer 1546 advertise 0x0020 (1G) |
| 143 | + # ethtool --set-eee enp1s0 eee on tx-lpi on tx-timer 1546 advertise 0x8000 (2.5G) |
0 commit comments