summaryrefslogtreecommitdiff
path: root/sys/dev/microcode
diff options
context:
space:
mode:
authorozaki-r <ozaki-r@NetBSD.org>2014-12-15 06:52:25 +0000
committerozaki-r <ozaki-r@NetBSD.org>2014-12-15 06:52:25 +0000
commit664ac229fcbb51f80c7b08a202eb7fabe693c710 (patch)
tree372a042d0f216079109d6c8d6fe376507cb0f2b6 /sys/dev/microcode
parenta8821b5415ef133120866d62dc54edab5a119627 (diff)
Introduce if_initialize and if_register as an alternative to if_attach
if_attach initializes an ifnet object and registers it to the system (e.g., ifnet_list), however, if_attach doesn't complete the initialization and the rest of it will be done by if_alloc_sadl that is normally directly called by device drivers or called via functions like ether_ifattach. So there is a race between if_attach and if_alloc_sadl (A half-baked ifnet object may be accessed, for example, via ioctl between them). The aim of this fix is to register an initializing ifnet object after completing its initializations. To this end, this fix separates if_attach into an initialization part (if_initialize) and a registration part (if_register) and call the latter after if_alloc_sadl (ether_ifattach). So a typical usage of the two new APIs is like this: if_initialize(ifp); // was if_attach ether_ifattach(ifp, enaddr); if_register(ifp); Nonetheless, changing every drivers to do so at once isn't feasible. So we keep if_attach working as it used to be and will change only some drivers that we need at this point. Once we know the fix really works well, we'll change all the others. Some more information of the fix can be found here: http://mail-index.netbsd.org/tech-kern/2014/12/10/msg018242.html No objection on tech-kern and tech-net.
Diffstat (limited to 'sys/dev/microcode')
0 files changed, 0 insertions, 0 deletions