Lines Matching refs:fu
47 static int bot_enqueue_cmd_cbw(struct f_uas *fu) in bot_enqueue_cmd_cbw() argument
51 if (fu->flags & USBG_BOT_CMD_PEND) in bot_enqueue_cmd_cbw()
54 ret = usb_ep_queue(fu->ep_out, fu->cmd[0].req, GFP_ATOMIC); in bot_enqueue_cmd_cbw()
56 fu->flags |= USBG_BOT_CMD_PEND; in bot_enqueue_cmd_cbw()
63 struct f_uas *fu = cmd->fu; in bot_status_complete() local
73 bot_enqueue_cmd_cbw(fu); in bot_status_complete()
76 static void bot_enqueue_sense_code(struct f_uas *fu, struct usbg_cmd *cmd) in bot_enqueue_sense_code() argument
78 struct bulk_cs_wrap *csw = &fu->bot_status.csw; in bot_enqueue_sense_code()
85 fu->bot_status.req->context = cmd; in bot_enqueue_sense_code()
86 ret = usb_ep_queue(fu->ep_in, fu->bot_status.req, GFP_ATOMIC); in bot_enqueue_sense_code()
94 struct f_uas *fu = cmd->fu; in bot_err_compl() local
111 bot_enqueue_sense_code(fu, cmd); in bot_err_compl()
116 struct f_uas *fu = cmd->fu; in bot_send_bad_status() local
117 struct bulk_cs_wrap *csw = &fu->bot_status.csw; in bot_send_bad_status()
125 ep = fu->ep_in; in bot_send_bad_status()
126 req = fu->bot_req_in; in bot_send_bad_status()
128 ep = fu->ep_out; in bot_send_bad_status()
129 req = fu->bot_req_out; in bot_send_bad_status()
132 if (cmd->data_len > fu->ep_in->maxpacket) { in bot_send_bad_status()
141 req->buf = fu->cmd[0].buf; in bot_send_bad_status()
144 bot_enqueue_sense_code(fu, cmd); in bot_send_bad_status()
150 struct f_uas *fu = cmd->fu; in bot_send_status() local
151 struct bulk_cs_wrap *csw = &fu->bot_status.csw; in bot_send_status()
168 fu->bot_status.req->context = cmd; in bot_send_status()
170 ret = usb_ep_queue(fu->ep_in, fu->bot_status.req, GFP_KERNEL); in bot_send_status()
211 struct f_uas *fu = cmd->fu; in bot_send_read_response() local
213 struct usb_gadget *gadget = fuas_to_gadget(fu); in bot_send_read_response()
232 fu->bot_req_in->buf = cmd->data_buf; in bot_send_read_response()
234 fu->bot_req_in->buf = NULL; in bot_send_read_response()
235 fu->bot_req_in->num_sgs = se_cmd->t_data_nents; in bot_send_read_response()
236 fu->bot_req_in->sg = se_cmd->t_data_sg; in bot_send_read_response()
239 fu->bot_req_in->complete = bot_read_compl; in bot_send_read_response()
240 fu->bot_req_in->length = se_cmd->data_length; in bot_send_read_response()
241 fu->bot_req_in->context = cmd; in bot_send_read_response()
242 ret = usb_ep_queue(fu->ep_in, fu->bot_req_in, GFP_ATOMIC); in bot_send_read_response()
253 struct f_uas *fu = cmd->fu; in bot_send_write_request() local
256 cmd->fu = fu; in bot_send_write_request()
263 ret = usbg_prepare_w_request(cmd, fu->bot_req_out); in bot_send_write_request()
266 ret = usb_ep_queue(fu->ep_out, fu->bot_req_out, GFP_KERNEL); in bot_send_write_request()
278 struct f_uas *fu = req->context; in bot_cmd_complete() local
284 fu->flags &= ~USBG_BOT_CMD_PEND; in bot_cmd_complete()
287 struct usb_gadget *gadget = fuas_to_gadget(fu); in bot_cmd_complete()
290 bot_enqueue_cmd_cbw(fu); in bot_cmd_complete()
294 ret = bot_submit_command(fu, req->buf, req->actual); in bot_cmd_complete()
297 if (!(fu->flags & USBG_BOT_WEDGED)) in bot_cmd_complete()
298 usb_ep_set_wedge(fu->ep_in); in bot_cmd_complete()
300 fu->flags |= USBG_BOT_WEDGED; in bot_cmd_complete()
301 bot_enqueue_cmd_cbw(fu); in bot_cmd_complete()
302 } else if (fu->flags & USBG_BOT_WEDGED) { in bot_cmd_complete()
303 fu->flags &= ~USBG_BOT_WEDGED; in bot_cmd_complete()
304 usb_ep_clear_halt(fu->ep_in); in bot_cmd_complete()
308 static int bot_prepare_reqs(struct f_uas *fu) in bot_prepare_reqs() argument
312 fu->bot_req_in = usb_ep_alloc_request(fu->ep_in, GFP_KERNEL); in bot_prepare_reqs()
313 if (!fu->bot_req_in) in bot_prepare_reqs()
316 fu->bot_req_out = usb_ep_alloc_request(fu->ep_out, GFP_KERNEL); in bot_prepare_reqs()
317 if (!fu->bot_req_out) in bot_prepare_reqs()
320 fu->cmd[0].req = usb_ep_alloc_request(fu->ep_out, GFP_KERNEL); in bot_prepare_reqs()
321 if (!fu->cmd[0].req) in bot_prepare_reqs()
324 fu->bot_status.req = usb_ep_alloc_request(fu->ep_in, GFP_KERNEL); in bot_prepare_reqs()
325 if (!fu->bot_status.req) in bot_prepare_reqs()
328 fu->bot_status.req->buf = &fu->bot_status.csw; in bot_prepare_reqs()
329 fu->bot_status.req->length = US_BULK_CS_WRAP_LEN; in bot_prepare_reqs()
330 fu->bot_status.req->complete = bot_status_complete; in bot_prepare_reqs()
331 fu->bot_status.csw.Signature = cpu_to_le32(US_BULK_CS_SIGN); in bot_prepare_reqs()
333 fu->cmd[0].buf = kmalloc(fu->ep_out->maxpacket, GFP_KERNEL); in bot_prepare_reqs()
334 if (!fu->cmd[0].buf) in bot_prepare_reqs()
337 fu->cmd[0].req->complete = bot_cmd_complete; in bot_prepare_reqs()
338 fu->cmd[0].req->buf = fu->cmd[0].buf; in bot_prepare_reqs()
339 fu->cmd[0].req->length = fu->ep_out->maxpacket; in bot_prepare_reqs()
340 fu->cmd[0].req->context = fu; in bot_prepare_reqs()
342 ret = bot_enqueue_cmd_cbw(fu); in bot_prepare_reqs()
347 kfree(fu->cmd[0].buf); in bot_prepare_reqs()
348 fu->cmd[0].buf = NULL; in bot_prepare_reqs()
350 usb_ep_free_request(fu->ep_in, fu->bot_status.req); in bot_prepare_reqs()
352 usb_ep_free_request(fu->ep_out, fu->cmd[0].req); in bot_prepare_reqs()
353 fu->cmd[0].req = NULL; in bot_prepare_reqs()
355 usb_ep_free_request(fu->ep_out, fu->bot_req_out); in bot_prepare_reqs()
356 fu->bot_req_out = NULL; in bot_prepare_reqs()
358 usb_ep_free_request(fu->ep_in, fu->bot_req_in); in bot_prepare_reqs()
359 fu->bot_req_in = NULL; in bot_prepare_reqs()
365 static void bot_cleanup_old_alt(struct f_uas *fu) in bot_cleanup_old_alt() argument
367 if (!(fu->flags & USBG_ENABLED)) in bot_cleanup_old_alt()
370 usb_ep_disable(fu->ep_in); in bot_cleanup_old_alt()
371 usb_ep_disable(fu->ep_out); in bot_cleanup_old_alt()
373 if (!fu->bot_req_in) in bot_cleanup_old_alt()
376 usb_ep_free_request(fu->ep_in, fu->bot_req_in); in bot_cleanup_old_alt()
377 usb_ep_free_request(fu->ep_out, fu->bot_req_out); in bot_cleanup_old_alt()
378 usb_ep_free_request(fu->ep_out, fu->cmd[0].req); in bot_cleanup_old_alt()
379 usb_ep_free_request(fu->ep_in, fu->bot_status.req); in bot_cleanup_old_alt()
381 kfree(fu->cmd[0].buf); in bot_cleanup_old_alt()
383 fu->bot_req_in = NULL; in bot_cleanup_old_alt()
384 fu->bot_req_out = NULL; in bot_cleanup_old_alt()
385 fu->cmd[0].req = NULL; in bot_cleanup_old_alt()
386 fu->bot_status.req = NULL; in bot_cleanup_old_alt()
387 fu->cmd[0].buf = NULL; in bot_cleanup_old_alt()
390 static void bot_set_alt(struct f_uas *fu) in bot_set_alt() argument
392 struct usb_function *f = &fu->function; in bot_set_alt()
396 fu->flags = USBG_IS_BOT; in bot_set_alt()
398 config_ep_by_speed_and_alt(gadget, f, fu->ep_in, USB_G_ALT_INT_BBB); in bot_set_alt()
399 ret = usb_ep_enable(fu->ep_in); in bot_set_alt()
403 config_ep_by_speed_and_alt(gadget, f, fu->ep_out, USB_G_ALT_INT_BBB); in bot_set_alt()
404 ret = usb_ep_enable(fu->ep_out); in bot_set_alt()
408 ret = bot_prepare_reqs(fu); in bot_set_alt()
411 fu->flags |= USBG_ENABLED; in bot_set_alt()
415 usb_ep_disable(fu->ep_out); in bot_set_alt()
417 usb_ep_disable(fu->ep_in); in bot_set_alt()
419 fu->flags = USBG_IS_BOT; in bot_set_alt()
425 struct f_uas *fu = to_f_uas(f); in usbg_bot_setup() local
442 luns = atomic_read(&fu->tpg->tpg_port_count); in usbg_bot_setup()
459 if (fu->flags & USBG_BOT_WEDGED) { in usbg_bot_setup()
460 fu->flags &= ~USBG_BOT_WEDGED; in usbg_bot_setup()
461 usb_ep_clear_halt(fu->ep_in); in usbg_bot_setup()
464 bot_enqueue_cmd_cbw(fu); in usbg_bot_setup()
511 static void uasp_cleanup_one_stream(struct f_uas *fu, struct uas_stream *stream) in uasp_cleanup_one_stream() argument
517 usb_ep_free_request(fu->ep_in, stream->req_in); in uasp_cleanup_one_stream()
518 usb_ep_free_request(fu->ep_out, stream->req_out); in uasp_cleanup_one_stream()
519 usb_ep_free_request(fu->ep_status, stream->req_status); in uasp_cleanup_one_stream()
526 static void uasp_free_cmdreq(struct f_uas *fu) in uasp_free_cmdreq() argument
531 usb_ep_free_request(fu->ep_cmd, fu->cmd[i].req); in uasp_free_cmdreq()
532 kfree(fu->cmd[i].buf); in uasp_free_cmdreq()
533 fu->cmd[i].req = NULL; in uasp_free_cmdreq()
534 fu->cmd[i].buf = NULL; in uasp_free_cmdreq()
538 static void uasp_cleanup_old_alt(struct f_uas *fu) in uasp_cleanup_old_alt() argument
542 if (!(fu->flags & USBG_ENABLED)) in uasp_cleanup_old_alt()
545 usb_ep_disable(fu->ep_in); in uasp_cleanup_old_alt()
546 usb_ep_disable(fu->ep_out); in uasp_cleanup_old_alt()
547 usb_ep_disable(fu->ep_status); in uasp_cleanup_old_alt()
548 usb_ep_disable(fu->ep_cmd); in uasp_cleanup_old_alt()
551 uasp_cleanup_one_stream(fu, &fu->stream[i]); in uasp_cleanup_old_alt()
552 uasp_free_cmdreq(fu); in uasp_cleanup_old_alt()
560 struct f_uas *fu = cmd->fu; in uasp_prepare_r_request() local
561 struct usb_gadget *gadget = fuas_to_gadget(fu); in uasp_prepare_r_request()
562 struct uas_stream *stream = &fu->stream[se_cmd->map_tag]; in uasp_prepare_r_request()
595 struct uas_stream *stream = &cmd->fu->stream[se_cmd->map_tag]; in uasp_prepare_status()
618 struct uas_stream *stream = &cmd->fu->stream[se_cmd->map_tag]; in uasp_prepare_response()
647 struct usb_gadget *gadget = fuas_to_gadget(cmd->fu); in uasp_prepare_response()
672 struct f_uas *fu = cmd->fu; in uasp_status_data_cmpl() local
673 struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; in uasp_status_data_cmpl()
684 ret = usb_ep_queue(fu->ep_in, stream->req_in, GFP_ATOMIC); in uasp_status_data_cmpl()
693 ret = usb_ep_queue(fu->ep_out, stream->req_out, GFP_ATOMIC); in uasp_status_data_cmpl()
700 ret = usb_ep_queue(fu->ep_status, stream->req_status, in uasp_status_data_cmpl()
728 se_sess = fu->tpg->tpg_nexus->tvn_se_sess; in uasp_status_data_cmpl()
736 usb_ep_queue(fu->ep_cmd, cmd->req, GFP_ATOMIC); in uasp_status_data_cmpl()
752 struct f_uas *fu = cmd->fu; in uasp_send_status_response() local
753 struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; in uasp_send_status_response()
757 cmd->fu = fu; in uasp_send_status_response()
759 return usb_ep_queue(fu->ep_status, stream->req_status, GFP_ATOMIC); in uasp_send_status_response()
764 struct f_uas *fu = cmd->fu; in uasp_send_tm_response() local
765 struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; in uasp_send_tm_response()
769 cmd->fu = fu; in uasp_send_tm_response()
771 return usb_ep_queue(fu->ep_status, stream->req_status, GFP_ATOMIC); in uasp_send_tm_response()
776 struct f_uas *fu = cmd->fu; in uasp_send_read_response() local
777 struct uas_stream *stream = &fu->stream[cmd->se_cmd.map_tag]; in uasp_send_read_response()
781 cmd->fu = fu; in uasp_send_read_response()
784 if (fu->flags & USBG_USE_STREAMS) { in uasp_send_read_response()
789 ret = usb_ep_queue(fu->ep_in, stream->req_in, GFP_ATOMIC); in uasp_send_read_response()
808 ret = usb_ep_queue(fu->ep_status, stream->req_status, in uasp_send_read_response()
819 struct f_uas *fu = cmd->fu; in uasp_send_write_request() local
821 struct uas_stream *stream = &fu->stream[se_cmd->map_tag]; in uasp_send_write_request()
825 cmd->fu = fu; in uasp_send_write_request()
829 if (fu->flags & USBG_USE_STREAMS) { in uasp_send_write_request()
834 ret = usb_ep_queue(fu->ep_out, stream->req_out, GFP_ATOMIC); in uasp_send_write_request()
850 ret = usb_ep_queue(fu->ep_status, stream->req_status, in uasp_send_write_request()
864 struct f_uas *fu = req->context; in uasp_cmd_complete() local
870 usb_ep_queue(fu->ep_cmd, req, GFP_ATOMIC); in uasp_cmd_complete()
874 usbg_submit_command(fu, req); in uasp_cmd_complete()
877 static int uasp_alloc_stream_res(struct f_uas *fu, struct uas_stream *stream) in uasp_alloc_stream_res() argument
881 stream->req_in = usb_ep_alloc_request(fu->ep_in, GFP_KERNEL); in uasp_alloc_stream_res()
885 stream->req_out = usb_ep_alloc_request(fu->ep_out, GFP_KERNEL); in uasp_alloc_stream_res()
889 stream->req_status = usb_ep_alloc_request(fu->ep_status, GFP_KERNEL); in uasp_alloc_stream_res()
896 usb_ep_free_request(fu->ep_out, stream->req_out); in uasp_alloc_stream_res()
899 usb_ep_free_request(fu->ep_in, stream->req_in); in uasp_alloc_stream_res()
905 static int uasp_alloc_cmd(struct f_uas *fu, int i) in uasp_alloc_cmd() argument
907 fu->cmd[i].req = usb_ep_alloc_request(fu->ep_cmd, GFP_KERNEL); in uasp_alloc_cmd()
908 if (!fu->cmd[i].req) in uasp_alloc_cmd()
911 fu->cmd[i].buf = kmalloc(fu->ep_cmd->maxpacket, GFP_KERNEL); in uasp_alloc_cmd()
912 if (!fu->cmd[i].buf) in uasp_alloc_cmd()
915 fu->cmd[i].req->complete = uasp_cmd_complete; in uasp_alloc_cmd()
916 fu->cmd[i].req->buf = fu->cmd[i].buf; in uasp_alloc_cmd()
917 fu->cmd[i].req->length = fu->ep_cmd->maxpacket; in uasp_alloc_cmd()
918 fu->cmd[i].req->context = fu; in uasp_alloc_cmd()
922 usb_ep_free_request(fu->ep_cmd, fu->cmd[i].req); in uasp_alloc_cmd()
927 static int uasp_prepare_reqs(struct f_uas *fu) in uasp_prepare_reqs() argument
933 ret = uasp_alloc_stream_res(fu, &fu->stream[i]); in uasp_prepare_reqs()
939 ret = uasp_alloc_cmd(fu, i); in uasp_prepare_reqs()
943 ret = usb_ep_queue(fu->ep_cmd, fu->cmd[i].req, GFP_ATOMIC); in uasp_prepare_reqs()
951 uasp_free_cmdreq(fu); in uasp_prepare_reqs()
956 uasp_cleanup_one_stream(fu, &fu->stream[i - 1]); in uasp_prepare_reqs()
964 static void uasp_set_alt(struct f_uas *fu) in uasp_set_alt() argument
966 struct usb_function *f = &fu->function; in uasp_set_alt()
970 fu->flags = USBG_IS_UAS; in uasp_set_alt()
973 fu->flags |= USBG_USE_STREAMS; in uasp_set_alt()
975 config_ep_by_speed_and_alt(gadget, f, fu->ep_in, USB_G_ALT_INT_UAS); in uasp_set_alt()
976 ret = usb_ep_enable(fu->ep_in); in uasp_set_alt()
980 config_ep_by_speed_and_alt(gadget, f, fu->ep_out, USB_G_ALT_INT_UAS); in uasp_set_alt()
981 ret = usb_ep_enable(fu->ep_out); in uasp_set_alt()
985 config_ep_by_speed_and_alt(gadget, f, fu->ep_cmd, USB_G_ALT_INT_UAS); in uasp_set_alt()
986 ret = usb_ep_enable(fu->ep_cmd); in uasp_set_alt()
989 config_ep_by_speed_and_alt(gadget, f, fu->ep_status, USB_G_ALT_INT_UAS); in uasp_set_alt()
990 ret = usb_ep_enable(fu->ep_status); in uasp_set_alt()
994 ret = uasp_prepare_reqs(fu); in uasp_set_alt()
997 fu->flags |= USBG_ENABLED; in uasp_set_alt()
1002 usb_ep_disable(fu->ep_status); in uasp_set_alt()
1004 usb_ep_disable(fu->ep_cmd); in uasp_set_alt()
1006 usb_ep_disable(fu->ep_out); in uasp_set_alt()
1008 usb_ep_disable(fu->ep_in); in uasp_set_alt()
1010 fu->flags = 0; in uasp_set_alt()
1085 struct uas_stream *stream = &cmd->fu->stream[se_cmd->map_tag]; in usbg_data_write_cmpl()
1106 queue_work(cmd->fu->tpg->workqueue, &cmd->work); in usbg_data_write_cmpl()
1126 struct f_uas *fu = cmd->fu; in usbg_prepare_w_request() local
1127 struct usb_gadget *gadget = fuas_to_gadget(fu); in usbg_prepare_w_request()
1155 struct f_uas *fu = cmd->fu; in usbg_send_status_response() local
1157 if (fu->flags & USBG_IS_BOT) in usbg_send_status_response()
1167 struct f_uas *fu = cmd->fu; in usbg_send_write_request() local
1169 if (fu->flags & USBG_IS_BOT) in usbg_send_write_request()
1179 struct f_uas *fu = cmd->fu; in usbg_send_read_response() local
1181 if (fu->flags & USBG_IS_BOT) in usbg_send_read_response()
1196 se_sess = cmd->fu->tpg->tpg_nexus->tvn_se_sess; in usbg_submit_tmr()
1223 tpg = cmd->fu->tpg; in usbg_submit_cmd()
1266 struct f_uas *fu = cmd->fu; in usbg_cmd_work() local
1272 se_sess = cmd->fu->tpg->tpg_nexus->tvn_se_sess; in usbg_cmd_work()
1274 hash_for_each_possible_safe(fu->stream_hash, stream, tmp, node, cmd->tag) { in usbg_cmd_work()
1275 int i = stream - &fu->stream[0]; in usbg_cmd_work()
1284 usbg_submit_command(cmd->fu, cmd->req); in usbg_cmd_work()
1310 usbg_submit_command(cmd->fu, cmd->req); in usbg_cmd_work()
1336 static struct usbg_cmd *usbg_get_cmd(struct f_uas *fu, in usbg_get_cmd() argument
1353 cmd->fu = fu; in usbg_get_cmd()
1360 static int usbg_submit_command(struct f_uas *fu, struct usb_request *req) in usbg_submit_command() argument
1364 struct usbg_tpg *tpg = fu->tpg; in usbg_submit_command()
1379 cmd = usbg_get_cmd(fu, tv_nexus, scsi_tag); in usbg_submit_command()
1386 cmd->fu = fu; in usbg_submit_command()
1403 hash_for_each_possible_safe(fu->stream_hash, stream, tmp, node, scsi_tag) { in usbg_submit_command()
1406 int i = stream - &fu->stream[0]; in usbg_submit_command()
1408 se_sess = cmd->fu->tpg->tpg_nexus->tvn_se_sess; in usbg_submit_command()
1417 stream = &fu->stream[cmd->se_cmd.map_tag]; in usbg_submit_command()
1418 hash_add(fu->stream_hash, &stream->node, scsi_tag); in usbg_submit_command()
1483 tpg = cmd->fu->tpg; in bot_cmd_work()
1504 static int bot_submit_command(struct f_uas *fu, in bot_submit_command() argument
1509 struct usbg_tpg *tpg = fu->tpg; in bot_submit_command()
1532 cmd = usbg_get_cmd(fu, tv_nexus, cbw->Tag); in bot_submit_command()
1597 struct f_uas *fu = cmd->fu; in usbg_aborted_task() local
1598 struct usb_gadget *gadget = fuas_to_gadget(fu); in usbg_aborted_task()
1599 struct uas_stream *stream = &fu->stream[se_cmd->map_tag]; in usbg_aborted_task()
1603 ret = usb_ep_dequeue(fu->ep_out, stream->req_out); in usbg_aborted_task()
1605 ret = usb_ep_dequeue(fu->ep_in, stream->req_in); in usbg_aborted_task()
1607 ret = usb_ep_dequeue(fu->ep_status, stream->req_status); in usbg_aborted_task()
2273 struct f_uas *fu = to_f_uas(f); in tcm_bind() local
2302 fu->iface = iface; in tcm_bind()
2307 fu->ep_in = ep; in tcm_bind()
2312 fu->ep_out = ep; in tcm_bind()
2317 fu->ep_status = ep; in tcm_bind()
2322 fu->ep_cmd = ep; in tcm_bind()
2352 struct f_uas *fu; member
2360 struct f_uas *fu = work->fu; in tcm_delayed_set_alt() local
2365 if (fu->flags & USBG_IS_BOT) in tcm_delayed_set_alt()
2366 bot_cleanup_old_alt(fu); in tcm_delayed_set_alt()
2367 if (fu->flags & USBG_IS_UAS) in tcm_delayed_set_alt()
2368 uasp_cleanup_old_alt(fu); in tcm_delayed_set_alt()
2371 bot_set_alt(fu); in tcm_delayed_set_alt()
2373 uasp_set_alt(fu); in tcm_delayed_set_alt()
2374 usb_composite_setup_continue(fu->function.config->cdev); in tcm_delayed_set_alt()
2379 struct f_uas *fu = to_f_uas(f); in tcm_get_alt() local
2381 if (fu->iface != intf) in tcm_get_alt()
2384 if (fu->flags & USBG_IS_BOT) in tcm_get_alt()
2386 else if (fu->flags & USBG_IS_UAS) in tcm_get_alt()
2394 struct f_uas *fu = to_f_uas(f); in tcm_set_alt() local
2396 if (fu->iface != intf) in tcm_set_alt()
2406 work->fu = fu; in tcm_set_alt()
2416 struct f_uas *fu = to_f_uas(f); in tcm_disable() local
2418 if (fu->flags & USBG_IS_UAS) in tcm_disable()
2419 uasp_cleanup_old_alt(fu); in tcm_disable()
2420 else if (fu->flags & USBG_IS_BOT) in tcm_disable()
2421 bot_cleanup_old_alt(fu); in tcm_disable()
2422 fu->flags = 0; in tcm_disable()
2428 struct f_uas *fu = to_f_uas(f); in tcm_setup() local
2430 if (!(fu->flags & USBG_IS_BOT)) in tcm_setup()
2580 struct f_uas *fu; in tcm_alloc() local
2592 fu = kzalloc(sizeof(*fu), GFP_KERNEL); in tcm_alloc()
2593 if (!fu) { in tcm_alloc()
2598 fu->function.name = "Target Function"; in tcm_alloc()
2599 fu->function.bind = tcm_bind; in tcm_alloc()
2600 fu->function.unbind = tcm_unbind; in tcm_alloc()
2601 fu->function.set_alt = tcm_set_alt; in tcm_alloc()
2602 fu->function.get_alt = tcm_get_alt; in tcm_alloc()
2603 fu->function.setup = tcm_setup; in tcm_alloc()
2604 fu->function.disable = tcm_disable; in tcm_alloc()
2605 fu->function.free_func = tcm_free; in tcm_alloc()
2606 fu->tpg = tpg_instances[i].tpg; in tcm_alloc()
2608 hash_init(fu->stream_hash); in tcm_alloc()
2611 return &fu->function; in tcm_alloc()