struct most_channel_config *cfg;
unsigned int channel_id;
dev_t devno;
- bool keep_mbo;
unsigned int mbo_offs;
struct mbo *stacked_mbo;
DECLARE_KFIFO_PTR(fifo, typeof(struct mbo *));
while (kfifo_out((struct kfifo *)&channel->fifo, &mbo, 1))
most_put_mbo(mbo);
- if (channel->keep_mbo)
+ if (channel->stacked_mbo)
most_put_mbo(channel->stacked_mbo);
ret = most_stop_channel(channel->iface, channel->channel_id, &cdev_aim);
atomic_dec(&channel->access_ref);
struct mbo *mbo;
struct aim_channel *channel = filp->private_data;
- if (channel->keep_mbo) {
+ if (channel->stacked_mbo) {
mbo = channel->stacked_mbo;
- channel->keep_mbo = false;
goto start_copy;
}
while ((!kfifo_out(&channel->fifo, &mbo, 1)) && (channel->dev)) {
return -EIO;
}
- if (count < mbo->processed_length)
- channel->keep_mbo = true;
-
proc_len = min((int)count,
(int)(mbo->processed_length - channel->mbo_offs));
retval = not_copied ? proc_len - not_copied : proc_len;
- if (channel->keep_mbo) {
+ if (count < mbo->processed_length) {
channel->mbo_offs = retval;
channel->stacked_mbo = mbo;
} else {
most_put_mbo(mbo);
channel->mbo_offs = 0;
+ channel->stacked_mbo = NULL;
}
mutex_unlock(&channel->io_mutex);
return retval;