I'm fine with this. The main odd-ball here is iwm(4) that requires interrupts to be up before the NIC is initialised (firmware), and it will do firmware loading and commands before you can get the MAC which is required for attach.
Flesh it out a bit more with iwm(4) and I'll take a look at the results. :) Thanks! -adrian On 8 September 2015 at 08:22, Gleb Smirnoff <gleb...@freebsd.org> wrote: > Hi! > > It looks like another sweep over net80211 drivers is required. It isn't > going to be as huge as previous one. > > The problem is that in the "new world order", there will be only if_attach(), > instead of if_alloc() / fill & hack / ether_ifattach. What right now happens > with net80211 is that all drivers have the same copy & paste in their > ic_vap_create, which yields in a sequence of: > > - if_alloc > - driver specific code > - ether_ifattach > > Which isn't possible to collapse into if_attach(), since driver code is > in the middle. > > Another problem is embedding if ieee80211_vap into driver's softc. This > is a bad habit, which was proved by ifnet experience (fixed decade ago). > > What patch does: > > - Inline ieee80211_vap_setup() and ieee80211_vap_attach() into > wlan_clone_create(). > Note, that this moves code from ieee80211.c to into ieee80211_freebsd.c, > which is good, since this code about interaction with ifnet layer, which > is FreeBSD specific and will be more FreeBSD specific. > As dependency ifmedia support code and ieee80211_get_counter() also > naturally > move to the same file. > > - In the new long wlan_clone_create(), after initial error checking call > ic_vap_preattach() to allow driver do its own error checking. I predict > that for now ath(4) will be the only driver to use ic_vap_preattach(). > > - If no errors, go with allocating and attaching the interface, and then > call ic_vap_postattach. > > - The ic_vap_postattach() for all drivers (save ath) would be remnants > of ic_vap_create(), where all copy and paste is removed and only driver > specific bits remain. > > - ic_vap_postattach() may allocate driver specific softc for vap, which > now longer has ieee80211_vap embedded. > > This also removes all ambiguities with mac address handling, which was > juggled between three functions before. > > The current patch covers iwn(4) only. Now sending this mail with patched > driver. Changing MAC aldo tested - works. > > I'm starting to convert rest of drivers and meanwhile, waiting for your > input. May be you have ideas what else can be improved here. > > -- > Totus tuus, Glebius. _______________________________________________ freebsd-net@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"