Lines Matching defs:pipe

29  * keyspanport pipe routines (mostly device-neutral)
46 * initialize pipe structure with the given parameters
50 keyspan_pipe_t *pipe)
55 "pipe = %p, pipe_stat %x", (void *)pipe, pipe->pipe_state);
58 mutex_init(&pipe->pipe_mutex, NULL, MUTEX_DRIVER, (void *)NULL);
60 /* init pipe policy */
61 policy = &pipe->pipe_policy;
64 pipe->pipe_ksp = ksp;
67 pipe->pipe_lh = ksp->ks_lh;
70 pipe->pipe_lh = kp->kp_lh;
73 pipe->pipe_state = KEYSPAN_PIPE_CLOSED;
78 keyspan_fini_one_pipe(keyspan_pipe_t *pipe)
80 USB_DPRINTF_L4(DPRINT_OPEN, pipe->pipe_ksp->ks_lh,
81 "keyspan_fini_one_pipe: pipe_stat %x", pipe->pipe_state);
83 if (pipe->pipe_state != KEYSPAN_PIPE_NOT_INIT) {
84 mutex_destroy(&pipe->pipe_mutex);
85 pipe->pipe_state = KEYSPAN_PIPE_NOT_INIT;
91 * Allocate resources, initialize pipe structures.
252 * Device globle pipes: a bulk in pipe for status and a bulk out
253 * pipe for controle cmd.
282 * Allocate resources, initialize pipe structures.
381 /* intr in pipe for status */
415 /* fini status pipe */
418 * fini control pipe
419 * If USA_49WG, don't need fini control pipe
438 keyspan_open_one_pipe(keyspan_state_t *ksp, keyspan_pipe_t *pipe)
443 mutex_enter(&pipe->pipe_mutex);
444 ASSERT(pipe->pipe_state != KEYSPAN_PIPE_NOT_INIT);
445 if (pipe->pipe_state != KEYSPAN_PIPE_CLOSED) {
446 mutex_exit(&pipe->pipe_mutex);
450 mutex_exit(&pipe->pipe_mutex);
452 rval = usb_pipe_open(ksp->ks_dip, &pipe->pipe_ep_descr,
453 &pipe->pipe_policy, USB_FLAGS_SLEEP, &pipe->pipe_handle);
456 mutex_enter(&pipe->pipe_mutex);
457 pipe->pipe_state = KEYSPAN_PIPE_OPEN;
458 mutex_exit(&pipe->pipe_mutex);
465 * Open shared datain pipe for USA_49WG
468 keyspan_open_pipe_datain_usa49wg(keyspan_state_t *ksp, keyspan_pipe_t *pipe)
473 mutex_enter(&pipe->pipe_mutex);
474 ASSERT(pipe->pipe_state != KEYSPAN_PIPE_NOT_INIT);
475 if (pipe->pipe_state != KEYSPAN_PIPE_CLOSED) {
476 mutex_exit(&pipe->pipe_mutex);
480 mutex_exit(&pipe->pipe_mutex);
487 if ((rval = (usb_pipe_open(ksp->ks_dip, &pipe->pipe_ep_descr,
488 &pipe->pipe_policy, USB_FLAGS_SLEEP,
489 &pipe->pipe_handle))) == USB_SUCCESS) {
490 mutex_enter(&pipe->pipe_mutex);
491 pipe->pipe_state = KEYSPAN_PIPE_OPEN;
492 mutex_exit(&pipe->pipe_mutex);
495 ksp->ks_datain_pipe_handle = pipe->pipe_handle;
505 /* data in pipe has been opened by other port */
508 mutex_enter(&pipe->pipe_mutex);
509 pipe->pipe_handle = ksp->ks_datain_pipe_handle;
510 /* Set datain pipe state */
511 pipe->pipe_state = KEYSPAN_PIPE_OPEN;
512 mutex_exit(&pipe->pipe_mutex);
520 * close one pipe if open
523 keyspan_close_one_pipe(keyspan_pipe_t *pipe)
526 * pipe may already be closed, e.g. if device has been physically
529 if (pipe->pipe_handle != NULL) {
530 usb_pipe_close(pipe->pipe_ksp->ks_dip, pipe->pipe_handle,
532 mutex_enter(&pipe->pipe_mutex);
533 pipe->pipe_handle = NULL;
534 pipe->pipe_state = KEYSPAN_PIPE_CLOSED;
535 mutex_exit(&pipe->pipe_mutex);
540 * close shared datain pipe if open for USA_49WG
543 keyspan_close_pipe_datain_usa49wg(keyspan_pipe_t *pipe)
545 keyspan_state_t *ksp = pipe->pipe_ksp;
547 * pipe may already be closed, e.g. if device has been physically
550 if (pipe->pipe_handle != NULL) {
555 usb_pipe_close(pipe->pipe_ksp->ks_dip,
556 pipe->pipe_handle, USB_FLAGS_SLEEP,
562 mutex_enter(&pipe->pipe_mutex);
563 pipe->pipe_handle = NULL;
564 pipe->pipe_state = KEYSPAN_PIPE_CLOSED;
565 mutex_exit(&pipe->pipe_mutex);
571 * Open global pipes, a status pipe and a control pipe
584 "keyspan_open_dev_pipes_usa49: open ctrl pipe failed %d",
592 "keyspan_open_dev_pipes_usa49: open status pipe failed %d",
595 /* close the first opened pipe here */
620 * Open global pipes, a status pipe
621 * Use default control pipe, don't need to open it.
628 /* Open status pipe */
633 "open status pipe failed %d",
645 * Open global pipes, status pipe and control pipe,
695 "keyspan_reopen_pipes() reopen pipe #%d", i);
822 * USA_49WG use default control pipe, don't need close it
823 * Stop polling before close status in pipe
902 keyspan_bulkout_cb(usb_pipe_handle_t pipe, usb_bulk_req_t *req)
963 keyspan_introut_cb_usa49wg(usb_pipe_handle_t pipe, usb_intr_req_t *req)
1131 * pipe callbacks
1138 keyspan_bulkin_cb_usa49(usb_pipe_handle_t pipe, usb_bulk_req_t *req)
1183 * pipe callbacks
1190 keyspan_bulkin_cb_usa49wg(usb_pipe_handle_t pipe, usb_bulk_req_t *req)
1338 * pipe callbacks
1345 keyspan_bulkin_cb(usb_pipe_handle_t pipe, usb_bulk_req_t *req)
1357 data_len = keyspan_bulkin_cb_usa49(pipe, req);
1377 * pipe callbacks
1384 keyspan_status_cb_usa19hs(usb_pipe_handle_t pipe, usb_bulk_req_t *req)
1458 * pipe callbacks
1465 keyspan_status_cb_usa49(usb_pipe_handle_t pipe, usb_bulk_req_t *req)
1535 * pipe callbacks
1542 keyspan_status_cb(usb_pipe_handle_t pipe, usb_bulk_req_t *req)
1553 keyspan_status_cb_usa19hs(pipe, req);
1559 keyspan_status_cb_usa49(pipe, req);
1591 * USB_SUCCESS, pipe is acquired and request is sent, otherwise req is free.
1687 * if this function returns USB_SUCCESS, pipe is acquired and request
1688 * is sent, otherwise pipe is free.
1740 * if this function returns USB_SUCCESS, pipe is acquired and request
1741 * is sent, otherwise pipe is free.
1786 * pipe callbacks
1793 keyspan_status_cb_usa49wg(usb_pipe_handle_t pipe, usb_intr_req_t *req)
1862 * pipe callbacks
1869 keyspan_intr_cb_usa49wg(usb_pipe_handle_t pipe, usb_intr_req_t *req)
1878 (void) keyspan_status_cb_usa49wg(pipe, req);
1884 * pipe callbacks
1891 keyspan_intr_ex_cb_usa49wg(usb_pipe_handle_t pipe, usb_intr_req_t *req)
1914 * start polling on the interrupt pipe for USA_49WG model only