| .. | .. |
|---|
| 106 | 106 | mutex_init(&wmi->multi_rmw_mutex); |
|---|
| 107 | 107 | init_completion(&wmi->cmd_wait); |
|---|
| 108 | 108 | INIT_LIST_HEAD(&wmi->pending_tx_events); |
|---|
| 109 | | - tasklet_init(&wmi->wmi_event_tasklet, ath9k_wmi_event_tasklet, |
|---|
| 110 | | - (unsigned long)wmi); |
|---|
| 109 | + tasklet_setup(&wmi->wmi_event_tasklet, ath9k_wmi_event_tasklet); |
|---|
| 111 | 110 | |
|---|
| 112 | 111 | return wmi; |
|---|
| 113 | 112 | } |
|---|
| .. | .. |
|---|
| 121 | 120 | mutex_unlock(&wmi->op_mutex); |
|---|
| 122 | 121 | } |
|---|
| 123 | 122 | |
|---|
| 124 | | -void ath9k_destoy_wmi(struct ath9k_htc_priv *priv) |
|---|
| 123 | +void ath9k_destroy_wmi(struct ath9k_htc_priv *priv) |
|---|
| 125 | 124 | { |
|---|
| 126 | 125 | kfree(priv->wmi); |
|---|
| 127 | 126 | } |
|---|
| .. | .. |
|---|
| 136 | 135 | spin_unlock_irqrestore(&priv->wmi->wmi_lock, flags); |
|---|
| 137 | 136 | } |
|---|
| 138 | 137 | |
|---|
| 139 | | -void ath9k_wmi_event_tasklet(unsigned long data) |
|---|
| 138 | +void ath9k_wmi_event_tasklet(struct tasklet_struct *t) |
|---|
| 140 | 139 | { |
|---|
| 141 | | - struct wmi *wmi = (struct wmi *)data; |
|---|
| 140 | + struct wmi *wmi = from_tasklet(wmi, t, wmi_event_tasklet); |
|---|
| 142 | 141 | struct ath9k_htc_priv *priv = wmi->drv_priv; |
|---|
| 143 | 142 | struct wmi_cmd_hdr *hdr; |
|---|
| 144 | 143 | void *wmi_event; |
|---|
| .. | .. |
|---|
| 170 | 169 | &wmi->drv_priv->fatal_work); |
|---|
| 171 | 170 | break; |
|---|
| 172 | 171 | case WMI_TXSTATUS_EVENTID: |
|---|
| 172 | + /* Check if ath9k_tx_init() completed. */ |
|---|
| 173 | + if (!data_race(priv->tx.initialized)) |
|---|
| 174 | + break; |
|---|
| 175 | + |
|---|
| 173 | 176 | spin_lock_bh(&priv->tx.tx_lock); |
|---|
| 174 | 177 | if (priv->tx.flags & ATH9K_HTC_OP_TX_DRAIN) { |
|---|
| 175 | 178 | spin_unlock_bh(&priv->tx.tx_lock); |
|---|
| .. | .. |
|---|
| 339 | 342 | ath_dbg(common, WMI, "Timeout waiting for WMI command: %s\n", |
|---|
| 340 | 343 | wmi_cmd_to_name(cmd_id)); |
|---|
| 341 | 344 | mutex_unlock(&wmi->op_mutex); |
|---|
| 342 | | - kfree_skb(skb); |
|---|
| 343 | 345 | return -ETIMEDOUT; |
|---|
| 344 | 346 | } |
|---|
| 345 | 347 | |
|---|