Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162391
b: refs/heads/master
c: 2e7dcc3
h: refs/heads/master
i:
  162389: a603c50
  162387: f9d8b31
  162383: b522e67
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent 5ed8cd4 commit 3e99782
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6f9e0f60c46d597ee924dd073628ca2424f4178c
refs/heads/master: 2e7dcc3bbffb0b87f64369b3dab3ac8993d446b3
68 changes: 45 additions & 23 deletions trunk/drivers/staging/sep/sep_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ static unsigned int sep_poll(struct file *filp, poll_table * wait)
}

/*
calculates time and sets it at the predefined address
calculates time and sets it at the predefined address. Called with the
mutex held.
*/
static int sep_set_time(struct sep_device *sep, unsigned long *address_ptr, unsigned long *time_in_sec_ptr)
{
Expand Down Expand Up @@ -496,53 +497,74 @@ static int sep_set_time(struct sep_device *sep, unsigned long *address_ptr, unsi
return 0;
}

/*
This function raises interrupt to SEP that signals that is has a new
command from HOST
*/
/**
* sep_dump_message - dump the message that is pending
* @sep: sep device
*
* Dump out the message pending in the shared message area
*/

static void sep_dump_message(struct sep_device *sep)
{
int count;
for (count = 0; count < 12 * 4; count += 4)
edbg("Word %d of the message is %u\n", count, *((u32 *) (sep->shared_addr + count)));
}

/**
* sep_send_command_handler - kick off a command
* @sep: sep being signalled
*
* This function raises interrupt to SEP that signals that is has a new
* command from the host
*/

static void sep_send_command_handler(struct sep_device *sep)
{
unsigned long count;
dbg("sep:sep_send_command_handler start\n");

dbg("SEP Driver:--------> sep_send_command_handler start\n");
mutex_lock(&sep_mutex);
sep_set_time(sep, 0, 0);

/* flash cache */
/* FIXME: flush cache */
flush_cache_all();

for (count = 0; count < 12 * 4; count += 4)
edbg("Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + count)));

sep_dump_message(sep);
/* update counter */
sep->send_ct++;
/* send interrupt to SEP */
sep_write_reg(sep, HW_HOST_HOST_SEP_GPR0_REG_ADDR, 0x2);
dbg("SEP Driver:<-------- sep_send_command_handler end\n");
mutex_unlock(&sep_mutex);
return;
}

/*
This function raises interrupt to SEPm that signals that is has a
new command from HOST
*/
/**
* sep_send_reply_command_handler - kick off a command reply
* @sep: sep being signalled
*
* This function raises interrupt to SEP that signals that is has a new
* command from the host
*/

static void sep_send_reply_command_handler(struct sep_device *sep)
{
unsigned long count;

dbg("SEP Driver:--------> sep_send_reply_command_handler start\n");
dbg("sep:sep_send_reply_command_handler start\n");

/* flash cache */
flush_cache_all();
for (count = 0; count < 12 * 4; count += 4)
edbg("Word %lu of the message is %lu\n", count, *((unsigned long *) (sep->shared_addr + count)));
/* update counter */
sep->send_ct++;

sep_dump_message(sep);

mutex_lock(&sep_mutex);
sep->send_ct++; /* update counter */
/* send the interrupt to SEP */
sep_write_reg(sep, HW_HOST_HOST_SEP_GPR2_REG_ADDR, sep->send_ct);
/* update both counters */
sep->send_ct++;
sep->reply_ct++;
dbg("SEP Driver:<-------- sep_send_reply_command_handler end\n");
mutex_unlock(&sep_mutex);
dbg("sep: sep_send_reply_command_handler end\n");
}

/*
Expand Down

0 comments on commit 3e99782

Please sign in to comment.