Lines Matching full:channel

15 /* Open a packet data online channel between the network layer and CP. */
79 /* Initialize wwan channel */
142 /* return true if channel is ready for use */
144 struct ipc_mem_channel *channel) in ipc_imem_is_channel_active() argument
162 if (channel->state != IMEM_CHANNEL_RESERVED) { in ipc_imem_is_channel_active()
164 "ch[%d]:invalid channel state %d,expected %d", in ipc_imem_is_channel_active()
165 channel->channel_id, channel->state, in ipc_imem_is_channel_active()
174 channel->channel_id, phase); in ipc_imem_is_channel_active()
177 /* Check the full availability of the channel. */ in ipc_imem_is_channel_active()
178 if (channel->state != IMEM_CHANNEL_ACTIVE) { in ipc_imem_is_channel_active()
179 dev_err(ipc_imem->dev, "ch[%d]: confused channel state %d", in ipc_imem_is_channel_active()
180 channel->channel_id, channel->state); in ipc_imem_is_channel_active()
194 * @channel: Channel instance.
197 struct ipc_mem_channel *channel) in ipc_imem_sys_port_close() argument
206 * channel is already freed. Nothing to do. in ipc_imem_sys_port_close()
215 if (channel->state == IMEM_CHANNEL_FREE) { in ipc_imem_sys_port_close()
216 dev_err(ipc_imem->dev, "ch[%d]: invalid channel state %d", in ipc_imem_sys_port_close()
217 channel->channel_id, channel->state); in ipc_imem_sys_port_close()
224 if (channel->ul_pipe.old_tail != channel->ul_pipe.old_head) { in ipc_imem_sys_port_close()
236 channel->ul_pipe.pipe_nr, in ipc_imem_sys_port_close()
237 channel->ul_pipe.old_head, in ipc_imem_sys_port_close()
238 channel->ul_pipe.old_tail); in ipc_imem_sys_port_close()
248 &channel->dl_pipe, NULL, &tail); in ipc_imem_sys_port_close()
250 if (tail != channel->dl_pipe.old_tail) { in ipc_imem_sys_port_close()
262 channel->dl_pipe.pipe_nr, in ipc_imem_sys_port_close()
263 channel->dl_pipe.old_head, in ipc_imem_sys_port_close()
264 channel->dl_pipe.old_tail); in ipc_imem_sys_port_close()
271 * between closing the pipe and updating the channel is closed. In this in ipc_imem_sys_port_close()
273 * the channel state as CLOSING to aviod unnecessary interrupt in ipc_imem_sys_port_close()
276 channel->state = IMEM_CHANNEL_CLOSING; in ipc_imem_sys_port_close()
278 ipc_imem_pipe_close(ipc_imem, &channel->ul_pipe); in ipc_imem_sys_port_close()
279 ipc_imem_pipe_close(ipc_imem, &channel->dl_pipe); in ipc_imem_sys_port_close()
281 ipc_imem_channel_free(channel); in ipc_imem_sys_port_close()
284 /* Open a PORT link to CP and return the channel */
288 struct ipc_mem_channel *channel; in ipc_imem_sys_port_open() local
305 channel = ipc_imem_channel_open(ipc_imem, ch_id, hp_id); in ipc_imem_sys_port_open()
307 if (!channel) { in ipc_imem_sys_port_open()
308 dev_err(ipc_imem->dev, "PORT channel id open failed"); in ipc_imem_sys_port_open()
312 return channel; in ipc_imem_sys_port_open()
318 struct ipc_mem_channel *channel = ipc_cdev->channel; in ipc_imem_sys_cdev_write() local
322 if (!ipc_imem_is_channel_active(ipc_imem, channel) || in ipc_imem_sys_cdev_write()
332 skb_queue_tail(&channel->ul_list, skb); in ipc_imem_sys_cdev_write()
337 skb_dequeue_tail(&channel->ul_list); in ipc_imem_sys_cdev_write()
338 dev_err(ipc_cdev->dev, "channel id[%d] write failed\n", in ipc_imem_sys_cdev_write()
339 ipc_cdev->channel->channel_id); in ipc_imem_sys_cdev_write()
345 /* Open a SIO link to CP and return the channel instance */
348 struct ipc_mem_channel *channel; in ipc_imem_sys_devlink_open() local
356 /* Get a channel id as flash id and reserve it. */ in ipc_imem_sys_devlink_open()
363 "reservation of a flash channel id failed"); in ipc_imem_sys_devlink_open()
368 channel = &ipc_imem->channels[channel_id]; in ipc_imem_sys_devlink_open()
373 channel->state = IMEM_CHANNEL_FREE; in ipc_imem_sys_devlink_open()
377 return channel; in ipc_imem_sys_devlink_open()
399 /* Release a SIO channel link to CP. */
405 struct ipc_mem_channel *channel; in ipc_imem_sys_devlink_close() local
409 channel = ipc_imem->ipc_devlink->devlink_sio.channel; in ipc_imem_sys_devlink_close()
423 if (channel->ul_pipe.old_tail != channel->ul_pipe.old_head) { in ipc_imem_sys_devlink_close()
430 channel->ul_pipe.pipe_nr, in ipc_imem_sys_devlink_close()
431 channel->ul_pipe.old_head, in ipc_imem_sys_devlink_close()
432 channel->ul_pipe.old_tail); in ipc_imem_sys_devlink_close()
437 &channel->dl_pipe, NULL, &tail); in ipc_imem_sys_devlink_close()
439 if (tail != channel->dl_pipe.old_tail) { in ipc_imem_sys_devlink_close()
446 channel->dl_pipe.pipe_nr, in ipc_imem_sys_devlink_close()
447 channel->dl_pipe.old_head, in ipc_imem_sys_devlink_close()
448 channel->dl_pipe.old_tail); in ipc_imem_sys_devlink_close()
453 * between closing the pipe and updating the channel is closed. In this in ipc_imem_sys_devlink_close()
455 * the channel state as CLOSING to aviod unnecessary interrupt in ipc_imem_sys_devlink_close()
458 channel->state = IMEM_CHANNEL_CLOSING; in ipc_imem_sys_devlink_close()
460 ipc_imem_pipe_cleanup(ipc_imem, &channel->ul_pipe); in ipc_imem_sys_devlink_close()
461 ipc_imem_pipe_cleanup(ipc_imem, &channel->dl_pipe); in ipc_imem_sys_devlink_close()
474 struct ipc_mem_channel *channel, in ipc_imem_sys_psi_transfer() argument
495 (&channel->ul_sem, in ipc_imem_sys_psi_transfer()
540 (&channel->ul_sem, msecs_to_jiffies(IPC_PSI_TRANSFER_TIMEOUT)); in ipc_imem_sys_psi_transfer()
551 channel->channel_id, in ipc_imem_sys_psi_transfer()
558 /* Create the flash channel for the transfer of the images. */ in ipc_imem_sys_psi_transfer()
575 struct ipc_mem_channel *channel; in ipc_imem_sys_devlink_write() local
580 channel = ipc_imem->ipc_devlink->devlink_sio.channel; in ipc_imem_sys_devlink_write()
586 ret = ipc_imem_sys_psi_transfer(ipc_imem, channel, buf, count); in ipc_imem_sys_devlink_write()
610 skb_queue_tail(&channel->ul_list, skb); in ipc_imem_sys_devlink_write()
614 ret = wait_for_completion_interruptible(&channel->ul_sem); in ipc_imem_sys_devlink_write()
619 channel->channel_id, ret); in ipc_imem_sys_devlink_write()