aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/cmd.c')
-rw-r--r--drivers/net/wireless/libertas/cmd.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index d798bcc0d83a..26e68326710b 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -733,15 +733,13 @@ int lbs_get_rssi(struct lbs_private *priv, s8 *rssi, s8 *nf)
733 * to the firmware 733 * to the firmware
734 * 734 *
735 * @priv: pointer to &struct lbs_private 735 * @priv: pointer to &struct lbs_private
736 * @request: cfg80211 regulatory request structure
737 * @bands: the device's supported bands and channels
738 * 736 *
739 * returns: 0 on success, error code on failure 737 * returns: 0 on success, error code on failure
740*/ 738*/
741int lbs_set_11d_domain_info(struct lbs_private *priv, 739int lbs_set_11d_domain_info(struct lbs_private *priv)
742 struct regulatory_request *request,
743 struct ieee80211_supported_band **bands)
744{ 740{
741 struct wiphy *wiphy = priv->wdev->wiphy;
742 struct ieee80211_supported_band **bands = wiphy->bands;
745 struct cmd_ds_802_11d_domain_info cmd; 743 struct cmd_ds_802_11d_domain_info cmd;
746 struct mrvl_ie_domain_param_set *domain = &cmd.domain; 744 struct mrvl_ie_domain_param_set *domain = &cmd.domain;
747 struct ieee80211_country_ie_triplet *t; 745 struct ieee80211_country_ie_triplet *t;
@@ -752,21 +750,23 @@ int lbs_set_11d_domain_info(struct lbs_private *priv,
752 u8 first_channel = 0, next_chan = 0, max_pwr = 0; 750 u8 first_channel = 0, next_chan = 0, max_pwr = 0;
753 u8 i, flag = 0; 751 u8 i, flag = 0;
754 size_t triplet_size; 752 size_t triplet_size;
755 int ret; 753 int ret = 0;
756 754
757 lbs_deb_enter(LBS_DEB_11D); 755 lbs_deb_enter(LBS_DEB_11D);
756 if (!priv->country_code[0])
757 goto out;
758 758
759 memset(&cmd, 0, sizeof(cmd)); 759 memset(&cmd, 0, sizeof(cmd));
760 cmd.action = cpu_to_le16(CMD_ACT_SET); 760 cmd.action = cpu_to_le16(CMD_ACT_SET);
761 761
762 lbs_deb_11d("Setting country code '%c%c'\n", 762 lbs_deb_11d("Setting country code '%c%c'\n",
763 request->alpha2[0], request->alpha2[1]); 763 priv->country_code[0], priv->country_code[1]);
764 764
765 domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN); 765 domain->header.type = cpu_to_le16(TLV_TYPE_DOMAIN);
766 766
767 /* Set country code */ 767 /* Set country code */
768 domain->country_code[0] = request->alpha2[0]; 768 domain->country_code[0] = priv->country_code[0];
769 domain->country_code[1] = request->alpha2[1]; 769 domain->country_code[1] = priv->country_code[1];
770 domain->country_code[2] = ' '; 770 domain->country_code[2] = ' ';
771 771
772 /* Now set up the channel triplets; firmware is somewhat picky here 772 /* Now set up the channel triplets; firmware is somewhat picky here
@@ -848,6 +848,7 @@ int lbs_set_11d_domain_info(struct lbs_private *priv,
848 848
849 ret = lbs_cmd_with_response(priv, CMD_802_11D_DOMAIN_INFO, &cmd); 849 ret = lbs_cmd_with_response(priv, CMD_802_11D_DOMAIN_INFO, &cmd);
850 850
851out:
851 lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret); 852 lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
852 return ret; 853 return ret;
853} 854}
@@ -1019,9 +1020,9 @@ static void lbs_submit_command(struct lbs_private *priv,
1019 if (ret) { 1020 if (ret) {
1020 netdev_info(priv->dev, "DNLD_CMD: hw_host_to_card failed: %d\n", 1021 netdev_info(priv->dev, "DNLD_CMD: hw_host_to_card failed: %d\n",
1021 ret); 1022 ret);
1022 /* Let the timer kick in and retry, and potentially reset 1023 /* Reset dnld state machine, report failure */
1023 the whole thing if the condition persists */ 1024 priv->dnld_sent = DNLD_RES_RECEIVED;
1024 timeo = HZ/4; 1025 lbs_complete_command(priv, cmdnode, ret);
1025 } 1026 }
1026 1027
1027 if (command == CMD_802_11_DEEP_SLEEP) { 1028 if (command == CMD_802_11_DEEP_SLEEP) {