I have been having problems connecting to a wireless network that does not broadcast its SSID. (A so-called "hidden" network.) I am using an Intel IPW 2200 802.11b/g mini-pci wireless card that uses the ipw2200 wireless module.
I found that reloading the ipw2200 module before attempting to connect to the network fixed my problems (but only if I put a pause between the unload/load/connect sequence). I use wifi-radar to manage my wireless connections, and was able to call my unload/reload script using its "before" connection command.
The script is simply:
sudo rmmod ipw2200
sudo modprobe ipw2200
This does add two seconds to the connection time, but this is not a terrible penalty to pay as without the above pause the connection would usually only work about 25% of the time.