Wireless is disabled by hardware switch

While configuring the wired network on Ubuntu 12.04 Linux laptop, the wireless network connection broke down suddenly. On clicking the networking icon on the top panel, no wireless networks were displayed on the NetworkManager applet and a message Wireless is disabled by hardware switch was reported. The laptop wireless switch was in the on position.

The problem was solved by giving the command,

sudo rfkill unblock all

The rfkill command is for enabling and disabling the wireless devices. You can list all the wireless devices with indexes using the rfkill list command. For example,

$ rfkill list 0: hci0: Bluetooth Soft blocked: no Hard blocked: no 1: sony-wifi: Wireless LAN Soft blocked: no Hard blocked: no 2: sony-bluetooth: Bluetooth Soft blocked: no Hard blocked: no 3: phy0: Wireless LAN Soft blocked: no Hard blocked: no

In this case, there are four devices with indexes 0, 1, 2 and 3. The rfkill block and unblock commands are,

rfkill block index|type rfkill unblock index|type

The block command disables the indicated device whereas the unblock command enables it. A device is identified by the device index or the device type. The device type is one of the following: all, wifi, wlan, bluetooth, uwb, ultrawideband, wimax, wwan, gps or fm.

Software: