LWN: Comments on "Linux and wireless networking" https://lwn.net/Articles/167270/ This is a special feed containing comments posted to the individual LWN article titled "Linux and wireless networking". en-us Sat, 20 Sep 2025 10:06:21 +0000 Sat, 20 Sep 2025 10:06:21 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net Using sysfs for configuring wireless networking https://lwn.net/Articles/168329/ https://lwn.net/Articles/168329/ georgm I like this idea, but I would change it a bit (to also solve the state thing mentioned in this thread:<br> <p> Yo have different folders for different configuration sets (one for each configuration) and a folder called current.<br> <p> You change values in the configuration folders (e.g. one for home, one for work). If you finished, you do an "echo home &gt; config_in_use" or something like that and the values of this folder are copied to current. <br> <p> current is no symlink to solve the problem, if something crashes between changing and applying. So the current state could always be read from folder current.<br> <p> Thu, 19 Jan 2006 08:51:54 +0000 Using sysfs for configuring wireless networking https://lwn.net/Articles/167689/ https://lwn.net/Articles/167689/ fergal <pre> t = open(">/sys/blah/transaction") ... # write lots of new values write(t, "commit") close(t) </pre> <p>write(t, "rollback") or just closing the filehandle without writing "commit" would cause the new values to be discarded. Until the commit, everything else sees the old values. No danger from crashing programs, just kill them and start a new transaction. There are issues about concurrent updates to multiple parts of /sys but that'll be true in any system that provides atomic updates for multiple values.</p> Sat, 14 Jan 2006 12:38:20 +0000 benefits of sysfs https://lwn.net/Articles/167683/ https://lwn.net/Articles/167683/ alex <em>"what's the benefit of 'cat /sys/foo' over 'linux-config --get foo'"</em> <p> Exactly that. cat is cat, it does what it says on the tin and is pretty stable and unlikly to break. Once you move away from text based keys then you have issues with is linux-config up to date with the kernel? Has the ABI changed? Is linking working so linux-config can find /lib/libconfig.so? <p> Now the debate as to if sysfs can <b>neatly</b> support atomic writes of groups is one to be had but I think a text based sysfs is very handy for the problem domain its aimed at. Sat, 14 Jan 2006 12:05:57 +0000 benefits of sysfs https://lwn.net/Articles/167595/ https://lwn.net/Articles/167595/ elanthis Given that netlink sockets and specialized tools are already needed and will continue to be needed for many parts of the kernel, what is the benefit of having sysfs at all? All subsystems and modules could simply use a "generic" configuration protocol over netlink and standard tools for querying and setting those values could be part of the Linux userspace utilities.<br> <p> Really, what's the benefit of 'cat /sys/foo' over 'linux-config --get foo' ? Is it because C code has an easier time reading a value from a file than from another program's output? That's also easily solvable with a really simple C library liblinuxconfig or somesuch.<br> <p> Using a special tool like linux-config could easily make atomic writes possible, assuming the actual netlink-based configuration protocol supports them, by simply allowing multiple keys to be set on the command line or piping some specially formatted lines to linux-config's stdin.<br> <p> A separate tool would also allow much better error reports than sysfs by allowing errors to be sent to stderr.<br> <p> Is sysfs really that great of an idea, or was it just another case of someone pushing something into the kernel without *really* thinking things through, a lot like how devfs is (now) recognized to be?<br> Fri, 13 Jan 2006 17:23:54 +0000 Using sysfs for configuring wireless networking https://lwn.net/Articles/167514/ https://lwn.net/Articles/167514/ neilbrown Configfs seems to be designed for initial configuration. <ol> <li>you create a directory under '/config/scratch' (or some similar name). It magically has a bunch of attribute files in it. <li>you fill values into those attribute files <li>you rename "/config/scratch/whatever" to "/config/active/whatever" (names might be wrong) and suddenly "whatever" becomes live. </ol> <p> This doesn't seem to allow for reconfiguration. e.g. I want to change these three attributes atomically. <p> It also means that all the attributes appear under configfs for initial configuration, and may well need to appear in sysfs as well for monitoring/maintenance if they might change after initialisation. This is untidy. <p> In short, configfs seems to draw an unnatural distinction between initial configuration and ongoing maintenance, whereas I believe these should be indistinguishable. <p> The idea of using "mkdir" to create a new object is a nice one. It is a shame it cannot (does not) live directly in sysfs. Fri, 13 Jan 2006 04:28:32 +0000 Using sysfs for configuring wireless networking https://lwn.net/Articles/167512/ https://lwn.net/Articles/167512/ gregkh <font class="QuotedText">&gt; Atomic, multi-parameter update is quite possible with sysfs.</font><br> <font class="QuotedText">&gt; You just need a "go" button.</font><br> <p> But it's much easier to do with configfs, which is why it was created :)<br> Fri, 13 Jan 2006 03:58:35 +0000 Using sysfs for configuring wireless networking https://lwn.net/Articles/167410/ https://lwn.net/Articles/167410/ nix If the size of that multi-value lump is bigger than a page, write() is not necessarily atomic either.<br> Thu, 12 Jan 2006 13:59:49 +0000 Using sysfs for configuring wireless networking https://lwn.net/Articles/167408/ https://lwn.net/Articles/167408/ bronson That's starting to sound fairly brutal, don't you think? The cure might be worse than the disease.<br> <p> I realize one of the key features of sysfs is that there's one value per file (try to avoid the mess that became /proc), but lack of atomic updates seems a rather fundamental limitation. What about writing multiple values to a write-only file?<br> <p> echo "essid=bug;key=gazpacho" &gt; /sys/class/net/eth1/config<br> <p> Escaping would be required, of course, but that's easily solved.<br> <p> I don't understand why a netlink socket would be an improvement... It requires parsing, like /proc, but is not user-configurable, like ioctls. It's the worst of both worlds!<br> <p> Thu, 12 Jan 2006 13:58:22 +0000 Using sysfs for configuring wireless networking https://lwn.net/Articles/167340/ https://lwn.net/Articles/167340/ neilbrown A fair point.<br> <p> As the new settings have not yet come into effect, there is no particular value in finding out what they are. But it would be useful to be able to revert any partial setting of these values.<br> <p> So that attribute where you write 'go' to effect the new values: Also allow 'reset' to be written which reverts all the stored-for-later-use values to the currently active values.<br> <p> Ofcourse this could be achived by simply reading each attribute and writing the value back again, but that it somewhat ugly.<br> <p> There is a thing called 'configfs' in -mm which is meant to be able to provide this multiple-values-at-once thing, but when I considerred using it for something, it turned out to be too special purpose. The same thing can be achieved in sysfs with a bit of creativity, and I think it fits better there.<br> <p> Thu, 12 Jan 2006 07:09:25 +0000 Using sysfs for configuring wireless networking https://lwn.net/Articles/167339/ https://lwn.net/Articles/167339/ akumria <p> Let's imagine that the program crashes in-between writing the new values and hitting the 'go' button.<br> <p> Wouldn't that mean that I would not be able to determine the current values of various settings?<br> <p> <p> Thu, 12 Jan 2006 07:00:35 +0000 Small typo https://lwn.net/Articles/167328/ https://lwn.net/Articles/167328/ jhs <blockquote> Wireless adapters have a large number of parameters, and it is often to change several of them simultaneously. </blockquote> <p> Looks like a "necessary" was omitted. </p> Thu, 12 Jan 2006 05:00:24 +0000 Using sysfs for configuring wireless networking https://lwn.net/Articles/167310/ https://lwn.net/Articles/167310/ neilbrown Atomic, multi-parameter update is quite possible with sysfs. You just need a "go" button.<br> <p> Define the semantics of "write" to you sysfs attributes to be "store this value somewhere safe for later use".<br> <p> Then have an attribute somewhere to which you can write "go".<br> This validates all those stored-for-later-use values and if they appear valid they all get update atomically.<br> <p> This would require some locking so you don't get two apps writing to all those attributes at once, but that is hardly rocket-science.<br> <p> <p> Thu, 12 Jan 2006 03:31:24 +0000