提交 ad5351db 编写于 作者: J Johannes Berg 提交者: John W. Linville

mac80211: allow DMA optimisation

If we have a lot of frames to transmit at once, for
instance with fragmentation, it can be an optimisation
to only tell the DMA engine about them on the last
fragment/frame to avoid banging the IO too much. This
patch allows implementation such an optimisation by
telling the driver when more frames can be expected.

Currently, this is used by mac80211 only on fragmented
frames, but could also be used in the future on other
frames when the queue was full and there are multiple
frames pending.

Note that drivers need to be careful when using this
flag, they need to kick their DMA engines not just
when this flag is clear, but also when the queue gets
full so that progress can be made.
Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 ab5b5342
...@@ -268,6 +268,10 @@ struct ieee80211_bss_conf { ...@@ -268,6 +268,10 @@ struct ieee80211_bss_conf {
* @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?) * @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?)
* This frame is a response to a PS-poll frame and should be sent * This frame is a response to a PS-poll frame and should be sent
* although the station is in powersave mode. * although the station is in powersave mode.
* @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the
* transmit function after the current frame, this can be used
* by drivers to kick the DMA queue only if unset or when the
* queue gets full.
*/ */
enum mac80211_tx_control_flags { enum mac80211_tx_control_flags {
IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
...@@ -288,6 +292,7 @@ enum mac80211_tx_control_flags { ...@@ -288,6 +292,7 @@ enum mac80211_tx_control_flags {
IEEE80211_TX_INTFL_RETRIED = BIT(15), IEEE80211_TX_INTFL_RETRIED = BIT(15),
IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17),
IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
}; };
/** /**
......
...@@ -1154,6 +1154,9 @@ static int __ieee80211_tx(struct ieee80211_local *local, ...@@ -1154,6 +1154,9 @@ static int __ieee80211_tx(struct ieee80211_local *local,
next = skb->next; next = skb->next;
len = skb->len; len = skb->len;
if (next)
info->flags |= IEEE80211_TX_CTL_MORE_FRAMES;
sdata = vif_to_sdata(info->control.vif); sdata = vif_to_sdata(info->control.vif);
switch (sdata->vif.type) { switch (sdata->vif.type) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册