Realtek : Latest ethernet module compilation ========================================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`Architecture ` * :ref:`HW : ` * :ref:`SW : ` * :ref:`Applications & Libraries ` * :ref:`Kernel & Driver modules ` * :ref:`List of driver modules ` * :ref:`Use case ` * :ref:`Driver Development ` * :ref:`Custom build of driver modules ` * :ref:`Load custom built driver modules ` * :ref:`Init path ` * :ref:`Control path ` * :ref:`Data path ` * :ref:`Contexts ` * :ref:`Threads ` * :ref:`Timers ` * :ref:`Interrupts ` * :ref:`Data Structures ` * :ref:`FAQs ` * :ref:`Reference links ` .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow * How to load ethernet driver .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step3: .. tab-set:: .. tab-item:: Version Info =============================== ======================================= # Version =============================== ======================================= Freebsd 14.1.0 =============================== ======================================= .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step4: .. tab-set:: .. tab-item:: Architecture * Architecture .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step5: .. tab-set:: .. tab-item:: HW .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step6: .. tab-set:: .. tab-item:: SW .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step7: .. tab-set:: .. tab-item:: Applications & Libraries .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step8: .. tab-set:: .. tab-item:: Kernel & Driver modules .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step9: .. tab-set:: .. tab-item:: List of driver modules .. tab-set:: .. tab-item:: 1. if_iwlwifi.ko .. csv-table:: :file: ./if_iwlwifi_ko.csv :widths: 50, 50 .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step10: .. tab-set:: .. tab-item:: Use case .. tab-set:: .. tab-item:: Before downloading and compile the latest driver source code set the : * The Ethernet module(if_re) as a separate module by modifying the GENERIC kernel configuration file: .. code-block:: shell test:~$ #device re * Unload the module .. code-block:: c test:~$ kldunload if_re.ko .. tab-set:: .. tab-item:: Download the latest driver source code from Ports * A FreeBSD 'port' is a collection of files designed to automate the process of compiling an application from source code. * The files that comprise a port contain all the necessary information to automatically download, extract, patch, compile, and install the application. .. tab-set:: .. tab-item:: Installing the ports * Path for port folder: /usr/ports/ * If contain files and folder then check ethernet module. * If 'ports' was not installed during the installation of FreeBSD, use the following method to install it * 1. Ensure your system is up-to-date: * First, make sure your FreeBSD system is up-to-date. This can sometimes pull in updated drivers. .. code-block:: c test:~$ freebsd-update fetch test:~$ freebsd-update install * 2. Then, fetch update the FreeBSD ports tree: .. code-block:: c test:~$ portsnap fetch * The extract command is only necessary if you're setting up portsnap for the first time, otherwise the fetch and update commands should suffice. .. code-block:: c test:~$ portsnap extract test:~$ portsnap update * Check the folder which contains latest files and sub-folders of application software .. code-block:: c test:~$ cd /usr/ports/ test:~$ ls .. tab-set:: .. tab-item:: Download the latest driver source code from ports and compile the realtek (re) ethernet driver: .. tab-set:: .. tab-item:: Compiling the driver .. code-block:: c test:~$ cd /usr/ports/net/realtek-re-kmod/ test:~$ make install clean * This will compile and generate the binary for the realtek driver and place it in the /boot/modules/ directory .. code-block:: c test:~$ ls -lrt /boot/modules/if_re.ko -r--r--r-- 1 root wheel 1171016 Sep 13 16:52 /boot/modules/if_re.ko * And also this module is present in: .. code-block:: c test:~$ cd /usr/ports/net/realtek-re-kmod/work/stage/boot/modules/ test:~$ ls if_re.ko * Now we can load/unload the module .. code-block:: c test:~$ kldload ./if_re.ko * Source code of realtek (re) ethernet driver downloaded, check it .. code-block:: c test:~$ cd work/rtl_bsd_drv-ea4ed1e/ test:~$ ls if_re.c * Check ethernet interface .. code-block:: c test:~$ ifconfig re0: flags=1008843 metric 0 mtu 1500 options=60251b ether 7c:8a:e1:98:43:82 inet 10.91.229.72 netmask 0xffffff00 broadcast 10.91.229.255 inet6 fe80::7e8a:e1ff:fe98:4382%re0 prefixlen 64 scopeid 0x1 media: Ethernet autoselect (1000baseT ) status: active .. tab-set:: .. tab-item:: Loading the driver module automatically on boot * Add the following lines to /etc/rc.conf to load the driver module at boot .. code-block:: c test:~$ vim /etc/rc.conf if_re_load="YES" if_re_name="/boot/modules/if_re.ko" * Reboot and check module .. code-block:: c test:~$ reboot .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step11: .. tab-set:: .. tab-item:: Driver Development .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step12: .. tab-set:: .. tab-item:: Custom build of driver modules .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step13: .. tab-set:: .. tab-item:: Load custom built driver modules .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step14: .. tab-set:: .. tab-item:: Init path .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step15: .. tab-set:: .. tab-item:: Control path .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step16: .. tab-set:: .. tab-item:: Data path .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step17: .. tab-set:: .. tab-item:: Contexts .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step18: .. tab-set:: .. tab-item:: Threads .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step19: .. tab-set:: .. tab-item:: Timers .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step20: .. tab-set:: .. tab-item:: Interrupts .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step21: .. tab-set:: .. tab-item:: Data Structures .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step22: .. tab-set:: .. tab-item:: FAQs .. code-block:: c test:~$ .. _FreebsdDeviceDriver_ethernet_fdd_ethernet_chipset_realtek_latest_step23: .. tab-set:: .. tab-item:: Reference links .. code-block:: c test:~$