Well, I managed to resolve the issue after more troubleshooting. First off, there is no need to suspend the ath9k module. There were two other issues instead.
Firstly, the AP I was using used a hidden SSID (non-broadcast), and the wlan0 couldn't re-authenticate upon resume. As the use of hidden SSID is not a very effective security measure, I decided to do away with it. After making the changes at the AP, wlan0 managed to re-authenticate itself with the AP.
After successful re-authentication, the wlan0 interface still could not be used to connect to the Internet. The second issue was that dhcpcd was not running after resume. I am not sure if this is the normal. In any case, to resolve the issue, I added a script in /etc/pm/sleep.d/. The script is simply as follows:
Code:
#!/bin/bash
WLAN0_UP=`/sbin/ifconfig | grep wlan0 | awk '{print $1}'`
case $1 in
hibernate)
echo "Hey guy, we are going to suspend to disk!"
;;
suspend)
echo "Oh, this time we're doing a suspend to RAM. Cool!"
;;
thaw)
echo "oh, suspend to disk is over, we are resuming..."
#dhcpcd somehow won't re-assign IP to wlan0 after resume
#thus the need of this fix
if [ -n $WLAN_UP ]; then
dhcpcd wlan0
fi
;;
resume)
echo "hey, the suspend to RAM seems to be over..."
#dhcpcd somehow won't re-assign IP to wlan0 after resume
#thus the need of this fix
if [ -n $WLAN_UP ]; then
dhcpcd wlan0
fi
;;
*) echo "somebody is calling me totally wrong."
;;
esac
Cheers