Ticket 1388:
When a user explicitly changes the channel on an access point VAP, the behavior is currently to record the desired channel, which would ONLY take effect on bringing down the interface and bringing it back up.
Oddly enough, the only path through this code for master mode VAPs looks at the roaming mode and determines whether it is set to auto. If so, it puts us into 'scan' mode which causes channel change to occur (in the case of station, it will no scan if a channel change is pending and will jus switch).
The correct behavior should be as follows:
If interface is down, set desired channel and do no further action. If interface is running and up, use the channel change IE on beacon to update the channel. If interface is running and not up we set the channel directly.
The current behavior of not changing channels has two unpleasant side effects:
1. Because the channel change has not taken effect, the txpower list is not updated and invalid power levels are seen and entered in startup scripts. Setting channel + power will often fail if the old channel had a lower power level restriction.
2. Because the channel change does not take effect until an explicit restart, assigning the channel after bringing up an interface in a ifup type script would fail.
3. You should not have to use iwpriv doth_chanswitch in order to change the channel of an AP explicitly.
4. You should be able to change channels on an AP without dropping associations.