Lines Matching refs:target

21 static int htc_issue_send(struct htc_target *target, struct sk_buff* skb,
26 struct htc_endpoint *endpoint = &target->endpoint[epid];
35 status = target->hif->send(target->hif_dev, endpoint->ul_pipeid, skb);
88 static void htc_process_target_rdy(struct htc_target *target,
94 target->credit_size = be16_to_cpu(htc_ready_msg->credit_size);
96 endpoint = &target->endpoint[ENDPOINT0];
99 atomic_inc(&target->tgt_ready);
100 complete(&target->target_wait);
103 static void htc_process_conn_rsp(struct htc_target *target,
128 endpoint = &target->endpoint[epid];
131 tmp_endpoint = &target->endpoint[tepid];
147 target->conn_rsp_epid = epid;
148 complete(&target->cmd_wait);
150 target->conn_rsp_epid = ENDPOINT_UNUSED;
154 static int htc_config_pipe_credits(struct htc_target *target)
163 dev_err(target->dev, "failed to allocate send buffer\n");
172 cp_msg->credits = target->credits;
174 target->htc_flags |= HTC_OP_CONFIG_PIPE_CREDITS;
176 ret = htc_issue_send(target, skb, skb->len, 0, ENDPOINT0);
180 time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
182 dev_err(target->dev, "HTC credit config timeout\n");
192 static int htc_setup_complete(struct htc_target *target)
201 dev_err(target->dev, "failed to allocate send buffer\n");
209 target->htc_flags |= HTC_OP_START_WAIT;
211 ret = htc_issue_send(target, skb, skb->len, 0, ENDPOINT0);
215 time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
217 dev_err(target->dev, "HTC start timeout\n");
230 int htc_init(struct htc_target *target)
234 ret = htc_config_pipe_credits(target);
238 return htc_setup_complete(target);
241 int htc_connect_service(struct htc_target *target,
252 endpoint = get_next_avail_ep(target->endpoint);
254 dev_err(target->dev, "Endpoint is not available for service %d\n",
268 dev_err(target->dev, "Failed to allocate buf to send"
286 ret = htc_issue_send(target, skb, skb->len, 0, ENDPOINT0);
290 time_left = wait_for_completion_timeout(&target->cmd_wait, HZ);
292 dev_err(target->dev, "Service connection timeout for: %d\n",
297 *conn_rsp_epid = target->conn_rsp_epid;
304 int htc_send(struct htc_target *target, struct sk_buff *skb)
309 return htc_issue_send(target, skb, skb->len, 0, tx_ctl->epid);
312 int htc_send_epid(struct htc_target *target, struct sk_buff *skb,
315 return htc_issue_send(target, skb, skb->len, 0, epid);
318 void htc_stop(struct htc_target *target)
320 target->hif->stop(target->hif_dev);
323 void htc_start(struct htc_target *target)
325 target->hif->start(target->hif_dev);
328 void htc_sta_drain(struct htc_target *target, u8 idx)
330 target->hif->sta_drain(target->hif_dev, idx);
497 struct htc_target *target;
499 target = kzalloc(sizeof(struct htc_target), GFP_KERNEL);
500 if (!target)
503 init_completion(&target->target_wait);
504 init_completion(&target->cmd_wait);
506 target->hif = hif;
507 target->hif_dev = hif_handle;
508 target->dev = dev;
511 endpoint = &target->endpoint[ENDPOINT0];
515 atomic_set(&target->tgt_ready, 0);
517 return target;
525 int ath9k_htc_hw_init(struct htc_target *target,
529 if (ath9k_htc_probe_device(target, dev, devid, product, drv_info)) {
537 void ath9k_htc_hw_deinit(struct htc_target *target, bool hot_unplug)
539 if (target)
540 ath9k_htc_disconnect_device(target, hot_unplug);