Kernel driver for National Instruments USB-6251 device

by jm » Tue, 12 Jan 2010 20:23:02 GMT


Sponsored Links
 Hi,
Has any one done any work towards building a USB driver for any of the
National Instruments multifunction I/O devices (specifically the NI-
USB-6251...) ?

I have downloaded the Linux 2.7 DDK from NI, which provides the source
for a generic kernel driver, but I have never rebuilt (or modified) a
Linux kernel before.

Are there pointers to any 'how-to' pages/docs available?

regards,
jm



Kernel driver for National Instruments USB-6251 device

by Greg KH » Tue, 12 Jan 2010 20:26:35 GMT


 


Is this a USB device (where you plug it into a USB host), or a USB
host controller
where you are going to be running Android with it as the host controller?


Have you read, "Documentation/HOWTO" in the Linux kernel source tree?
If not, I suggest starting there, that is what it was written for :)

good luck,

greg k-h


Sponsored Links


Kernel driver for National Instruments USB-6251 device

by jm » Tue, 12 Jan 2010 20:39:31 GMT


 Hi Greg,

Thx for the fast response.

Yes, there is a USB device (NI-USB-6251), and a Motorola Droid will be
the USB Host Controller.
Thanks for the ref to the doc - will start there and come back to this
thread with any questions.

-jm





> greg k-h



Kernel driver for National Instruments USB-6251 device

by jm » Fri, 15 Jan 2010 21:18:21 GMT


 Nope. No idea that this will not work.

Are you saying that the Motorola hardware cannot support the role of a
USB Host Contoller?






> greg k-h



Kernel driver for National Instruments USB-6251 device

by jm » Fri, 15 Jan 2010 21:32:17 GMT


 The kernel mods, I agree need to be performed - I have the driver
source from device manufacturer (generically, for Linunx 2.6.x) and
currently in the middle or re-building the kernel.

But you raise a good question of the USB controller on the phone - I
assumed (most likely incorrectly...) that it would support the role of
a host.

trying the keyboard...





> greg k-h



Kernel driver for National Instruments USB-6251 device

by jm » Mon, 18 Jan 2010 15:23:37 GMT


 No keyboards to be found that feature a micro-usb connector
(MotorolaDroid uses a micro...), so no-joy yet. No converter cables
either.

As far as a USB driver, I got libusb to compile (ARM) and run on the
Droid.
It's nice since it strictly user-space, and does not require any
kernel mods.
However, it wants the usbfs to be mounted, which you can't do with
rooting the phone (un-desireable, in my case).





> > greg k-h



Other Threads

1. Wifi notworking

Hey guys, luv the x86port and really want to use it on this
touchscreen Malata netbook I have.  Everything works great except the
WIFI which is a biggie.  Anyone have a clue how to load the proper
driver.  its a R73 chipset from raillink, everything else on the
machine is stanard intel atom hardware.

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Make hierarchyviewer work with android-x86

Because of this bug in java:

  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4215269

hierarchyviewer doesn't work with the android-x86. The windows's and
views's hashcode could be negative integers, and Integer.parseInt can
not cope with it.

Two git repo need patch, the first is sdk:

diff --git a/hierarchyviewer/src/com/android/hierarchyviewer/device/Window.java 
b/hierarchyviewer/src/com/android/hierarchyviewer/device/Window.java
index 0417df6..6645d01 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/device/Window.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/device/Window.java
@@ -20,9 +20,9 @@ public class Window {
     public static final Window FOCUSED_WINDOW = new Window("<Focused Window>", 
-1);
 
     private String title;
-    private int hashCode;
+    private long hashCode;
 
-    public Window(String title, int hashCode) {
+    public Window(String title, long hashCode) {
         this.title = title;
         this.hashCode = hashCode;
     }
@@ -31,12 +31,12 @@ public class Window {
         return title;
     }
 
-    public int getHashCode() {
+    public long getHashCode() {
         return hashCode;
     }
 
     public String encode() {
-        return Integer.toHexString(hashCode);
+        return Long.toHexString(hashCode);
     }
 
     public String toString() {
diff --git 
a/hierarchyviewer/src/com/android/hierarchyviewer/scene/WindowsLoader.java 
b/hierarchyviewer/src/com/android/hierarchyviewer/scene/WindowsLoader.java
index ef93707..758061a 100644
--- a/hierarchyviewer/src/com/android/hierarchyviewer/scene/WindowsLoader.java
+++ b/hierarchyviewer/src/com/android/hierarchyviewer/scene/WindowsLoader.java
@@ -58,7 +58,7 @@ public class WindowsLoader {
                 int index = line.indexOf(' ');
                 if (index != -1) {
                     Window w = new Window(line.substring(index + 1),
-                            Integer.parseInt(line.substring(0, index), 16));
+                            Long.parseLong(line.substring(0, index), 16));
                     windows.add(w);
                 }
             }


The second is frameworks/base:

diff --git a/core/java/android/view/ViewDebug.java 
b/core/java/android/view/ViewDebug.java
index 4baf612..efb1558 100644
--- a/core/java/android/view/ViewDebug.java
+++ b/core/java/android/view/ViewDebug.java
@@ -702,7 +702,7 @@ public class ViewDebug {
         if (parameter.indexOf('@') != -1) {
             final String[] ids = parameter.split("@");
             final String className = ids[0];
-            final int hashCode = Integer.parseInt(ids[1], 16);
+            final long hashCode = Long.parseLong(ids[1], 16);
 
             View view = root.getRootView();
             if (view instanceof ViewGroup) {
@@ -927,7 +927,8 @@ public class ViewDebug {
         }
     }
 
-    private static View findView(ViewGroup group, String className, int 
hashCode) {
+    private static View findView(ViewGroup group, String className, long 
hc_long) {
+        int  hashCode = (int) hc_long;
         if (isRequestedView(group, className, hashCode)) {
             return group;
         }
diff --git a/services/java/com/android/server/WindowManagerService.java 
b/services/java/com/android/server/WindowManagerService.java
index 8709f54..25c16b8 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -4667,7 +4667,7 @@ public class WindowManagerService extends 
IWindowManager.Stub
                 index = parameters.length();
             }
             final String code = parameters.substring(0, index);
-            int hashCode = "ffffffff".equals(code) ? -1 : 
Integer.parseInt(code, 16);
+            long hashCode = "ffffffff".equals(code) ? -1 : 
Long.parseLong(code, 16);
 
             // Extract the command's parameter after the window description
             if (index < parameters.length()) {
@@ -4711,7 +4711,8 @@ public class WindowManagerService extends 
IWindowManager.Stub
         return success;
     }
 
-    private WindowState findWindow(int hashCode) {
+    private WindowState findWindow(long hc_long) {
+        int hashCode = (int)hc_long;
         if (hashCode == -1) {
             return getFocusedWindow();
         }

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. How to track URL in each landing page in Webview

4. parse local media file to get Mime type

5. bingung tentang ADB

6. Tmobile Native IM versi 1.1.2 worked via gprs/3G and wifi

7. Android Hidden Secret Codes