For some reason I was experiencing wifi disconnects with the ath9k wifi driver under Linux (Ubuntu 12.04). After reading numerous blogs and bug reports (disable ipv6, use hwcrypto=0, etc.), I suspected it was the power management that was somehow disabling the driver, in turn leading to a disconnect. This will probably be fixed in newer kernels (Ubuntu 12.04 ships 3.2.x).

For now I took a shortcut and disabled the power management on the wlan0 interface. For this to work I created a (super)small script: /etc/network/if-up.d/wifipower:

#!/bin/sh -e
case $IFACE in
    wlan0) /sbin/iwconfig "$IFACE" power off ;;
esac