kernel-module-atheros: apply load parameters to correct module
In Linux 2.6.35, the kernel module accepting the parameters on load was 'ath6kl_sdio' while in 3.10 is 'ath6kl_core'. So we need to apply the load parameters to either module depending on the kernel version. This is solved by configuring the modprobe configuration file '/etc/modprobe.d/atheros.conf' with the parameters to the correct module instead of passing them in the command line. Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
parent
9a7841e346
commit
cb25e67665
|
|
@ -28,6 +28,7 @@ SRC_URI += " \
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
ATH_ONLY_INSTALL_FW = "${@base_version_less_or_equal('PREFERRED_VERSION_linux-dey', '2.6.35.14', '', '1', d)}"
|
ATH_ONLY_INSTALL_FW = "${@base_version_less_or_equal('PREFERRED_VERSION_linux-dey', '2.6.35.14', '', '1', d)}"
|
||||||
|
ATH6KL_MOD = "${@base_conditional('ATH_ONLY_INSTALL_FW', '1' , 'ath6kl_core', 'ath6kl_sdio', d)}"
|
||||||
|
|
||||||
EXTRA_OEMAKE = "DEL_PLATFORM=${MACHINE} KLIB_BUILD=${STAGING_KERNEL_DIR} ATH_ONLY_INSTALL_FW=${ATH_ONLY_INSTALL_FW}"
|
EXTRA_OEMAKE = "DEL_PLATFORM=${MACHINE} KLIB_BUILD=${STAGING_KERNEL_DIR} ATH_ONLY_INSTALL_FW=${ATH_ONLY_INSTALL_FW}"
|
||||||
|
|
||||||
|
|
@ -40,6 +41,7 @@ do_install_append() {
|
||||||
install -m 0755 ${WORKDIR}/atheros ${D}${sysconfdir}/network/if-pre-up.d/
|
install -m 0755 ${WORKDIR}/atheros ${D}${sysconfdir}/network/if-pre-up.d/
|
||||||
install -d ${D}${sysconfdir}/modprobe.d
|
install -d ${D}${sysconfdir}/modprobe.d
|
||||||
install -m 0644 ${WORKDIR}/atheros.conf ${D}${sysconfdir}/modprobe.d/
|
install -m 0644 ${WORKDIR}/atheros.conf ${D}${sysconfdir}/modprobe.d/
|
||||||
|
echo "options ${ATH6KL_MOD} ath6kl_p2p=1 softmac_enable=1" >> ${D}${sysconfdir}/modprobe.d/atheros.conf
|
||||||
}
|
}
|
||||||
|
|
||||||
FILES_${PN} += " \
|
FILES_${PN} += " \
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ MAC_FILENAME="softmac"
|
||||||
# Get the wlan MAC address from kernel command line. Use a default
|
# Get the wlan MAC address from kernel command line. Use a default
|
||||||
# value if the address has not been set.
|
# value if the address has not been set.
|
||||||
#
|
#
|
||||||
MAC_ADDR="$(sed -e 's,.\+ethaddr2=\([^[:blank:]]\+\)[[:blank:]].*,\1,g' /proc/cmdline)"
|
MAC_ADDR="$(sed -ne 's,.\+ethaddr2=\([^[:blank:]]\+\)[[:blank:]].*,\1,g;T;p' /proc/cmdline)"
|
||||||
if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then
|
if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then
|
||||||
MAC_ADDR="00:04:F3:4C:B1:D3"
|
MAC_ADDR="00:04:F3:4C:B1:D3"
|
||||||
fi
|
fi
|
||||||
|
|
@ -53,7 +53,7 @@ if ! cmp -s ${RAM_DRIVE}/${MAC_FILENAME} ${FIRMWARE_DIR}/${MAC_FILENAME}; then
|
||||||
fi
|
fi
|
||||||
rm -f ${RAM_DRIVE}/${MAC_FILENAME}
|
rm -f ${RAM_DRIVE}/${MAC_FILENAME}
|
||||||
|
|
||||||
BDATA_SOURCE=Digi_6203-6233-World.bin
|
BDATA_SOURCE="Digi_6203-6233-World.bin"
|
||||||
if [ -e "/sys/kernel/machine/name" ]; then
|
if [ -e "/sys/kernel/machine/name" ]; then
|
||||||
# Figure out which wireless region we are in. The US has rules for
|
# Figure out which wireless region we are in. The US has rules for
|
||||||
# what channels can be used and at what power level. We use a different set of
|
# what channels can be used and at what power level. We use a different set of
|
||||||
|
|
@ -65,7 +65,7 @@ if [ -e "/sys/kernel/machine/name" ]; then
|
||||||
MACHINE="$(cat /sys/kernel/machine/name)"
|
MACHINE="$(cat /sys/kernel/machine/name)"
|
||||||
REGION_CODE="$(cat /sys/kernel/${MACHINE}/mod_cert)"
|
REGION_CODE="$(cat /sys/kernel/${MACHINE}/mod_cert)"
|
||||||
if [ -z "${REGION_CODE}" -o "${US_CODE}" = "${REGION_CODE}" ]; then
|
if [ -z "${REGION_CODE}" -o "${US_CODE}" = "${REGION_CODE}" ]; then
|
||||||
BDATA_SOURCE=Digi_6203-6233-US.bin
|
BDATA_SOURCE="Digi_6203-6233-US.bin"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
logger -t atheros "Undefined machine, defaulting to world region."
|
logger -t atheros "Undefined machine, defaulting to world region."
|
||||||
|
|
@ -79,10 +79,8 @@ if [ ! -e "${BDATA_LINK}" ] || ! cmp -s "${BDATA_LINK}" "${FIRMWARE_DIR}/${BDATA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ath6kl_sdio.ko
|
# ath6kl_sdio.ko
|
||||||
ATH6KL_PARAMS="ath6kl_p2p=1 softmac_enable=1"
|
|
||||||
[ -f "/root/wifi_test_mode" ] && { ATH6KL_PARAMS="${ATH6KL_PARAMS} testmode=1"; test_mode_str=" in test mode"; }
|
|
||||||
grep -qs ath6kl_sdio /proc/modules || \
|
grep -qs ath6kl_sdio /proc/modules || \
|
||||||
modprobe --ignore-install -q ath6kl_sdio ${ATH6KL_PARAMS} || echo "Loading ath6kl_sdio module${test_mode_str}: [FAILED]"
|
modprobe --ignore-install -q ath6kl_sdio || echo "Loading ath6kl_sdio module: [FAILED]"
|
||||||
|
|
||||||
# Delay required for the interface 'wlan0' to settle down before trying to configure it.
|
# Delay required for the interface 'wlan0' to settle down before trying to configure it.
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ MAC_FILENAME="softmac"
|
||||||
# Get the wlan MAC address from kernel command line. Use a default
|
# Get the wlan MAC address from kernel command line. Use a default
|
||||||
# value if the address has not been set.
|
# value if the address has not been set.
|
||||||
#
|
#
|
||||||
MAC_ADDR="$(sed -e 's,.\+ethaddr2=\([^[:blank:]]\+\)[[:blank:]].*,\1,g' /proc/cmdline)"
|
MAC_ADDR="$(sed -ne 's,.\+ethaddr2=\([^[:blank:]]\+\)[[:blank:]].*,\1,g;T;p' /proc/cmdline)"
|
||||||
if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then
|
if [ -z "${MAC_ADDR}" -o "${MAC_ADDR}" = "00:00:00:00:00:00" ]; then
|
||||||
MAC_ADDR="00:04:F3:4C:B1:D3"
|
MAC_ADDR="00:04:F3:4C:B1:D3"
|
||||||
fi
|
fi
|
||||||
|
|
@ -53,8 +53,8 @@ if ! cmp -s ${RAM_DRIVE}/${MAC_FILENAME} ${FIRMWARE_DIR}/${MAC_FILENAME}; then
|
||||||
fi
|
fi
|
||||||
rm -f ${RAM_DRIVE}/${MAC_FILENAME}
|
rm -f ${RAM_DRIVE}/${MAC_FILENAME}
|
||||||
|
|
||||||
|
BDATA_SOURCE="calData_AR6103_Digi_X2e_B_world.bin"
|
||||||
if [ -e "/sys/kernel/machine/name" ]; then
|
if [ -e "/sys/kernel/machine/name" ]; then
|
||||||
MACHINE="$(cat /sys/kernel/machine/name)"
|
|
||||||
# Figure out which wireless region we are in. The US has rules for
|
# Figure out which wireless region we are in. The US has rules for
|
||||||
# what channels can be used and at what power level. We use a different set of
|
# what channels can be used and at what power level. We use a different set of
|
||||||
# rules for the other regions in the world that we sell into. The mod_cert field
|
# rules for the other regions in the world that we sell into. The mod_cert field
|
||||||
|
|
@ -62,15 +62,13 @@ if [ -e "/sys/kernel/machine/name" ]; then
|
||||||
# appropriate calibration file is loaded.
|
# appropriate calibration file is loaded.
|
||||||
#
|
#
|
||||||
US_CODE="0x0"
|
US_CODE="0x0"
|
||||||
|
MACHINE="$(cat /sys/kernel/machine/name)"
|
||||||
REGION_CODE="$(cat /sys/kernel/${MACHINE}/mod_cert)"
|
REGION_CODE="$(cat /sys/kernel/${MACHINE}/mod_cert)"
|
||||||
if [ -z "${REGION_CODE}" -o "${US_CODE}" = "${REGION_CODE}" ]; then
|
if [ -z "${REGION_CODE}" -o "${US_CODE}" = "${REGION_CODE}" ]; then
|
||||||
BDATA_SOURCE=calData_AR6103_Digi_X2e_B.bin
|
BDATA_SOURCE="calData_AR6103_Digi_X2e_B.bin"
|
||||||
else
|
|
||||||
BDATA_SOURCE=calData_AR6103_Digi_X2e_B_world.bin
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Undefined machine, defaulting to world region."
|
logger -t atheros "Undefined machine, defaulting to world region."
|
||||||
BDATA_SOURCE=calData_AR6103_Digi_X2e_B_world.bin
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# We don't want to rewrite NAND every time we boot so only
|
# We don't want to rewrite NAND every time we boot so only
|
||||||
|
|
@ -81,10 +79,8 @@ if [ ! -e "${BDATA_LINK}" ] || ! cmp -s "${BDATA_LINK}" "${FIRMWARE_DIR}/${BDATA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ath6kl_sdio.ko
|
# ath6kl_sdio.ko
|
||||||
ATH6KL_PARAMS="ath6kl_p2p=1 softmac_enable=1"
|
|
||||||
[ -f "/root/wifi_test_mode" ] && { ATH6KL_PARAMS="${ATH6KL_PARAMS} testmode=1"; test_mode_str=" in test mode"; }
|
|
||||||
grep -qs ath6kl_sdio /proc/modules || \
|
grep -qs ath6kl_sdio /proc/modules || \
|
||||||
modprobe --ignore-install -q ath6kl_sdio ${ATH6KL_PARAMS} || echo "Loading ath6kl_sdio module${test_mode_str}: [FAILED]"
|
modprobe --ignore-install -q ath6kl_sdio || echo "Loading ath6kl_sdio module: [FAILED]"
|
||||||
|
|
||||||
# Delay required for the interface 'wlan0' to settle down before trying to configure it.
|
# Delay required for the interface 'wlan0' to settle down before trying to configure it.
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue