add the carl9170 wifi driver for ar9170 devices
[openwrt/svn-archive/archive.git] / package / carl9170 / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9 include $(INCLUDE_DIR)/kernel.mk
10
11 PKG_NAME:=carl9170
12 PKG_VERSION:=0.9.2.1
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://www.kernel.org/pub/linux/kernel/people/chr/carl9170/$(PKG_VERSION)
17 PKG_MD5SUM:=5f0057ea651343460ea4f1fb093a4bdf
18
19 include $(INCLUDE_DIR)/package.mk
20
21 DRV_PATH:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170
22
23 define KernelPackage/carl9170
24 SUBMENU:=Wireless Drivers
25 TITLE:=Driver for Atheros AR9170 USB sticks
26 DEPENDS:=+kmod-mac80211 +kmod-ath
27 URL:=http://www.kernel.org/pub/linux/kernel/people/chr/carl9170
28 FILES:=$(DRV_PATH)/carl9170usb.$(LINUX_KMOD_SUFFIX)
29 AUTOLOAD:=$(call AutoLoad,60,carl9170usb)
30 endef
31
32 define KernelPackage/carl9170/description
33 This package contains a driver for Atheros AR9170 USB sticks using the free firmware
34 endef
35
36 define Build/Prepare
37 rm -rf $(PKG_BUILD_DIR)
38 mkdir -p $(PKG_BUILD_DIR)
39 $(HOST_TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(PKG_SOURCE)
40 $(HOST_TAR) -C $(PKG_BUILD_DIR) -xf $(PKG_BUILD_DIR)/$(PKG_VERSION)/driver/carl9170-driver-$(PKG_VERSION).tar
41 ln -s Makefile.standalone $(DRV_PATH)/Makefile
42 ln -s $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)/drivers/net/wireless/ath/
43 $(Build/Patch)
44 endef
45
46 BUILDFLAGS= \
47 $(if $(CONFIG_ATH_USER_REGD),-DATH_USER_REGD)
48
49 define Build/Compile
50 $(MAKE) -C $(LINUX_DIR) \
51 SUBDIRS="$(DRV_PATH)" \
52 ARCH="$(LINUX_KARCH)" \
53 CROSS_COMPILE="$(KERNEL_CROSS)" \
54 CC="$(TARGET_CC) -I$(STAGING_DIR)/usr/include/mac80211 $(BUILDFLAGS)"
55 endef
56
57 define KernelPackage/carl9170/install
58 $(INSTALL_DIR) $(1)/lib/firmware
59 $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_VERSION)/firmware_build/carl9170.fw $(1)/lib/firmware/
60 endef
61
62 $(eval $(call KernelPackage,carl9170))