cmake .
make
popd
- config/conf Kconfig
+ shift 1
+ config/conf Kconfig "$@"
cmake .
;;
echo -n "Installing firmware..."
if [ "$CONFIG_CARL9170FW_BUILD_TOOLS" = "y" ]; then
+ echo -n "Prepare firmware image..."
+ tools/src/fwprepare carlfw/carl9170.fw
+
if [ "$CONFIG_CARL9170FW_BUILD_MINIBOOT" = "y" ]; then
echo -n "Apply miniboot..."
- # also adds checksum
+ # also update checksum
tools/src/miniboot a carlfw/carl9170.fw minifw/miniboot.fw
- else
- echo -n "Add checksum..."
- tools/src/checksum carlfw/carl9170.fw
fi
fi
-
install -m 644 carlfw/carl9170.fw \
../carl9170-$CONFIG_CARL9170FW_RELEASE_VERSION.fw
echo "done."
;;
*)
- $0 config
+ $0 config "$@"
$0 compile
;;
def_bool y
prompt "Experimental Features"
+config CARL9170FW_RADAR
+ def_bool n
+ prompt "Radar pattern generator"
+ depends on CARL9170FW_EXPERIMENTAL
+ ---help---
+ With this option enabled, the firmware can generate random
+ transmission pattern that might fool a reciever to believe
+ that there is an active radar on the channel.
+ Note: sadly, no SDR here.
+
config CARL9170FW_WOL_OPTION
def_bool n
prompt "Wakeup on WLAN"
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.
#include "wl.h"
#include "rf.h"
#include "usb.h"
+#include "radar.h"
#define AR9170_WATCH_DOG_TIMER 0x100
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++;
}
+#ifdef CONFIG_CARL9170FW_RADAR
+static void radar_pattern_generator(void)
+{
+ if (fw.phy.state == CARL9170_PHY_ON) {
+ if (fw.wlan.soft_radar == NO_RADAR ||
+ fw.wlan.soft_radar >= __CARL9170FW_NUM_RADARS)
+ return;
+
+ const struct radar_info *radar = &radars[fw.wlan.soft_radar];
+ if (radar->pulses >= fw.wlan.pattern_index) {
+ fw.wlan.pattern_index = 0;
+ }
+
+ if (radar->pulses > fw.wlan.pattern_index) {
+ const struct radar_info_pattern *pattern = &radar->pattern[fw.wlan.pattern_index];
+ if (is_after_usecs(fw.wlan.radar_last, pattern->pulse_interval)) {
+ fw.wlan.radar_last = get_clock_counter();
+ set(0x1C3BC0, pattern->pulse_pattern);
+ set(0x1C3BBC, pattern->pulse_mode);
+ udelay(pattern->pulse_width);
+ set(0x1C3BBC, ~pattern->pulse_mode);
+ fw.wlan.pattern_index++;
+ }
+ }
+ }
+}
+#else
+static void radar_pattern_generator(void)
+{
+}
+#endif /* CONFIG_CARL9170FW_RADAR */
+
static void __noreturn main_loop(void)
{
/* main loop */
handle_timer();
tally_update();
+
+ radar_pattern_generator();
}
}