Putting this in here in the hope that it helps someone else, because yesterday I spent numerous fruitless hours trying to get my HTC Desire S to work with Wi-Fi on my router.
There are countless un-resolved threads and posts scattered all over the internet of numerous people having similar difficulties in that ALL models of HTC phones seem to be having difficulty gaining wifi access via their router.
The problem affects several different makes of router, but primarily seems to be the speedtouch routers that are affected.
It would appear that upgrading the to Gingerbread (Android 2.3.3) seems to 'break' a few things related to wifi in the HTC phones.
-----------------------------
1) Wireless signal on the HTC Desire S is diminished and the phone switches over to contracted internet 3g services much sooner than previously. This apparently is inbuilt by design by google to provide a 'more seamless experience' for the user allowing 3g services to kick in at a much lower -88dBm. This is not good for UK customers who are on a limited amount of contract/PAYG bandwidth. This problem is supposedly being looked into and hopefully an updated patch will be released soon.
-----------------------------
2) HTC phones (HTC Desire, HD, S, Sensation, Hero etc) will not connect to Wi-Fi services on certain routers, most notably (but not limited to) the Speedtouch router.
My investigations yesterday showed that the phone was being allocated an IP address via the router, but all attempts to navigate to the internet just wasnt happening.
Its not a DNS issue because using an IP address to navigate to websites doesnt work either.
Switching off WEP/WPA encryption/ security on the router works, but running your network unsecured is not a good idea.
The only way to get get wifi access on my secured network was to use a static IP on the HTC. This isnt an ideal solution, but at least its a work around until the problem gets resolved.
To do this:-
From the (hard) menu button on the bottom
>> Settings
>> Wireless & Networks
Select Wi-Fi settings
When on the "WI-FI" Screen, Press the Hard Menu button at the bottom.
This will bring up a popup screen. Select "Advanced".
A New screen appears.
Under IP settings
>> Tick the "Use Static IP" box
>> Click IP address.
Enter 192.168.1.20 (or whatever IP you wish to designate) OK
>> Click Gateway.
Enter 192.168.1.254 (or whatever IP your router is using) OK
>> Click Netmask
Enter 255.255.255.0 OK
>> Click DNS 1
Enter 8.8.8.8 (Im using google DNS for this example) OK
>> Click DNS 2
Enter 8.8.4.4 (Im using google DNS for this example) OK