Skip navigation
Home > All Places > Wi-Fi/Bluetooth for Linux and Android > Blog
prde_1473251

Linux Device Tree - FMAC

Posted by prde_1473251 Mar 24, 2018

This blog post explains the basic concepts of Linux Device Tree and takes some examples to explain how the FMAC WiFi/BT Device Tree has built up for NXP's i.MX6 platform.

Introduction

A Device Tree is a data structure, describing the hardware components of a particular computer so that the operating system's kernel can use and manage those components, including CPU, memory, buses and peripherals. The device tree was derived from SPARC-based workstations and servers via the Open Firmware project and has been chosen as the default mechanism to pass low-level hardware information from the bootloader to the kernel.

 

One of the more challenging aspects of porting Linux (and U-Boot) to your new board is the recent requirement for a device tree blob (DTB). It is also referred to as "Flat Device Tree". Prior to the requirement for a DTB, U-Boot would pass a board information structure to the kernel, which was derived from a header file in U-Boot that had to exactly match the contents of a similar header file in the kernel. It was very difficult to keep them in sync, and it didn't scale well. This was, in part, the motivation for incorporating the flat device tree as a method to communicate low-level hardware details from the bootloader to the kernel.

Reference

Sample Data Format

The Linux device tree is a simple tree structure of nodes and properties. The properties are key-value pairs, and node may contain both properties and child nodes.

For example, the following is a simple tree in the .dts format which shows the structure of nodes and properties.

    • single root node: "/"
    • couple of child nodes: "node1" and "node2"
    • couple of children for node1: "child-node1" and "child-node2"
    • bunch of properties scattered through the tree.

 

/dts-v1/;

/ {

    node1 {

        a-string-property = "A string";

        a-string-list-property = "first string", "second string";

        // hex is implied in byte arrays. no '0x' prefix is required

        a-byte-data-property = [01 23 34 56];

        child-node1 {

            first-child-property;

            second-child-property = <1>;

            a-string-property = "Hello, world";

        };

        child-node2 {

        };

    };

    node2 {

        an-empty-property;

        a-cell-property = <1 2 3 4>; /* each number (cell) is a uint32 */

        child-node1 {

        };

    };

};

GPIO Device Tree

With the basic concepts explained above, let us try to configure a GPIO on iMX6SX platform from device tree. Make sure to keep the following resources available.

    • Linux kernel source code
    • iMX6SX Board schematic
    • iMX6SX Datasheet

From the schematic of iMX6SX, we have two user buttons (KEY_FUNC1 and KEY_FUNC2). Let us select the KEY_FUNC1 (User button 1) in this example. The KEY_FUNC1 is mapped to CSI_DATA04 which internally maps to GPIO1_IO18(from iMX6SX datasheet reference).

 

The basic convention to find the GPIO number: Linux GPIO Number = (gpio_bank - 1) * 32 + gpio_bit. In this case, GPIO number = (1 - 1) * 32 + 18, which gives GPIO number = 18. Therefore, we need to configure the GPIO number 18 in device tree.

 

Linux already have "gpio-keys" driver that translates GPIO events in key/button events. Let us look at how we can generate a key code(say, KEY_NUMLOCK code) when a button is pressed.

gpio-keys {

        compatible = "gpio-keys";

        left-key {

            label = "Left key";

            gpios = <&gpio1 18 0>;

            linux,code = <69>; /* KEY_NUMLOCK */

        };

}

Now, compile the modified DTS file using DTC compiler. The following command can be used to compile DTS files for all flavors.

    • make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs

Copy the corresponding .DTB file to SD card boot directory and boot the image on platform. Test the key press and check the event generated with the key code that  configured in DTS file.

    • root@imx6sxsabresd:~# cd /dev/input/by-path/

    • root@imx6sxsabresd:/dev/input/by-path# evtest platform-gpio-keys-event

Input driver version is 1.0.1

Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100

Input device name: "gpio-keys"

Supported events:

  Event type 0 (EV_SYN)

  Event type 1 (EV_KEY)

    Event code 69 (KEY_NUMLOCK)

    Event code 114 (KEY_VOLUMEDOWN)

Properties:

Testing ... (interrupt to exit)

Event: time 1519994189.663102, type 1 (EV_KEY), code 69 (KEY_NUMLOCK), value 1

Event: time 1519994189.663102, -------------- SYN_REPORT ------------

Event: time 1519994189.793001, type 1 (EV_KEY), code 69 (KEY_NUMLOCK), value 0

    • root@imx6sxsabresd:/dev/input/by-path# cat /proc/interrupts

...

103:          2  gpio-mxc  18 Edge      Left key

...

 

In similar way, we can enhance the DTS to generate all key code as needed for target application. Below is sample code which takes two user buttons on iMX6SX for Volume UP and DOWN configuration.

        gpio-keys {

                compatible = "gpio-keys";

                pinctrl-names = "default";

                pinctrl-0 = <&pinctrl_gpio_keys>;

                volume-up {

                        label = "Volume Up";

                        gpios = <&gpio1 18 GPIO_ACTIVE_LOW>;

                        linux,code = <KEY_VOLUMEUP>;

                };

                volume-down {

                        label = "Volume Down";

                        gpios = <&gpio1 19 GPIO_ACTIVE_LOW>;

                        linux,code = <KEY_VOLUMEDOWN>;

                };

        };

 

For each key, add the corresponding GPIO in sub-node of pinctrl node. The iMX6SX allows Pin/Pad IO MUXing. Refer to "arch/arm/boot/dts/imx6sx-pinfunc.h" for list of IOMUX definition. For instance, the MX6SX_PAD_CSI_DATA04__GPIO1_IO_18 shows the mapping between CSI_DATA04 and GPIO1_IO18.

 

        pinctrl_gpio_keys: gpio_keysgrp {

                fsl,pins = <

                    MX6SX_PAD_CSI_DATA04__GPIO1_IO_18 0x17059

                    MX6SX_PAD_CSI_DATA05__GPIO1_IO_19 0x17059

                >;

        };

Pin multiplexing (IOMUX)

The i.MX System-On-Chip has a lot of functionality but a limited number of pins (or pads). Even though a single pin can only perform one function at a time, they can be configured internally to perform different functions. This is called Pin Multiplexing.

 

Refer PadMux/Control which explains better about PAD/PIN IOMUX settings.

 

The macro MX6SX_PAD_CSI_DATA04__GPIO1_IO_18 has 5 integers. These five integers are:

IOMUX register offset (0x005C)

Pad configuration register offset (0x03A4)

Select input daisy chain register offset (0x0000)

IOMUX configuration setting (0x5)

Select input daisy chain setting (0x0)

 

The sixth integer is mentioned in DTS file 0x17059  which describes the pin's electrical behavior. More details about electrical definition can be obtained in kernel source tree: "Documentation/devicetree/bindings/pinctrl/fsl,imx6sx-pinctrl.txt"

FMAC BT-WiFi Device Tree

As mentioned above, the i.MX SOC has IOMUX module built in. The IOMUX module controls a pin usage so that the same pin can be configured for different purposes and can be used by different modules. This is a common way to reduce the pin count while meeting the requirements from various customers. Platforms that do not have the IOMUX hardware module can do pin muxing through the GPIO module.

 

For reference, please take look at the DTS file attached (imx6sx-sdb-btwifi-fmac.dts) which has device tree source support for plugging in Murata Wi-Fi/BT EVK into SD3 slot using Murata i.MX InterConnect v1.0 adapter and SD Card Extender on SD2 slot. Bluetooth UART connects via SD3 EMMC/MMC Plus pinout and WL_REG_ON/BT_REG_ON/WL_HOST_WAKE connect via SD Card Extender.

 

Since the dongle is a WiFi-BT combo type, the DTS need to declare the pins needed for BT_REG_ON, WL_REG_ON, and WL_HOST_WAKE. We can see that it takes IOMUX pins for data/control signals to communicate between dongle and host.

The IOMUX section contains four groups: btgrp, uart3grp, usdhc2grp-1 and wifigrp.

 

btgrp

  • SD2_DATA3 pin mux'd to GPIO6_IO11 and used for BT_REG_ON

pinctrl_bt: btgrp {

     fsl,pins = <

          MX6SX_PAD_SD2_DATA3__GPIO6_IO_11 0x13069 /* BT_REG_ON */

     >;

};

uart3grp

  • SD3 data signals(4-7) mux'd to UART3 RX, TX, RTS, CTS respectively.
  • BT communication via UART

pinctrl_uart3: uart3grp {

     fsl,pins = <

          MX6SX_PAD_SD3_DATA4__UART3_RX 0x1b0b1

          MX6SX_PAD_SD3_DATA5__UART3_TX 0x1b0b1

          MX6SX_PAD_SD3_DATA7__UART3_CTS_B 0x1b0b1

          MX6SX_PAD_SD3_DATA6__UART3_RTS_B 0x1b0b1

     >;

};

usdhc2grp-1

  • Change MUXing on SD2 slot for control signals.

pinctrl_usdhc2_1: usdhc2grp-1 {

     fsl,pins = <

          MX6SX_PAD_SD2_CMD__USDHC2_CMD 0x17059

          MX6SX_PAD_SD2_CLK__USDHC2_CLK 0x10059

          MX6SX_PAD_SD2_DATA0__USDHC2_DATA0 0x17059

     >;

};

wifigrp

  • Murata change SD3 to 4-bit SDIO only; use upper 4-bits for UART.
  • Note the WL_HOST_WAKE and WL_REG_ON declared below.

pinctrl_wifi: wifigrp {

     fsl,pins = <

          MX6SX_PAD_SD3_CMD__USDHC3_CMD 0x17069

          MX6SX_PAD_SD3_CLK__USDHC3_CLK 0x10071

          MX6SX_PAD_SD3_DATA0__USDHC3_DATA0 0x17069

          MX6SX_PAD_SD3_DATA1__USDHC3_DATA1 0x17069

          MX6SX_PAD_SD3_DATA2__USDHC3_DATA2 0x17069

          MX6SX_PAD_SD3_DATA3__USDHC3_DATA3 0x17069

          MX6SX_PAD_KEY_COL0__GPIO2_IO_10 0x17059 /* CD */

          MX6SX_PAD_KEY_ROW0__GPIO2_IO_15 0x17059 /* WP */

          /* Murata Module control signals */

          MX6SX_PAD_SD2_DATA1__GPIO6_IO_9         0x13069 /* WL_HOST_WAKE */

          MX6SX_PAD_SD2_DATA2__GPIO6_IO_10 0x13069 /* WL_REG_ON */

     >;

};

Now, apply the above IOMUX pin control settings to actual group in DTS file (for instance, map the uart3grp to its corresponding parent module uart3).

&uart3 {

     pinctrl-names = "default";

     pinctrl-0 = <&pinctrl_uart3

                         &pinctrl_bt>;

     fsl,uart-has-rtscts;

     status = "okay";

};

&usdhc2 {

     pinctrl-names = "default";

     pinctrl-0 = <&pinctrl_usdhc2_1>;

     bus-width = <1>;

};

&usdhc3 {

     #address-cells = <1>;

     #size-cells = <0>;

     pinctrl-names = "default";

     pinctrl-0 = <&pinctrl_wifi>;

     bus-width = <4>;

     no-1-8-v; /* force 3.3V VIO */

     non-removable;

     mmc-pwrseq = <&usdhc3_pwrseq>;

     pm-ignore-notify;

     status = "okay";

     brcmf: bcrmf@1 {

          reg = <1>;

          compatible = "brcm,bcm4329-fmac";

     };

};

As highlighted above, it declares "brcm" in "compatible" property. The Kernel is responsible to load the correct drivers requested by DTS and apply the configuration, by parsing all the properties in DTS.

Device Tree Compiler

The device tree compiler (dtc) converts the human-readable device tree source into the machine-readable binary that both U-Boot and the Linux kernel understand. Although a git tree is hosted on kernel.org for dtc, the device tree source has been merged into the kernel source tree.

It is quite straightforward to use the device tree compiler. A typical command to convert source to binary looks like this:

    • dtc -O dtb -o <myboard>.dtb -b 0 <myboard>.dts

In this command, myboard.dts is the device tree human-readable source, and myboard.dtb is the binary created by this command invocation. The -O flag specifies the output format—in this case, the device tree blob binary. The -o flag names the output file, and the -b 0 parameter specifies the physical boot CPU in the multicore case.Note that the dtc compiler allows you to go in both directions. The command example just shown performs a compile from source to device tree binary, whereas a command shown below, produces source from the binary:

    • dtc -I dtb -O dts imx6sx-sdb.dtb >imx6sx-sdb.dts

(Note: Device tree sources in the kernel deviate from the regular syntax, by using the cpp preprocessor for includes and substitution. Please check here for more information.)

The simplest way is to use "make" commands and build the DTB for many well-known reference boards directly from the kernel source. The command to generate DTB for i.MX6SX platform is shown below:

    • make ARCH=arm imx6sx-sdb.dtb

To compile all DTS and generate its DTB, use the following command.

    • make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs

 

Load DTB file

  • Copy the DTB file generated in the boot partition of SD card.
  • Power on the device and stop at boot prompt.
  • Set DTB to correct file name using below command.
    • setenv fdt_file imx6sx-sdb-btwifi-fmac
    • saveenv
    • reset

 

prde_1473251

Supplicant in Linux

Posted by prde_1473251 Mar 6, 2018

The objective of this post is to install wpa_supplicant on the ARM target running Linux.

 

Introduction

wpa_supplicant is a WPA Supplicant for Linux, BSD, Mac OS X, and Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). It is suitable for both desktop/laptop computers and embedded systems. Supplicant is the IEEE 802.1X/WPA component that is used in the client stations. It implements key negotiation with a WPA Authenticator and it controls the roaming and IEEE 802.11 authentication/association of the wlan driver.

wpa_supplicant is designed to be a "daemon" program that runs in the background and acts as the backend component controlling the wireless connection. wpa_supplicant supports separate front-end programs and a text-based front-end (wpa_cli) and a GUI (wpa_gui) are included with wpa_supplicant. wpa_supplicant uses a flexible build configuration that can be used to select which features shall be included and that allows to generate minimal code size binary.

 

Refer to WPA_Supplicant page for more information on the features supported. Also, refer to the attached developer's document on Supplicant and Hostapd which might be a helpful reference.

 

Dependencies

The following dependent libraries need to be installed on the target in order to run HostApd.

  • Libnl
  • OpenSSL

The installation steps for Libnl and OpenSSL is same as written for Hostapd. Check this blog to setup the dependencies before proceeding to the following section.

 

Install wpa_supplicant sources

Host commands

   1. Download the wpa_supplicant open-source package. Extract the file and go to root folder of the package.

$ wget http://hostap.epitest.fi/releases/wpa_supplicant-2.6.tar.gz

$ tar -xzf wpa_supplicant-2.6.tar.gz

$ cd wpa_supplicant-2.6/wpa_supplicant

   2. Copy the existing "defconfig" file to ".config". Edit the .config as shown below.

$ cp defconfig .config

$ vi .config

Now edit .config and make sure to set the following:

CONFIG_DRIVER_NL80211=y

CFLAGS += -I/usr/include/libnl3

CONFIG_LIBNL32=y

   3. Export the "pkgconfig" location.

       $ export PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig 

   4. Cross-compile the sources and install the binaries to destination folder.

$ make CC=arm-linux-gnueabi-gcc

$ make install DESTDIR=<target_rootfs>

 

Start the WPA_Supplicant

  • wpa_supplicant runs as a daemon and requires a configuration file. Create a file called /etc/wpa_supplicant.conf with the following contents:

Secured networkOpen network

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

update_config=1

ap_scan=1

 

network={

ssid="MySSID"

key_mgmt=WPA-PSK

proto=RSN

pairwise=CCMP TKIP

psk="MyPassPhrase"

}

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

update_config=1

ap_scan=1

 

network={

        ssid="MySSID"

        key_mgmt=NONE

}

 

  • Make sure the following kernel drivers are installed before starting the supplicant. Follow this blog to bringup the target with necessary drivers.

$ lsmod

Module                  Size  Used by

brcmfmac              209662  0

brcmutil                8504  1 brcmfmac

cfg80211              236740  1 brcmfmac

compat                  2028  2 brcmfmac,cfg80211

  • Start the supplicant to run in background. Basically the below command takes driver(nl80211), interface(wlan0), configuration file(/etc/wpa_supplicant).

$ wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B

This blog post shows GIT command usage to get the list of commit logs.

Refer this link to find the list of patches submitted in kernel.org.

 

List of FMAC changes

The following GIT command shall be used to filter FMAC related commits writing to a separate log file.

> git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative | grep brcmfmac > log_file

 

Alternatively, go to "drivers/net/wireless/broadcom/brcm80211/brcmfmac" and issue the above command.

 

Linux GIT log (git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)

Preview:

dd2349121bb1 - brcmfmac: Add check for short event packets (5 weeks ago)

35f62727df0e - brcmfmac: setup passive scan if requested by user-space (7 weeks ago)

17df6453d4be - brcmfmac: add length check in brcmf_cfg80211_escan_handler() (7 weeks ago)

f957dd3c8db2 - brcmfmac: feature check for multi-scheduled scan fails on bcm4345 devices (8 weeks ago)

f38966a7ace8 - brcmfmac: Log chip id and revision (10 weeks ago)

8b943e36e24a - brcmfmac: add setting carrier state ON for successful roaming (3 months ago)

99976fc08412 - brcmfmac: fix wrong num_different_channels when mchan feature enabled (3 months ago)

0ec9eb90feec - brcmfmac: Add support for CYW4373 SDIO/USB chipset (3 months ago)

fdfb0f94bfb7 - brcmfmac: set wpa_auth to WPA_AUTH_DISABLED in AP/OPEN security mode (3 months ago)

 

Cypress GIT log (git://git-iot.aus.cypress.com/wiced/hnd/brcm/linux/brcm80211.git)

  • Attached the complete file cy_log.txt for reference.

Preview:

a7c9acc452b2 - brcmfmac: Delete redundant length check (5 weeks ago)

73f2c8e933b1 - brcmfmac: Avoid possible out-of-bounds read (5 weeks ago)

30ac40763939 - brcmfmac: use setup_timer() helper (6 weeks ago)

dd2349121bb1 - brcmfmac: Add check for short event packets (5 weeks ago)

35f62727df0e - brcmfmac: setup passive scan if requested by user-space (7 weeks ago)

17df6453d4be - brcmfmac: add length check in brcmf_cfg80211_escan_handler() (7 weeks ago)

f957dd3c8db2 - brcmfmac: feature check for multi-scheduled scan fails on bcm4345 devices (8 weeks ago)

f38966a7ace8 - brcmfmac: Log chip id and revision (10 weeks ago)

8b943e36e24a - brcmfmac: add setting carrier state ON for successful roaming (3 months ago)

99976fc08412 - brcmfmac: fix wrong num_different_channels when mchan feature enabled (3 months ago)

0ec9eb90feec - brcmfmac: Add support for CYW4373 SDIO/USB chipset (3 months ago)

fdfb0f94bfb7 - brcmfmac: set wpa_auth to WPA_AUTH_DISABLED in AP/OPEN security mode (3 months ago)

e66d70b789d1 - brcmfmac: constify pci_device_id (3 months ago)

e9bf53ab1ee3 - brcmfmac: feature check for multi-scheduled scan fails on bcm4343x devices (3 months ago)

The Linux wireless page and this updated wiki page lists the wireless chipset that Linux releases support.

 

The following table shows the list of Cypress's firmware releases with FMAC support in Linux.

 

PCIe devices

Chip

Device ID

Status

4356

14e4:43ec

Supported in v4.14 Cypress FMAC package.


SDIO devices

Chip

Device ID

Status

43362

0xA962

Supported in v4.14 Cypress FMAC package.

43340

0xA94C

Supported in v4.14 Cypress FMAC package.

4339

0x4335

Supported in v4.14 Cypress FMAC package.

43540x4354Supported in v4.14 Cypress FMAC package.

4343W

0xA9A6

Supported in v4.14 Cypress FMAC package.

43364

0xA9A6

Supported in v4.14 Cypress FMAC package.

434550x4345Supported in v4.14 Cypress FMAC package.
43730x4373Supported in v4.14 Cypress FMAC package.

43012

0xA804Supported in v4.14 Cypress FMAC package.
prde_1473251

HostApd setup in Linux

Posted by prde_1473251 Dec 13, 2017

The objective of this post is to install hostapd on the ARM target and ready to go for its use. This post explains the instructions on how to setup dependent hostapd libraries and cross-compile the sources against ARM platform running Linux. Read this post which explains the steps to bring up the target with Linux.

 

Introduction

Hostapd is a user space daemon for access point and authentication servers. It implements IEEE 802.11 access point management, IEEE 802.1X/WPA/WPA2/EAP Authenticators, RADIUS client, EAP server, and RADIUS authentication server. Hostapd is designed to be a daemon program that runs in the background and acts as the backend component controlling authentication. It supports separate frontend programs and an example text-based frontend, hostapd_cli, is included with hostapd.

 

Refer to Hostapd page for more information on hostapd features.

 

Dependencies

The following dependent libraries need to be installed on the target in order to run HostApd.

  • Libnl
  • OpenSSL

 

Libnl

The libnl suite is a collection of libraries providing APIs to netlink based Linux kernel interfaces. Netlink is a socket based IPC mechanism primarily between the kernel and user space processes. It was designed to be a more flexible successor to IOCTL to provide mainly networking related kernel configuration and monitoring interfaces. The IOCTL risks polluting the kernel and damaging the stability of the system. Netlink socket is simple, only a constant (protocol type) needs to be added to netlink.h. Then the kernel module and application can talk using socket-style APIs immediately.

 

Threaded Netlink Application

It was common practice to use the process identifier (PID) as the local port number in Netlink. This became unpractical with the introduction of threaded Netlink applications and applications requiring multiple sockets. Therefore libnl generates unique port numbers based on the process identifier and adds an offset to it allowing for multiple sockets to be used. The initial socket will still equal to the process identifier for backwards compatibility reasons.

 

With reference to the figure below, it shows the common Netlink communication in User space and kernel. Refer to this web page which explains the following Netlink communication mechanisms and important APIs.

  1. User space to Kernel
  2. User space to User space
  3. Listening to kernel multicast notifications

libnl.png

The libnl interfaces are split into several small libraries to not force applications to link against a single, bloated library. Basically, there are following types of libnl libraries available.

libnl: Core library implementing the fundamentals required to use the netlink protocol such as socket handling, message construction and parsing, and sending and receiving of data. This library is kept small and minimalistic. Other libraries of the suite depend on this library.

libnl-route: API to the configuration interfaces of the NETLINK_ROUTE family including network interfaces, routes, addresses, neighbours, and traffic control.

libnl-genl: API to the generic netlink protocol, an extended version of the netlink protocol.

libnl-nf: API to netlink based netfilter configuration and monitoring interfaces (conntrack, log, queue)x

OpenSSL

OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and related cryptography standards required by them. The OpenSSL program is a command line tool for using the various cryptography functions of OpenSSL's crypto library from the shell.

 

Install Netlink protocol library sources (libnl)

Host commands

   1. Download the Libnl open-source package. Extract the file and go to root folder of the package.

$ wget http://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz

$ tar -xzf libnl-3.2.25.tar.gz

$ cd libnl-3.2.25

   2. Configure the Libnl and make sure to set the configure variables to correct toolchain against which the source need to be compiled. After configuration, run the build command. (Note: Cross-compile the sources that matches the target platform, whether the target file system supports soft-float(arm-linux-gnueabi-) or hard-float(arm-linux-gnueabihf-)).

$ ./configure --host=arm-linux-gnueabi --prefix=/usr/arm-linux-gnueabi

$ make install

   3. Copy the generated shared objects (.so files) to the target root filesystem.

$ cp /usr/arm-linux-gnueabi/lib/libnl-genl-3.so.200  <target_rootfs>/lib/

$ cp /usr/arm-linux-gnueabi/lib/libnl-3.so.200  <target_rootfs>/lib/

 

Target command (ldconfig)

Configure dynamic linker run-time bindings by executing below command on the target. This creates the necessary links and update to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib).

The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and filenames of the libraries it encounters when determining which versions should have their links updated.

$ ldconfig -v

 

Install OpenSSL library sources

Host commands

  1. Download the OpenSSL open-source package. Extract the file and go to root folder of the package.

$ wget https://www.openssl.org/source/openssl-1.1.0g.tar.gz

$ tar -xzf openssl-1.1.0g.tar.gz

$ cd openssl-1.1.0g

    2. Export the environment variables which will be used by cross-compiler.

$ export ARCH=arm

$ export CROSS_COMPILE=arm-linux-gnueabi-

    3. Configure the OpenSSL as below and make sure to mention "shared" to generate a shared object (.so files) which will be copied to the target for run-time shared object library of OpenSSL. After configuration completes, run the build command as shown below. The "make install" will install the binaries on the host machine which will then be copied to the target.

$ ./Configure linux-generic32 shared --prefix=/usr/arm-linux-gnueabi

$ make install

    4. Copy the generated shared objects (.so files) to the target root filesystem.

$ cp /usr/arm-linux-gnueabi/lib/libcrypto.so.1.1  <target_rootfs>/lib/

$ cp /usr/arm-linux-gnueabi/lib/libssl.so.1.1  <target_rootfs>/lib/

 

Install hostapd sources

Host commands

   1. Download the HostApd open-source package. Extract the file and go to root folder of the package.

$ wget http://hostap.epitest.fi/releases/hostapd-2.6.tar.gz

$ tar -xzf hostapd-2.6.tar.gz

$ cd hostapd-2.6/hostapd

   2. Copy the existing "defconfig" file to ".config". Edit the .config as shown below.

$ cp defconfig .config

$ vi .config

Now edit .config and make sure to set the following:

CONFIG_DRIVER_NL80211=y

CFLAGS += -I/usr/include/libnl3

CONFIG_LIBNL32=y

   3. Export the "pkgconfig" location.

       $ export PKG_CONFIG_PATH=/usr/arm-linux-gnueabi/lib/pkgconfig

   4. Cross-compile the sources and install the binaries to destination folder.

$ make CC=arm-linux-gnueabi-gcc install DESTDIR=<target_rootfs>

 

Start HostApd

  • Create a hostapd configuration file with name "hostpd.conf" (could be any name though) and copy the following content.

interface=wlan0

driver=nl80211

ssid=test_ssid

hw_mode=g

channel=1

macaddr_acl=0

auth_algs=1

wpa=2

wpa_key_mgmt=WPA-PSK

wpa_passphrase=test_ssid

rsn_pairwise=CCMP

wpa_pairwise=CCMP

ctrl_interface=/tmp/hostapd

  • Make sure the following kernel drivers are already installed. Follow this blog to bringup the target with necessary drivers.

$ lsmod

Module                  Size  Used by

brcmfmac              209662  0

brcmutil                8504  1 brcmfmac

cfg80211              236740  1 brcmfmac

compat                  2028  2 brcmfmac,cfg80211

  • Start the hostapd by following command.
    • sudo hostapd ./hostapd.conf -B
  • The "hostapd_cli" command line tool shall be used to debug/get configuration details of hostapd.
    • hostapd_cli -i wlan0 -p /tmp/hostapd/

hostapd_cli v2.6

Copyright (c) 2004-2016, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.

See README for more details.

Interactive mode

> help

Commands:

   mib                  get MIB variables (dot1x, dot11, radius)

   sta <addr>           get MIB variables for one station

   all_sta              get MIB variables for all stations

   new_sta <addr>       add a new station

   deauthenticate <addr>  deauthenticate a station

   disassociate <addr>  disassociate a station

   sa_query <addr>      send SA Query to a station

   get_config           show current configuration

   help                 show this usage help

   interface [ifname]   show interfaces/select interface

   level <debug level>  change debug level

   license              show full hostapd_cli license

   quit                 exit hostapd_cli

> get_config

bssid=00:90:4c:2a:0a:00

ssid=test_ssid

key_mgmt=WPA-PSK

group_cipher=CCMP

rsn_pairwise_cipher=CCMP

> AP-STA-CONNECTED X:X:X:X:X:X

> all_sta

X:X:X:X:X:X

flags=[AUTH][ASSOC][AUTHORIZED]

aid=0

capability=0x0

listen_interval=0

supported_rates=

timeout_next=NULLFUNC POLL

dot11RSNAStatsSTAAddress=X:X:X:X:X:X

dot11RSNAStatsVersion=1

dot11RSNAStatsSelectedPairwiseCipher=00-ee-xx-xx

dot11RSNAStatsTKIPLocalMICFailures=0

dot11RSNAStatsTKIPRemoteMICFailures=0

hostapdWPAPTKState=11

hostapdWPAPTKGroupState=0

rx_packets=0

tx_packets=0

rx_bytes=0

tx_bytes=0

connected_time=34

 

DHCP Configuration

The DHCP demon could be different for different platforms such as udhcp, dhcp, etc. The following explains the DHCP configuration using "udhcp". The udhcpd is the DHCP Server demon which is part of BusyBox and is included by default with core OS (no need to install any additional package). It is a perfect candidate for simple and lightweight DHCP Server.

  • Create the config script using the “sudo vi /opt/wlan0.sh” command and copy the text as attached with this post (wlan0.sh).
  • Assign execute permission to “wlan0.sh” script
    • sudo chmod 777 /opt/wlan0.sh
  • Execute the script to configure the “wlan0” interface using the following command. This will take care of configuring the wlan0 interface with unique IP address with netmask.
    • sudo /opt/wlan0.sh
  • Check the interface "wlan0". The interface should be assigned with IP address now.

wlan0     Link encap:Ethernet  HWaddr 00:90:4c:c5:12:38

          inet addr:192.168.10.1  Bcast:192.168.10.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

  • Create a DHCP Configuration file with the “sudo vi /etc/udhcpd.conf” command and fill it will following template.

start 192.168.10.100

end 192.168.10.200

interface wlan0

option subnet 255.255.255.0

option router 192.168.10.1

option lease 43200

option dns 192.168.10.1

option domain local

  • Start the DHCP process using the following command
    • sudo udhcpd /etc/udhcpd.conf
  • You can use following commands to verify if the DHCP process is running properly using the following commands. The DHCP server listens at UDP port 67.
    • ps -ef | grep udhcpd

  913 root     udhcpd /etc/udhcpd.conf  933 tc       grep udhcpd

    • sudo netstat -anp | grep udhcpd

netstat: /proc/net/tcp6: No such file or directory

udp        0      0 0.0.0.0:67              0.0.0.0:*                       913/udhcpd

netstat: /proc/net/udp6: No such file or directory

netstat: /proc/net/raw6: No such file or directory

This post explains how to cross-compile the Linux kernel and Backport driver sources against ARM platform and loading the binaries to the target. The end users who are interested in bringing up their target with linux kernel with wlan drivers might find this blog helpful.

 

What is Backporting in Linux?

The backports is a separate Linux project. "Backporting" aims to backport current Linux upstream device drivers for use with older kernels. Refer Linux wiki page for more documentation. The Linux backports project is a set of patches/scripts/sources that allows us to generate a backport package.

This blog post picks up Cypress's FMAC backport package and compiles them against ARM platform.

 

Why we need Backports ?

The objective is to provide a central mechanism for backporting the device drivers of any subsystem, thereby enabling both users and developers to always focus on upstream Linux kernel development. This means that one can stay in old kernel version and still can use the latest drivers from mainline so as to support the latest features.

Note that the backport shall have limitation on the minimum kernel version running on the target. For instance, the backport driver source with version v4.12 need atleast linux kernel version v3.0+ for backporting to work fine. Check the Cypress's readme files in backport sources for the related information.

 

Setup the toolchain for cross-compiling the linux kernel(against ARM) and device drivers to the target platform.

This blog has following sections.

  • Setting up cross toolchain for ARM

  • Build Linux kernel
  • Build kernel driver module
  • Download or build device tree for the target
  • Load the drivers to the target

 

Contact the Cypress customer support to gain access to the Cypress's FMAC package (Backport driver sources).

 

Toolchain setup

     $ sudo apt-get install libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev gcc-arm-linux-gnueabi u-boot-tools lzop

 

The Linux kernel image and driver modules shall be built separately. Below is the example using iMX6UL platform running linux kernel 4.1.15 interfacing 43430 WLAN chip. The instructions provided here should be the same for iMX6SX platform.

 

The high level goal of the following "Build Linux Kernel" section is to generate a kernel image with CONFIG_CFG80211 and CONFIG_BCMDHD being configured in different way as mentioned below, while all others steps are standard steps to build an iMX image.

 

Build Linux Kernel

1. Get the Linux kernel source from freescale git repository and extract the source.

    Git clone/download the correct linux kernel source by referring the git tag from Freescale git - refs/tags/rel_imx_4.1.15_2.1.0_ga

    $ tar zxvf linux-imx-rel_imx_4.1.15_2.1.0_ga.tar.gz

2. Set up build environment and kernel configuration

    $ cd linux-imx-rel_imx_4.1.15_2.1.0_ga

    Make sure to run following commands in full privileged mode, as "distclean" would require admin permission to clear all the last configured files. The "distclean" takes care of deleting all the configs and files that need to be deleted for clean build.

    $ sudo -s

    $ make distclean

    Configure the kernel against iMX platform. Both iMX6UL and iMX6SX platforms use imx_v7_defconfig.

    The kernel configuration will be written to ".config" file.

    $ make ARCH=arm imx_v7_defconfig

3. Now, edit .config and build cfg80211 as module (as shown below). The CONFIG_BCMDHD is not needed as part of kernel, as FMAC driver is used for WLAN configuration in this case.  The CONFIG_CFG80211=m will let kernel know that this is a driver module and it won't get compiled with the kernel build. The driver modules has to be built explicitly.

      CONFIG_CFG80211=m

      CONFIG_BCMDHD=n

4. Build the Linux kernel image(uImage). Pass ARCH=arm and CROSS_COMPILE=arm-linux-gnueabi-  so as to cross-compile against ARM platform using the toolchain "arm-linux-gnueabi-". The LOADADDR is a platform dependent value and this indicates the start address of kernel image. Check the Board files from vendor and set accordingly. The address 0x10008000 is the LOADADDR for iMX6UL platform. (Note: LOADADDR=0x80800000 for iMX6SX platform)

    $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- uImage LOADADDR=0x10008000

5. The kernel image is available in the following folder after successful build.

    Path to kernel image: arch/arm/boot/zImage

 

Please refer to the attached file (kernel_logs) which gives some help commands to cross check the build arguments set correctly for toolchain before build.

 

Build kernel driver module

Get the Cypress's backport driver sources available from Cypress FMAC package: Cypress Linux FMAC (Orga)

1. Download and untar the linux backports package

      $ tar zxvf cypress-backports-*.tar.gz

      $ cd *backports/

2. (Native) compile local tools and generate .config. Export the MY_KERNEL to point to the target linux kernel to compile the drivers against it.

      $ MY_KERNEL=<4.1.15 kernel path>

    Generate the .config using "defconfig-brcmfmac" which will set all necessary configurations for FMAC driver. The driver configuration will be written to ".config" file.

      $ make KLIB=$MY_KERNEL KLIB_BUILD=$MY_KERNEL defconfig-brcmfmac

3. Cross compile the kernel modules. This command will start the build and generate the driver modules. As mentioned in above section, build the FMAC driver modules explicitly by passing "modules" with the make command.

      $ make KLIB=$MY_KERNEL KLIB_BUILD=$MY_KERNEL ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-  modules

4. The following files are generated after successful build.

      compat/compat.ko

      net/wireless/cfg80211.ko

      drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko

      drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko

 

Build Device tree -- (Skip this section if .dtb file for target is already available)

Get the Cypress's device tree available from Cypress FMAC package: Cypress Linux FMAC (Orga)

1. Untar the Cypress devicetree package.

      $ tar zxvf cypress-devicetree-*.tar.gz

2. Find your board's dtb file, for example

      cypress-devicetree/iMX6SX/4.1.15/imx6sx-sdb-btwifi-fmac.dtb

      (Note: If your board's dtb is not available in the cypress devicetree package, please refer to the available dts/dtsi files and create them for your board, then compile them for the dtb file. iMX dts files are located in linux-imx/arch/arm/boot/dts/ folder of the Linux kernel tree. Below command compiles a dts file)

      $ make ARCH=arm <devicetree name>.dtb

 

Find attached to this post "fmac_wl_dtb", the DTBs for iMX6UL and iMX6SX platforms.

 

Load the DTB, Kernel image, WLAN firmware and drivers

1. Copy the zImage and dtb files to the target board. Set the build args TARGET_IP with the IP address of the target board. Make sure the target board has internet access via wired/wireless connectivity and reachable to the build machine. Use "scp" to transfer the files from build machine to target.

      $ TARGET_IP=<target board IP>

      $ scp <dtb file> root@$TARGET_IP:/run/media/<mmcblk1p1>/cy.dtb (check mmcblk* on target using "df" command)

      $ scp <zImage file> root@$TARGET_IP:/run/media/<mmcblk1p1>/zImage_cy (check available space on target using "df -h ." at /run/media/mmcblk*. Delete/Backup the old kernel and replace with the new one, if there is no sufficient memory to copy).

2. Copy firmware files to the target board and rename the filename as per chip name(Example: brcmfmac43430-sdio.bin where 43430 is chip name). Create "/lib/firmware/brcm" directory if not already present on target.

      $ tar zxvf cypress-firmware*.tar.gz

      $ scp <firmware.bin> root@$TARGET_IP:/lib/firmware/brcm/brcmfmac<43430>-sdio.bin

3. Copy your nvram file (from board vendor) to the target board and rename it as per chip name (Example: brcmfmac43430-sdio.txt)

      $ scp <nvram file.txt> root@$TARGET_IP:/lib/firmware/brcm/brcmfmac<43430>-sdio.txt

4. Extract the attached "fmac_wl_dtb" and find the "wl_fmac_imx" user utility and copy to the target. This user-space utility is used to configure WLAN chip, associate to SSID, perform scan and get scan results, etc.

      $ scp wl_fmac_imx root@$TARGET_IP:/bin/.

5. Copy Cypress kernel modules which was compiled in previous steps (compat.ko, cfg80211.ko, brcmfmac.ko, and brcmutil.ko ) to the target.

      $ scp <module files> root@$TARGET_IP:/lib/modules/<current_kernel_dir>

6. Reboot the target. Press ctrl-c to enter u-boot and configure it to load with new kernel image. Update the board environment variables to use the correct kernel image and device-tree file. Save and reset the target.

U-Boot command:

      => env print image fdt_file

      => setenv image zImage_cy

      => setenv fdt_file cy.dtb

      => saveenv

      => env print image fdt_file

    Before "reset", connect the wifi dongle to the target.

      => reset

7. Check the updated kernel version using "uname -a". Boot up the target board with the above zImage and insmod the following driver modules.

      $ insmod /lib/modules/<kernel_dir>/compat.ko

      $ insmod /lib/modules/<kernel_dir>/cfg80211.ko

      $ insmod /lib/modules/<kernel_dir>/brcmutil.ko

      $ insmod /lib/modules/<kernel_dir>/brcmfmac.ko

8. Check the new wlan interface "wlan0" created in "ifconfig" menu.

      $ ifconfig

eth0      Link encap:Ethernet  HWaddr 00:04:9F:04:0C:EE

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

..

..

wlan0    Link encap:Ethernet  HWaddr 00:90:4C:2A:0A:00

          inet6 addr: fe80::290:4cff:fe2a:a00/64 Scope:Link

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:652 (652.0 B)

9. Check the kernel logs by "dmesg". Check the FMAC firmware version and the logs showing "wlan0" which is the new interface created in "ifconfig".

      $ dmesg | tail

brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: Nov 14 2017 18:47:34 version 13.10.271 (TOB) (r674299 WLTEST) FWID 01-c46a1839

brcmfmac: brcmf_c_preinit_dcmds: CLM version = API: 18.2 Data: 9.10.0 Compiler: 1.36.1 ClmImport: 1.34.1 Creation: 2017-11-14 18:45:42

IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready

10. Give full permission for "wl" utility since this will be used for any wlan configuration or getting wlan status.

      $ chmod +x /bin/wl_fmac_imx

11. End users prefer to use wpa_supplicant and wpa_cli commands to configure WLAN. The supplicant uses a global configuration file. The following example is based on a minimal configuration file which let supplicant to join a SSID with open network. Refer to: WPA_Supplicant page for more details on advanced supplicant configuration.

  • Copy and paste the below configuration on /etc/wpa_supplicant file.

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

update_config=1

 

network={

ssid="XX"

key_mgmt=NONE

}

  • Start the supplicant to run in background. Basically the below command takes driver(nl80211), interface(wlan0), configuration file(/etc/wpa_supplicant).

$ wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf -B

  • Run wpa_cli and look for connection status.

$ wpa_cli

wpa_cli v2.5

Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.

See README for more details.

Selected interface 'wlan0'

Interactive mode

> status

bssid=xx:xx:xx:xx:xx:xx

freq=2417

ssid=XX

id=0

mode=station

pairwise_cipher=NONE

group_cipher=NONE

key_mgmt=NONE

wpa_state=COMPLETED

ip_address=x.x.x.x

address=xx:xx:xx:xx:xx:xx

uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

> scan_results

bssid / frequency / signal level / flags / ssid

xx:xx:xx:xx:xx:xx       2417    -69     [ESS]   XX

> disconnect

OK

<3>CTRL-EVENT-DISCONNECTED bssid=xx:xx:xx:xx:xx:xx reason=3 locally_generated=1

> status

wpa_state=DISCONNECTED

ip_address=x.x.x.x

address=xx:xx:xx:xx:xx:xx

uuid=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

> reconnect

OK

<3>CTRL-EVENT-SCAN-STARTED

<3>CTRL-EVENT-SCAN-RESULTS

<3>WPS-AP-AVAILABLE

<3>Trying to associate with SSID 'XX'

<3>Associated with xx:xx:xx:xx:xx:xx

<3>CTRL-EVENT-CONNECTED - Connection to xx:xx:xx:xx:xx:xx completed [id=0 id_str=]

12. Obtain IP address from access point.

      $ udhcpc -i wlan0

      $ ifconfig

..

..

wlan0    Link encap:Ethernet  HWaddr 00:90:4C:2A:0A:00

          inet addr:192.168.43.249  Bcast:192.168.43.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:3 errors:0 dropped:0 overruns:0 frame:0

          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:702 (702.0 B)  TX bytes:1772 (1.7 KiB)

 

(Note: the DHCP client could be different for different platforms)

This tutorial is intended as an introduction to adding the FMAC driver to your iMX6 UVELK running Freescale 4.1.15.x with Murata 1DX. This guide assumes that the 4.1.15 kernel is already booted up and running on your iMX6 UVELK board. From here, this tutorial is meant to guide on how to load in precompiled FMAC drivers onto your iMX6 UVELK board running 4.1.15 without recompiling the kernel. In another post, instructions will be provided on how to compile the driver for any kernel and how to port in the latest changes to the driver.

 

1. Download and transfer the attached tarball to your platform.

2. Untar and cd:

          $ tar xzvf brcmfmac_imx_minya_backport.tar.gz

          $ cd brcmfmac_imx

3. Run the setup script and choose your platform (only 43430 and 43455 currently supported):

          $ ./install.sh 43430

4. Reboot the device:

          $ reboot

5. Interrupt u-boot, pass the following commands at prompt:

          => setenv fdt_file imx6ul-14x14-evk-btwifi-fmac.dtb

          => saveenv

          => reset

6. After reboot, run the insmod script:

          $ cd brcmfmac_imx

          $ ./insmod_fmac.sh

7. At this point, the driver should be usable. A quick scan should yield all the AP’s around you:

          $ wl_fmac_imx scan

          $ wl_fmac_imx scanresults

 

Note on attachments:

brcmfmac_imx_minya_backport.tar.gz => most recent driver

brcmfmac_imx.tar.gz => older version from original posting

1. First follow this to prepare your iMX.

Quick Start with iMX6 Ultralite EVK and Mass Market Modules

 

2. Below are logs which shows using WPA supplicant with bcmdhd.

 

3. Below restart_wpa_supplicant is a script. The commands in it are

     killall wpa_supplicant

     wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D nl80211

   

root@imx6ulevk:~# ./bcm_imx/scripts/insmod_dhd.sh

FW=/lib/firmware/bcm/fw_bcmdhd.bin

NVRAM=/lib/firmware/bcm/bcmdhd.cal

dhd_module_init in

Power-up adapter 'DHD generic adapter'

wifi_platform_bus_enumerate device present 1

mmc0: queuing unknown CIS tuple 0x80 (2 bytes)

mmc0: queuing unknown CIS tuple 0x80 (3 bytes)

mmc0: queuing unknown CIS tuple 0x80 (3 bytes)

mmc0: queuing unknown CIS tuple 0x80 (7 bytes)

mmc0: queuing unknown CIS tuple 0x80 (3 bytes)

mmc0: new high speed SDIO card at address 0001

F1 signature OK, socitype:0x1 chip:0xa9a6 rev:0x1 pkg:0x3

DHD: dongle ram size is set to 524288(orig 524288) at 0x0

wifi_platform_get_mac_addr

CFG80211-ERROR) wl_setup_wiphy : Registering Vendor80211)

wl_create_event_handler(): thread:wl_event_handler:4da started

CFG80211-ERROR) wl_event_handler : tsk Enter, tsk = 0x88f4141c

dhd_attach(): thread:dhd_watchdog_thread:4db started

dhd_attach(): thread:dhd_dpc:4dc started

dhd_deferred_work_init: work queue initialized

dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.

dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)

wifi_platform_get_mac_addr

Firmware up: op_mode=0x0005, MAC=98:f1:70:6e:8b:08

Firmware version = wl0: Dec 29 2015 15:56:15 version 7.45.41.24 (r608913) FWID 01-4e412465

dhd_wlfc_init(): successfully enabled bdcv2 tlv signaling, 79

dhd_wlfc_init: query wlfc_mode succeed, fw_caps=0x1c

dhd_wlfc_init(): wlfc_mode=0x1c, ret=0

 

 

Dongle Host Driver, version 1.141.88 (r)

Compiled from

Register interface [wlan0]  MAC: 98:f1:70:6e:8b:08

 

 

root@imx6ulevk:~# CFG80211-ERROR) wl_update_wiphybands : error reading vhtmode (-23)

CFG80211-ERROR) wl_cfg80211_connect : Connecting withff:ff:ff:ff:ff:ff channel (0) ssid "NexusV", len (6)

 

 

wl_bss_connect_done succeeded with 02:1a:11:fb:92:fb

wl_bss_connect_done succeeded with 02:1a:11:fb:92:fb

 

 

root@imx6ulevk:~# restart_wpa_supplicant

+ killall wpa_supplicant

CFG80211-ERROR) wl_cfg80211_disconnect : Reason 3

+ sleep 1

CFG80211-ERROR) wl_is_linkdown :

cfg80211: Calling CRDA to update world regulatory domain

Link down Reason : WLC_E_LINK

link down if wlan0 may call cfg80211_disconnected. event : 16, reason=2 from 02:1a:11:fb:92:fb

+ wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D nl80211

Successfully initialized wpa_supplicant

rfkill: Cannot open RFKILL control device

_dhd_wlfc_mac_entry_update():1649, entry(32)

CFG80211-ERROR) wl_update_wiphybands : error reading vhtmode (-23)

+ set +x

root@imx6ulevk:~# CFG80211-ERROR) wl_cfg80211_connect : Connecting withff:ff:ff:ff:ff:ff channel (0) ssid "NexusV", len (6)

 

 

wl_bss_connect_done succeeded with 02:1a:11:fb:92:fb

wl_bss_connect_done succeeded with 02:1a:11:fb:92:fb

 

 

root@imx6ulevk:~# cat /etc/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant

ctrl_interface_group=0

driver_param=/var/run/wlan0

update_config=1

 

 

network={

        ssid="NexusV"

        psk="12345678"

}

root@imx6ulevk:~# wl ver

1.107 RC5.0

wl0: Dec 29 2015 15:56:15 version 7.45.41.24 (r608913) FWID 01-4e412465

root@imx6ulevk:~# wl revinfo

vendorid 0x14e4

deviceid 0x43e2

radiorev 0x3da000

chipnum 0xa9a6

chiprev 0x1

chippackage 0x3

corerev 0x27

boardid 0x726

boardvendor 0x14e4

boardrev P101

driverrev 0x72d2918

ucoderev 0x413080c

bus 0x0

phytype 0xc

phyrev 0x0

anarev 0x0

nvramrev 0

root@imx6ulevk:~# wl status

SSID: "NexusV"

Mode: Managed   RSSI: -52 dBm   SNR: 0 dB       noise: -91 dBm  Flags: RSSI on-channel  Channel: 6

BSSID: 02:1A:11:FB:92:FB        Capability: ESS WEP ShortSlot

Supported Rates: [ 1(b) 2(b) 5.5(b) 6 9 11(b) 12 18 24 36 48 54 ]

RSN:

        multicast cipher: AES-CCMP

        unicast ciphers(1): AES-CCMP

        AKM Suites(1): WPA-PSK

        Capabilities(0x000c): No Pre-Auth, Pairwise, 16 PTK Replay Ctrs1 GTK Replay Ctr

HT Capable:

        Chanspec: 2.4GHz channel 6 20MHz (0x1006)

        Primary channel: 6

        HT Capabilities: SGI20

        Supported MCS : [ 0 1 2 3 4 5 6 7 ]

 

 

root@imx6ulevk:~# udhcpc -i wlan0                                                                                                               

udhcpc (v1.23.1) started

Sending discover...

Sending discover...

Sending select for 192.168.43.41...

Lease of 192.168.43.41 obtained, lease time 3600

RTNETLINK answers: File exists

/etc/udhcpc.d/50default: Adding DNS 192.168.43.1

root@imx6ulevk:~# ping 192.168.43.1

PING 192.168.43.1 (192.168.43.1): 56 data bytes

64 bytes from 192.168.43.1: seq=0 ttl=64 time=66.056 ms

64 bytes from 192.168.43.1: seq=1 ttl=64 time=26.829 ms

64 bytes from 192.168.43.1: seq=2 ttl=64 time=24.099 ms

64 bytes from 192.168.43.1: seq=3 ttl=64 time=21.426 ms

64 bytes from 192.168.43.1: seq=4 ttl=64 time=22.528 ms

^C

--- 192.168.43.1 ping statistics ---

5 packets transmitted, 5 packets received, 0% packet loss

round-trip min/avg/max = 21.426/32.187/66.056 ms

root@imx6ulevk:~#

CTRL-A Z for help | 115200 8N1 | NOR | Minicom 2.7 | VT102 | Offline | ttyUSB0                                                                 

BSA server, bsa_server, reads the configuration parameters from the bt_config.xml text file. If the bt_config.xml text file is not present, one will be created and the random Bluetooth MAC address will be used to setup the bluetooth device. If the configuration file exist, the device will be set based on the configuration set in the file.

 

root@imx6ulevk_1:~/mmp/bsa# cat bt_config.xml

<X_BROADCOM_COM_BluetoothAdapter>

  <bt_config>

    <enable>1</enable>

    <visible>1</visible>

    <connectable>1</connectable>

    <local_name>My BSA Bluetooth Device</local_name>

    <bd_addr>BE:EF:BE:EF:A3:56</bd_addr>

    <class_of_device>00:04:24</class_of_device>

    <pin_code>0000</pin_code>

    <pin_len>4</pin_len>

    <io_capabilities>1</io_capabilities>

    <root_path>./pictures</root_path>

  </bt_config>

</X_BROADCOM_COM_BluetoothAdapter>

root@imx6ulevk_1:~/mmp/bsa#

Filter Blog

By date:
By tag: