diff options
author | Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> | 2011-10-25 10:04:17 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2011-11-11 05:58:49 -0500 |
commit | 6765d0aa5ff5b92098f5e571f26904106eae6ff3 (patch) | |
tree | 7b677f3222b52131edba6f139971399019b2844d /drivers/net/wireless/ath/ath6kl/wmi.c | |
parent | 6db8fa53ad4fa6d4b390e9bdd68f1238a01070ee (diff) |
ath6kl: Use interface index from wmi data headr
Interface index is passed in wmi data header as well, use it
to get the corresponding vif structure.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/wmi.c')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index ed092b77ef6b..ed95c2acf475 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -81,7 +81,7 @@ enum htc_endpoint_id ath6kl_wmi_get_control_ep(struct wmi *wmi) | |||
81 | return wmi->ep_id; | 81 | return wmi->ep_id; |
82 | } | 82 | } |
83 | 83 | ||
84 | static struct ath6kl_vif *ath6kl_get_vif_by_index(struct ath6kl *ar, u8 if_idx) | 84 | struct ath6kl_vif *ath6kl_get_vif_by_index(struct ath6kl *ar, u8 if_idx) |
85 | { | 85 | { |
86 | if (WARN_ON(if_idx > (MAX_NUM_VIF - 1))) | 86 | if (WARN_ON(if_idx > (MAX_NUM_VIF - 1))) |
87 | return NULL; | 87 | return NULL; |
@@ -170,12 +170,12 @@ static int ath6kl_wmi_meta_add(struct wmi *wmi, struct sk_buff *skb, | |||
170 | int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb, | 170 | int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb, |
171 | u8 msg_type, bool more_data, | 171 | u8 msg_type, bool more_data, |
172 | enum wmi_data_hdr_data_type data_type, | 172 | enum wmi_data_hdr_data_type data_type, |
173 | u8 meta_ver, void *tx_meta_info) | 173 | u8 meta_ver, void *tx_meta_info, u8 if_idx) |
174 | { | 174 | { |
175 | struct wmi_data_hdr *data_hdr; | 175 | struct wmi_data_hdr *data_hdr; |
176 | int ret; | 176 | int ret; |
177 | 177 | ||
178 | if (WARN_ON(skb == NULL)) | 178 | if (WARN_ON(skb == NULL || (if_idx > MAX_NUM_VIF - 1))) |
179 | return -EINVAL; | 179 | return -EINVAL; |
180 | 180 | ||
181 | if (tx_meta_info) { | 181 | if (tx_meta_info) { |
@@ -197,7 +197,7 @@ int ath6kl_wmi_data_hdr_add(struct wmi *wmi, struct sk_buff *skb, | |||
197 | WMI_DATA_HDR_MORE_MASK << WMI_DATA_HDR_MORE_SHIFT; | 197 | WMI_DATA_HDR_MORE_MASK << WMI_DATA_HDR_MORE_SHIFT; |
198 | 198 | ||
199 | data_hdr->info2 = cpu_to_le16(meta_ver << WMI_DATA_HDR_META_SHIFT); | 199 | data_hdr->info2 = cpu_to_le16(meta_ver << WMI_DATA_HDR_META_SHIFT); |
200 | data_hdr->info3 = 0; | 200 | data_hdr->info3 = cpu_to_le16(if_idx & WMI_DATA_HDR_IF_IDX_MASK); |
201 | 201 | ||
202 | return 0; | 202 | return 0; |
203 | } | 203 | } |
@@ -1631,7 +1631,7 @@ int ath6kl_wmi_cmd_send(struct wmi *wmi, u8 if_idx, struct sk_buff *skb, | |||
1631 | /* Only for OPT_TX_CMD, use BE endpoint. */ | 1631 | /* Only for OPT_TX_CMD, use BE endpoint. */ |
1632 | if (cmd_id == WMI_OPT_TX_FRAME_CMDID) { | 1632 | if (cmd_id == WMI_OPT_TX_FRAME_CMDID) { |
1633 | ret = ath6kl_wmi_data_hdr_add(wmi, skb, OPT_MSGTYPE, | 1633 | ret = ath6kl_wmi_data_hdr_add(wmi, skb, OPT_MSGTYPE, |
1634 | false, false, 0, NULL); | 1634 | false, false, 0, NULL, if_idx); |
1635 | if (ret) { | 1635 | if (ret) { |
1636 | dev_kfree_skb(skb); | 1636 | dev_kfree_skb(skb); |
1637 | return ret; | 1637 | return ret; |
@@ -2098,7 +2098,7 @@ int ath6kl_wmi_setpmkid_cmd(struct wmi *wmi, u8 if_idx, const u8 *bssid, | |||
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | static int ath6kl_wmi_data_sync_send(struct wmi *wmi, struct sk_buff *skb, | 2100 | static int ath6kl_wmi_data_sync_send(struct wmi *wmi, struct sk_buff *skb, |
2101 | enum htc_endpoint_id ep_id) | 2101 | enum htc_endpoint_id ep_id, u8 if_idx) |
2102 | { | 2102 | { |
2103 | struct wmi_data_hdr *data_hdr; | 2103 | struct wmi_data_hdr *data_hdr; |
2104 | int ret; | 2104 | int ret; |
@@ -2110,7 +2110,7 @@ static int ath6kl_wmi_data_sync_send(struct wmi *wmi, struct sk_buff *skb, | |||
2110 | 2110 | ||
2111 | data_hdr = (struct wmi_data_hdr *) skb->data; | 2111 | data_hdr = (struct wmi_data_hdr *) skb->data; |
2112 | data_hdr->info = SYNC_MSGTYPE << WMI_DATA_HDR_MSG_TYPE_SHIFT; | 2112 | data_hdr->info = SYNC_MSGTYPE << WMI_DATA_HDR_MSG_TYPE_SHIFT; |
2113 | data_hdr->info3 = 0; | 2113 | data_hdr->info3 = cpu_to_le16(if_idx & WMI_DATA_HDR_IF_IDX_MASK); |
2114 | 2114 | ||
2115 | ret = ath6kl_control_tx(wmi->parent_dev, skb, ep_id); | 2115 | ret = ath6kl_control_tx(wmi->parent_dev, skb, ep_id); |
2116 | 2116 | ||
@@ -2192,7 +2192,7 @@ static int ath6kl_wmi_sync_point(struct wmi *wmi, u8 if_idx) | |||
2192 | traffic_class); | 2192 | traffic_class); |
2193 | ret = | 2193 | ret = |
2194 | ath6kl_wmi_data_sync_send(wmi, data_sync_bufs[index].skb, | 2194 | ath6kl_wmi_data_sync_send(wmi, data_sync_bufs[index].skb, |
2195 | ep_id); | 2195 | ep_id, if_idx); |
2196 | 2196 | ||
2197 | if (ret) | 2197 | if (ret) |
2198 | break; | 2198 | break; |