OK, I'm not sure how detiled I should be so just incase I'm being pretty detailed here.
Go to the linksys.com and download the latest factory firmware for your unit.
If you have any sort of firewall software on your PC, the ping or the tftp command may not work. I've had to temporarily turn of firewall and internet security software before doing this.
Telnet or SSH in to the router and type:
"nvram set boot_wait=on"
and then type:
"nvram commit"
Then you shouldn't ever have to log in to the router anymore. The rest of this procedure is done on your PC.
Change the IP address on your PC to a Staic ip of 192.168.1.10 with a gateway of 192.168.1.1
Then open two command prompt windows. In one window type "ping -w 5 -t 192.168.1.1". You should see continuous replies.
Then in the second command prompt window:
If you saved the new linksys firmware on your desktop then you would do a "cd desktop" before running this command:
"tftp -i 192.168.1.1 PUT linksysfilename.bin" (linksysfilename.bin actually being whatever file that you just downloaded from linksys.com) but dont press enter yet.
Unplug the router and plug it back in. You should see the replies stop from the ping window.
The split second that you start seeing replies again you hit the enter key on the tftp command to launch it.
If it worked, you should see a Transfer successful messege.
If you dont get a sucessful messege, then reboot the router again and try hitting the tftp command right when the pings start replying. It ussually works on the first or second try for me.