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>] [day] [month] [year] [list]
Message-ID: <CACRpkdY2pGOV=PFKEaPAnKpt16HNLomRuQKRgH8A+cKFUotRXw@mail.gmail.com>
Date:   Tue, 20 Sep 2022 11:44:19 +0200
From:   Linus Walleij <linus.walleij@...aro.org>
To:     Martin Zaťovič <m.zatovic1@...il.com>
Cc:     linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
        mani@...nel.org, hemantk@...eaurora.org, elder@...aro.org,
        f.fainelli@...il.com, Michael.Srba@...nam.cz,
        jeffrey.l.hugo@...il.com, gregkh@...uxfoundation.org,
        bjorn.andersson@...aro.org, saravanak@...gle.com,
        krzysztof.kozlowski+dt@...aro.org, robh+dt@...nel.org
Subject: Re: [PATCH RFC v1 1/2] bus: add Wiegand write-only GPIO driver

On Mon, Sep 19, 2022 at 2:57 PM Martin Zaťovič <m.zatovic1@...il.com> wrote:

> 1. drivers/bus/wiegand.c
> 2. include/linux/wiegand.h
> 3. drivers/gpio/gpio-wiegand.h
>
> I have looked for drivers with a similar division and tried to figure out what the file drivers/bus/wiegand.c should contain.
> So far I am only sure that it will contain the parity calculation functions.

That is a question for people who know wiegand... Maybe just yourself!

You also clearly need some bus infrastructure to populate and spawn devices.
This mechanism depends on the specifics of the bus.

> The code for sysfs attribute files may also be a part of this file, but I am not sure about it.
> If hypothetically there was another Wiegand driver besides the GPIO one and a user would
> like to connect both of these Wiegand interfaces, he would loose the ability to set attributes
> for individual Wiegand interfaces, am I right?

You should spawn individual devices on a wiegand bus (the kernel concept of
bus). Each new device becomes something like a struct wiegand_device that
contains a struct device, and the struct device is the anchor in sysfs.
https://www.kernel.org/doc/html/latest/driver-api/driver-model/bus.html

> Should the drivers/bus/wiegand.c be a full-scale driver or should it just be a file that
> contains the Wiegand-specific functions(such as parity calculation)?

It should be what we call a bus driver, OK a bit self-referential, but anything
that is common for the bus and the code to spawn the devices.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ