Lines Matching full:channel
15 /* Open a packet data online channel between the network layer and CP. */
79 /* Initialize wwan channel */
138 /* return true if channel is ready for use */
140 struct ipc_mem_channel *channel) in ipc_imem_is_channel_active() argument
158 if (channel->state != IMEM_CHANNEL_RESERVED) { in ipc_imem_is_channel_active()
160 "ch[%d]:invalid channel state %d,expected %d", in ipc_imem_is_channel_active()
161 channel->channel_id, channel->state, in ipc_imem_is_channel_active()
170 channel->channel_id, phase); in ipc_imem_is_channel_active()
173 /* Check the full availability of the channel. */ in ipc_imem_is_channel_active()
174 if (channel->state != IMEM_CHANNEL_ACTIVE) { in ipc_imem_is_channel_active()
175 dev_err(ipc_imem->dev, "ch[%d]: confused channel state %d", in ipc_imem_is_channel_active()
176 channel->channel_id, channel->state); in ipc_imem_is_channel_active()
190 * @channel: Channel instance.
193 struct ipc_mem_channel *channel) in ipc_imem_sys_port_close() argument
202 * channel is already freed. Nothing to do. in ipc_imem_sys_port_close()
211 if (channel->state == IMEM_CHANNEL_FREE) { in ipc_imem_sys_port_close()
212 dev_err(ipc_imem->dev, "ch[%d]: invalid channel state %d", in ipc_imem_sys_port_close()
213 channel->channel_id, channel->state); in ipc_imem_sys_port_close()
220 if (channel->ul_pipe.old_tail != channel->ul_pipe.old_head) { in ipc_imem_sys_port_close()
232 channel->ul_pipe.pipe_nr, in ipc_imem_sys_port_close()
233 channel->ul_pipe.old_head, in ipc_imem_sys_port_close()
234 channel->ul_pipe.old_tail); in ipc_imem_sys_port_close()
244 &channel->dl_pipe, NULL, &tail); in ipc_imem_sys_port_close()
246 if (tail != channel->dl_pipe.old_tail) { in ipc_imem_sys_port_close()
258 channel->dl_pipe.pipe_nr, in ipc_imem_sys_port_close()
259 channel->dl_pipe.old_head, in ipc_imem_sys_port_close()
260 channel->dl_pipe.old_tail); in ipc_imem_sys_port_close()
267 * between closing the pipe and updating the channel is closed. In this in ipc_imem_sys_port_close()
269 * the channel state as CLOSING to aviod unnecessary interrupt in ipc_imem_sys_port_close()
272 channel->state = IMEM_CHANNEL_CLOSING; in ipc_imem_sys_port_close()
274 ipc_imem_pipe_close(ipc_imem, &channel->ul_pipe); in ipc_imem_sys_port_close()
275 ipc_imem_pipe_close(ipc_imem, &channel->dl_pipe); in ipc_imem_sys_port_close()
277 ipc_imem_channel_free(channel); in ipc_imem_sys_port_close()
280 /* Open a PORT link to CP and return the channel */
284 struct ipc_mem_channel *channel; in ipc_imem_sys_port_open() local
301 channel = ipc_imem_channel_open(ipc_imem, ch_id, hp_id); in ipc_imem_sys_port_open()
303 if (!channel) { in ipc_imem_sys_port_open()
304 dev_err(ipc_imem->dev, "PORT channel id open failed"); in ipc_imem_sys_port_open()
308 return channel; in ipc_imem_sys_port_open()
314 struct ipc_mem_channel *channel = ipc_cdev->channel; in ipc_imem_sys_cdev_write() local
318 if (!ipc_imem_is_channel_active(ipc_imem, channel) || in ipc_imem_sys_cdev_write()
328 skb_queue_tail(&channel->ul_list, skb); in ipc_imem_sys_cdev_write()
333 skb_dequeue_tail(&channel->ul_list); in ipc_imem_sys_cdev_write()
334 dev_err(ipc_cdev->dev, "channel id[%d] write failed\n", in ipc_imem_sys_cdev_write()
335 ipc_cdev->channel->channel_id); in ipc_imem_sys_cdev_write()
341 /* Open a SIO link to CP and return the channel instance */
344 struct ipc_mem_channel *channel; in ipc_imem_sys_devlink_open() local
352 /* Get a channel id as flash id and reserve it. */ in ipc_imem_sys_devlink_open()
359 "reservation of a flash channel id failed"); in ipc_imem_sys_devlink_open()
364 channel = &ipc_imem->channels[channel_id]; in ipc_imem_sys_devlink_open()
369 channel->state = IMEM_CHANNEL_FREE; in ipc_imem_sys_devlink_open()
373 return channel; in ipc_imem_sys_devlink_open()
395 /* Release a SIO channel link to CP. */
401 struct ipc_mem_channel *channel; in ipc_imem_sys_devlink_close() local
405 channel = ipc_imem->ipc_devlink->devlink_sio.channel; in ipc_imem_sys_devlink_close()
419 if (channel->ul_pipe.old_tail != channel->ul_pipe.old_head) { in ipc_imem_sys_devlink_close()
426 channel->ul_pipe.pipe_nr, in ipc_imem_sys_devlink_close()
427 channel->ul_pipe.old_head, in ipc_imem_sys_devlink_close()
428 channel->ul_pipe.old_tail); in ipc_imem_sys_devlink_close()
433 &channel->dl_pipe, NULL, &tail); in ipc_imem_sys_devlink_close()
435 if (tail != channel->dl_pipe.old_tail) { in ipc_imem_sys_devlink_close()
442 channel->dl_pipe.pipe_nr, in ipc_imem_sys_devlink_close()
443 channel->dl_pipe.old_head, in ipc_imem_sys_devlink_close()
444 channel->dl_pipe.old_tail); in ipc_imem_sys_devlink_close()
449 * between closing the pipe and updating the channel is closed. In this in ipc_imem_sys_devlink_close()
451 * the channel state as CLOSING to aviod unnecessary interrupt in ipc_imem_sys_devlink_close()
454 channel->state = IMEM_CHANNEL_CLOSING; in ipc_imem_sys_devlink_close()
456 ipc_imem_pipe_cleanup(ipc_imem, &channel->ul_pipe); in ipc_imem_sys_devlink_close()
457 ipc_imem_pipe_cleanup(ipc_imem, &channel->dl_pipe); in ipc_imem_sys_devlink_close()
470 struct ipc_mem_channel *channel, in ipc_imem_sys_psi_transfer() argument
491 (&channel->ul_sem, in ipc_imem_sys_psi_transfer()
536 (&channel->ul_sem, msecs_to_jiffies(IPC_PSI_TRANSFER_TIMEOUT)); in ipc_imem_sys_psi_transfer()
547 channel->channel_id, in ipc_imem_sys_psi_transfer()
554 /* Create the flash channel for the transfer of the images. */ in ipc_imem_sys_psi_transfer()
571 struct ipc_mem_channel *channel; in ipc_imem_sys_devlink_write() local
576 channel = ipc_imem->ipc_devlink->devlink_sio.channel; in ipc_imem_sys_devlink_write()
582 ret = ipc_imem_sys_psi_transfer(ipc_imem, channel, buf, count); in ipc_imem_sys_devlink_write()
606 skb_queue_tail(&channel->ul_list, skb); in ipc_imem_sys_devlink_write()
610 ret = wait_for_completion_interruptible(&channel->ul_sem); in ipc_imem_sys_devlink_write()
615 channel->channel_id, ret); in ipc_imem_sys_devlink_write()