# Software

Source: [https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html](https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html)

The following table lists the source code locations of the ath11k driver components.

Table : Source code location of software components

| Component | Source code location |
| --- | --- |
| mac80211 | net/mac80211 |
| ath11k driver | <ul class="ul" id="bvc1569159747557__ul_jt5_z41_mcc_navyanka_08-22-24-1616-29-903"><br>                                <li class="li"><span class="ph filepath">drivers/net/wireless/ath/ath11k</span></li><br><br>                                <li class="li"><a href="https://github.com/torvalds/linux/tree/master/drivers/net/wireless/ath/ath11k" target="_blank" class="xref cursorpointer" onclick="Window.BookmapComponent.navigateExternalFile('https://github.com/torvalds/linux/tree/master/drivers/net/wireless/ath/ath11k')">https://github.com/torvalds/linux/tree/master/drivers/net/wireless/ath/ath11k</a></li><br><br>                            </ul> |
| wpa\_supplicant | source: SRC\_URI =<br>                                "git://w1.fi/hostap.git;protocol=https;branch=main" |
| Supplicant configuration file | sources/mdm-init/upstream |

For more information on ath11k, see: 
- ath11k: [https://wireless.docs.kernel.org/en/latest/en/users/drivers/ath11k.html](https://wireless.docs.kernel.org/en/latest/en/users/drivers/ath11k.html)
- mac80211: [https://wireless.wiki.kernel.org/en/developers/documentation/mac80211](https://wireless.wiki.kernel.org/en/developers/documentation/mac80211)
- cfg80211: [https://wireless.wiki.kernel.org/en/developers/documentation/cfg80211](https://wireless.wiki.kernel.org/en/developers/documentation/cfg80211)

## CLD driver

Source: [https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html](https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html)

By default, Qualcomm Linux enables WLAN functionality through the **ath11k WLAN                    driver** across all chipsets. However, in **RB3 Gen 2**, you have the
                option to use the **Convergence Linux Driver (CLD)**, which offers value-added
                features such as **Wi-Fi Direct mode** and **4K QAM**.

The following table lists the source code location of software components with the
                CLD driver:

Table : Source code location of software components with the CLD driver

| Component | Source code location |
| --- | --- |
| Wi-Fi subsystem platform driver (icnss) | sources/wlan/platform/ |
| Qualcomm Wi-Fi host driver | <ul class="ul" id="software-cld-driver__ul_ypp_kkc_mcc_navyanka_08-22-24-2217-37-642"><br>                                        <li class="li"><span class="ph filepath">sources/wlan/qcacld-3.0</span></li><br><br>                                        <li class="li"><span class="ph filepath">sources/wlan/qca-wifi-host-cmn</span></li><br><br>                                    </ul> |
| wpa\_supplicant | sources/wlan/wpa\_supplicant\_8 |
| Supplicant configuration file | sources/mdm-init/wlan\_qcm6490/ |

To debug any issues related to the CLD driver, see [Logs for CLD driver](https://docs.qualcomm.com/doc/80-70017-14/topic/report_a_w_fi_issue_to_qualcomm.html#debug-cld-driver).

### Set WLAN MAC address in software with CLD driver

Source: [https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html](https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html)

### About this task

Consider the following points about the WLAN MAC address:

- By default, the factory writes the WLAN MAC address in the OTP memory of the
                    network card.
- You can modify the MAC address, if required using the following procedure. The
                    MAC address that you set persists until a reboot or the next power cycle. It
                    takes precedence over the factory-set MAC address stored in OTP memory.
- If no factory-set MAC address is available, the software generates a random MAC
                    address during each boot cycle.

Before you begin, ensure that the device is connected to the host over UART as
                described in [Connect to a UART shell](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-254/how_to.html#connect-to-a-uart-shell).

To set a unique WLAN MAC address in software with a CLD driver, perform the following
                steps in the debug UART serial console:

### Procedure

1. Allow read/write access by running the following command:
                
mount -o rw,remount /Copy to clipboard
2. Create a wlan\_mac.bin file in the
                        /lib/firmware/wlan/qca\_cld/ directory by running the
                    following commands:
                
cd /lib/firmware/wlan/qca_cld/Copy to clipboard

Note: There is no default
                            wlan\_mac.bin file.
3. Open the wlan\_mac.bin file in a text editor.
                
For example, to open the wlan\_mac.bin file in VI editor,
                        run the following
                        command:

        vi /lib/firmware/wlan/qca_cld/wlan_mac.binCopy to clipboard
4. Enter the MAC address in the wlan\_mac.bin file in the
                    following format:
                
Intf0MacAddress=<IP_0>
                            Intf1MacAddress=<IP_1>
                            Intf2MacAddress=<IP_2>
                            Intf3MacAddress=<IP_3>
                            ENDCopy to clipboard

For example,

        Intf0MacAddress=000AF58989FF
                                Intf1MacAddress=000AF58989FE
                                Intf2MacAddress=000AF58989FD
                                Intf3MacAddress=000AF58989FC
                                ENDCopy to clipboard
5. Save the wlan\_mac.bin file.
6. Get read/write/executable permission for the wlan\_mac.bin
                    file by running the following command:
                
chmod 777 wlan_mac.binCopy to clipboard

**Sample output**

root@qcm6490:/# mount -o rw, remount /
        root@qcm6490:/# cd /lib/firmware/wlan/qca_cld/
        root@qcm6490:/lib/firmware/wlan/qca_cld# vi wlan mac.bin
        root@qcm6490:/lib/firmware/wlan/qca _cld# chmod 777 wlan_mac.bin
        root@qcm6490:/lib/firmware/wlan/qca_cld# cat wlan_mac.bin
        Intf(MacAddress=000AF58989FF
        IntflMacAddress=000AF58989FE
        Intf2MacAddress=000AF58989FD
        Intf3MacAddress=000AF58989FC
        END
        root@qcm6490:/lib/firmware/wlan/qca_cld#Copy to clipboard
7. Add the `read_mac_addr_from_mac_file=1` INI parameter in the
                /lib/firmware/wlan/qca\_cld/WCNSS\_qcom\_cfg.ini file. 
            
For more information on updating the INI parameter, see [Customize Wi-Fi parameters in software with CLD driver](https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html#son1569159700009).
8. Reboot the device.

### Customize Wi-Fi parameters in software with CLD driver

Source: [https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html](https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html)

### About this task

You can customize the CLD Wi-Fi host driver with various configurations using the
          `WCNSS_qcom_cfg.ini` file.

The Wi-Fi host driver reads this INI file during its initialization.

Any change made to the INI file is reflected only after the device reboot. The INI file
        used by the Wi-Fi host driver is located in the
          /lib/firmware/wlan/qca\_cld/WCNSS\_qcom\_cfg.ini path.

To customize the Wi-Fi parameters as per your requirements, perform the following
          steps:
Note: Ensure that you enable SSH by following the steps
            mentioned in [Use SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-254/how_to.html#use-ssh).

### Procedure

1. Run the SSH using the following command:
        
ssh root@<device_IP_address>Copy to clipboard

For example, if the IP address of the device is `192.168.1.22`, run the
            following
            command:

        ssh root@192.168.1.22Copy to clipboard

        mount -o remount rw /Copy to clipboard

Note: Ensure that the RB3 Gen 2 device and the peer client device are
              in the Wi-Fi vicinity.
2. To pull the default `WCNSS_qcom_cfg.ini` file from the device, run the
          following commands:
        
scp -r root@192.168.1.22:/lib/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini .Copy to clipboard
3. Modify the `WCNSS_qcom_cfg.ini` file.
4. To push the `WCNSS_qcom_cfg.ini` file to the device, run the following
          commands:
        
scp -r WCNSS_qcom_cfg.ini  root@192.168.1.22:/lib/firmware/wlan/qca_cld
        reboot
        Copy to clipboard
5. Power cycle the device. 
        
The information of all the INI configurations is located at
            sources/wlan/qcacld-3.0/core/hdd/inc/hdd\_config.h. Use the
          following configurations for testing:
    - `gDot11Mode=8` for 11ac only mode support.
    - `gEnableBmps=0` to disable beacon mode power save (bmps).
    - `gEnableDFSChnlScan=0` to avoid scanning the DFS channel.

### Switch to CLD driver

Source: [https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html](https://docs.qualcomm.com/doc/80-70017-14/topic/Check_WLAN_host_and_SS_platform_driver_source_codes.html)

Note: The following step is applicable only when the Qualcomm RB3 Gen 2 Development Kit
                has a WCN6750 Wi-Fi chipset.

To switch from ath11k to CLD driver, use the
                following two patches.

- Apply the following patch, for which the source file is at
                            sources/wlan/wlan-devicetree:

        diff --git a/qcm6490-wlan-idp.dtsi b/qcm6490-wlan-idp.dtsi
        index 5a50eda..bb15319 100644
        --- a/qcm6490-wlan-idp.dtsi
        +++ b/qcm6490-wlan-idp.dtsi
        @@ -60,7 +60,6 @@
         		qcom,vdd-1.3-rfa-config = <1256000 1500000 0 0 0>;
         		qcom,smem-states = <&wlan_smp2p_out 0>;
         		qcom,smem-state-names = "wlan-smp2p-out";
        -		status = "disabled";
         
         		icnss_cdev_apss: qcom,icnss_cdev1 {
         				#cooling-cells = <2>;
        diff --git a/qcm6490-wlan-rb3.dtsi b/qcm6490-wlan-rb3.dtsi
        index a716fa2..57f5637 100644
        --- a/qcm6490-wlan-rb3.dtsi
        +++ b/qcm6490-wlan-rb3.dtsi
        @@ -60,7 +60,6 @@
         		qcom,vdd-1.3-rfa-config = <1256000 1500000 0 0 0>;
         		qcom,smem-states = <&wlan_smp2p_out 0>;
         		qcom,smem-state-names = "wlan-smp2p-out";
        -		status = "disabled";
         
         		icnss_cdev_apss: qcom,icnss_cdev1 {
         				#cooling-cells = <2>;
        diff --git a/qcm6490-wlan-upstream.dtsi b/qcm6490-wlan-upstream.dtsi
        index b7f219a..7f81991 100644
        --- a/qcm6490-wlan-upstream.dtsi
        +++ b/qcm6490-wlan-upstream.dtsi
        @@ -4,10 +4,5 @@
          */
         &wifi {
                memory-region = <&wlan_fw_mem>, <&wlan_ce_mem>;
        -       status = "okay";
        -};
        -
        -&remoteproc_wpss {
        -       firmware-name = "ath11k/WCN6750/hw1.0/wpss.mdt";
        -       status = "okay";
        +       status = "disabled";
         };
        diff --git a/qcs5430-wlan-rb3.dtsi b/qcs5430-wlan-rb3.dtsi
        index 0dab35c..f50a644 100644
        --- a/qcs5430-wlan-rb3.dtsi
        +++ b/qcs5430-wlan-rb3.dtsi
        @@ -60,7 +60,6 @@
         		qcom,vdd-1.3-rfa-config = <1256000 1500000 0 0 0>;
         		qcom,smem-states = <&wlan_smp2p_out 0>;
         		qcom,smem-state-names = "wlan-smp2p-out";
        -		status = "disabled";
         
         		icnss_cdev_apss: qcom,icnss_cdev1 {
         				#cooling-cells = <2>;
        diff --git a/qcs5430-wlan-upstream.dtsi b/qcs5430-wlan-upstream.dtsi
        index b7f219a..7f81991 100644
        --- a/qcs5430-wlan-upstream.dtsi
        +++ b/qcs5430-wlan-upstream.dtsi
        @@ -4,10 +4,5 @@
          */
         &wifi {
                memory-region = <&wlan_fw_mem>, <&wlan_ce_mem>;
        -       status = "okay";
        -};
        -
        -&remoteproc_wpss {
        -       firmware-name = "ath11k/WCN6750/hw1.0/wpss.mdt";
        -       status = "okay";
        +       status = "disabled";
         };
        Copy to clipboard
- Revert the following patch, for which the source file is at
                            sources/mdm-init/wlan\_qcm6490

        diff --git a/wlan_qcm6490/wlan b/wlan_qcm6490/wlan
        index 54059ee..d23fdfd 100644
        --- a/wlan_qcm6490/wlan
        +++ b/wlan_qcm6490/wlan
        @@ -32,7 +32,11 @@
        # SPDX-License-Identifier: BSD-3-Clause-Clear
        export MODULE_BASE=/lib/modules/`uname -r`
        -export MODNAME=wlan
        +#To load qcacld driver make MODNAME=wlan
        +#export MODNAME=wlan
        +
        +#MODNAME=ath11k_ahb indicates upstream ath11k driver is being loaded
        +export MODNAME=ath11k_ahb
        export RETRY_LIMIT=20
        HELP="Usage $0 {start | stop | restart} <ap | sta,ap>"
        DUMP_TO_KMSG=/dev/kmsg
        @@ -65,7 +69,6 @@wpa_supplicant -Dnl80211 -iwlan0 -ddd -c /etc/wpa_supplicant.conf -t -f /tmp/wpa_supplicant-log.txt &
        -	dhcpcd wlan0
                 cnt=0
                 while ! [ -d /var/run/wpa_supplicant ]
        @@ -100,8 +103,9 @@
             stop)
                 echo "Stopping WLAN..." > $DUMP_TO_KMSGkillall wpa_supplicant
        -	killall dhcpcd
        -	rmmod $MODNAME
        +        if [ "$MODNAME" = "wlan" ]; then
        +            rmmod $MODNAME
        +        fi
                 ;;
             restart)Copy to clipboard

After applying the patches, ensure that you recompile the entire image and flash it
            as described in the [Qualcomm Linux Build Guide](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-254/introduction.html).

Last Published: Dec 17, 2024

[Previous Topic
Architecture](https://docs.qualcomm.com/bundle/publicresource/80-70017-14/topics/wlan_sw_overview.md) [Next Topic
Configure](https://docs.qualcomm.com/bundle/publicresource/80-70017-14/topics/Set_up_and_configure_WLAN_connection.md)