WEP key index handling was broken: the default key when using key 0 was never
specified to the FW, and if using other default than 0, it would be set on the
TX path for every single TX'd frame.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-by: Kalle Valo <kalle.valo@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
                        wl1271_error("Could not add or replace key");
                        goto out_sleep;
                }
+
+               /* the default WEP key needs to be configured at least once */
+               if (key_type == KEY_WEP) {
+                       ret = wl1271_cmd_set_default_wep_key(wl,
+                                                            wl->default_key);
+                       if (ret < 0)
+                               goto out_sleep;
+               }
                break;
 
        case DISABLE_KEY:
 
                        ret = wl1271_cmd_set_default_wep_key(wl, idx);
                        if (ret < 0)
                                return ret;
+                       wl->default_key = idx;
                }
        }