@@ -898,7 +898,10 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
898898 int hdrlen ;
899899 int fragnum ;
900900
901- if (!(tx -> flags & IEEE80211_TX_FRAGMENTED ))
901+ if (info -> flags & IEEE80211_TX_CTL_DONTFRAG )
902+ return TX_CONTINUE ;
903+
904+ if (tx -> local -> ops -> set_frag_threshold )
902905 return TX_CONTINUE ;
903906
904907 /*
@@ -911,7 +914,7 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
911914
912915 hdrlen = ieee80211_hdrlen (hdr -> frame_control );
913916
914- /* internal error, why is TX_FRAGMENTED set? */
917+ /* internal error, why isn't DONTFRAG set? */
915918 if (WARN_ON (skb -> len + FCS_LEN <= frag_threshold ))
916919 return TX_DROP ;
917920
@@ -1050,17 +1053,13 @@ static bool __ieee80211_parse_tx_radiotap(struct ieee80211_tx_data *tx,
10501053 struct ieee80211_radiotap_iterator iterator ;
10511054 struct ieee80211_radiotap_header * rthdr =
10521055 (struct ieee80211_radiotap_header * ) skb -> data ;
1053- bool hw_frag ;
10541056 struct ieee80211_tx_info * info = IEEE80211_SKB_CB (skb );
10551057 int ret = ieee80211_radiotap_iterator_init (& iterator , rthdr , skb -> len ,
10561058 NULL );
10571059 u16 txflags ;
10581060
1059- info -> flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT ;
1060- tx -> flags &= ~IEEE80211_TX_FRAGMENTED ;
1061-
1062- /* packet is fragmented in HW if we have a non-NULL driver callback */
1063- hw_frag = (tx -> local -> ops -> set_frag_threshold != NULL );
1061+ info -> flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT |
1062+ IEEE80211_TX_CTL_DONTFRAG ;
10641063
10651064 /*
10661065 * for every radiotap entry that is present
@@ -1098,9 +1097,8 @@ static bool __ieee80211_parse_tx_radiotap(struct ieee80211_tx_data *tx,
10981097 }
10991098 if (* iterator .this_arg & IEEE80211_RADIOTAP_F_WEP )
11001099 info -> flags &= ~IEEE80211_TX_INTFL_DONT_ENCRYPT ;
1101- if ((* iterator .this_arg & IEEE80211_RADIOTAP_F_FRAG ) &&
1102- !hw_frag )
1103- tx -> flags |= IEEE80211_TX_FRAGMENTED ;
1100+ if (* iterator .this_arg & IEEE80211_RADIOTAP_F_FRAG )
1101+ info -> flags &= ~IEEE80211_TX_CTL_DONTFRAG ;
11041102 break ;
11051103
11061104 case IEEE80211_RADIOTAP_TX_FLAGS :
@@ -1206,13 +1204,6 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
12061204 tx -> local = local ;
12071205 tx -> sdata = sdata ;
12081206 tx -> channel = local -> hw .conf .channel ;
1209- /*
1210- * Set this flag (used below to indicate "automatic fragmentation"),
1211- * it will be cleared/left by radiotap as desired.
1212- * Only valid when fragmentation is done by the stack.
1213- */
1214- if (!local -> ops -> set_frag_threshold )
1215- tx -> flags |= IEEE80211_TX_FRAGMENTED ;
12161207
12171208 /* process and remove the injection radiotap header */
12181209 if (unlikely (info -> flags & IEEE80211_TX_INTFL_HAS_RADIOTAP )) {
@@ -1281,13 +1272,11 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
12811272 */
12821273 }
12831274
1284- if (tx -> flags & IEEE80211_TX_FRAGMENTED ) {
1285- if ((tx -> flags & IEEE80211_TX_UNICAST ) &&
1286- skb -> len + FCS_LEN > local -> hw .wiphy -> frag_threshold &&
1287- !(info -> flags & IEEE80211_TX_CTL_AMPDU ))
1288- tx -> flags |= IEEE80211_TX_FRAGMENTED ;
1289- else
1290- tx -> flags &= ~IEEE80211_TX_FRAGMENTED ;
1275+ if (!(info -> flags & IEEE80211_TX_CTL_DONTFRAG )) {
1276+ if (!(tx -> flags & IEEE80211_TX_UNICAST ) ||
1277+ skb -> len + FCS_LEN <= local -> hw .wiphy -> frag_threshold ||
1278+ info -> flags & IEEE80211_TX_CTL_AMPDU )
1279+ info -> flags |= IEEE80211_TX_CTL_DONTFRAG ;
12911280 }
12921281
12931282 if (!tx -> sta )
0 commit comments