When an ad-hoc vap is just created it starts transmitting beacons with a tsf of 0. When another node is already present in the same ad-hoc network it will also transmit beacons with a higher tsf, causing the new ad-hoc vap to perform an ibss merge. After this merge the node doesn't transmit beacons anymore for quite a while (usually longer than 20 seconds).
The problem lies in the fact that the code that setups the new beacons uses the last received tsf value from the other beacon as the tsf value for the next beacon to be transmitted. The tsf value is too low (in the past) for that beacon, causing the hardware/HAL to become confused I think. The tsf value should be incremented until it has the correct value for the next beacon to be transmitted.
Unfortunately I don't know how exactly this tsf value should calculated. I've attached a patch that just adds 250ms, which seems to solve the problem but it is just a hack. I hope someone can figure out using the HAL what the real tsf value should be.
Signed-off-by: Tjalling Hattink <tjalling.hattink@ti-wmc.nl> Twente Institute of Wireless and Mobile Communications