Subject: locking out device attach/detach?
To: None <>
From: Iain Hibbert <>
List: tech-kern
Date: 12/05/2005 22:06:10
   How should I lock out device attach/detach routines while for example
walking a device list that I've added to in said routines in order to
protect against the list being modified while I use it? (only short scans)

   looking at the master ifnet list in net/if.c for instance:

	ifunit() uses TAILQ_FIRST/TAILQ_NEXT with no protection (?)

	if_attach() uses TAILQ_INSERT_LAST with no protection

	if_detach() uses TAILQ_REMOVE inside splnet()

when device attach/detach functions are called, how are they triggered and
at what priority is the call? (is pcmcia different to usb?)

I'm not using the ifnet code any more (I think bluetooth device is not
exactly an interface), but am doing much the same thing with another list