From owner-freebsd-hackers@freebsd.org Sun Oct 2 08:58:53 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B9E2AC635A for ; Sun, 2 Oct 2016 08:58:53 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: from mail-yb0-x230.google.com (mail-yb0-x230.google.com [IPv6:2607:f8b0:4002:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 36EEF36F; Sun, 2 Oct 2016 08:58:53 +0000 (UTC) (envelope-from m.e.sanliturk@gmail.com) Received: by mail-yb0-x230.google.com with SMTP id 191so2062805ybv.3; Sun, 02 Oct 2016 01:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WCOk7AZrraxvBIMiSHI4w7m8lraJ34UPgktCX8h872w=; b=SX69zaVSpFE8NgNCXl3j7A79rndIbWKe66z+f20QT926DGN74GSA6/VPYg1cNAZl6+ o7IYAdDS7+/lud3hdL6Z99V2BH8ug5yRf4RSJaztU6SSxNwWNIubjJg7tjCEnS4cX2MB fNBRG4kwWVuNjiu07SCD4NToErQeQVKolmkF/S4Zh5irF+FyxLXu+5+PGuS+UYuLVlnO DdpuQ+SpmVHxuCp0EVqTtZGg/zusIZT9HVD2yEqsU6ZmnHMDu6Gh7EicsgC2iiAuNevd +XOKV6Ql+eGzWsiIYrmjwRsfl8j1CJYFF/P2cllN06uQxPB8URbm6wLqsU6TH3htxAF1 CRAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WCOk7AZrraxvBIMiSHI4w7m8lraJ34UPgktCX8h872w=; b=TaZv0swyMXMQWxqgoJV5UzZ71ipUHtHHrYFkZy6N+AbcQ5s86ATkEUGuBTv4pQYBv7 UmkAnKL2XHfUzQuBX/fj2+vQqvno7u5BVmXu1Ib4vgmlDZy2PckCXNAkqJDnVG/iwHIY PHvUSlgusrHQ4qhrlco389ebvCnzYPgEgIYh+YVZG9DYgnuM857mRQRqYIc2pXxEem3B kzXcb6ru41VOeH5rJLjvvWe6ZB0JyCThjAPKxa5sqkqSBfIu9GZDclQ9c9fhxHUhyH/h sPGBoVrKKWY/1qtwgbzUivdj0Cc2sGZxqYyNYcHDQjp7fVJ1OeM+dQ/p69DhT7GIcTbN 1/0Q== X-Gm-Message-State: AA6/9RkFqbzL88uurH0VqbCbw47CSU8cZXEBW7rTPkSK7QPX5Sl9VZZeL7Cd+EVliUg5j+aCQJPkoKYcGn4oHg== X-Received: by 10.37.19.202 with SMTP id 193mr11187690ybt.3.1475398732440; Sun, 02 Oct 2016 01:58:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.88.214 with HTTP; Sun, 2 Oct 2016 01:58:51 -0700 (PDT) In-Reply-To: <20161002082609.GC97879@e-new.0x20.net> References: <4300eab5-dafb-bce6-5b58-24d347202e23@selasky.org> <20161002082609.GC97879@e-new.0x20.net> From: Mehmet Erol Sanliturk Date: Sun, 2 Oct 2016 01:58:51 -0700 Message-ID: Subject: Re: Logitech G510s keyboard fail. To: Lars Engels Cc: Hans Petter Selasky , Eitan Adler , Zaphod Beeblebrox , FreeBSD Hackers Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2016 08:58:53 -0000 On Sun, Oct 2, 2016 at 1:26 AM, Lars Engels wrote: > On Wed, Sep 28, 2016 at 10:01:18PM +0200, Hans Petter Selasky wrote: > > On 09/28/16 20:46, Zaphod Beeblebrox wrote: > > > Ok... that makes the keyboard attach. It still says the following on > dmesg: > > > > > > uhid1: addr 10> > > > on usbus0 > > > hid_get_item: Number of items(991) truncated to 255 > > > hid_get_item: Number of items(257) truncated to 255 > > > hid_get_item: Number of items(991) truncated to 255 > > > hid_get_item: Number of items(257) truncated to 255 > > > hid_get_item: Number of items(991) truncated to 255 > > > hid_get_item: Number of items(257) truncated to 255 > > > > > > How do I make this permanent? > > > > > > > Make a patch for sys/dev/usb/quirk/usb_quirk.c . Look at existing > > keyboard quirks. > > There are plenty of patches for the USB quirks coming in much faster > than new FreeBSD releases are made. Would it be possible to swap out the > quirks in a port? We could still have the quirks in base but if you > install the port it would override them? > I have another idea ( I am sorry that I can not do it now ) : Move all of the existent device definitions arrays into XML files . When a device is detected , load its definition from related XML file Find its "index" . By using that "index" , in a case statement do whatever is required such as obtained from now from internal arrays : load a driver , etc. This may have two parts : Existing device drivers in FreeBSD and XML definition specified above . These will be stored into FreeBSD base directories . If device definition is not found in FreeBSD base XML definition files , the system will look into following files defined below : If it is found , it will use it , if it is not found , it will not "panic" but display a proper error message ( in sufficient detail to be understandable by user ) . For user devices which they are not in the above XML files : System will search a predefined device directory in user space for a possible XML file having definition of the device dedicated to the device detected : In this file , a driver name should be specified . FreeBSD will load this driver into user space and execute it . Sources reading XML files is already present in the FreeBSD . The only required part is to decode loaded XML file with respect to elements . The above structure will allow the companies to produce related XML files and device drivers and let the users to use them without requiring modifications into FreeBSD base system . If they are not open source , it is the responsibility of the user whether she/he will use it or not use it . Such a structure will not require continuous modification in kernel sources , and recompiling them . It will move new device drivers into user space . Later on , on new releases , if it is found useful , such drivers may be moved into FreeBSD base . Thank you very much . Mehmet Erol Sanliturk