Created attachment 3171 [details] wireless-prep.patch etcnet-0.9.7-alt0.M41.1 wireless-tools-29-alt2 On iwl3945, setting the mode can't be done when the interface is up: # iwconfig wlan0 mode ad-hoc Error for wireless request "Set Mode" (8B06) : SET failed on device wlan0 ; Device or resource busy. # But /etc/net/ifaces/*/iwconfig is called when the interface is already up. So I needed to add the processing of new /etc/net/ifaces/*/iwconfig_prep files before the iface is brought up in order to have iface profiles which switch the modes. The patch and the example are attached.
Created attachment 3172 [details] wireless-prep-example.tar Doing the actual setting of the mode at the preparation stage. Before the iface is UP! Doing it with the same value once again when it is UP doesn't harm. (And even has a benefit: it is a check that the mode has actually been set; if the used etcnet code doesn't support this "extension" (the "_prep" files), it will fail on processing the "iwconfig" and report an error.) I have modified the code for this feature (in another commit).
Another solution would be probably to write an explicit call to "iwconfig ..." in wlan0/ifup-pre. I have not tried this approach. If there are many actions of iwconfig that should be done "before", then probably it makes sense to have this extension for processing special "iwconfig_prep" files, and describing it in the documentation, so that people will write a working configuration straight on after getting acquainted with etcnet.
And, I forgot to tell: I couldn't move the whole processing of iwconfig to an earlier stage, because the situation with essid is exactly the opposite: it *can't* be set before the iface is up: # modprobe -r iwl3945 # modprobe iwl3945 # ifdown wlan0 # iwconfig wlan0 mode ad-hoc # iwconfig wlan0 essid test2 Error for wireless request "Set ESSID" (8B1A) : SET failed on device wlan0 ; Input/output error. # So, I needed the two parts of iwconfig options.
https://bugzilla.altlinux.org/show_bug.cgi?id=15588 is about the same problem, but perhaps with a somewhat different solution. *** This bug has been marked as a duplicate of bug 15588 ***
Does this hack/solution without wlanconfig (unlike https://bugzilla.altlinux.org/show_bug.cgi?id=15588 ) represent something worth including into the package? For example, I use it on Desktop 4.1.1RC 2008/11/15 system without any wlanconfig, with the iwl3??? driver.
(In reply to comment #2) > Another solution would be probably to write an explicit call to "iwconfig ..." > in wlan0/ifup-pre. I have not tried this approach. ifup-pre is the right tool for special cases like this. > If there are many actions of iwconfig that should be done "before", then > probably it makes sense to have this extension for processing special > "iwconfig_prep" files, and describing it in the documentation, so that people > will write a working configuration straight on after getting acquainted with > etcnet. I don't want to make a decision right now about pushing (or not) this multi-stage approach, because it's not clear, how many real application is there for iwconfig_prep. I know about this case only by far, but I assume, that there can be more. That said, I suggest doing the job with ifup-pre for now.
В 4.1/branch исправления не будут вноситься уже технически (заглушена очередь на сборку), поэтому прошу ошибки, актуальные для sisyphus/p7/t7, перевесить на текущие ветки или сизиф.