From: Pedro R. <ram...@se...> - 2005-09-10 16:56:34
|
Jiri Benc wrote: > On Thu, 01 Sep 2005 19:16:05 +0100, Pedro Ramalhais wrote: > >>> Of >>>course you may sometimes want to force reassociation manually - and >>>there should be some call available for this. (Maybe setting BSSID while >>>the card is running should force reassociation?) >> >>That's the kind of hackish solution that brings confusion. We should >>separate things: wireless configuration and wireless association. This >>way you won't have to do those hackish approaches and special cases. >>What i mean is that if you want to associate, tell the card to do so, >>don't send -1 as the channel or send 0 as the essid_len, or resend the >>previously configured essid. > > > I probably didn't explain well what I thought, sorry. Imagine following > situation: we have an AP with BSSID1 and another one with BSSID2, both > in the same ESS. When you set just the ESSID, somebody (kernel or > daemon, I'm still not decided on this) tell the driver to associate to > one of the APs - e.g. to BSSID1. When conditions change, the driver is > told to reassociate (to BSSID2). And so on. When you manually set BSSID2 > (while we are associated to BSSID1), it surely means that the user wants > to reassociate to BSSID2 - there is nothing hackish in that. > > But you're right anyway. > > Hi! You did explain it well, however i'm not convinced that association should be automatically tried after you change configuration. I still think configuration should be independent of association, or at least be optional (ex: iwconfig iface0 essid NEWESSID associate manual VS iwconfig iface0 essid NEWESSID auto). If you make association automatic upon configuration, it will bypass userspace daemons that might be controling wireless profiles/association. I missed the case where one needs to revert some of the settings to the default, which makes my point about the -1,0 values being default settings a bit useless. However i still think it's a good idea to make the configuration/association work like the commit command in wireless extensions/tools, and enforce it in the kernel interface. I also just remembered one case where you might not want to associate immediately after configuration, but apply the configuration in the card: setting the essid so that you can scan,receive and detect the beacons from an AP with hidden SSID. To summarize it all, it looks to me that the steps for wireless configuration should be something like: 1 - Load the driver. 2 - Load the firmware when we are sure that hotplug is running and can read the firmware from the filesystem (not sure if this is doable, maybe make the driver retry from time to time, ocasionally output a warning message saying it couldn't load the firmware, and only create the network interface after the firmware is loaded successfuly). 3 - Bring the interface UP (IFF_UP). 4 - Configure it (ESSID, Channel, etc...). 5 - Commit the configuration to the driver/card (don't make it associate). 6 - Tell the card to associate, selecting manual or automatic (similar to roaming?). 7 - At this step, if association is successful the interface would be IFF_RUNNING, so, link would be detected by userspace apps. 8 - Start DHCP (and possibly wpa_supplicant). Steps 4, 5 and 6 could probably be optionally issued at the same time in one command to prevent users from having to type multiple commands. Step 8 still has the problem of DHCP being started at the same time as wpa_supplicant. DHCP has no way of knowing that wpa_supplicant has established authentication. This problem probably already exists with wired 802.1X authentication. Maybe there should be some interaction beteween userspace daemons that handle authentication (802.1X, WPA, etc...) and the kernel, so that they instruct the kernel that authentication was successful and some flag could be set on the interface that the interface is ready for communication, OR make the daemons that need to know if the interface is ready for communication get that information from the auth daemons. I hope this makes sense, it's just the way i see it. I'd like to know about other opinions. Thanks! -- Pedro Ramalhais |