Lines Matching defs:channel

87     // Number of packets queued for transfer before programming the channel.
90 // Number of bytes queued for transfer before programming the channel.
793 static void dwc_handle_channel_irq(uint32_t channel, dwc_usb_t* dwc) {
794 // Save the interrupt state of this channel.
795 volatile struct dwc_host_channel* chanptr = &regs->host_channels[channel];
796 dwc->channel_interrupts[channel] = chanptr->interrupts;
798 // Clear the interrupt state of this channel.
802 // Signal to the waiter that this channel is ready.
803 sync_completion_signal(&dwc->channel_complete[channel]);
1084 // A quick sanity check. We should never mark a channel that doesn't
1088 // Is there at least one channel that's free?
1094 // channel is in use.
1108 // We couldn't find a free channel, wait for somebody to tell us to
1109 // wake up and attempt to acquire a channel again.
1159 static union dwc_host_channel_interrupts dwc_await_channel_complete(uint32_t channel, dwc_usb_t* dwc) {
1160 sync_completion_wait(&dwc->channel_complete[channel], ZX_TIME_INFINITE);
1161 sync_completion_reset(&dwc->channel_complete[channel]);
1162 return dwc->channel_interrupts[channel];
1309 "channel = %u\n", req->request_id, chan);
1318 static void await_sof_if_necessary(uint channel, dwc_usb_transfer_request_t* req,
1337 sync_completion_reset(&dwc->sof_waiters[channel]);
1338 sync_completion_wait(&dwc->sof_waiters[channel], ZX_TIME_INFINITE);
1356 static bool handle_normal_channel_halted(uint channel,
1361 volatile struct dwc_host_channel* chanptr = &regs->host_channels[channel];
1402 release_channel(channel, dwc);
1415 // Requeue the request, don't release the channel.
1448 release_channel(channel, dwc);
1457 dwc_start_transaction(channel, req);
1464 dwc_start_transaction(channel, req);
1467 release_channel(channel, dwc);
1474 static bool handle_channel_halted_interrupt(uint channel,
1479 volatile struct dwc_host_channel* chanptr = &regs->host_channels[channel];
1496 // Release the channel used for this transaction.
1497 release_channel(channel, dwc);
1512 release_channel(channel, dwc);
1526 release_channel(channel, dwc);
1528 // Only release the channel if we're in the SETUP phase. The later
1529 // phases assume that the channel is already held when they retry.
1531 release_channel(channel, dwc);
1546 await_sof_if_necessary(channel, req, ep, dwc);
1566 await_sof_if_necessary(channel, req, ep, dwc);
1570 dwc_start_transaction(channel, req);
1574 return handle_normal_channel_halted(channel, req, ep, interrupts, dwc);
1592 uint channel = NUM_HOST_CHANNELS + 1;
1620 // We're going to use a single channel for all three phases
1623 channel = acquire_channel_blocking(dwc);
1640 dwc_start_transfer(channel, req, self);
1645 dwc_start_transfer(channel, req, self);
1648 dwc_start_transfer(channel, req, self);
1656 channel = acquire_channel_blocking(dwc);
1657 dwc_start_transfer(channel, req, self);
1660 channel = acquire_channel_blocking(dwc);
1661 await_sof_if_necessary(channel, req, self, dwc);
1662 dwc_start_transfer(channel, req, self);
1665 // Wait for an interrupt on this channel.
1668 dwc_await_channel_complete(channel, dwc);
1670 volatile struct dwc_host_channel* chanptr = &regs->host_channels[channel];
1673 if (handle_channel_halted_interrupt(channel, req, self, interrupts, dwc))
1798 // Initialize all the channel completions.