Skip to contentSkip to conversation

package: add support for the wf111 WiFi driver and its utilities

PATCH New Antoine Tenart 2 participants 3 messages Jan 28, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package: add support for the wf111 WiFi driver and its utilities

Adds support for the BlueGiga WF111 WiFi driver and the binary utilities distributed alongside the driver. An account is required to download the sources from the BlueGiga website, which can be created freely. The driver is available for armv5, arvmv7a and i386.

It is not possible to automatically retrieve the sources, because of the required user account needed on the BlueGiga website, an option is added to let the Buildroot user specify the directory were the driver's tarball was downloaded.

Finally, two options must be selected in the Linux kernel configuration:
CONFIG_WIRELESS_EXT and CONFIG_WEXT_PRIV.

---
 package/Config.in       |  1 +
 package/wf111/Config.in | 25 +++++++++++++++++++++++++
 package/wf111/wf111.mk  | 32 ++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+)
 create mode 100644 package/wf111/Config.in
 create mode 100644 package/wf111/wf111.mk
package/Config.in +1 -0
index d65de7057ff4..dc0b0bc15e06 100644
@@ -387,6 +387,7 @@ endif
 	source "package/usbmount/Config.in"
 	source "package/usbutils/Config.in"
 	source "package/w_scan/Config.in"
+	source "package/wf111/Config.in"
 	source "package/wipe/Config.in"
 	source "package/xorriso/Config.in"
 endmenu
package/wf111/Config.in new file +25 -0
new file mode 100644
index 000000000000..4806a6958476
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_WF111
+	bool "wf111"
+	depends on BR2_LINUX_KERNEL
+	depends on BR2_ARM_CPU_ARMV5 || BR2_ARM_CPU_ARMV7A || BR2_i386
+	# Binary tools are distributed alongside the driver, and are
+	# dynamically linked against the glibc.
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  BlueGiga WF111 WiFi driver and utilities.
+
+	  Warning: CONFIG_WIRELESS_EXT and CONFIG_WEXT_PRIV must be
+	  selected in the Linux kernel configuration.
+
+if BR2_PACKAGE_WF111
+
+config BR2_PACKAGE_WF111_TARBALL_PATH
+	string "WF111 tarball directory location"
+	help
+	  The WF111 tarball can be retrieve on the BlueGiga website after
+	  registration. This options specify the path were the tarball is
+	  locally saved.
+
+	  http://www.bluegiga.com/en-US/products/wifi-modules/wf111-wifi-module/
+
+endif
package/wf111/wf111.mk new file +32 -0
new file mode 100644
index 000000000000..a9642e5d724a
@@ -0,0 +1,32 @@
+################################################################################
+#
+# wf111
+#
+################################################################################
+
+WF111_VERSION = 5.2.2
+WF111_SITE_METHOD = file
+WF111_SITE = $(BR2_PACKAGE_WF111_TARBALL_PATH)
+WF111_DEPENDENCIES = linux
+
+ifeq ($(BR2_ARM_CPU_ARMV7A),y)
+WF111_SOURCE = wf111-linux-driver_5.2.2-r1_armv7-a.tar.gz
+else ifeq ($(BR2_ARM_CPU_ARMV5),y)
+WF111_SOURCE = wf111-linux-driver_5.2.2-r1_armv5t.tar.gz
+else ifeq ($(BR2_i386),y)
+WF111_SOURCE = wf111-linux-driver_5.2.2-r1_x86.tar.gz
+endif
+
+define WF111_BUILD_CMDS
+	make \
+		-C $(@D) PWD=$(@D) ARCH=arm \
+		CC=$(TARGET_CC) LD=$(TARGET_LD) \
+		KDIR=$(LINUX_DIR) \
+		install_static
+endef
+
+define WF111_INSTALL_TARGET_CMDS
+	rsync -a $(@D)/output/ $(TARGET_DIR)
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.2.2
#1 lore raw

PATCH 1/1 package: add support for the wf111 WiFi driver and its utilities

Dear Antoine Tenart,

The preferred title for a new package is:

<package name>: new package

Quoted 4 lines · Antoine Tenart

Adds support for the BlueGiga WF111 WiFi driver and the binary utilities distributed alongside the driver. An account is required to download the sources from the BlueGiga website, which can be created freely. The driver is available for armv5, arvmv7a and i386.

Typo on armv7.

Quoted 1 line

It is not possible to automatically retrieve the sources, because of the

Missing "Since" at the beginning of the sentence?

Quoted 2 lines

required user account needed on the BlueGiga website, an option is added to let the Buildroot user specify the directory were the driver's

were -> where

"the driver's tarball" -> the driver tarball.

Quoted 4 lines

tarball was downloaded.

Finally, two options must be selected in the Linux kernel configuration:
CONFIG_WIRELESS_EXT and CONFIG_WEXT_PRIV.

Please explain that those options are blind options, so they cannot be enabled by a change in linux/linux.mk. And maybe you should explain how the user is supposed to enable such blind options: either patch the kernel to make them non-blind, or enable some other random WiFi driver that selects them.

Quoted 8 lines
package/wf111/Config.in new file +2 -0
new file mode 100644
index 000000000000..4806a6958476
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_WF111
+	bool "wf111"

package/wf111/Config.in line 12

Quoted 10 lines
package/wf111/Config.in new file +10 -0
+	depends on BR2_LINUX_KERNEL
+	depends on BR2_ARM_CPU_ARMV5 || BR2_ARM_CPU_ARMV7A || BR2_i386
+	# Binary tools are distributed alongside the driver, and are
+	# dynamically linked against the glibc.
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	help
+	  BlueGiga WF111 WiFi driver and utilities.
+
+	  Warning: CONFIG_WIRELESS_EXT and CONFIG_WEXT_PRIV must be
+	  selected in the Linux kernel configuration.

See above: please give more details about this. Also, the upstream URL should be in the Config.in help text of the main option, i.e here.

package/wf111/Config.in line 17

Quoted 5 lines
package/wf111/Config.in new file +5 -0
+
+if BR2_PACKAGE_WF111
+
+config BR2_PACKAGE_WF111_TARBALL_PATH
+	string "WF111 tarball directory location"

No need to repeat "WF111" in the prompt, since this option will appear as a sub-option of the previous one, so:

string "local tarball location"

or something like that.

package/wf111/Config.in line 19

Quoted 2 lines
package/wf111/Config.in new file +2 -0
+	help
+	  The WF111 tarball can be retrieve on the BlueGiga website after

retrieve -> retrieved.

package/wf111/Config.in line 20

Quoted 1 line
package/wf111/Config.in new file +1 -0
+	  registration. This options specify the path were the tarball is

options -> option
specify -> specifies
were -> where

package/wf111/Config.in line 25

Quoted 5 lines
package/wf111/Config.in new file +5 -0
+	  locally saved.
+
+	  http://www.bluegiga.com/en-US/products/wifi-modules/wf111-wifi-module/
+
+endif

Please add:

comment "wf111 needs an (e)glibc toolchain"
depends on BR2_LINUX_KERNEL
depends on BR2_ARM_CPU_ARMV5 || BR2_ARM_CPU_ARMV7A || BR2_i386 depends on !BR2_TOOLCHAIN_USES_GLIBC

Quoted 6 lines
package/wf111/wf111.mk new file +0 -0
new file mode 100644
index 000000000000..a9642e5d724a

package/wf111/wf111.mk line 9

Quoted 9 lines
package/wf111/wf111.mk new file +9 -0
@@ -0,0 +1,32 @@
+################################################################################
+#
+# wf111
+#
+################################################################################
+
+WF111_VERSION = 5.2.2
+WF111_SITE_METHOD = file
+WF111_SITE = $(BR2_PACKAGE_WF111_TARBALL_PATH)

Maybe:

WF111_SITE = $(call qstrip,$(BR2_PACKAGE_WF111_TARBALL_PATH))

to strip the double quotes that appear in the value of string options.

package/wf111/wf111.mk line 21

Quoted 12 lines
package/wf111/wf111.mk new file +12 -0
+WF111_DEPENDENCIES = linux
+
+ifeq ($(BR2_ARM_CPU_ARMV7A),y)
+WF111_SOURCE = wf111-linux-driver_5.2.2-r1_armv7-a.tar.gz
+else ifeq ($(BR2_ARM_CPU_ARMV5),y)
+WF111_SOURCE = wf111-linux-driver_5.2.2-r1_armv5t.tar.gz
+else ifeq ($(BR2_i386),y)
+WF111_SOURCE = wf111-linux-driver_5.2.2-r1_x86.tar.gz
+endif
+
+define WF111_BUILD_CMDS
+	make \
	$(MAKE)

package/wf111/wf111.mk line 22

Quoted 1 line
package/wf111/wf111.mk new file +1 -0
+		-C $(@D) PWD=$(@D) ARCH=arm \

ARCH=arm, really ? :-)

Please use $(LINUX_MAKE_FLAGS) instead, which already contains ARCH= correctly.

package/wf111/wf111.mk line 23

Quoted 1 line
package/wf111/wf111.mk new file +1 -0
+		CC=$(TARGET_CC) LD=$(TARGET_LD) \

With $(LINUX_MAKE_FLAGS) containing CROSS_COMPILE, this should probably become unnecessary.

package/wf111/wf111.mk line 29

Quoted 6 lines
package/wf111/wf111.mk new file +6 -0
+		KDIR=$(LINUX_DIR) \
+		install_static
+endef
+
+define WF111_INSTALL_TARGET_CMDS
+	rsync -a $(@D)/output/ $(TARGET_DIR)

We typically don't use rsync for such things. What does $(@D)/output contains exactly? We would more typically use:

	cp -dpfr $(@D)/output/* $(TARGET_DIR)

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 package: add support for the wf111 WiFi driver and its utilities

Thomas,

Quoted 9 lines · Thomas Petazzoni
Quoted 3 lines

Finally, two options must be selected in the Linux kernel configuration:
CONFIG_WIRELESS_EXT and CONFIG_WEXT_PRIV.

Please explain that those options are blind options, so they cannot be enabled by a change in linux/linux.mk. And maybe you should explain how the user is supposed to enable such blind options: either patch the kernel to make them non-blind, or enable some other random WiFi driver that selects them.

Will do.

Quoted 7 lines

Please add:

comment "wf111 needs an (e)glibc toolchain"
depends on BR2_LINUX_KERNEL
depends on BR2_ARM_CPU_ARMV5 || BR2_ARM_CPU_ARMV7A || BR2_i386 depends on !BR2_TOOLCHAIN_USES_GLIBC

Sure.

Quoted 4 lines

package/wf111/wf111.mk line 22

Quoted 2 lines
package/wf111/wf111.mk new file +1 -0
+		-C $(@D) PWD=$(@D) ARCH=arm \

ARCH=arm, really ? :-)

Oops :)

Quoted 8 lines

Please use $(LINUX_MAKE_FLAGS) instead, which already contains ARCH= correctly.

package/wf111/wf111.mk line 23

Quoted 1 line
package/wf111/wf111.mk new file +1 -0
+		CC=$(TARGET_CC) LD=$(TARGET_LD) \

With $(LINUX_MAKE_FLAGS) containing CROSS_COMPILE, this should probably become unnecessary.

I'll update in v2.

Quoted 11 lines

package/wf111/wf111.mk line 29

Quoted 7 lines
package/wf111/wf111.mk new file +6 -0
+		KDIR=$(LINUX_DIR) \
+		install_static
+endef
+
+define WF111_INSTALL_TARGET_CMDS
+	rsync -a $(@D)/output/ $(TARGET_DIR)

We typically don't use rsync for such things. What does $(@D)/output contains exactly? We would more typically use:

Quoted 1 line
	cp -dpfr $(@D)/output/* $(TARGET_DIR)

Utility binaries, the firmware and the kernel module, all in theirs respective directories. cp -dpfr should be fine, I'll update.

I'll also fix all the typos, and I'll add a check to be sure BR2_PACKAGE_WF111_TARBALL_PATH is correctly filled.

Thanks!

Antoine

Signature · 3 lines
Antoine T?nart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com