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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 03 Mar 2012 16:44:05 +0100
From:	Federico Vaga <federico.vaga@...il.com>
To:	Kay Sievers <kay.sievers@...y.org>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Alessandro Rubini <rubini@...dd.com>,
	linux-kernel@...r.kernel.org
Subject: Re: How to make a bus with heterogeneous devices?

> Maybe I miss something but it sounds not that different from USB.
> 
> You have a bus that enumerates devices and a "bus driver" creates a
> generic device on that bus for everything it finds. These devices stay
> generic, do not have type-specific attributes, but export matches
> again to bind other device-specific drivers, which create _new_ child
> devices below the generic ones with the proper attributes matching
> their individual type of devices. So every "logical" device is always
> represented by one generic device and one type-specific child device.

It sounds like our option 5:

> 5- The real attributes may live in another device, which is a child of
> the one used within the bus abstraction.  Here the drawback is using
> an additional device and directory level for no reason.

- I register the generic (empty) device on the bus
- when the device match with a driver 
  - I register a new device child of the matched one but without connect     
    it directly on the bus.

The result will be something like (zio is our bus):

/sys/bus/zio/devices/<generic-dev1>/<real-device1>/<attributes>
/sys/bus/zio/devices/<generic-dev2>/<real-device2>/<attributes>
/sys/bus/zio/devices/<generic-devN>/<real-deviceN>/<attributes>

When there is not a driver:

/sys/bus/zio/devices/<generic-dev1>/<device-stuff>
/sys/bus/zio/devices/<generic-devN>/<device-stuff>

Where the generic-dev is an empty device used to make the bus work. Is 
it correct?

> All these devices, the generic ones and the type-specific ones can be
> on the same bus (struct bus_type) when they get a "struct device_type"
> assigned which carries the device-type specific set of attributes.

But if all devices can live on the bus (set device->bus for all 
devices), when I register the "real-device" (type-specific)  the bus try 
to match it with a driver (again); but we already matched the device 
with its driver. it is better if the type-specific devices are not 
directly on the bus but only a child of a device on the bus.

-- 
Federico Vaga
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ