goldfish: pipe: ANDROID: Add 'pipe' to pipe functions
Replace the 'goldfish' prefix with 'goldfish_pipe' to say they are pipe functions. Bug: 72717639 Bug: 66884503 Change-Id: I5a5cf7ee38cf2ae193877b1ffac19eadb15a374a Signed-off-by: Roman Kiryanov <rkir@google.com>
This commit is contained in:
parent
e008465076
commit
ed6207885d
1 changed files with 9 additions and 8 deletions
|
@ -215,7 +215,8 @@ struct goldfish_pipe {
|
||||||
|
|
||||||
struct goldfish_pipe_dev goldfish_pipe_dev;
|
struct goldfish_pipe_dev goldfish_pipe_dev;
|
||||||
|
|
||||||
static int goldfish_cmd_locked(struct goldfish_pipe *pipe, enum PipeCmdCode cmd)
|
static int goldfish_pipe_cmd_locked(
|
||||||
|
struct goldfish_pipe *pipe, enum PipeCmdCode cmd)
|
||||||
{
|
{
|
||||||
pipe->command_buffer->cmd = cmd;
|
pipe->command_buffer->cmd = cmd;
|
||||||
/* failure by default */
|
/* failure by default */
|
||||||
|
@ -224,14 +225,14 @@ static int goldfish_cmd_locked(struct goldfish_pipe *pipe, enum PipeCmdCode cmd)
|
||||||
return pipe->command_buffer->status;
|
return pipe->command_buffer->status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int goldfish_cmd(struct goldfish_pipe *pipe, enum PipeCmdCode cmd)
|
static int goldfish_pipe_cmd(struct goldfish_pipe *pipe, enum PipeCmdCode cmd)
|
||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (mutex_lock_interruptible(&pipe->lock))
|
if (mutex_lock_interruptible(&pipe->lock))
|
||||||
return PIPE_ERROR_IO;
|
return PIPE_ERROR_IO;
|
||||||
|
|
||||||
status = goldfish_cmd_locked(pipe, cmd);
|
status = goldfish_pipe_cmd_locked(pipe, cmd);
|
||||||
|
|
||||||
mutex_unlock(&pipe->lock);
|
mutex_unlock(&pipe->lock);
|
||||||
return status;
|
return status;
|
||||||
|
@ -354,7 +355,7 @@ static int transfer_max_buffers(struct goldfish_pipe *pipe,
|
||||||
pipe->command_buffer);
|
pipe->command_buffer);
|
||||||
|
|
||||||
/* Transfer the data */
|
/* Transfer the data */
|
||||||
*status = goldfish_cmd_locked(
|
*status = goldfish_pipe_cmd_locked(
|
||||||
pipe,
|
pipe,
|
||||||
is_write ? PIPE_CMD_WRITE : PIPE_CMD_READ);
|
is_write ? PIPE_CMD_WRITE : PIPE_CMD_READ);
|
||||||
|
|
||||||
|
@ -372,7 +373,7 @@ static int wait_for_host_signal(struct goldfish_pipe *pipe, int is_write)
|
||||||
set_bit(wakeBit, &pipe->flags);
|
set_bit(wakeBit, &pipe->flags);
|
||||||
|
|
||||||
/* Tell the emulator we're going to wait for a wake event */
|
/* Tell the emulator we're going to wait for a wake event */
|
||||||
(void)goldfish_cmd(pipe,
|
goldfish_pipe_cmd(pipe,
|
||||||
is_write ? PIPE_CMD_WAKE_ON_WRITE : PIPE_CMD_WAKE_ON_READ);
|
is_write ? PIPE_CMD_WAKE_ON_WRITE : PIPE_CMD_WAKE_ON_READ);
|
||||||
|
|
||||||
while (test_bit(wakeBit, &pipe->flags)) {
|
while (test_bit(wakeBit, &pipe->flags)) {
|
||||||
|
@ -493,7 +494,7 @@ static unsigned int goldfish_pipe_poll(struct file *filp, poll_table *wait)
|
||||||
|
|
||||||
poll_wait(filp, &pipe->wake_queue, wait);
|
poll_wait(filp, &pipe->wake_queue, wait);
|
||||||
|
|
||||||
status = goldfish_cmd(pipe, PIPE_CMD_POLL);
|
status = goldfish_pipe_cmd(pipe, PIPE_CMD_POLL);
|
||||||
if (status < 0)
|
if (status < 0)
|
||||||
return -ERESTARTSYS;
|
return -ERESTARTSYS;
|
||||||
|
|
||||||
|
@ -723,7 +724,7 @@ static int goldfish_pipe_open(struct inode *inode, struct file *file)
|
||||||
MAX_BUFFERS_PER_COMMAND;
|
MAX_BUFFERS_PER_COMMAND;
|
||||||
dev->buffers->open_command_params.command_buffer_ptr =
|
dev->buffers->open_command_params.command_buffer_ptr =
|
||||||
(u64)(unsigned long)__pa(pipe->command_buffer);
|
(u64)(unsigned long)__pa(pipe->command_buffer);
|
||||||
status = goldfish_cmd_locked(pipe, PIPE_CMD_OPEN);
|
status = goldfish_pipe_cmd_locked(pipe, PIPE_CMD_OPEN);
|
||||||
spin_unlock_irqrestore(&dev->lock, flags);
|
spin_unlock_irqrestore(&dev->lock, flags);
|
||||||
if (status < 0) {
|
if (status < 0) {
|
||||||
pr_err("Could not tell host of new pipe! status=%d\n", status);
|
pr_err("Could not tell host of new pipe! status=%d\n", status);
|
||||||
|
@ -752,7 +753,7 @@ static int goldfish_pipe_release(struct inode *inode, struct file *filp)
|
||||||
struct goldfish_pipe_dev *dev = pipe->dev;
|
struct goldfish_pipe_dev *dev = pipe->dev;
|
||||||
|
|
||||||
/* The guest is closing the channel, so tell the emulator right now */
|
/* The guest is closing the channel, so tell the emulator right now */
|
||||||
(void)goldfish_cmd(pipe, PIPE_CMD_CLOSE);
|
goldfish_pipe_cmd(pipe, PIPE_CMD_CLOSE);
|
||||||
|
|
||||||
spin_lock_irqsave(&dev->lock, flags);
|
spin_lock_irqsave(&dev->lock, flags);
|
||||||
dev->pipes[pipe->id] = NULL;
|
dev->pipes[pipe->id] = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue