bcmdhd: Use PRODUCT_COPY_FILES to copy wlan FW

Change-Id: Iced1c0f3c02c83fc5d18a0f92e19c4086b47015a
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/bcmdhd/firmware/Android.mk b/bcmdhd/firmware/Android.mk
index 128945c..d5028cc 100644
--- a/bcmdhd/firmware/Android.mk
+++ b/bcmdhd/firmware/Android.mk
@@ -1,6 +1,4 @@
 LOCAL_PATH := $(call my-dir)
 ifeq ($(BOARD_WLAN_DEVICE_REV),bcm4329)
     include $(LOCAL_PATH)/bcm4329/Android.mk
-else
-    include $(LOCAL_PATH)/bcm4330/Android.mk
 endif
diff --git a/bcmdhd/firmware/bcm4330/Android.mk b/bcmdhd/firmware/bcm4330/Android.mk
deleted file mode 100644
index de416cd..0000000
--- a/bcmdhd/firmware/bcm4330/Android.mk
+++ /dev/null
@@ -1,42 +0,0 @@
-#
-# Copyright (C) 2008 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH := $(call my-dir)
-
-########################
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := fw_bcmdhd.bin
-LOCAL_MODULE_CLASS := ETC
-#LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/firmware
-LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/firmware
-LOCAL_MODULE_TAGS := optional
-ifeq ($(BOARD_WLAN_DEVICE_REV),bcm4330b1)
-LOCAL_SRC_FILES := fw_bcm4330_b1.bin
-else
-LOCAL_SRC_FILES := fw_bcm4330_b2.bin
-endif
-include $(BUILD_PREBUILT)
-
-########################
-
-#include $(CLEAR_VARS)
-#LOCAL_MODULE := fw_bcmdhd_apsta.bin
-#LOCAL_MODULE_CLASS := ETC
-#LOCAL_MODULE_PATH := $(TARGET_OUT)/vendor/firmware
-#LOCAL_SRC_FILES := $(LOCAL_MODULE)
-#include $(BUILD_PREBUILT)
-
-########################
diff --git a/bcmdhd/firmware/bcm4330/device-bcm.mk b/bcmdhd/firmware/bcm4330/device-bcm.mk
new file mode 100644
index 0000000..11a135c
--- /dev/null
+++ b/bcmdhd/firmware/bcm4330/device-bcm.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2008 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+########################
+
+ifeq ($(BOARD_WLAN_DEVICE_REV),bcm4330_b1)
+BCM_FW_SRC_FILES := fw_bcm4330_b1.bin
+else
+BCM_FW_SRC_FILES := fw_bcm4330_b2.bin
+endif
+
+PRODUCT_COPY_FILES += \
+    hardware/broadcom/wlan/bcmdhd/firmware/bcm4330/$(BCM_FW_SRC_FILES):system/vendor/firmware/fw_bcmdhd.bin
+
+########################