summaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2010-11-08 04:51:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-11-16 16:37:04 -0500
commitf23a478075659db8a4fd62fa6e264a8bb052cc5b (patch)
treeba1492a4a781770644359b88e8ca2d8d3a00adc2 /net/mac80211/tx.c
parentca4a0831917d6541b45f03542257fcb20dc9cf4a (diff)
mac80211: support hardware TX fragmentation offload
The lower driver is notified when the fragmentation threshold changes and upon a reconfig of the interface. If the driver supports hardware TX fragmentation, don't fragment packets in the stack. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/tx.c')
-rw-r--r--net/mac80211/tx.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 96c594309506..b392876af7d8 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1033,6 +1033,7 @@ static bool __ieee80211_parse_tx_radiotap(struct ieee80211_tx_data *tx,
1033 struct ieee80211_radiotap_header *rthdr = 1033 struct ieee80211_radiotap_header *rthdr =
1034 (struct ieee80211_radiotap_header *) skb->data; 1034 (struct ieee80211_radiotap_header *) skb->data;
1035 struct ieee80211_supported_band *sband; 1035 struct ieee80211_supported_band *sband;
1036 bool hw_frag;
1036 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1037 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1037 int ret = ieee80211_radiotap_iterator_init(&iterator, rthdr, skb->len, 1038 int ret = ieee80211_radiotap_iterator_init(&iterator, rthdr, skb->len,
1038 NULL); 1039 NULL);
@@ -1042,6 +1043,9 @@ static bool __ieee80211_parse_tx_radiotap(struct ieee80211_tx_data *tx,
1042 info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT; 1043 info->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
1043 tx->flags &= ~IEEE80211_TX_FRAGMENTED; 1044 tx->flags &= ~IEEE80211_TX_FRAGMENTED;
1044 1045
1046 /* packet is fragmented in HW if we have a non-NULL driver callback */
1047 hw_frag = (tx->local->ops->set_frag_threshold != NULL);
1048
1045 /* 1049 /*
1046 * for every radiotap entry that is present 1050 * for every radiotap entry that is present
1047 * (ieee80211_radiotap_iterator_next returns -ENOENT when no more 1051 * (ieee80211_radiotap_iterator_next returns -ENOENT when no more
@@ -1078,7 +1082,8 @@ static bool __ieee80211_parse_tx_radiotap(struct ieee80211_tx_data *tx,
1078 } 1082 }
1079 if (*iterator.this_arg & IEEE80211_RADIOTAP_F_WEP) 1083 if (*iterator.this_arg & IEEE80211_RADIOTAP_F_WEP)
1080 info->flags &= ~IEEE80211_TX_INTFL_DONT_ENCRYPT; 1084 info->flags &= ~IEEE80211_TX_INTFL_DONT_ENCRYPT;
1081 if (*iterator.this_arg & IEEE80211_RADIOTAP_F_FRAG) 1085 if ((*iterator.this_arg & IEEE80211_RADIOTAP_F_FRAG) &&
1086 !hw_frag)
1082 tx->flags |= IEEE80211_TX_FRAGMENTED; 1087 tx->flags |= IEEE80211_TX_FRAGMENTED;
1083 break; 1088 break;
1084 1089
@@ -1181,8 +1186,10 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
1181 /* 1186 /*
1182 * Set this flag (used below to indicate "automatic fragmentation"), 1187 * Set this flag (used below to indicate "automatic fragmentation"),
1183 * it will be cleared/left by radiotap as desired. 1188 * it will be cleared/left by radiotap as desired.
1189 * Only valid when fragmentation is done by the stack.
1184 */ 1190 */
1185 tx->flags |= IEEE80211_TX_FRAGMENTED; 1191 if (!local->ops->set_frag_threshold)
1192 tx->flags |= IEEE80211_TX_FRAGMENTED;
1186 1193
1187 /* process and remove the injection radiotap header */ 1194 /* process and remove the injection radiotap header */
1188 if (unlikely(info->flags & IEEE80211_TX_INTFL_HAS_RADIOTAP)) { 1195 if (unlikely(info->flags & IEEE80211_TX_INTFL_HAS_RADIOTAP)) {