diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/htt.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/htt.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c index 185a5468a2f2..39342c5cfcb2 100644 --- a/drivers/net/wireless/ath/ath10k/htt.c +++ b/drivers/net/wireless/ath/ath10k/htt.c | |||
@@ -16,6 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/if_ether.h> | ||
19 | 20 | ||
20 | #include "htt.h" | 21 | #include "htt.h" |
21 | #include "core.h" | 22 | #include "core.h" |
@@ -36,7 +37,7 @@ static int ath10k_htt_htc_attach(struct ath10k_htt *htt) | |||
36 | /* connect to control service */ | 37 | /* connect to control service */ |
37 | conn_req.service_id = ATH10K_HTC_SVC_ID_HTT_DATA_MSG; | 38 | conn_req.service_id = ATH10K_HTC_SVC_ID_HTT_DATA_MSG; |
38 | 39 | ||
39 | status = ath10k_htc_connect_service(htt->ar->htc, &conn_req, | 40 | status = ath10k_htc_connect_service(&htt->ar->htc, &conn_req, |
40 | &conn_resp); | 41 | &conn_resp); |
41 | 42 | ||
42 | if (status) | 43 | if (status) |
@@ -47,15 +48,11 @@ static int ath10k_htt_htc_attach(struct ath10k_htt *htt) | |||
47 | return 0; | 48 | return 0; |
48 | } | 49 | } |
49 | 50 | ||
50 | struct ath10k_htt *ath10k_htt_attach(struct ath10k *ar) | 51 | int ath10k_htt_attach(struct ath10k *ar) |
51 | { | 52 | { |
52 | struct ath10k_htt *htt; | 53 | struct ath10k_htt *htt = &ar->htt; |
53 | int ret; | 54 | int ret; |
54 | 55 | ||
55 | htt = kzalloc(sizeof(*htt), GFP_KERNEL); | ||
56 | if (!htt) | ||
57 | return NULL; | ||
58 | |||
59 | htt->ar = ar; | 56 | htt->ar = ar; |
60 | htt->max_throughput_mbps = 800; | 57 | htt->max_throughput_mbps = 800; |
61 | 58 | ||
@@ -65,8 +62,11 @@ struct ath10k_htt *ath10k_htt_attach(struct ath10k *ar) | |||
65 | * since ath10k_htt_rx_attach involves sending a rx ring configure | 62 | * since ath10k_htt_rx_attach involves sending a rx ring configure |
66 | * message to the target. | 63 | * message to the target. |
67 | */ | 64 | */ |
68 | if (ath10k_htt_htc_attach(htt)) | 65 | ret = ath10k_htt_htc_attach(htt); |
66 | if (ret) { | ||
67 | ath10k_err("could not attach htt htc (%d)\n", ret); | ||
69 | goto err_htc_attach; | 68 | goto err_htc_attach; |
69 | } | ||
70 | 70 | ||
71 | ret = ath10k_htt_tx_attach(htt); | 71 | ret = ath10k_htt_tx_attach(htt); |
72 | if (ret) { | 72 | if (ret) { |
@@ -74,8 +74,11 @@ struct ath10k_htt *ath10k_htt_attach(struct ath10k *ar) | |||
74 | goto err_htc_attach; | 74 | goto err_htc_attach; |
75 | } | 75 | } |
76 | 76 | ||
77 | if (ath10k_htt_rx_attach(htt)) | 77 | ret = ath10k_htt_rx_attach(htt); |
78 | if (ret) { | ||
79 | ath10k_err("could not attach htt rx (%d)\n", ret); | ||
78 | goto err_rx_attach; | 80 | goto err_rx_attach; |
81 | } | ||
79 | 82 | ||
80 | /* | 83 | /* |
81 | * Prefetch enough data to satisfy target | 84 | * Prefetch enough data to satisfy target |
@@ -89,13 +92,12 @@ struct ath10k_htt *ath10k_htt_attach(struct ath10k *ar) | |||
89 | 8 + /* llc snap */ | 92 | 8 + /* llc snap */ |
90 | 2; /* ip4 dscp or ip6 priority */ | 93 | 2; /* ip4 dscp or ip6 priority */ |
91 | 94 | ||
92 | return htt; | 95 | return 0; |
93 | 96 | ||
94 | err_rx_attach: | 97 | err_rx_attach: |
95 | ath10k_htt_tx_detach(htt); | 98 | ath10k_htt_tx_detach(htt); |
96 | err_htc_attach: | 99 | err_htc_attach: |
97 | kfree(htt); | 100 | return ret; |
98 | return NULL; | ||
99 | } | 101 | } |
100 | 102 | ||
101 | #define HTT_TARGET_VERSION_TIMEOUT_HZ (3*HZ) | 103 | #define HTT_TARGET_VERSION_TIMEOUT_HZ (3*HZ) |
@@ -148,5 +150,4 @@ void ath10k_htt_detach(struct ath10k_htt *htt) | |||
148 | { | 150 | { |
149 | ath10k_htt_rx_detach(htt); | 151 | ath10k_htt_rx_detach(htt); |
150 | ath10k_htt_tx_detach(htt); | 152 | ath10k_htt_tx_detach(htt); |
151 | kfree(htt); | ||
152 | } | 153 | } |