From owner-svn-src-user@FreeBSD.ORG Sun Apr 19 14:55:23 2015 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F24A297; Sun, 19 Apr 2015 14:55:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63F3D400; Sun, 19 Apr 2015 14:55:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3JEtN5L054099; Sun, 19 Apr 2015 14:55:23 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3JEtNLj054098; Sun, 19 Apr 2015 14:55:23 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <201504191455.t3JEtNLj054098@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sun, 19 Apr 2015 14:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r281744 - user/jceel/soc2014_evdev/head/sys/dev/evdev X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Apr 2015 14:55:23 -0000 Author: jceel Date: Sun Apr 19 14:55:22 2015 New Revision: 281744 URL: https://svnweb.freebsd.org/changeset/base/281744 Log: To conform with Linux implementation, return ENOENT from EVIOCGPHYS and EVIOCGUNIQ ioctl if device is backed by uinput. Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c ============================================================================== --- user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c Sun Apr 19 13:51:25 2015 (r281743) +++ user/jceel/soc2014_evdev/head/sys/dev/evdev/cdev.c Sun Apr 19 14:55:22 2015 (r281744) @@ -367,7 +367,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd case IOCBASECMD(EVIOCGREP): if (evdev->ev_repeat_mode == NO_REPEAT) - return ENOTSUP; + return (ENOTSUP); rep_params[0] = evdev->ev_rep[REP_DELAY]; rep_params[1] = evdev->ev_rep[REP_PERIOD]; @@ -376,7 +376,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd case IOCBASECMD(EVIOCSREP): if (evdev->ev_repeat_mode == NO_REPEAT) - return ENOTSUP; + return (ENOTSUP); memcpy(rep_params, data, sizeof(rep_params)); evdev->ev_rep[REP_DELAY] = rep_params[0]; @@ -391,7 +391,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd case IOCBASECMD(EVIOCGKEYCODE_V2): if (evdev->ev_methods->ev_get_keycode == NULL) - return ENOTSUP; + return (ENOTSUP); ke = (struct input_keymap_entry *)data; evdev->ev_methods->ev_get_keycode(evdev, evdev->ev_softc, ke); @@ -399,7 +399,7 @@ evdev_ioctl(struct cdev *dev, u_long cmd case IOCBASECMD(EVIOCSKEYCODE_V2): if (evdev->ev_methods->ev_set_keycode == NULL) - return ENOTSUP; + return (ENOTSUP); ke = (struct input_keymap_entry *)data; evdev->ev_methods->ev_set_keycode(evdev, evdev->ev_softc, ke); @@ -410,10 +410,16 @@ evdev_ioctl(struct cdev *dev, u_long cmd break; case EVIOCGPHYS(0): + if (evdev->ev_dev == NULL) + return (ENOENT); + strlcpy(data, evdev->ev_shortname, len); break; case EVIOCGUNIQ(0): + if (evdev->ev_dev == NULL) + return (ENOENT); + strlcpy(data, evdev->ev_serial, len); break;