Skip to content

Instantly share code, notes, and snippets.

@xenon92
Last active December 31, 2015 14:49
Show Gist options
  • Save xenon92/8002658 to your computer and use it in GitHub Desktop.
Save xenon92/8002658 to your computer and use it in GitHub Desktop.
Fix Broadcom RIL on SlimKat

SlimKat ROM

Patch (android Kitkat)

  • This patch fixes the RIL in the SlimKat source for broadcom device Samsung Galaxy Grand Duos GT-i9082
  • Without this patch, outgoing and incoming calls don't work
  • The path of the patch is mentioned in the file name of the patch
  • Patch can be merged using "git am filename.patch"
From 609ecf77c10a37f4d1f4111eb832eedd58c71e92 Mon Sep 17 00:00:00 2001
From: Shubhang <shubhang92@gmail.com>
Date: Tue, 17 Dec 2013 15:28:29 +0530
Subject: [PATCH] For broadcom RIL to work on SlimKat
Change-Id: I36b5bbf63285f70bc631e0e68e869997cf0400b9
---
libnetutils/ifc_utils.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/libnetutils/ifc_utils.c b/libnetutils/ifc_utils.c
index ad1a0c9..f48e1b0 100644
--- a/libnetutils/ifc_utils.c
+++ b/libnetutils/ifc_utils.c
@@ -962,3 +962,39 @@ int ifc_remove_route(const char *ifname, const char*dst, int prefix_length, cons
{
return ifc_act_on_route(SIOCDELRT, ifname, dst, prefix_length, gw);
}
+
+
+// Added both functions as both are needed for Broadcom RILD
+int ifc_get_mtu(const char *name, int *mtuSz)
+{
+ struct ifreq ifr;
+ ifc_init_ifr(name, &ifr);
+
+ if (mtuSz != NULL) {
+ if(ioctl(ifc_ctl_sock, SIOCGIFMTU, &ifr) < 0) {
+ *mtuSz = 0;
+ return -2;
+ } else {
+ *mtuSz = ifr.ifr_mtu;
+ return 0;
+ }
+ }
+
+ return -1;
+}
+
+// Required for Broadcom RILD
+int ifc_set_mtu(const char *name, int mtuSz)
+{
+ struct ifreq ifr;
+ int ret;
+ ifc_init_ifr(name, &ifr);
+ ifr.ifr_mtu = mtuSz;
+
+ ret = ioctl(ifc_ctl_sock, SIOCSIFMTU, &ifr);
+ if (ret < 0) {
+ printerr("ifc_set_mtu: SIOCSIFMTU failed: %d\n", ret);
+ }
+
+ return ret;
+}
--
1.8.5
@xenon92
Copy link
Author

xenon92 commented Dec 17, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment