ioctlent: add UAPI support

* Makefile.am (IOCTLSORT_INCLUDEDIR): Define.
(ioctlsort): Use it.
* linux/ioctlent.sh (lookup_ioctls): Look into uapi directory tree.
Strip "uapi/" prefix from output path names.
* linux/ioctlent.h.in: Regenerate from v3.9 headers.
* NEWS: Mention it.
diff --git a/linux/ioctlent.sh b/linux/ioctlent.sh
index 9bcff5f..c483ba8 100755
--- a/linux/ioctlent.sh
+++ b/linux/ioctlent.sh
@@ -47,7 +47,7 @@
 
 	# Build the list of all ioctls
 	regexp='^[[:space:]]*#[[:space:]]*define[[:space:]]\+[A-Z][A-Z0-9_]*[[:space:]]\+0x'"$type"'..\>'
-	(cd "$dir" && grep "$regexp" "$@" /dev/null 2>/dev/null) |
+	(cd "$dir" && for f; do grep "$regexp" "$f" "uapi/$f" 2>/dev/null; done) |
 		sed -ne "s,$asm/,asm/,g"'
 s/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*\(0x'"$type"'..\).*/	{ "\1",	"\2",	\3	},/p' \
 		>> ioctls.h
@@ -94,8 +94,11 @@
 	-e 's/^\(.*\):[[:space:]]*#[[:space:]]*define[[:space:]]*\([A-Z0-9_]*\)[[:space:]]*_S\?I.*(\([^[,]*\)[[:space:]]*,[[:space:]]*\([^,)]*\).*/	{ "\1",	"\2",	_IOC(_IOC_NONE,\3,\4,0)	},/p' \
 	>> ioctls.h
 
-# Sort and drop dups?
-# sort -u <ioctls.h >ioctls1.h && mv ioctls1.h ioctls.h
+# Strip uapi/ prefix
+sed -i 's|"uapi/|"|' ioctls.h
+
+# Sort and drop dups
+sort -u -o ioctls.h ioctls.h
 
 > ioctldefs.h