|
@@ -143,17 +143,18 @@ static int iwm_ntf_init_complete(struct iwm_priv *iwm, u8 *buf,
|
|
|
unsigned long buf_size,
|
|
|
struct iwm_wifi_cmd *cmd)
|
|
|
{
|
|
|
+ struct wiphy *wiphy = iwm_to_wiphy(iwm);
|
|
|
struct iwm_umac_notif_init_complete *init_complete =
|
|
|
(struct iwm_umac_notif_init_complete *)(buf);
|
|
|
u16 status = le16_to_cpu(init_complete->status);
|
|
|
+ bool blocked = (status == UMAC_NTFY_INIT_COMPLETE_STATUS_ERR);
|
|
|
|
|
|
- if (status == UMAC_NTFY_INIT_COMPLETE_STATUS_ERR) {
|
|
|
+ if (blocked)
|
|
|
IWM_DBG_NTF(iwm, DBG, "Hardware rf kill is on (radio off)\n");
|
|
|
- set_bit(IWM_RADIO_RFKILL_HW, &iwm->radio);
|
|
|
- } else {
|
|
|
+ else
|
|
|
IWM_DBG_NTF(iwm, DBG, "Hardware rf kill is off (radio on)\n");
|
|
|
- clear_bit(IWM_RADIO_RFKILL_HW, &iwm->radio);
|
|
|
- }
|
|
|
+
|
|
|
+ wiphy_rfkill_set_hw_state(wiphy, blocked);
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
@@ -875,6 +876,7 @@ static int iwm_ntf_statistics(struct iwm_priv *iwm, u8 *buf,
|
|
|
/* UMAC passes rate info multiplies by 2 */
|
|
|
iwm->rate = max_rate >> 1;
|
|
|
}
|
|
|
+ iwm->txpower = le32_to_cpu(stats->tx_power);
|
|
|
|
|
|
wstats->status = 0;
|
|
|
|
|
@@ -1015,6 +1017,7 @@ static int iwm_ntf_wifi_if_wrapper(struct iwm_priv *iwm, u8 *buf,
|
|
|
static int iwm_ntf_card_state(struct iwm_priv *iwm, u8 *buf,
|
|
|
unsigned long buf_size, struct iwm_wifi_cmd *cmd)
|
|
|
{
|
|
|
+ struct wiphy *wiphy = iwm_to_wiphy(iwm);
|
|
|
struct iwm_lmac_card_state *state = (struct iwm_lmac_card_state *)
|
|
|
(buf + sizeof(struct iwm_umac_wifi_in_hdr));
|
|
|
u32 flags = le32_to_cpu(state->flags);
|
|
@@ -1023,10 +1026,7 @@ static int iwm_ntf_card_state(struct iwm_priv *iwm, u8 *buf,
|
|
|
flags & IWM_CARD_STATE_HW_DISABLED ? "ON" : "OFF",
|
|
|
flags & IWM_CARD_STATE_CTKILL_DISABLED ? "ON" : "OFF");
|
|
|
|
|
|
- if (flags & IWM_CARD_STATE_HW_DISABLED)
|
|
|
- set_bit(IWM_RADIO_RFKILL_HW, &iwm->radio);
|
|
|
- else
|
|
|
- clear_bit(IWM_RADIO_RFKILL_HW, &iwm->radio);
|
|
|
+ wiphy_rfkill_set_hw_state(wiphy, flags & IWM_CARD_STATE_HW_DISABLED);
|
|
|
|
|
|
return 0;
|
|
|
}
|