Getting the same issue ever since updating to 5.1.1 OTA. I've tried resetting the network settings, rebooting my iPhone, rebooting the router & modem and forget the wifi network but I'm still getting the same issue.
Just a note, that I'm trying to connect directly to my router and not sharing via anything else like the original poster.
A few users from other websites as well as Apple Support forums appear to be having the same issue.
Update 1;
Tried restoring my iPhone from iTunes, I attempted to restore my content via the iCloud but I wasn't able to get past the WiFi setup.
Update 2;
Downgraded to 5.1 and it was still having the same issue, so I restored my router to factory settings and it seems to of fixed the issue. No idea what happened, but all is good now.