diff options
Diffstat (limited to 'drivers/net/wireless/mwifiex/sta_cmdresp.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/sta_cmdresp.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c index 62223ab662ce..675c00bbe7d3 100644 --- a/drivers/net/wireless/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c | |||
@@ -123,7 +123,8 @@ static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv, | |||
123 | { | 123 | { |
124 | struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp = | 124 | struct host_cmd_ds_802_11_rssi_info_rsp *rssi_info_rsp = |
125 | &resp->params.rssi_info_rsp; | 125 | &resp->params.rssi_info_rsp; |
126 | struct mwifiex_ds_misc_subsc_evt subsc_evt; | 126 | struct mwifiex_ds_misc_subsc_evt *subsc_evt = |
127 | &priv->async_subsc_evt_storage; | ||
127 | 128 | ||
128 | priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); | 129 | priv->data_rssi_last = le16_to_cpu(rssi_info_rsp->data_rssi_last); |
129 | priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); | 130 | priv->data_nf_last = le16_to_cpu(rssi_info_rsp->data_nf_last); |
@@ -140,26 +141,27 @@ static int mwifiex_ret_802_11_rssi_info(struct mwifiex_private *priv, | |||
140 | if (priv->subsc_evt_rssi_state == EVENT_HANDLED) | 141 | if (priv->subsc_evt_rssi_state == EVENT_HANDLED) |
141 | return 0; | 142 | return 0; |
142 | 143 | ||
144 | memset(subsc_evt, 0x00, sizeof(struct mwifiex_ds_misc_subsc_evt)); | ||
145 | |||
143 | /* Resubscribe low and high rssi events with new thresholds */ | 146 | /* Resubscribe low and high rssi events with new thresholds */ |
144 | memset(&subsc_evt, 0x00, sizeof(struct mwifiex_ds_misc_subsc_evt)); | 147 | subsc_evt->events = BITMASK_BCN_RSSI_LOW | BITMASK_BCN_RSSI_HIGH; |
145 | subsc_evt.events = BITMASK_BCN_RSSI_LOW | BITMASK_BCN_RSSI_HIGH; | 148 | subsc_evt->action = HostCmd_ACT_BITWISE_SET; |
146 | subsc_evt.action = HostCmd_ACT_BITWISE_SET; | ||
147 | if (priv->subsc_evt_rssi_state == RSSI_LOW_RECVD) { | 149 | if (priv->subsc_evt_rssi_state == RSSI_LOW_RECVD) { |
148 | subsc_evt.bcn_l_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg - | 150 | subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg - |
149 | priv->cqm_rssi_hyst); | 151 | priv->cqm_rssi_hyst); |
150 | subsc_evt.bcn_h_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); | 152 | subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); |
151 | } else if (priv->subsc_evt_rssi_state == RSSI_HIGH_RECVD) { | 153 | } else if (priv->subsc_evt_rssi_state == RSSI_HIGH_RECVD) { |
152 | subsc_evt.bcn_l_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); | 154 | subsc_evt->bcn_l_rssi_cfg.abs_value = abs(priv->cqm_rssi_thold); |
153 | subsc_evt.bcn_h_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg + | 155 | subsc_evt->bcn_h_rssi_cfg.abs_value = abs(priv->bcn_rssi_avg + |
154 | priv->cqm_rssi_hyst); | 156 | priv->cqm_rssi_hyst); |
155 | } | 157 | } |
156 | subsc_evt.bcn_l_rssi_cfg.evt_freq = 1; | 158 | subsc_evt->bcn_l_rssi_cfg.evt_freq = 1; |
157 | subsc_evt.bcn_h_rssi_cfg.evt_freq = 1; | 159 | subsc_evt->bcn_h_rssi_cfg.evt_freq = 1; |
158 | 160 | ||
159 | priv->subsc_evt_rssi_state = EVENT_HANDLED; | 161 | priv->subsc_evt_rssi_state = EVENT_HANDLED; |
160 | 162 | ||
161 | mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SUBSCRIBE_EVENT, | 163 | mwifiex_send_cmd_async(priv, HostCmd_CMD_802_11_SUBSCRIBE_EVENT, |
162 | 0, 0, &subsc_evt); | 164 | 0, 0, subsc_evt); |
163 | 165 | ||
164 | return 0; | 166 | return 0; |
165 | } | 167 | } |