Merge tag android-5.1.0_r1 into AOSP_5.1_MERGE

Change-Id: Ib940371ddeca0530ed8e279536cec5eb3e9ceed9
diff --git a/bcmdhd/dhdutil/dhdu.c b/bcmdhd/dhdutil/dhdu.c
index 6b2007c..2c628c2 100644
--- a/bcmdhd/dhdutil/dhdu.c
+++ b/bcmdhd/dhdutil/dhdu.c
@@ -2154,7 +2154,7 @@
 	ramsize = *(uint32*)buf;
 
 	if (!ramsize)
-		ramsize = start + size;
+		ramsize = size;
 
 	if ((fp = fopen(fname, "wb")) == NULL) {
 		fprintf(stderr, "%s: Could not open %s: %s\n",
@@ -2165,7 +2165,7 @@
 
 	/* default size to full RAM */
 	if (!size)
-		size = ramsize - start;
+		size = ramsize;
 
 	/* read memory and write to file */
 	while (size) {
diff --git a/bcmdhd/firmware/bcm43341/device-bcm.mk b/bcmdhd/firmware/bcm43341/device-bcm.mk
new file mode 100644
index 0000000..3ee7745
--- /dev/null
+++ b/bcmdhd/firmware/bcm43341/device-bcm.mk
@@ -0,0 +1,24 @@
+#
+# 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.
+#
+
+########################
+-include hardware/broadcom/wlan/bcmdhd/config/config-bcm.mk
+
+BCM_FW_SRC_FILE_STA := fw_bcm43341.bin
+
+PRODUCT_COPY_FILES += \
+    hardware/broadcom/wlan/bcmdhd/firmware/bcm43341/$(BCM_FW_SRC_FILE_STA):$(TARGET_COPY_OUT_VENDOR)/firmware/fw_bcmdhd.bin
+########################
diff --git a/bcmdhd/firmware/bcm43341/fw_bcm43341.bin b/bcmdhd/firmware/bcm43341/fw_bcm43341.bin
new file mode 100644
index 0000000..368b0a1
--- /dev/null
+++ b/bcmdhd/firmware/bcm43341/fw_bcm43341.bin
Binary files differ
diff --git a/bcmdhd/firmware/bcm4343/device-bcm.mk b/bcmdhd/firmware/bcm4343/device-bcm.mk
new file mode 100644
index 0000000..f3cf3e3
--- /dev/null
+++ b/bcmdhd/firmware/bcm4343/device-bcm.mk
@@ -0,0 +1,22 @@
+# Copyright 2013 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.
+
+-include hardware/broadcom/wlan/bcmdhd/config/config-bcm.mk
+
+BCM_FW_SRC_FILE_STA := fw_bcm4343.bin
+BCM_FW_SRC_FILE_AP  := fw_bcm4343_apsta.bin
+
+PRODUCT_COPY_FILES += \
+    hardware/broadcom/wlan/bcmdhd/firmware/bcm4343/$(BCM_FW_SRC_FILE_STA):system/vendor/firmware/fw_bcmdhd.bin \
+    hardware/broadcom/wlan/bcmdhd/firmware/bcm4343/$(BCM_FW_SRC_FILE_AP):system/vendor/firmware/fw_bcmdhd_apsta.bin
diff --git a/bcmdhd/firmware/bcm4343/fw_bcm4343.bin b/bcmdhd/firmware/bcm4343/fw_bcm4343.bin
new file mode 100644
index 0000000..cd3941e
--- /dev/null
+++ b/bcmdhd/firmware/bcm4343/fw_bcm4343.bin
Binary files differ
diff --git a/bcmdhd/firmware/bcm4343/fw_bcm4343_apsta.bin b/bcmdhd/firmware/bcm4343/fw_bcm4343_apsta.bin
new file mode 100644
index 0000000..97580dd
--- /dev/null
+++ b/bcmdhd/firmware/bcm4343/fw_bcm4343_apsta.bin
Binary files differ
diff --git a/bcmdhd/firmware/bcm4354/fw_bcm4354.bin b/bcmdhd/firmware/bcm4354/fw_bcm4354.bin
index 1ad1933..e3d12be 100644
--- a/bcmdhd/firmware/bcm4354/fw_bcm4354.bin
+++ b/bcmdhd/firmware/bcm4354/fw_bcm4354.bin
Binary files differ
diff --git a/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin b/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin
index 0be3ffc..6a690b5 100644
--- a/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin
+++ b/bcmdhd/firmware/bcm4354/fw_bcm4354_ap.bin
Binary files differ
diff --git a/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin b/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin
old mode 100755
new mode 100644
index 052592b..15ad73f
--- a/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin
+++ b/bcmdhd/firmware/bcm4356/fw_bcm4356_ap_pcie.bin
Binary files differ
diff --git a/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin b/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin
old mode 100755
new mode 100644
index 6e22483..79c3c99
--- a/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin
+++ b/bcmdhd/firmware/bcm4356/fw_bcm4356_pcie.bin
Binary files differ