GNU/Linux


Install terminator in CentOS 7 (64bit) 2

We installed CentOS 7 (64bit) using this ISO, which we downloaded from http://vault.centos.org/7.1.1503/isos/x86_64/

Once we got the OS started, we executed yum update -y to update all installed packages that were older than the versions in the repositories.
After the update process was complete, we then tried to install terminator using yum.

The Problem

Executing yum install -y terminator resulted in an error:

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.us.leaseweb.net
* extras: mirror.us.leaseweb.net
* updates: mirror.us.leaseweb.net
No package terminator available.
Error: Nothing to do

Solution

To solve the problem we needed to install the Extra Packages for Enterprise Linux (EPEL) repository using yum install -y epel-release.

After the installation was done, we executed yum install -y terminator once more and the installation of terminator succeeded.

Example Logs

Following is the full log from the terminal, showing the correct completion of the installation

[root@localhost bytefreaks]# yum install terminator
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.us.leaseweb.net
 * extras: mirror.us.leaseweb.net
 * updates: mirror.us.leaseweb.net
No package terminator available.
Error: Nothing to do
[root@localhost bytefreaks]# yum install -y epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.us.leaseweb.net
 * extras: mirror.us.leaseweb.net
 * updates: mirror.us.leaseweb.net
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================
 Package                        Arch                     Version                 Repository                Size
================================================================================================================
Installing:
 epel-release                   noarch                   7-6                     extras                    14 k

Transaction Summary
================================================================================================================
Install  1 Package

Total download size: 14 k
Installed size: 24 k
Downloading packages:
epel-release-7-6.noarch.rpm                                                              |  14 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-6.noarch                                                                      1/1 
  Verifying  : epel-release-7-6.noarch                                                                      1/1 

Installed:
  epel-release.noarch 0:7-6                                                                                     

Complete!
[root@localhost bytefreaks]# yum install terminator -y
Loaded plugins: fastestmirror, langpacks
epel/x86_64/metalink                                                                     |  23 kB  00:00:00     
epel                                                                                     | 4.3 kB  00:00:00     
(1/3): epel/x86_64/group_gz                                                              | 170 kB  00:00:01     
epel/x86_64/primary_db         FAILED                                          
https://ftp.fau.de/epel/7/x86_64/repodata/e11482622ec75721199897552409e0b0b1d6fd798be905c88014f539d027efec-primary.sqlite.xz: [Errno 14] HTTPS Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below knowledge base article 

https://access.redhat.com/articles/1320623

If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/

(2/3): epel/x86_64/primary_db                                                            | 4.3 MB  00:00:12     
(3/3): epel/x86_64/updateinfo                                                            | 674 kB  00:00:18     
Loading mirror speeds from cached hostfile
 * base: mirror.us.leaseweb.net
 * epel: mirror.de.leaseweb.net
 * extras: mirror.us.leaseweb.net
 * updates: mirror.us.leaseweb.net
Resolving Dependencies
--> Running transaction check
---> Package terminator.noarch 0:0.98-3.el7 will be installed
--> Processing Dependency: vte for package: terminator-0.98-3.el7.noarch
--> Processing Dependency: python-psutil for package: terminator-0.98-3.el7.noarch
--> Processing Dependency: python-keybinder for package: terminator-0.98-3.el7.noarch
--> Processing Dependency: gnome-python2-gconf for package: terminator-0.98-3.el7.noarch
--> Processing Dependency: gnome-python2-bonobo for package: terminator-0.98-3.el7.noarch
--> Running transaction check
---> Package gnome-python2-bonobo.x86_64 0:2.28.1-14.el7 will be installed
--> Processing Dependency: gnome-python2-canvas(x86-64) = 2.28.1-14.el7 for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: gnome-python2(x86-64) = 2.28.1-14.el7 for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: pyorbit(x86-64) >= 2.0.1 for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libbonoboui(x86-64) >= 2.8.0 for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libbonobo(x86-64) >= 2.8.0 for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libgnomecanvas-2.so.0()(64bit) for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libgnome-2.so.0()(64bit) for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libbonoboui-2.so.0()(64bit) for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libbonobo-activation.so.4()(64bit) for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libbonobo-2.so.0()(64bit) for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libart_lgpl_2.so.2()(64bit) for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
--> Processing Dependency: libORBit-2.so.0()(64bit) for package: gnome-python2-bonobo-2.28.1-14.el7.x86_64
---> Package gnome-python2-gconf.x86_64 0:2.28.1-14.el7 will be installed
---> Package python-keybinder.x86_64 0:0.3.1-1.el7 will be installed
--> Processing Dependency: keybinder = 0.3.1-1.el7 for package: python-keybinder-0.3.1-1.el7.x86_64
--> Processing Dependency: libkeybinder.so.0()(64bit) for package: python-keybinder-0.3.1-1.el7.x86_64
---> Package python-psutil.x86_64 0:2.2.1-1.el7 will be installed
---> Package vte.x86_64 0:0.28.2-10.el7 will be installed
--> Running transaction check
---> Package ORBit2.x86_64 0:2.14.19-13.el7 will be installed
--> Processing Dependency: libIDL-2.so.0()(64bit) for package: ORBit2-2.14.19-13.el7.x86_64
---> Package gnome-python2.x86_64 0:2.28.1-14.el7 will be installed
---> Package gnome-python2-canvas.x86_64 0:2.28.1-14.el7 will be installed
---> Package keybinder.x86_64 0:0.3.1-1.el7 will be installed
---> Package libart_lgpl.x86_64 0:2.3.21-10.el7 will be installed
---> Package libbonobo.x86_64 0:2.32.1-7.el7 will be installed
---> Package libbonoboui.x86_64 0:2.24.5-7.el7 will be installed
---> Package libgnome.x86_64 0:2.32.1-9.el7 will be installed
--> Processing Dependency: libgnomevfs-2.so.0()(64bit) for package: libgnome-2.32.1-9.el7.x86_64
---> Package libgnomecanvas.x86_64 0:2.30.3-8.el7 will be installed
---> Package pyorbit.x86_64 0:2.24.0-15.el7 will be installed
--> Running transaction check
---> Package gnome-vfs2.x86_64 0:2.24.4-14.el7 will be installed
--> Processing Dependency: libfam.so.0()(64bit) for package: gnome-vfs2-2.24.4-14.el7.x86_64
---> Package libIDL.x86_64 0:0.8.14-8.el7 will be installed
--> Running transaction check
---> Package gamin.x86_64 0:0.1.10-16.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================
 Package                            Arch                 Version                       Repository          Size
================================================================================================================
Installing:
 terminator                         noarch               0.98-3.el7                    epel               3.4 M
Installing for dependencies:
 ORBit2                             x86_64               2.14.19-13.el7                base               176 k
 gamin                              x86_64               0.1.10-16.el7                 base               128 k
 gnome-python2                      x86_64               2.28.1-14.el7                 base                47 k
 gnome-python2-bonobo               x86_64               2.28.1-14.el7                 base                87 k
 gnome-python2-canvas               x86_64               2.28.1-14.el7                 base                34 k
 gnome-python2-gconf                x86_64               2.28.1-14.el7                 base                46 k
 gnome-vfs2                         x86_64               2.24.4-14.el7                 base               839 k
 keybinder                          x86_64               0.3.1-1.el7                   epel                15 k
 libIDL                             x86_64               0.8.14-8.el7                  base                87 k
 libart_lgpl                        x86_64               2.3.21-10.el7                 base                67 k
 libbonobo                          x86_64               2.32.1-7.el7                  base               437 k
 libbonoboui                        x86_64               2.24.5-7.el7                  base               342 k
 libgnome                           x86_64               2.32.1-9.el7                  base               741 k
 libgnomecanvas                     x86_64               2.30.3-8.el7                  base               226 k
 pyorbit                            x86_64               2.24.0-15.el7                 base                51 k
 python-keybinder                   x86_64               0.3.1-1.el7                   epel                19 k
 python-psutil                      x86_64               2.2.1-1.el7                   epel               114 k
 vte                                x86_64               0.28.2-10.el7                 epel               361 k

Transaction Summary
================================================================================================================
Install  1 Package (+18 Dependent packages)

Total download size: 7.1 M
Installed size: 27 M
Downloading packages:
(1/19): gnome-python2-2.28.1-14.el7.x86_64.rpm                                           |  47 kB  00:00:02     
(2/19): gnome-python2-canvas-2.28.1-14.el7.x86_64.rpm                                    |  34 kB  00:00:02     
(3/19): ORBit2-2.14.19-13.el7.x86_64.rpm                                                 | 176 kB  00:00:02     
(4/19): gnome-python2-gconf-2.28.1-14.el7.x86_64.rpm                                     |  46 kB  00:00:01     
(5/19): libIDL-0.8.14-8.el7.x86_64.rpm                                                   |  87 kB  00:00:00     
warning: /var/cache/yum/x86_64/7/epel/packages/keybinder-0.3.1-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for keybinder-0.3.1-1.el7.x86_64.rpm is not installed
(6/19): keybinder-0.3.1-1.el7.x86_64.rpm                                                 |  15 kB  00:00:02     
(7/19): libart_lgpl-2.3.21-10.el7.x86_64.rpm                                             |  67 kB  00:00:01     
(8/19): gnome-vfs2-2.24.4-14.el7.x86_64.rpm                                              | 839 kB  00:00:03     
(9/19): gamin-0.1.10-16.el7.x86_64.rpm                                                   | 128 kB  00:00:07     
(10/19): libgnome-2.32.1-9.el7.x86_64.rpm                                                | 741 kB  00:00:01     
(11/19): libbonoboui-2.24.5-7.el7.x86_64.rpm                                             | 342 kB  00:00:02     
(12/19): pyorbit-2.24.0-15.el7.x86_64.rpm                                                |  51 kB  00:00:00     
(13/19): libbonobo-2.32.1-7.el7.x86_64.rpm                                               | 437 kB  00:00:02     
(14/19): python-keybinder-0.3.1-1.el7.x86_64.rpm                                         |  19 kB  00:00:00     
(15/19): gnome-python2-bonobo-2.28.1-14.el7.x86_64.rpm                                   |  87 kB  00:00:08     
(16/19): python-psutil-2.2.1-1.el7.x86_64.rpm                                            | 114 kB  00:00:00     
(17/19): vte-0.28.2-10.el7.x86_64.rpm                                                    | 361 kB  00:00:01     
(18/19): libgnomecanvas-2.30.3-8.el7.x86_64.rpm                                          | 226 kB  00:00:03     
(19/19): terminator-0.98-3.el7.noarch.rpm                                                | 3.4 MB  00:00:05     
----------------------------------------------------------------------------------------------------------------
Total                                                                           524 kB/s | 7.1 MB  00:00:13     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
 Userid     : "Fedora EPEL (7) <[email protected]>"
 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
 Package    : epel-release-7-6.noarch (@extras)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libart_lgpl-2.3.21-10.el7.x86_64                                                            1/19 
  Installing : libgnomecanvas-2.30.3-8.el7.x86_64                                                          2/19 
  Installing : gnome-python2-2.28.1-14.el7.x86_64                                                          3/19 
  Installing : libIDL-0.8.14-8.el7.x86_64                                                                  4/19 
  Installing : ORBit2-2.14.19-13.el7.x86_64                                                                5/19 
  Installing : libbonobo-2.32.1-7.el7.x86_64                                                               6/19 
  Installing : pyorbit-2.24.0-15.el7.x86_64                                                                7/19 
  Installing : gnome-python2-gconf-2.28.1-14.el7.x86_64                                                    8/19 
  Installing : gnome-python2-canvas-2.28.1-14.el7.x86_64                                                   9/19 
  Installing : vte-0.28.2-10.el7.x86_64                                                                   10/19 
  Installing : keybinder-0.3.1-1.el7.x86_64                                                               11/19 
  Installing : python-keybinder-0.3.1-1.el7.x86_64                                                        12/19 
  Installing : python-psutil-2.2.1-1.el7.x86_64                                                           13/19 
  Installing : gamin-0.1.10-16.el7.x86_64                                                                 14/19 
  Installing : gnome-vfs2-2.24.4-14.el7.x86_64                                                            15/19 
  Installing : libgnome-2.32.1-9.el7.x86_64                                                               16/19 
  Installing : libbonoboui-2.24.5-7.el7.x86_64                                                            17/19 
  Installing : gnome-python2-bonobo-2.28.1-14.el7.x86_64                                                  18/19 
  Installing : terminator-0.98-3.el7.noarch                                                               19/19 
  Verifying  : libbonobo-2.32.1-7.el7.x86_64                                                               1/19 
  Verifying  : libgnome-2.32.1-9.el7.x86_64                                                                2/19 
  Verifying  : libgnomecanvas-2.30.3-8.el7.x86_64                                                          3/19 
  Verifying  : gamin-0.1.10-16.el7.x86_64                                                                  4/19 
  Verifying  : libIDL-0.8.14-8.el7.x86_64                                                                  5/19 
  Verifying  : gnome-python2-gconf-2.28.1-14.el7.x86_64                                                    6/19 
  Verifying  : gnome-python2-canvas-2.28.1-14.el7.x86_64                                                   7/19 
  Verifying  : python-psutil-2.2.1-1.el7.x86_64                                                            8/19 
  Verifying  : keybinder-0.3.1-1.el7.x86_64                                                                9/19 
  Verifying  : terminator-0.98-3.el7.noarch                                                               10/19 
  Verifying  : python-keybinder-0.3.1-1.el7.x86_64                                                        11/19 
  Verifying  : libbonoboui-2.24.5-7.el7.x86_64                                                            12/19 
  Verifying  : vte-0.28.2-10.el7.x86_64                                                                   13/19 
  Verifying  : gnome-vfs2-2.24.4-14.el7.x86_64                                                            14/19 
  Verifying  : ORBit2-2.14.19-13.el7.x86_64                                                               15/19 
  Verifying  : pyorbit-2.24.0-15.el7.x86_64                                                               16/19 
  Verifying  : gnome-python2-2.28.1-14.el7.x86_64                                                         17/19 
  Verifying  : gnome-python2-bonobo-2.28.1-14.el7.x86_64                                                  18/19 
  Verifying  : libart_lgpl-2.3.21-10.el7.x86_64                                                           19/19 

Installed:
  terminator.noarch 0:0.98-3.el7                                                                                

Dependency Installed:
  ORBit2.x86_64 0:2.14.19-13.el7                         gamin.x86_64 0:0.1.10-16.el7                          
  gnome-python2.x86_64 0:2.28.1-14.el7                   gnome-python2-bonobo.x86_64 0:2.28.1-14.el7           
  gnome-python2-canvas.x86_64 0:2.28.1-14.el7            gnome-python2-gconf.x86_64 0:2.28.1-14.el7            
  gnome-vfs2.x86_64 0:2.24.4-14.el7                      keybinder.x86_64 0:0.3.1-1.el7                        
  libIDL.x86_64 0:0.8.14-8.el7                           libart_lgpl.x86_64 0:2.3.21-10.el7                    
  libbonobo.x86_64 0:2.32.1-7.el7                        libbonoboui.x86_64 0:2.24.5-7.el7                     
  libgnome.x86_64 0:2.32.1-9.el7                         libgnomecanvas.x86_64 0:2.30.3-8.el7                  
  pyorbit.x86_64 0:2.24.0-15.el7                         python-keybinder.x86_64 0:0.3.1-1.el7                 
  python-psutil.x86_64 0:2.2.1-1.el7                     vte.x86_64 0:0.28.2-10.el7                            

Complete!


Building SnoopSnitch on Ubuntu 16.10 64bit

Step A: Update the system and install all necessary packages

sudo dpkg --add-architecture i386;
sudo apt-get update;
sudo apt-get upgrade -y;
sudo apt-get install git openjdk-8-jdk dh-autoreconf ant libncurses5:i386 libstdc++6:i386 zlib1g:i386 -y;
cd ~/;
mkdir Android;
cd Android;

Step B: Download the Android SDK and install all required packages

The following download link we got it from this page https://developer.android.com/studio/

wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz;
tar -xf android-sdk_r24.4.1-linux.tgz;
cd android-sdk-linux/tools;
#To list all available packages, including the obsolete extra-android-support
#./android list sdk --all –extended;
./android update sdk --no-ui --all --filter extra-android-support,tools,platform-tools,build-tools-19.1.0,android-19;

You will get a prompt for a license agreement, you need to type Y to proceed

November 20, 2015
Do you accept the license 'android-sdk-license-c81a61d9' [y/n]: y
cd ../..;
export ANDROID_HOME=`pwd`/android-sdk-linux;

Step C: Once the installation is complete, we need to install the Android NDK.

The following link we got it from https://developer.android.com/ndk/downloads/

wget https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip;
unzip -q android-ndk-r13b-linux-x86_64.zip;
export NDK_DIR=`pwd`/android-ndk-r13b;
#If we do not update the PATH we will get the following error: ../libtool: line 1719: arm-linux-androideabi-ranlib: command not found
PATH=$PATH:`pwd`/android-ndk-r13b/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin;
mkdir Projects;
cd Projects;

Step D: Afterwards, we can download SnoopSnitch and all of the git submodules of it using the following command.

git clone --recursive https://opensource.srlabs.de/git/snoopsnitch.git;

Step E: Then we need to compile two separate parts of the project.

We will start by compiling contrib/ projects, that are the supplementary projects needed for SnoopSnitch to get data.

cd snoopsnitch/contrib/;
./compile.sh -t android -u;
cd ..;

Step F: Finally, we can proceed to compile the android project of SnoopSnitch.

cd ./SnoopSnitch;

We need to update Application.mk and add APP_ABI := armeabi to it.
We do this to make sure that we compile  diag-helper.c only for armeabi as the rest of the packages will be available only on that architecture.
If we do not do this and we have a processor that supports armeabi-v7a (or different), then it will only install diag-helper.so and it will ignore the rest. Which will of course cause the application to fail.

echo "APP_ABI := armeabi" >> jni/Application.mk;
ant debug;
~/Android/android-sdk-linux/platform-tools/adb start-server

Once the compilation is complete, we can upload our apk to a device using the following commands:

#First we make sure that the adb server is running
$ANDROID_HOME/platform-tools/adb start-server;
#Then we check that our device is visible to the adb
$ANDROID_HOME/platform-tools/adb devices;
#Finally, we install the application to the device.
$ANDROID_HOME/platform-tools/adb install bin/SnoopSnitch-debug.apk;

This guide was tested on freshly installed Ubuntu 16.10 64bit.

snoopsnitch-map

Useful links


Compiling GobiNet on Ubuntu 16.10 64bit 5

Recently, we tried to compile the GobiNet drivers for Linux on an Ubuntu 16.10 64bit machine.

The version of GobiNet was GobiNet_2016-10-20.tar.gz ([download id=”2179″]).

To our surprise, we got a errors while compiling.

Solution:

Get the full project after it was patched from here: [download id=”2188″]

or

Download the following patched version of QMIDevice.c and replace it on your machine [download id=”2183″].

Download the following patched version of GobiUSBNet.c and replace it on your machine [download id=”3349″].

Errors:

First error: ‘struct net_device’ has no member named ‘trans_start’ (GobiUSBNet.c:876:8)

We removed the call to pNet->trans_start = jiffies; and replaced it with netif_trans_update(pNet); which as we can see below, it does the same thing in the end.

/* legacy drivers only, netdev_start_xmit() sets txq->trans_start */
static inline void netif_trans_update(struct net_device *dev)
{
    struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
    if (txq->trans_start != jiffies)
        txq->trans_start = jiffies;
}
GobiUSBNet.c:876 
@@ -873,7 +873,7 @@ int GobiUSBNetStartXmit( 
    complete( &pAutoPM->mThreadDoWork ); 
  
    // Start transfer timer 
-   pNet->trans_start = jiffies; 
+   netif_trans_update(pNet); 
    // Free SKB 
    dev_kfree_skb_any( pSKB );

Second error: return from incompatible pointer type [-Werror=incompatible-pointer-types] (GobiUSBNet.c:1692:13)

We got the following error:

/home/george/Downloads/gobiusbnet/GobiUSBNet.c: In function ‘__exittest’: 
/home/george/Downloads/gobiusbnet/GobiUSBNet.c:1692:13: error: return from incompatible pointer type [-Werror=incompatible-pointer-types] 
 module_exit(GobiUSBNetModExit); 
             ^ 
./include/linux/module.h:137:11: note: in definition of macro ‘module_exit’ 
  { return exitfn; }

module_exit is defined as follows:

typedef void (*exitcall_t)(void);
#define module_exit(exitfn)                                     \
         static inline exitcall_t __exittest(void)               \
         { return exitfn; }                                      \
         void cleanup_module(void) __attribute__((alias(#exitfn)));

So we see that we need to update static int GobiUSBNetModExit(void) to become static void GobiUSBNetModExit(void) and have it return nothing.

GobiUSBNet.c:1669 
@@ -1666,11 +1666,11 @@ RETURN VALUE: 
    void 
 ===========================================================================*/ 
 // static int GobiUSBNetModExit(struct platform_device *pdev) 
-static int GobiUSBNetModExit(void) 
+static void GobiUSBNetModExit(void) 
 { 
    usb_deregister( &GobiNet ); 
    class_destroy( gpClass ); 
-   return 0; 
+   return; 
 }

Third error: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] (QMIDevice.c:2393:21)

On this 64bit architecture the f_count of the struct file  is defined as long (64bit) so we should not use atomic_read but atomic_long_read instead.

@@ -2390,7 +2390,7 @@ int UserspaceClose(
    }
 
    // Fallthough.  If f_count == 1 no need to do more checks
-   if (atomic_read( &pFilp->f_count ) != 1)
+   if (atomic_long_read( &pFilp->f_count ) != 1)^M
    {
       rcu_read_lock();
       for_each_process( pEachTask )

Fourth error: ‘struct file’ has no member named ‘f_dentry’ (in 9 placed of QMIDevice.c)

The error was error: struct file has no member named f_dentry
Apparently, there was a change in the struct that contained f_dentry in the kernel 3.19 source code which created this bug.

@@ -2269,7 +2269,7 @@ int UserspaceIOCTL(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
 
@@ -2427,7 +2427,7 @@ int UserspaceClose(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
    
@@ -2486,7 +2486,7 @@ ssize_t UserspaceRead(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
    
@@ -2567,7 +2567,7 @@ ssize_t UserspaceWrite(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
 
@@ -2646,7 +2646,7 @@ unsigned int UserspacePoll(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return POLLERR;
    }
 
@@ -3003,9 +3003,9 @@ void DeregisterQMIDevice( sGobiUSBNet * pDev )
             for (count = 0; count < pFDT->max_fds; count++)
             {
                pFilp = pFDT->fd[count];
-               if (pFilp != NULL &&  pFilp->f_dentry != NULL)
+               if (pFilp != NULL &&  pFilp->f_path.dentry != NULL)^M
                {
-                  if (pFilp->f_dentry->d_inode == pOpenInode)
+                  if (pFilp->f_path.dentry->d_inode == pOpenInode)^M
                   {
                      // Close this file handle
                      rcu_assign_pointer( pFDT->fd[count], NULL );                     
@@ -3050,9 +3050,9 @@ void DeregisterQMIDevice( sGobiUSBNet * pDev )
                for (count = 0; count < pFDT->max_fds; count++)
                {
                   pFilp = pFDT->fd[count];
-                  if (pFilp != NULL &&  pFilp->f_dentry != NULL)
+                  if (pFilp != NULL &&  pFilp->f_path.dentry != NULL)^M
                   {
-                     if (pFilp->f_dentry->d_inode == pOpenInode)
+                     if (pFilp->f_path.dentry->d_inode == pOpenInode)^M
                      {
                         // Close this file handle
                         rcu_assign_pointer( pFDT->fd[count], NULL );

 

Following is the original output of the make commands before and while we were patching the source files.

george@ubuntu-1610:~/Downloads$ lsb_release -a 
No LSB modules are available. 
Distributor ID:    Ubuntu 
Description:    Ubuntu 16.10 
Release:    16.10 
Codename:    yakkety 
george@ubuntu-1610:~/Downloads$ wget https://portland.source.codeaurora.org/patches/quic/gobi/Gobi_Linux/GobiNet_2016-10-20.tar.gz 
--2017-04-24 09:42:08--  https://portland.source.codeaurora.org/patches/quic/gobi/Gobi_Linux/GobiNet_2016-10-20.tar.gz 
Resolving portland.source.codeaurora.org (portland.source.codeaurora.org)... 198.145.29.80 
Connecting to portland.source.codeaurora.org (portland.source.codeaurora.org)|198.145.29.80|:443... connected. 
HTTP request sent, awaiting response... 200 OK 
Length: 43818 (43K) [application/x-gzip] 
Saving to: ‘GobiNet_2016-10-20.tar.gz’ 
 
GobiNet_2016-10-20.tar.gz    100%[=============================================>]  42,79K   217KB/s    in 0,2s     
 
2017-04-24 09:42:09 (217 KB/s) - ‘GobiNet_2016-10-20.tar.gz’ saved [43818/43818] 
 
george@ubuntu-1610:~/Downloads$ tar -xzf GobiNet_2016-10-20.tar.gz  
george@ubuntu-1610:~/Downloads$ cd gobiusbnet/ 
george@ubuntu-1610:~/Downloads/gobiusbnet$ make 
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order 
make -C /lib/modules/4.8.0-27-generic/build M=/home/george/Downloads/gobiusbnet modules 
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-27-generic' 
  CC [M]  /home/george/Downloads/gobiusbnet/qmap.o 
  CC [M]  /home/george/Downloads/gobiusbnet/GobiUSBNet.o 
/home/george/Downloads/gobiusbnet/GobiUSBNet.c: In function ‘GobiUSBNetStartXmit’: 
/home/george/Downloads/gobiusbnet/GobiUSBNet.c:876:8: error: ‘struct net_device’ has no member named ‘trans_start’; did you mean ‘mem_start’? 
    pNet->trans_start = jiffies; 
        ^~ 
In file included from ./include/linux/phy.h:24:0, 
                 from ./include/net/dsa.h:19, 
                 from ./include/linux/netdevice.h:44, 
                 from ./include/linux/etherdevice.h:26, 
                 from /home/george/Downloads/gobiusbnet/Structs.h:47, 
                 from /home/george/Downloads/gobiusbnet/GobiUSBNet.c:57: 
/home/george/Downloads/gobiusbnet/GobiUSBNet.c: In function ‘__exittest’: 
/home/george/Downloads/gobiusbnet/GobiUSBNet.c:1692:13: error: return from incompatible pointer type [-Werror=incompatible-pointer-types] 
 module_exit(GobiUSBNetModExit); 
             ^ 
./include/linux/module.h:137:11: note: in definition of macro ‘module_exit’ 
  { return exitfn; }     \ 
           ^~~~~~ 
cc1: some warnings being treated as errors 
scripts/Makefile.build:289: recipe for target '/home/george/Downloads/gobiusbnet/GobiUSBNet.o' failed 
make[2]: *** [/home/george/Downloads/gobiusbnet/GobiUSBNet.o] Error 1 
Makefile:1489: recipe for target '_module_/home/george/Downloads/gobiusbnet' failed 
make[1]: *** [_module_/home/george/Downloads/gobiusbnet] Error 2 
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-27-generic' 
Makefile:8: recipe for target 'all' failed 
make: *** [all] Error 2 
george@ubuntu-1610:~/Downloads/gobiusbnet$  
 
 
GobiUSBNet.c:1669 
@@ -1666,11 +1666,11 @@ RETURN VALUE: 
    void 
 ===========================================================================*/ 
 // static int GobiUSBNetModExit(struct platform_device *pdev) 
-static int GobiUSBNetModExit(void) 
+static void GobiUSBNetModExit(void) 
 { 
    usb_deregister( &GobiNet ); 
    class_destroy( gpClass ); 
-   return 0; 
+   return; 
 } 
 
george@ubuntu-1610:~/Downloads/gobiusbnet$ make all 
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order 
make -C /lib/modules/4.8.0-27-generic/build M=/home/george/Downloads/gobiusbnet modules 
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-27-generic' 
  CC [M]  /home/george/Downloads/gobiusbnet/qmap.o 
  CC [M]  /home/george/Downloads/gobiusbnet/GobiUSBNet.o 
/home/george/Downloads/gobiusbnet/GobiUSBNet.c: In function ‘GobiUSBNetStartXmit’: 
/home/george/Downloads/gobiusbnet/GobiUSBNet.c:876:8: error: ‘struct net_device’ has no member named ‘trans_start’; did you mean ‘mem_start’? 
    pNet->trans_start = jiffies; 
        ^~ 
scripts/Makefile.build:289: recipe for target '/home/george/Downloads/gobiusbnet/GobiUSBNet.o' failed 
make[2]: *** [/home/george/Downloads/gobiusbnet/GobiUSBNet.o] Error 1 
Makefile:1489: recipe for target '_module_/home/george/Downloads/gobiusbnet' failed 
make[1]: *** [_module_/home/george/Downloads/gobiusbnet] Error 2 
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-27-generic' 
Makefile:8: recipe for target 'all' failed 
make: *** [all] Error 2 
george@ubuntu-1610:~/Downloads/gobiusbnet$  
 
  
GobiUSBNet.c:876 
@@ -873,7 +873,7 @@ int GobiUSBNetStartXmit( 
    complete( &pAutoPM->mThreadDoWork ); 
  
    // Start transfer timer 
-   pNet->trans_start = jiffies; 
+   netif_trans_update(pNet); 
    // Free SKB 
    dev_kfree_skb_any( pSKB ); 
 
george@ubuntu-1610:~/Downloads/gobiusbnet$ make all 
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order 
make -C /lib/modules/4.8.0-27-generic/build M=/home/george/Downloads/gobiusbnet modules 
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-27-generic' 
  CC [M]  /home/george/Downloads/gobiusbnet/qmap.o 
  CC [M]  /home/george/Downloads/gobiusbnet/GobiUSBNet.o 
  CC [M]  /home/george/Downloads/gobiusbnet/QMIDevice.o 
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceIOCTL’: 
/home/george/Downloads/gobiusbnet/QMIDevice.c:2272:26: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop; 
                          ^~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceClose’: 
/home/george/Downloads/gobiusbnet/QMIDevice.c:2393:21: error: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] 
    if (atomic_read( &pFilp->f_count ) != 1) 
                     ^ 
In file included from ./arch/x86/include/asm/msr.h:66:0, 
                 from ./arch/x86/include/asm/processor.h:20, 
                 from ./arch/x86/include/asm/cpufeature.h:4, 
                 from ./arch/x86/include/asm/thread_info.h:52, 
                 from ./include/linux/thread_info.h:54, 
                 from ./arch/x86/include/asm/preempt.h:6, 
                 from ./include/linux/preempt.h:59, 
                 from ./include/linux/spinlock.h:50, 
                 from ./include/linux/mm_types.h:8, 
                 from ./include/linux/kmemcheck.h:4, 
                 from ./include/linux/skbuff.h:18, 
                 from ./include/linux/if_ether.h:23, 
                 from ./include/linux/etherdevice.h:25, 
                 from /home/george/Downloads/gobiusbnet/Structs.h:47, 
                 from /home/george/Downloads/gobiusbnet/QMIDevice.h:95, 
                 from /home/george/Downloads/gobiusbnet/QMIDevice.c:91: 
./arch/x86/include/asm/atomic.h:24:28: note: expected ‘const atomic_t * {aka const struct <anonymous> *}’ but argument is of type ‘atomic_long_t * {aka struct <anonymous> *}’ 
 static __always_inline int atomic_read(const atomic_t *v) 
                            ^~~~~~~~~~~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c:2430:26: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop; 
                          ^~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceRead’: 
/home/george/Downloads/gobiusbnet/QMIDevice.c:2489:26: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop; 
                          ^~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceWrite’: 
/home/george/Downloads/gobiusbnet/QMIDevice.c:2570:26: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop; 
                          ^~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspacePoll’: 
/home/george/Downloads/gobiusbnet/QMIDevice.c:2649:26: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop; 
                          ^~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘DeregisterQMIDevice’: 
/home/george/Downloads/gobiusbnet/QMIDevice.c:3006:43: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
                if (pFilp != NULL &&  pFilp->f_dentry != NULL) 
                                           ^~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c:3008:28: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
                   if (pFilp->f_dentry->d_inode == pOpenInode) 
                            ^~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c:3053:46: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
                   if (pFilp != NULL &&  pFilp->f_dentry != NULL) 
                                              ^~ 
/home/george/Downloads/gobiusbnet/QMIDevice.c:3055:31: error: ‘struct file’ has no member named ‘f_dentry’; did you mean ‘f_owner’? 
                      if (pFilp->f_dentry->d_inode == pOpenInode) 
                               ^~ 
cc1: some warnings being treated as errors 
scripts/Makefile.build:289: recipe for target '/home/george/Downloads/gobiusbnet/QMIDevice.o' failed 
make[2]: *** [/home/george/Downloads/gobiusbnet/QMIDevice.o] Error 1 
Makefile:1489: recipe for target '_module_/home/george/Downloads/gobiusbnet' failed 
make[1]: *** [_module_/home/george/Downloads/gobiusbnet] Error 2 
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-27-generic' 
Makefile:8: recipe for target 'all' failed 
make: *** [all] Error 2 
 
     
    -               if (pFilp != NULL &&  pFilp->f_dentry != NULL) 
+               if (pFilp != NULL &&  pFilp->f_path.dentry != NULL)^M 
george@ubuntu-1610:~/Downloads/gobiusbnet$ make all 
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order 
make -C /lib/modules/4.8.0-27-generic/build M=/home/george/Downloads/gobiusbnet modules 
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-27-generic' 
  CC [M]  /home/george/Downloads/gobiusbnet/qmap.o 
  CC [M]  /home/george/Downloads/gobiusbnet/GobiUSBNet.o 
  CC [M]  /home/george/Downloads/gobiusbnet/QMIDevice.o 
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceClose’: 
/home/george/Downloads/gobiusbnet/QMIDevice.c:2393:21: error: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Werror=incompatible-pointer-types] 
    if (atomic_read( &pFilp->f_count ) != 1) 
                     ^ 
In file included from ./arch/x86/include/asm/msr.h:66:0, 
                 from ./arch/x86/include/asm/processor.h:20, 
                 from ./arch/x86/include/asm/cpufeature.h:4, 
                 from ./arch/x86/include/asm/thread_info.h:52, 
                 from ./include/linux/thread_info.h:54, 
                 from ./arch/x86/include/asm/preempt.h:6, 
                 from ./include/linux/preempt.h:59, 
                 from ./include/linux/spinlock.h:50, 
                 from ./include/linux/mm_types.h:8, 
                 from ./include/linux/kmemcheck.h:4, 
                 from ./include/linux/skbuff.h:18, 
                 from ./include/linux/if_ether.h:23, 
                 from ./include/linux/etherdevice.h:25, 
                 from /home/george/Downloads/gobiusbnet/Structs.h:47, 
                 from /home/george/Downloads/gobiusbnet/QMIDevice.h:95, 
                 from /home/george/Downloads/gobiusbnet/QMIDevice.c:91: 
./arch/x86/include/asm/atomic.h:24:28: note: expected ‘const atomic_t * {aka const struct <anonymous> *}’ but argument is of type ‘atomic_long_t * {aka struct <anonymous> *}’ 
 static __always_inline int atomic_read(const atomic_t *v) 
                            ^~~~~~~~~~~ 
cc1: some warnings being treated as errors 
scripts/Makefile.build:289: recipe for target '/home/george/Downloads/gobiusbnet/QMIDevice.o' failed 
make[2]: *** [/home/george/Downloads/gobiusbnet/QMIDevice.o] Error 1 
Makefile:1489: recipe for target '_module_/home/george/Downloads/gobiusbnet' failed 
make[1]: *** [_module_/home/george/Downloads/gobiusbnet] Error 2 
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-27-generic' 
Makefile:8: recipe for target 'all' failed 
make: *** [all] Error 2 
 
@@ -2390,7 +2390,7 @@ int UserspaceClose( 
    } 
  
    // Fallthough.  If f_count == 1 no need to do more checks 
-   if (atomic_read( &pFilp->f_count ) != 1) 
+   if (atomic_long_read( &pFilp->f_count ) != 1)^M 
    { 
       rcu_read_lock(); 
       for_each_process( pEachTask ) 
george@ubuntu-1610:~/Downloads/gobiusbnet$ make all 
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order 
make -C /lib/modules/4.8.0-27-generic/build M=/home/george/Downloads/gobiusbnet modules 
make[1]: Entering directory '/usr/src/linux-headers-4.8.0-27-generic' 
  CC [M]  /home/george/Downloads/gobiusbnet/qmap.o 
  CC [M]  /home/george/Downloads/gobiusbnet/GobiUSBNet.o 
  CC [M]  /home/george/Downloads/gobiusbnet/QMIDevice.o 
  CC [M]  /home/george/Downloads/gobiusbnet/QMI.o 
  LD [M]  /home/george/Downloads/gobiusbnet/GobiNet.o 
  Building modules, stage 2. 
  MODPOST 1 modules 
  CC      /home/george/Downloads/gobiusbnet/GobiNet.mod.o 
  LD [M]  /home/george/Downloads/gobiusbnet/GobiNet.ko 
make[1]: Leaving directory '/usr/src/linux-headers-4.8.0-27-generic'

Compiling GobiNet on Ubuntu 16.04 64bit

Recently, we tried to compile the GobiNet drivers for Linux on an Ubuntu 16.04 64bit machine.

The version of GobiNet was GobiNet_2016-10-20.tar.gz ([download id=”2179″]).

To our surprise, we got a errors while compiling.

Solution:

Get the full project after it was patched from here: [download id=”3342″]

or

Download the following patched version of QMIDevice.c and replace it on your machine [download id=”2183″].

Download the following patched version of GobiUSBNet.c and replace it on your machine [download id=”3352″].

Errors/Warnings:

First warning: return from incompatible pointer type [-Wincompatible-pointer-types] (GobiUSBNet.c:1692:13)

We got the following warning:

 module_exit(GobiUSBNetModExit);
             ^
include/linux/module.h:135:11: note: in definition of macro ‘module_exit’
  { return exitfn; }     \

module_exit is defined as follows:

typedef void (*exitcall_t)(void);
#define module_exit(exitfn)                                     \
         static inline exitcall_t __exittest(void)               \
         { return exitfn; }                                      \
         void cleanup_module(void) __attribute__((alias(#exitfn)));

So we see that we need to update static int GobiUSBNetModExit(void) to become static void GobiUSBNetModExit(void) and have it return nothing.

GobiUSBNet.c:1669 
@@ -1666,11 +1666,11 @@ RETURN VALUE: 
    void 
 ===========================================================================*/ 
 // static int GobiUSBNetModExit(struct platform_device *pdev) 
-static int GobiUSBNetModExit(void) 
+static void GobiUSBNetModExit(void) 
 { 
    usb_deregister( &GobiNet ); 
    class_destroy( gpClass ); 
-   return 0; 
+   return; 
 }

Second warning: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Wincompatible-pointer-types] (QMIDevice.c:2393:21)

On this 64bit architecture the f_count of the struct file  is defined as long (64bit) so we should not use atomic_read but atomic_long_read instead.

@@ -2390,7 +2390,7 @@ int UserspaceClose(
    }
 
    // Fallthough.  If f_count == 1 no need to do more checks
-   if (atomic_read( &pFilp->f_count ) != 1)
+   if (atomic_long_read( &pFilp->f_count ) != 1)^M
    {
       rcu_read_lock();
       for_each_process( pEachTask )

First error: ‘struct file’ has no member named ‘f_dentry’ (in 9 placed of QMIDevice.c)

The error was error: struct file has no member named f_dentry
Apparently, there was a change in the struct that contained f_dentry in the kernel 3.19 source code which created this bug.

@@ -2269,7 +2269,7 @@ int UserspaceIOCTL(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
 
@@ -2427,7 +2427,7 @@ int UserspaceClose(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
    
@@ -2486,7 +2486,7 @@ ssize_t UserspaceRead(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
    
@@ -2567,7 +2567,7 @@ ssize_t UserspaceWrite(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
 
@@ -2646,7 +2646,7 @@ unsigned int UserspacePoll(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return POLLERR;
    }
 
@@ -3003,9 +3003,9 @@ void DeregisterQMIDevice( sGobiUSBNet * pDev )
             for (count = 0; count < pFDT->max_fds; count++)
             {
                pFilp = pFDT->fd[count];
-               if (pFilp != NULL &&  pFilp->f_dentry != NULL)
+               if (pFilp != NULL &&  pFilp->f_path.dentry != NULL)^M
                {
-                  if (pFilp->f_dentry->d_inode == pOpenInode)
+                  if (pFilp->f_path.dentry->d_inode == pOpenInode)^M
                   {
                      // Close this file handle
                      rcu_assign_pointer( pFDT->fd[count], NULL );                     
@@ -3050,9 +3050,9 @@ void DeregisterQMIDevice( sGobiUSBNet * pDev )
                for (count = 0; count < pFDT->max_fds; count++)
                {
                   pFilp = pFDT->fd[count];
-                  if (pFilp != NULL &&  pFilp->f_dentry != NULL)
+                  if (pFilp != NULL &&  pFilp->f_path.dentry != NULL)^M
                   {
-                     if (pFilp->f_dentry->d_inode == pOpenInode)
+                     if (pFilp->f_path.dentry->d_inode == pOpenInode)^M
                      {
                         // Close this file handle
                         rcu_assign_pointer( pFDT->fd[count], NULL );

Following is the original output of the make commands before and while we were patching the source files.

george@ubuntu-1604:~/Downloads$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:    xenial

george@ubuntu-1604:~/Downloads$ wget https://portland.source.codeaurora.org/patches/quic/gobi/Gobi_Linux/GobiNet_2016-10-20.tar.gz
--2017-04-24 10:05:54--  https://portland.source.codeaurora.org/patches/quic/gobi/Gobi_Linux/GobiNet_2016-10-20.tar.gz
Resolving portland.source.codeaurora.org (portland.source.codeaurora.org)... 198.145.29.80
Connecting to portland.source.codeaurora.org (portland.source.codeaurora.org)|198.145.29.80|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 43818 (43K) [application/x-gzip]
Saving to: ‘GobiNet_2016-10-20.tar.gz’

GobiNet_2016-10-20.tar 100%[===========================>]  42,79K   111KB/s    in 0,4s    

2017-04-24 10:05:56 (111 KB/s) - ‘GobiNet_2016-10-20.tar.gz’ saved [43818/43818]

george@ubuntu-1604:~/Downloads$ tar -xzf GobiNet_2016-10-20.tar.gz 
george@ubuntu-1604:~/Downloads$ cd gobiusbnet/
george@ubuntu-1604:~/Downloads/gobiusbnet$ make
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order
make -C /lib/modules/4.4.0-57-generic/build M=/home/george/Downloads/gobiusbnet modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-57-generic'
  CC [M]  /home/george/Downloads/gobiusbnet/qmap.o
  CC [M]  /home/george/Downloads/gobiusbnet/GobiUSBNet.o
In file included from include/linux/phy.h:22:0,
                 from include/net/dsa.h:19,
                 from include/linux/netdevice.h:44,
                 from include/linux/etherdevice.h:26,
                 from /home/george/Downloads/gobiusbnet/Structs.h:47,
                 from /home/george/Downloads/gobiusbnet/GobiUSBNet.c:57:
/home/george/Downloads/gobiusbnet/GobiUSBNet.c: In function ‘__exittest’:
/home/george/Downloads/gobiusbnet/GobiUSBNet.c:1692:13: warning: return from incompatible pointer type [-Wincompatible-pointer-types]
 module_exit(GobiUSBNetModExit);
             ^
include/linux/module.h:135:11: note: in definition of macro ‘module_exit’
  { return exitfn; }     \
           ^
  CC [M]  /home/george/Downloads/gobiusbnet/QMIDevice.o
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceIOCTL’:
/home/george/Downloads/gobiusbnet/QMIDevice.c:2272:26: error: ‘struct file’ has no member named ‘f_dentry’
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
                          ^
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceClose’:
/home/george/Downloads/gobiusbnet/QMIDevice.c:2393:21: warning: passing argument 1 of ‘atomic_read’ from incompatible pointer type [-Wincompatible-pointer-types]
    if (atomic_read( &pFilp->f_count ) != 1)
                     ^
In file included from include/linux/atomic.h:4:0,
                 from ./arch/x86/include/asm/thread_info.h:53,
                 from include/linux/thread_info.h:54,
                 from ./arch/x86/include/asm/preempt.h:6,
                 from include/linux/preempt.h:59,
                 from include/linux/spinlock.h:50,
                 from include/linux/mm_types.h:8,
                 from include/linux/kmemcheck.h:4,
                 from include/linux/skbuff.h:18,
                 from include/linux/if_ether.h:23,
                 from include/linux/etherdevice.h:25,
                 from /home/george/Downloads/gobiusbnet/Structs.h:47,
                 from /home/george/Downloads/gobiusbnet/QMIDevice.h:95,
                 from /home/george/Downloads/gobiusbnet/QMIDevice.c:91:
./arch/x86/include/asm/atomic.h:25:28: note: expected ‘const atomic_t * {aka const struct <anonymous> *}’ but argument is of type ‘atomic_long_t * {aka struct <anonymous> *}’
 static __always_inline int atomic_read(const atomic_t *v)
                            ^
/home/george/Downloads/gobiusbnet/QMIDevice.c:2430:26: error: ‘struct file’ has no member named ‘f_dentry’
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
                          ^
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceRead’:
/home/george/Downloads/gobiusbnet/QMIDevice.c:2489:26: error: ‘struct file’ has no member named ‘f_dentry’
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
                          ^
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspaceWrite’:
/home/george/Downloads/gobiusbnet/QMIDevice.c:2570:26: error: ‘struct file’ has no member named ‘f_dentry’
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
                          ^
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘UserspacePoll’:
/home/george/Downloads/gobiusbnet/QMIDevice.c:2649:26: error: ‘struct file’ has no member named ‘f_dentry’
       pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
                          ^
/home/george/Downloads/gobiusbnet/QMIDevice.c: In function ‘DeregisterQMIDevice’:
/home/george/Downloads/gobiusbnet/QMIDevice.c:3006:43: error: ‘struct file’ has no member named ‘f_dentry’
                if (pFilp != NULL &&  pFilp->f_dentry != NULL)
                                           ^
/home/george/Downloads/gobiusbnet/QMIDevice.c:3008:28: error: ‘struct file’ has no member named ‘f_dentry’
                   if (pFilp->f_dentry->d_inode == pOpenInode)
                            ^
/home/george/Downloads/gobiusbnet/QMIDevice.c:3053:46: error: ‘struct file’ has no member named ‘f_dentry’
                   if (pFilp != NULL &&  pFilp->f_dentry != NULL)
                                              ^
/home/george/Downloads/gobiusbnet/QMIDevice.c:3055:31: error: ‘struct file’ has no member named ‘f_dentry’
                      if (pFilp->f_dentry->d_inode == pOpenInode)
                               ^
scripts/Makefile.build:258: recipe for target '/home/george/Downloads/gobiusbnet/QMIDevice.o' failed
make[2]: *** [/home/george/Downloads/gobiusbnet/QMIDevice.o] Error 1
Makefile:1420: recipe for target '_module_/home/george/Downloads/gobiusbnet' failed
make[1]: *** [_module_/home/george/Downloads/gobiusbnet] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-57-generic'
Makefile:8: recipe for target 'all' failed
make: *** [all] Error 2


george@ubuntu-1604:~/Downloads/gobiusbnet$ git diff
diff --git a/GobiUSBNet.c b/GobiUSBNet.c
index b8151e2..3b88372 100644
--- a/GobiUSBNet.c
+++ b/GobiUSBNet.c
@@ -1666,11 +1666,11 @@ RETURN VALUE:
    void
 ===========================================================================*/
 // static int GobiUSBNetModExit(struct platform_device *pdev)
-static int GobiUSBNetModExit(void)
+static void GobiUSBNetModExit(void)
 {
    usb_deregister( &GobiNet );
    class_destroy( gpClass );
-   return 0;
+   return;
 }
 
 #if 0
diff --git a/QMIDevice.c b/QMIDevice.c
index e7b3f72..6be39a6 100644
--- a/QMIDevice.c
+++ b/QMIDevice.c
@@ -2269,7 +2269,7 @@ int UserspaceIOCTL(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
 
@@ -2390,7 +2390,7 @@ int UserspaceClose(
    }
 
    // Fallthough.  If f_count == 1 no need to do more checks
-   if (atomic_read( &pFilp->f_count ) != 1)
+   if (atomic_long_read( &pFilp->f_count ) != 1)^M
    {
       rcu_read_lock();
       for_each_process( pEachTask )
@@ -2427,7 +2427,7 @@ int UserspaceClose(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
    
@@ -2486,7 +2486,7 @@ ssize_t UserspaceRead(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
    
@@ -2567,7 +2567,7 @@ ssize_t UserspaceWrite(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return -ENXIO;
    }
 
@@ -2646,7 +2646,7 @@ unsigned int UserspacePoll(
    if (IsDeviceValid( pFilpData->mpDev ) == false)
    {
       DBG( "Invalid device! Updating f_ops\n" );
-      pFilp->f_op = pFilp->f_dentry->d_inode->i_fop;
+      pFilp->f_op = pFilp->f_path.dentry->d_inode->i_fop;^M
       return POLLERR;
    }
 
@@ -3003,9 +3003,9 @@ void DeregisterQMIDevice( sGobiUSBNet * pDev )
             for (count = 0; count < pFDT->max_fds; count++)
             {
                pFilp = pFDT->fd[count];
-               if (pFilp != NULL &&  pFilp->f_dentry != NULL)
+               if (pFilp != NULL &&  pFilp->f_path.dentry != NULL)^M
                {
-                  if (pFilp->f_dentry->d_inode == pOpenInode)
+                  if (pFilp->f_path.dentry->d_inode == pOpenInode)^M
                   {
                      // Close this file handle
                      rcu_assign_pointer( pFDT->fd[count], NULL );                     
@@ -3050,9 +3050,9 @@ void DeregisterQMIDevice( sGobiUSBNet * pDev )
                for (count = 0; count < pFDT->max_fds; count++)
                {
                   pFilp = pFDT->fd[count];
-                  if (pFilp != NULL &&  pFilp->f_dentry != NULL)
+                  if (pFilp != NULL &&  pFilp->f_path.dentry != NULL)^M
                   {
-                     if (pFilp->f_dentry->d_inode == pOpenInode)
+                     if (pFilp->f_path.dentry->d_inode == pOpenInode)^M
                      {
                         // Close this file handle
                         rcu_assign_pointer( pFDT->fd[count], NULL );     

george@ubuntu-1604:~/Downloads/gobiusbnet$ make
rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions Module.* modules.order
make -C /lib/modules/4.4.0-57-generic/build M=/home/george/Downloads/gobiusbnet modules
make[1]: Entering directory '/usr/src/linux-headers-4.4.0-57-generic'
  CC [M]  /home/george/Downloads/gobiusbnet/qmap.o
  CC [M]  /home/george/Downloads/gobiusbnet/GobiUSBNet.o
  CC [M]  /home/george/Downloads/gobiusbnet/QMIDevice.o
  CC [M]  /home/george/Downloads/gobiusbnet/QMI.o
  LD [M]  /home/george/Downloads/gobiusbnet/GobiNet.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/george/Downloads/gobiusbnet/GobiNet.mod.o
  LD [M]  /home/george/Downloads/gobiusbnet/GobiNet.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.4.0-57-generic'