msm: adsprpc: FastRPC driver interface to get HLOS PID
Currently there is no interface request to get HLOS PID of the device attached to FastRPC bus driver. Add new request FASTRPC_DEV_GET_HLOS_PID, to get HLOS PID of the attached device. Signed-off-by: Himateja Reddy <quic_hmreddy@quicinc.com>
This commit is contained in:
33
dsp/adsprpc.c
Executable file → Normal file
33
dsp/adsprpc.c
Executable file → Normal file
@@ -8148,6 +8148,7 @@ static struct platform_driver fastrpc_driver = {
|
||||
union fastrpc_dev_param {
|
||||
struct fastrpc_dev_map_dma *map;
|
||||
struct fastrpc_dev_unmap_dma *unmap;
|
||||
struct fastrpc_dev_get_hlos_pid *hpid;
|
||||
};
|
||||
|
||||
long fastrpc_dev_map_dma(struct fastrpc_device *dev, unsigned long invoke_param)
|
||||
@@ -8281,6 +8282,35 @@ bail:
|
||||
return err;
|
||||
}
|
||||
|
||||
long fastrpc_dev_get_hlos_pid(struct fastrpc_device *dev, unsigned long invoke_param)
|
||||
{
|
||||
int err = 0;
|
||||
union fastrpc_dev_param p;
|
||||
struct fastrpc_file *fl = NULL;
|
||||
struct fastrpc_apps *me = &gfa;
|
||||
unsigned long irq_flags = 0;
|
||||
|
||||
p.hpid = (struct fastrpc_dev_get_hlos_pid *)invoke_param;
|
||||
spin_lock_irqsave(&me->hlock, irq_flags);
|
||||
/* Verify if fastrpc device is closed*/
|
||||
VERIFY(err, dev && !dev->dev_close);
|
||||
if (err) {
|
||||
err = -ESRCH;
|
||||
spin_unlock_irqrestore(&me->hlock, irq_flags);
|
||||
return err;
|
||||
}
|
||||
fl = dev->fl;
|
||||
/* Verify if fastrpc file is not NULL*/
|
||||
if (!fl) {
|
||||
err = -EBADF;
|
||||
spin_unlock_irqrestore(&me->hlock, irq_flags);
|
||||
return err;
|
||||
}
|
||||
p.hpid->hlos_pid = fl->tgid;
|
||||
spin_unlock_irqrestore(&me->hlock, irq_flags);
|
||||
return err;
|
||||
}
|
||||
|
||||
long fastrpc_driver_invoke(struct fastrpc_device *dev, unsigned int invoke_num,
|
||||
unsigned long invoke_param)
|
||||
{
|
||||
@@ -8293,6 +8323,9 @@ long fastrpc_driver_invoke(struct fastrpc_device *dev, unsigned int invoke_num,
|
||||
case FASTRPC_DEV_UNMAP_DMA:
|
||||
err = fastrpc_dev_unmap_dma(dev, invoke_param);
|
||||
break;
|
||||
case FASTRPC_DEV_GET_HLOS_PID:
|
||||
err = fastrpc_dev_get_hlos_pid(dev, invoke_param);
|
||||
break;
|
||||
default:
|
||||
err = -ENOTTY;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user