Author: gonzo
Date: Sat Oct 22 01:38:21 2016
New Revision: 307760
URL: https://svnweb.freebsd.org/changeset/base/307760

Log:
  MFC r305706, r305749, r306274
  
  r305706:
  Add evdev protocol implementation
  
  evdev is a generic input event interface compatible with Linux
  evdev API at ioctl level. It allows using unmodified (apart from
  header name) input evdev drivers in Xorg, Wayland, Qt.
  
  This commit has only generic kernel API. evdev support for individual
  hardware drivers like ukbd, ums, atkbd, etc. will be committed later.
  
  Project was started by Jakub Klama as part of GSoC 2014. Jakub's
  evdev implementation was later used as a base, updated and finished
  by Vladimir Kondratiev.
  
  Submitted by: Vladimir Kondratiev <w...@cicgroup.ru>
  Reviewed by:  adrian, hans
  Differential Revision:        https://reviews.freebsd.org/D6998
  
  r305749:
  Remove semicolon from the end of the macro definition
  
  Reported by: hans
  
  r306274:
  Handle NULL argument in evdev_free
  
  Add check for evdev argument of evdev_free being NULL. This is valid
  value and should not cause crash. In this case evdev_free does nothing
  
  Submitted by: Vladimir Kondratiev <w...@cicgroup.ru>

Added:
  stable/11/sys/dev/evdev/
     - copied from r305706, head/sys/dev/evdev/
Modified:
  stable/11/etc/mtree/BSD.include.dist
  stable/11/include/Makefile
  stable/11/sys/conf/NOTES
  stable/11/sys/conf/files
  stable/11/sys/conf/options
  stable/11/sys/dev/evdev/cdev.c
  stable/11/sys/dev/evdev/evdev.c
  stable/11/sys/dev/evdev/uinput.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/etc/mtree/BSD.include.dist
==============================================================================
--- stable/11/etc/mtree/BSD.include.dist        Sat Oct 22 00:48:58 2016        
(r307759)
+++ stable/11/etc/mtree/BSD.include.dist        Sat Oct 22 01:38:21 2016        
(r307760)
@@ -110,6 +110,8 @@
         ..
         ciss
         ..
+        evdev
+        ..
         filemon
         ..
         firewire

Modified: stable/11/include/Makefile
==============================================================================
--- stable/11/include/Makefile  Sat Oct 22 00:48:58 2016        (r307759)
+++ stable/11/include/Makefile  Sat Oct 22 01:38:21 2016        (r307760)
@@ -154,7 +154,7 @@ copies: .PHONY .META
                done; \
        fi
 .endfor
-.for i in ${LDIRS} 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci} ${LSUBSUBDIRS}
+.for i in ${LDIRS} 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/nand:Ndev/pci} 
${LSUBSUBDIRS}
        cd ${.CURDIR}/../sys; \
        ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 $i/*.h \
            ${DESTDIR}${INCLUDEDIR}/$i
@@ -177,6 +177,13 @@ copies: .PHONY .META
        ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nand_dev.h \
            ${DESTDIR}${INCLUDEDIR}/dev/nand
 .endif
+       cd ${.CURDIR}/../sys/dev/evdev; \
+       ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input.h \
+           ${DESTDIR}${INCLUDEDIR}/dev/evdev; \
+       ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 input-event-codes.h \
+           ${DESTDIR}${INCLUDEDIR}/dev/evdev; \
+       ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 uinput.h \
+           ${DESTDIR}${INCLUDEDIR}/dev/evdev
        cd ${.CURDIR}/../sys/dev/pci; \
        ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 pcireg.h \
            ${DESTDIR}${INCLUDEDIR}/dev/pci
@@ -238,7 +245,7 @@ symlinks: .PHONY .META
                ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../sys/$i/$$h 
${DESTDIR}${INCLUDEDIR}/$i; \
        done
 .endfor
-.for i in ${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/nand:Ndev/pci}
+.for i in 
${LSUBDIRS:Ndev/agp:Ndev/acpica:Ndev/bktr:Ndev/evdev:Ndev/nand:Ndev/pci}
        cd ${.CURDIR}/../sys/$i; \
        for h in *.h; do \
                ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/$i/$$h 
${DESTDIR}${INCLUDEDIR}/$i; \
@@ -266,6 +273,11 @@ symlinks: .PHONY .META
                    ${DESTDIR}${INCLUDEDIR}/dev/nand; \
        done
 .endif
+       cd ${.CURDIR}/../sys/dev/evdev; \
+       for h in input.h input-event-codes.h uinput.h; do \
+               ln -fs ../../../../sys/dev/evdev/$$h \
+                   ${DESTDIR}${INCLUDEDIR}/dev/evdev; \
+       done
        cd ${.CURDIR}/../sys/dev/pci; \
        for h in pcireg.h; do \
                ${INSTALL_SYMLINK} ${TAG_ARGS} ../../../../sys/dev/pci/$$h \

Modified: stable/11/sys/conf/NOTES
==============================================================================
--- stable/11/sys/conf/NOTES    Sat Oct 22 00:48:58 2016        (r307759)
+++ stable/11/sys/conf/NOTES    Sat Oct 22 01:38:21 2016        (r307760)
@@ -3062,3 +3062,8 @@ options   GZIO
 
 # BHND(4) drivers
 options                BHND_LOGLEVEL   # Logging threshold level
+
+# evdev interface 
+options        EVDEV
+options        EVDEV_DEBUG
+options        UINPUT_DEBUG

Modified: stable/11/sys/conf/files
==============================================================================
--- stable/11/sys/conf/files    Sat Oct 22 00:48:58 2016        (r307759)
+++ stable/11/sys/conf/files    Sat Oct 22 01:38:21 2016        (r307760)
@@ -1497,6 +1497,11 @@ dev/etherswitch/ip17x/ip17x_vlans.c      opti
 dev/etherswitch/miiproxy.c             optional miiproxy
 dev/etherswitch/rtl8366/rtl8366rb.c    optional rtl8366rb
 dev/etherswitch/ukswitch/ukswitch.c    optional ukswitch
+dev/evdev/cdev.c                       optional evdev
+dev/evdev/evdev.c                      optional evdev
+dev/evdev/evdev_mt.c                   optional evdev
+dev/evdev/evdev_utils.c                        optional evdev
+dev/evdev/uinput.c                     optional evdev uinput
 dev/ex/if_ex.c                 optional ex
 dev/ex/if_ex_isa.c             optional ex isa
 dev/ex/if_ex_pccard.c          optional ex pccard

Modified: stable/11/sys/conf/options
==============================================================================
--- stable/11/sys/conf/options  Sat Oct 22 00:48:58 2016        (r307759)
+++ stable/11/sys/conf/options  Sat Oct 22 01:38:21 2016        (r307760)
@@ -986,3 +986,8 @@ BHND_LOGLEVEL       opt_global.h
 
 # GPIO and child devices
 GPIO_SPI_DEBUG opt_gpio.h
+
+# evdev protocol support
+EVDEV          opt_evdev.h
+EVDEV_DEBUG    opt_evdev.h
+UINPUT_DEBUG   opt_evdev.h

Modified: stable/11/sys/dev/evdev/cdev.c
==============================================================================
--- head/sys/dev/evdev/cdev.c   Sun Sep 11 18:56:38 2016        (r305706)
+++ stable/11/sys/dev/evdev/cdev.c      Sat Oct 22 01:38:21 2016        
(r307760)
@@ -49,7 +49,7 @@
 #include <dev/evdev/evdev_private.h>
 
 #ifdef EVDEV_DEBUG
-#define        debugf(client, fmt, args...)    printf("evdev cdev: "fmt"\n", 
##args);
+#define        debugf(client, fmt, args...)    printf("evdev cdev: "fmt"\n", 
##args)
 #else
 #define        debugf(client, fmt, args...)
 #endif

Modified: stable/11/sys/dev/evdev/evdev.c
==============================================================================
--- head/sys/dev/evdev/evdev.c  Sun Sep 11 18:56:38 2016        (r305706)
+++ stable/11/sys/dev/evdev/evdev.c     Sat Oct 22 01:38:21 2016        
(r307760)
@@ -92,7 +92,8 @@ void
 evdev_free(struct evdev_dev *evdev)
 {
 
-       if (evdev->ev_cdev != NULL && evdev->ev_cdev->si_drv1 != NULL)
+       if (evdev != NULL && evdev->ev_cdev != NULL &&
+           evdev->ev_cdev->si_drv1 != NULL)
                evdev_unregister(evdev);
 
        free(evdev, M_EVDEV);

Modified: stable/11/sys/dev/evdev/uinput.c
==============================================================================
--- head/sys/dev/evdev/uinput.c Sun Sep 11 18:56:38 2016        (r305706)
+++ stable/11/sys/dev/evdev/uinput.c    Sat Oct 22 01:38:21 2016        
(r307760)
@@ -50,7 +50,7 @@
 #include <dev/evdev/evdev_private.h>
 
 #ifdef UINPUT_DEBUG
-#define        debugf(state, fmt, args...)     printf("uinput: " fmt "\n", 
##args);
+#define        debugf(state, fmt, args...)     printf("uinput: " fmt "\n", 
##args)
 #else
 #define        debugf(state, fmt, args...)
 #endif
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to