Hi,
nothing is really urgent, trust me. The sun will keep moving no matter how much urgent the thing is, so... relax and think. The need to find a solution is often the father of very bad choices.
Now, about your question. You didn't say what is the problem and why what you was trying "did not work".
My best guess is that it did work. It just didn't work as you was expecting.
The statement will work, it will load the MAC queue with packets. The problem may be that it will do it once, and it will not do it again.
Also, my best guess is that your "condition" is something related to the queue / channel status, and that you wanted to resume the MAC buffer filling when this condition reverts to false.
Let's say... you want to fill the queue up to the 80% of its size, and resume the generation once it is at 40% fill.
Let's also skip the part where I severely question the usefulness of such an idea. it's your idea and I'll not demolish it... for now.
Finally, let's avoid to point out that telling a bit more about the problem would have saved a lot of hypothesis. You may think that not telling everything may protect the idea, but it isn't for real.
Anyway, enough talking. How to do it. You need a backpressure system. Unfortunately NetDevices doesn't have such a thing.
Solution A: you schedule a periodic event (quite frequent) to check if the condition is changed. In case, resume the data generation.
Solution B: you hook a TraceSource (e.g., a Tx trace) and you check the condition when a packet has been dequeued and transmitted.
Solution C: you modify the wifi module and you add the backpressure you need.
Of course, this is true if all the hypothesis I did are true. But I'm quite confident that they are.
Cheers,
T.
PS: unless you're using a variable bit rate video codec (and also in that case it's not true), the source can not stop generating data according to a MAC level condition. No matter how hard you push, nine women can to deliver a baby in one month.
What can happen is that the Application level can use a buffer to smooth (or tune) the data forwarded to the MAC. However, the buffer is just moved from one place (the MAC) to another one (the App).
I.e., you need a far more complex application model.