If you have a TP-LINK router that seems to be cooked, but you can still ping it you should be ok and recovery is easier then you think.
This works perfectly for the TL-WR1043ND, and from what I can gather it just may save you on the WR940N as well.
1. unplug the power
2. Plug the power back in
3. Wait until the SYS light blinks then HOLD DOWN the QSS button
4. wait until you see the SYS LED flash VERY quickly then you can let go of the QSS button. you are now in recovery mode
you should now be able to Telnet or TFTP into the router via 192.168.1.1
If you are unfamiliar with that procedure you can try
1. make sure your LAN adapter in your PC is set to 192.168.1.2 for IP and 192.168.1.1 for GATEWAY
2. plug in VIA LAN cable to a LAN port on the back of the router
3. now open up a command window and use TELNET or any other TELNET or TFTP application (easiest on XP, on vista and win 7 you will hve to install Telenet)
4. In the command window type telnet 192.168.1.1 You should now see the login (NO USER OR PASSWORD REQUIRED)
5. at the command window you can now perform any action via command line. I normally wipe it back to OpenWrt defaults and that should get you back to square one.
6. The command line to reset everything to default is mtd -r erase rootfs_data
Good luck and let me know how you make out!