cmake .
make
popd
- config/conf Kconfig
+ shift 1
+ config/conf Kconfig "$@"
cmake .
;;
make
echo -n "Installing firmware..."
- if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ] &&
- [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
- echo -n "Apply miniboot..."
- tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
+ if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ]; then
+ if [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
+ echo -n "Apply miniboot..."
+ # also adds checksum
+ tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
+ else
+ echo -n "Add checksum..."
+ tools/src/checksum carlfw/carl9170.fw
+ fi
fi
- sudo install -m 644 carlfw/carl9170.fw \
- /lib/firmware/carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
+ install -m 644 carlfw/carl9170.fw \
+ ../carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
echo "done."
;;
*)
- $0 config
+ $0 config "$@"
$0 compile
;;
config CARL9170FW_USB_MODESWITCH
def_bool n
prompt "USB 1.1 / 2.0 switching support"
- depends on CARL9170FW_BROKEN_FEATURES
+ depends on CARL9170FW_BROKEN_FEATURES && CARL9170FW_USB_STANDARD_CMDS
---help---
Mostly implemented, but untested and some serious
doubts remain.
static void tally_update(void)
{
- unsigned int boff, time, delta;
+ unsigned int time;
time = get_clock_counter();
+#ifdef CONFIG_CARL9170FW_RADIO_FUNCTIONS
if (fw.phy.state == CARL9170_PHY_ON) {
+ unsigned int boff, delta;
+
delta = (time - fw.tally_clock);
fw.tally.active += delta;
if (boff & AR9170_MAC_BACKOFF_CCA)
fw.tally.cca += delta;
}
-
+#endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */
fw.tally_clock = time;
fw.counter++;
}
set(AR9170_UART_REG_TX_HOLDING, c);
while (get(AR9170_UART_REG_LINE_STATUS) &
- AR9170_UART_LINE_STS_TX_FIFO_ALMOST_EMPTY) {
+ AR9170_UART_LINE_STS_TX_FIFO_NEAR_EMPTY) {
/*
* wait until the byte has made it
*/
entries++;
}
- desc = get_wlan_txq_addr(qidx);
+ desc = (struct dma_desc *)get_wlan_txq_addr(qidx);
DBG("Queue: %d: te:%d td:%d h:%p c:%p t:%p",
qidx, entries, queue_len(&fw.wlan.tx_queue[qidx]),
# Copyright 2009 Kitware, Inc.
# Copyright 2006 Tristan Carel
#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+# nor the names of their contributors may be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+cmake_minimum_required(VERSION 2.8.4)
FIND_PROGRAM(GPERF_EXECUTABLE gperf DOC "path to the gperf executable")
MARK_AS_ADVANCED(GPERF_EXECUTABLE)
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+# nor the names of their contributors may be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
INCLUDE(FindPackageMessage)
INCLUDE(CMakeParseArguments)
#
# Copyright (c) 2009 Andreas Schneider <mail@cynapses.org>
#
-# Redistribution and use is allowed according to the terms of the New
-# BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# 1. Redistributions of source code must retain the copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# 3. The name of the author may not be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Copyright 2008 Andreas Pakulat <apaku@gmx.de>
# Copyright 2008-2009 Philip Lowman <philip@yhbt.com>
#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distributed this file outside of CMake, substitute the full
-# License text for the above reference.)
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+# nor the names of their contributors may be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#-------------------------------------------------------------------------------
BINUTILS_TAR=binutils-$(BINUTILS_VER).tar.bz2
BINUTILS_URL="http://mirrors.kernel.org/gnu/binutils/$(BINUTILS_TAR)"
-NEWLIB_VER=1.20.0
+NEWLIB_VER=2.0.0
NEWLIB_TAR=newlib-$(NEWLIB_VER).tar.gz
-NEWLIB_URL="ftp://sources.redhat.com/pub/newlib/$(NEWLIB_TAR)"
+NEWLIB_URL="ftp://sourceware.org/pub/newlib/$(NEWLIB_TAR)"
GCC_VER=4.7.2
GCC_TAR=gcc-$(GCC_VER).tar.bz2
BASEDIR=$(shell pwd)
+define checksum
+@if grep -q ' $(subst .,\.,$(1))$$' SHA256SUMS; then \
+ grep ' $(subst .,\.,$(1))$$' SHA256SUMS | sha256sum -c; \
+else \
+ echo "WARNING: no checksum defined for $(1)"; \
+fi
+endef
+
all: gcc
src/$(BINUTILS_TAR):
wget -P src $(BINUTILS_URL)
+ $(call checksum,$@)
src/$(NEWLIB_TAR):
wget -P src $(NEWLIB_URL)
+ $(call checksum,$@)
src/$(GCC_TAR):
wget -P src $(GCC_URL)
+ $(call checksum,$@)
src/binutils-$(BINUTILS_VER): src/$(BINUTILS_TAR)
tar -C src -xf $<
--- /dev/null
+6c7af8ed1c8cf9b4b9d6e6fe09a3e1d3d479fe63984ba8b9b26bf356b6313ca9 src/binutils-2.22.tar.bz2
+16093f6fa01732adf378d97fe338f113c933bdf56da22bf87c76beff13da406f src/gcc-4.7.1.tar.bz2
+c644b2847244278c57bec2ddda69d8fab5a7c767f3b9af69aa7aa3da823ff692 src/newlib-1.20.0.tar.gz
+2ab2e5b03e086d12c6295f831adad46b3e1410a3a234933a2e8fac66cb2e7a19 src/binutils-2.23.1.tar.bz2
+8a9283d7010fb9fe5ece3ca507e0af5c19412626384f8a5e9434251ae100b084 src/gcc-4.7.2.tar.bz2
+49c29e9129325e7c3b221aa829743ddcd796d024440e47c80fc0d6769af72d8a src/newlib-2.0.0.tar.gz
+
unsigned int len,
uint8_t compatible_revision)
{
- int scan = file->len, found = 0;
+ int scan, found = 0;
struct carl9170fw_desc_head *tmp = NULL;
- while (scan >= 0) {
+ /*
+ * Note: the last desc also has atleast a full desc_head.
+ * There's no reason for looking beyond that point.
+ */
+ scan = (file->len - 1) - (sizeof(*tmp) - CARL9170FW_MAGIC_SIZE);
+ while (scan > 0) {
if (file->data[scan] == descid[CARL9170FW_MAGIC_SIZE - found - 1])
found++;
else
}
if (found == CARL9170FW_MAGIC_SIZE) {
+ u16 tmp_desc_len;
+
tmp = (void *) &file->data[scan];
+ tmp_desc_len = le16_to_cpu(tmp->length);
if (!CHECK_HDR_VERSION(tmp, compatible_revision) &&
- (le16_to_cpu(tmp->length) >= len))
+ (scan + tmp_desc_len <= file->len) && (tmp_desc_len >= len))
return tmp;
}