Lines Matching defs:channel

78 	unsigned int channel;
88 * @cap: channel capabilities
89 * @conf: channel configuration
93 * @suffix: suffix for channel name
94 * @channel_lock: synchronize channel access
95 * @padding_active: indicates channel uses padding
96 * @is_channel_healthy: health status table of each channel
112 spinlock_t channel_lock[MAX_NUM_ENDPOINTS]; /* sync channel access */
191 * @cfg: channel configuration
218 dev_warn(dev, "Query frame size of non-streaming channel\n");
226 * hdm_poison_channel - mark buffers of this channel as invalid
228 * @channel: channel ID
236 static int hdm_poison_channel(struct most_interface *iface, int channel)
242 if (channel < 0 || channel >= iface->num_channels) {
247 lock = mdev->channel_lock + channel;
249 mdev->is_channel_healthy[channel] = false;
252 cancel_work_sync(&mdev->clear_work[channel].ws);
255 usb_kill_anchored_urbs(&mdev->busy_urbs[channel]);
256 if (mdev->padding_active[channel])
257 mdev->padding_active[channel] = false;
259 if (mdev->conf[channel].data_type == MOST_CH_ASYNC) {
270 * @channel: channel ID
274 * channel's buffer
276 static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
278 struct most_channel_config *conf = &mdev->conf[channel];
303 * @channel: channel ID
307 * channel's buffer.
309 static int hdm_remove_padding(struct most_dev *mdev, int channel,
312 struct most_channel_config *const conf = &mdev->conf[channel];
344 unsigned int channel = mbo->hdm_channel_id;
345 spinlock_t *lock = mdev->channel_lock + channel;
352 if (likely(mdev->is_channel_healthy[channel])) {
362 mdev->ep_address[channel]);
363 mdev->is_channel_healthy[channel] = false;
364 mdev->clear_work[channel].pipe = urb->pipe;
365 schedule_work(&mdev->clear_work[channel].ws);
396 unsigned int channel = mbo->hdm_channel_id;
398 spinlock_t *lock = mdev->channel_lock + channel;
405 if (likely(mdev->is_channel_healthy[channel])) {
411 if (mdev->padding_active[channel] &&
412 hdm_remove_padding(mdev, channel, mbo)) {
419 mdev->ep_address[channel]);
420 mdev->is_channel_healthy[channel] = false;
421 mdev->clear_work[channel].pipe = urb->pipe;
422 schedule_work(&mdev->clear_work[channel].ws);
430 mdev->ep_address[channel]);
445 * @channel: ID of the channel
448 * This allocates a new URB and fills it according to the channel
457 static int hdm_enqueue(struct most_interface *iface, int channel,
469 if (iface->num_channels <= channel || channel < 0)
476 conf = &mdev->conf[channel];
484 if ((conf->direction & MOST_CH_TX) && mdev->padding_active[channel] &&
485 hdm_add_padding(mdev, channel, mbo)) {
497 mdev->ep_address[channel]),
508 mdev->ep_address[channel]),
516 usb_anchor_urb(urb, &mdev->busy_urbs[channel]);
552 * hdm_configure_channel - receive channel configuration from core
554 * @channel: channel ID
566 static int hdm_configure_channel(struct most_interface *iface, int channel,
578 if (channel < 0 || channel >= iface->num_channels) {
583 mdev->is_channel_healthy[channel] = true;
584 mdev->clear_work[channel].channel = channel;
585 mdev->clear_work[channel].mdev = mdev;
586 INIT_WORK(&mdev->clear_work[channel].ws, wq_clear_halt);
596 mdev->padding_active[channel] = false;
605 mdev->padding_active[channel] = true;
620 mdev->suffix[channel], old_size, conf->buffer_size);
627 mdev->conf[channel] = *conf;
629 u16 ep = mdev->ep_address[channel];
640 * @channel: channel ID
646 static void hdm_request_netinfo(struct most_interface *iface, int channel,
732 unsigned int channel = clear_work->channel;
738 most_stop_enqueue(&mdev->iface, channel);
739 usb_kill_anchored_urbs(&mdev->busy_urbs[channel]);
744 * asynchronous rx channel, we need to clear the tx channel
751 if (mdev->conf[channel].data_type == MOST_CH_ASYNC &&
752 mdev->conf[channel].direction == MOST_CH_RX) {
753 if (channel == 0)
761 mdev->is_channel_healthy[channel] = true;
762 most_resume_enqueue(&mdev->iface, channel);