17 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
46 return &endpoint[avail_epid];
69 static u8 service_to_dlpipe(
u16 service_id)
122 tmp_endpoint = &target->
endpoint[tepid];
129 if (tepid == ENDPOINT0)
145 static int htc_config_pipe_credits(
struct htc_target *target)
153 dev_err(target->
dev,
"failed to allocate send buffer\n");
167 ret = htc_issue_send(target, skb, skb->
len, 0, ENDPOINT0);
173 dev_err(target->
dev,
"HTC credit config timeout\n");
183 static int htc_setup_complete(
struct htc_target *target)
187 int ret = 0, time_left;
191 dev_err(target->
dev,
"failed to allocate send buffer\n");
202 ret = htc_issue_send(target, skb, skb->
len, 0, ENDPOINT0);
225 ret = htc_config_pipe_credits(target);
229 return htc_setup_complete(target);
242 endpoint = get_next_avail_ep(target->
endpoint);
244 dev_err(target->
dev,
"Endpoint is not available for"
258 dev_err(target->
dev,
"Failed to allocate buf to send"
259 "service connect req\n");
273 ret = htc_issue_send(target, skb, skb->
len, 0, ENDPOINT0);
279 dev_err(target->
dev,
"Service connection timeout for: %d\n",
295 tx_ctl = HTC_SKB_CB(skb);
296 return htc_issue_send(target, skb, skb->
len, 0, tx_ctl->
epid);
302 return htc_issue_send(target, skb, skb->
len, 0, epid);
374 if (!htc_handle || !skb)
388 if (epid == ENDPOINT0) {
398 msg_id = (
__be16 *) ((
void *) htc_hdr +
404 htc_process_target_rdy(htc_handle, htc_hdr);
407 htc_process_conn_rsp(htc_handle, htc_hdr);
421 endpoint = &htc_handle->
endpoint[epid];
466 pr_err(
"Failed to initialize the device\n");