Commit 5e371815 authored by Omar Ramirez Luna's avatar Omar Ramirez Luna Committed by Hari Kanigeri

DSPBRIDGE: change ioctl base number

For newer kernels the ioctl numbers have changed, passing ioctl number
1 or 2, will call kernel functions inside the ioctl syscall switch.

This patch changes the base number for bridge ioctls to start on 101.
For this to work, the same change has to be propagated to bridge API.

This patch should be temporary until the _IOx kernel calls are used
to define ioctl numbers withing bridge driver.
Signed-off-by: default avatarOmar Ramirez Luna <omar.ramirez@ti.com>
parent b2e86cb3
......@@ -437,7 +437,7 @@ union Trapped_Args {
} ARGS_UTIL_TESTDLL;
} ;
#define CMD_BASE 1
#define CMD_BASE 101
/* MGR module offsets */
#define CMD_MGR_BASE_OFFSET CMD_BASE
......
......@@ -256,7 +256,10 @@ static struct WCD_Cmd WCD_cmdTable[] = {
inline DSP_STATUS WCD_CallDevIOCtl(u32 cmd, union Trapped_Args *args,
u32 *pResult)
{
if ((cmd < (sizeof(WCD_cmdTable) / sizeof(struct WCD_Cmd)))) {
int cmdtable = sizeof(WCD_cmdTable) / sizeof(struct WCD_Cmd);
cmd -= CMD_BASE;
if (cmd < cmdtable) {
/* make the fxn call via the cmd table */
*pResult = (*WCD_cmdTable[cmd].fxn) (args);
return DSP_SOK;
......@@ -307,9 +310,10 @@ bool WCD_Init(void)
#ifdef DEBUG
/* runtime check of Device IOCtl array. */
u32 i;
for (i = 1; i < (sizeof(WCD_cmdTable) / sizeof(struct WCD_Cmd)); i++)
DBC_Assert(WCD_cmdTable[i - 1].dwIndex == i);
int cmdtable = sizeof(WCD_cmdTable) / sizeof(struct WCD_Cmd);
for (i = 0; i < cmdtable; i++)
DBC_Assert(WCD_cmdTable[i].dwIndex == i + CMD_BASE);
#endif
if (WCD_cRefs == 0) {
/* initialize all SERVICES modules */
......
......@@ -688,9 +688,6 @@ static int bridge_ioctl(struct inode *ip, struct file *filp, unsigned int code,
GT_0trace(driverTrace, GT_ENTER, " -> driver_ioctl\n");
/* Deduct one for the CMD_BASE. */
code = (code - 1);
status = copy_from_user(&pBufIn, (union Trapped_Args *)args,
sizeof(union Trapped_Args));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment