msm: ipa: Change error value for set quota
Currently IPA send common error -EFAULT to user space in case of IOCTL fails. Change error value for set quota based on error received from modem. Change-Id: Ib6ba487a186245ddf752cd08de12293af1ea1bb9 Acked-by: Pooja Kumari <kumarip@qti.qualcomm.com> Signed-off-by: Mohammed Javid <mjavid@codeaurora.org>
This commit is contained in:
parent
1c86ad4bd6
commit
50e6a826d7
4 changed files with 18 additions and 10 deletions
|
@ -2647,7 +2647,7 @@ static int rmnet_ipa_set_data_quota_modem(struct wan_ioctl_set_data_quota *data)
|
||||||
if (index == MAX_NUM_OF_MUX_CHANNEL) {
|
if (index == MAX_NUM_OF_MUX_CHANNEL) {
|
||||||
IPAWANERR("%s is an invalid iface name\n",
|
IPAWANERR("%s is an invalid iface name\n",
|
||||||
data->interface_name);
|
data->interface_name);
|
||||||
return -EFAULT;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
mux_id = mux_channel[index].mux_id;
|
mux_id = mux_channel[index].mux_id;
|
||||||
|
|
|
@ -61,7 +61,7 @@ static dev_t device;
|
||||||
|
|
||||||
static long wan_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
static long wan_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0, rc = 0;
|
||||||
u32 pyld_sz;
|
u32 pyld_sz;
|
||||||
u8 *param = NULL;
|
u8 *param = NULL;
|
||||||
|
|
||||||
|
@ -184,10 +184,14 @@ static long wan_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (rmnet_ipa_set_data_quota(
|
rc = rmnet_ipa_set_data_quota(
|
||||||
(struct wan_ioctl_set_data_quota *)param)) {
|
(struct wan_ioctl_set_data_quota *)param);
|
||||||
|
if (rc != 0) {
|
||||||
IPAWANERR("WAN_IOC_SET_DATA_QUOTA failed\n");
|
IPAWANERR("WAN_IOC_SET_DATA_QUOTA failed\n");
|
||||||
retval = -EFAULT;
|
if (rc == -ENODEV)
|
||||||
|
retval = -ENODEV;
|
||||||
|
else
|
||||||
|
retval = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
|
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
|
||||||
|
|
|
@ -2791,7 +2791,7 @@ static int rmnet_ipa3_set_data_quota_modem(
|
||||||
if (index == MAX_NUM_OF_MUX_CHANNEL) {
|
if (index == MAX_NUM_OF_MUX_CHANNEL) {
|
||||||
IPAWANERR("%s is an invalid iface name\n",
|
IPAWANERR("%s is an invalid iface name\n",
|
||||||
data->interface_name);
|
data->interface_name);
|
||||||
return -EFAULT;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
mux_id = rmnet_ipa3_ctx->mux_channel[index].mux_id;
|
mux_id = rmnet_ipa3_ctx->mux_channel[index].mux_id;
|
||||||
|
|
|
@ -71,7 +71,7 @@ static long ipa3_wan_ioctl(struct file *filp,
|
||||||
unsigned int cmd,
|
unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
int retval = 0, rc = 0;
|
||||||
u32 pyld_sz;
|
u32 pyld_sz;
|
||||||
u8 *param = NULL;
|
u8 *param = NULL;
|
||||||
|
|
||||||
|
@ -247,10 +247,14 @@ static long ipa3_wan_ioctl(struct file *filp,
|
||||||
retval = -EFAULT;
|
retval = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (rmnet_ipa3_set_data_quota(
|
rc = rmnet_ipa3_set_data_quota(
|
||||||
(struct wan_ioctl_set_data_quota *)param)) {
|
(struct wan_ioctl_set_data_quota *)param);
|
||||||
|
if (rc != 0) {
|
||||||
IPAWANERR("WAN_IOC_SET_DATA_QUOTA failed\n");
|
IPAWANERR("WAN_IOC_SET_DATA_QUOTA failed\n");
|
||||||
retval = -EFAULT;
|
if (retval == -ENODEV)
|
||||||
|
retval = -ENODEV;
|
||||||
|
else
|
||||||
|
retval = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
|
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue