Skip to contentSkip to conversation

Hidraw: ioctl to expose 'uniq'

PATCH In review SephirXV 2 participants 2 messages Sep 10, 2009

Subsystems (2)
lore
Share & tools
lore

SephirXV

author
#0 lore raw

PATCH 3/3 Hidraw: ioctl to expose 'uniq'

From: Christopher Olson <[email protected]>

Simple, deterministic way of getting uniq field bound to hidrawN files. Flame me on this one, so long as I get some feedback I can use.

---

hid/hidraw.c.1 2009-09-10 10:32:13.000000000 -0500 renamed from hid/hidraw.c 2009-09-10 10:32:28.000000000 -0500 +6 -0
@@ -264,6 +264,12 @@ static long hidraw_ioctl(struct file *fi
                                        ret = -EFAULT;
                                break;
                        }
+               case HIDIOCGRAWINFO + 1:        //HIDIOCG_UNIQ
+                       {
+                               if (copy_to_user(user_arg, dev->hid->uniq, 64))
+                                       ret = -EFAULT;
+                               break;
+                       }
                default:
                        ret = -ENOTTY;
        }
maintainer
#1 lore raw

Hi Christopher,

Quoted 12 lines

Simple, deterministic way of getting uniq field bound to hidrawN files. Flame me on this one, so long as I get some feedback I can use.

---

hid/hidraw.c.1 2009-09-10 10:32:13.000000000 -0500 renamed from hid/hidraw.c 2009-09-10 10:32:28.000000000 -0500 +0 -0
@@ -264,6 +264,12 @@ static long hidraw_ioctl(struct file *fi
                                        ret = -EFAULT;
                                break;

hid/hidraw.c.1 2009-09-10 10:32:13.000000000 -0500 static long hidraw_ioctl(struct file *fi · line 275

Quoted 10 lines
hid/hidraw.c.1 2009-09-10 10:32:13.000000000 -0500 renamed from hid/hidraw.c 2009-09-10 10:32:28.000000000 -0500 +6 -0
                        }
+               case HIDIOCGRAWINFO + 1:        //HIDIOCG_UNIQ
+                       {
+                               if (copy_to_user(user_arg, dev->hid->uniq, 64))
+                                       ret = -EFAULT;
+                               break;
+                       }
                default:
                        ret = -ENOTTY;
        }

wrong mailing list to begin with.

Regards

Marcel