lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAL_JsqLNeV9BDvRtRbDCKbrq-gO9jv8-kmGJNS9AKXUSmEvYOA@mail.gmail.com>
Date:   Fri, 26 Aug 2016 16:27:35 -0500
From:   Rob Herring <robh@...nel.org>
To:     Pavel Machek <pavel@....cz>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Marcel Holtmann <marcel@...tmann.org>,
        Jiri Slaby <jslaby@...e.com>,
        Sebastian Reichel <sre@...nel.org>,
        Arnd Bergmann <arnd@...db.de>,
        "Dr . H . Nikolaus Schaller" <hns@...delico.com>,
        Alan Cox <gnomes@...rguk.ukuu.org.uk>,
        Loic Poulain <loic.poulain@...el.com>,
        Peter Hurley <peter@...leysoftware.com>,
        NeilBrown <neil@...wn.name>,
        Linus Walleij <linus.walleij@...aro.org>,
        "open list:BLUETOOTH DRIVERS" <linux-bluetooth@...r.kernel.org>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 4/6] serio: serport: add support for buffered write
 and receive

On Fri, Aug 26, 2016 at 3:12 PM, Pavel Machek <pavel@....cz> wrote:
> Hi!
>
>> @@ -133,26 +133,29 @@ static void serport_ldisc_receive(struct tty_struct *tty, const unsigned char *c
>>       if (!test_bit(SERPORT_ACTIVE, &serport->flags))
>>               goto out;
>>
>> -     for (i = 0; i < count; i++) {
>> -             if (fp) {
>> -                     switch (fp[i]) {
>> -                     case TTY_FRAME:
>> -                             ch_flags = SERIO_FRAME;
>> -                             break;
>> -
>> -                     case TTY_PARITY:
>> -                             ch_flags = SERIO_PARITY;
>> -                             break;
>> -
>> -                     default:
>> -                             ch_flags = 0;
>> -                             break;
>> +     if (serio_buffered_mode_enabled(serport->serio)) {
>> +             serio_receive_buf(serport->serio, cp, count);
>
> Elsewhere:
> +       /* Use buffer receive if the driver provides a callback */
> +       if (drv->receive_buf)
> +               set_bit(SERIO_MODE_BUFFERED, &drv->flags);
>
> Could we use if (drv->receive_buf) above directly, and not require the
> bitfield?

I'm allowing for allowing drivers to provide both functions and be
able to switch between them. However, I didn't provide any mechanism
to do so yet.

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ