@@ -4193,88 +4193,47 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
4193
4193
struct sk_buff * skb )
4194
4194
{
4195
4195
struct ieee80211_tx_info * info = IEEE80211_SKB_CB (skb );
4196
- struct ethhdr * ehdr = (struct ethhdr * )skb -> data ;
4197
4196
struct ieee80211_local * local = sdata -> local ;
4198
- bool authorized = false;
4199
- bool multicast ;
4200
- unsigned char * ra = ehdr -> h_dest ;
4201
4197
struct tid_ampdu_tx * tid_tx ;
4202
4198
u8 tid ;
4203
4199
4204
- if (IS_ERR (sta ) || (sta && !sta -> uploaded ))
4205
- sta = NULL ;
4206
-
4207
- if (sdata -> vif .type == NL80211_IFTYPE_STATION &&
4208
- (!sta || !test_sta_flag (sta , WLAN_STA_TDLS_PEER )))
4209
- ra = sdata -> u .mgd .bssid ;
4210
-
4211
- if (is_zero_ether_addr (ra ))
4212
- goto out_free ;
4213
-
4214
4200
if (local -> ops -> wake_tx_queue ) {
4215
4201
u16 queue = __ieee80211_select_queue (sdata , sta , skb );
4216
4202
skb_set_queue_mapping (skb , queue );
4217
4203
skb_get_hash (skb );
4218
4204
}
4219
4205
4220
- multicast = is_multicast_ether_addr (ra );
4221
-
4222
- if (sta )
4223
- authorized = test_sta_flag (sta , WLAN_STA_AUTHORIZED );
4224
-
4225
- if (!multicast && !authorized &&
4226
- (ehdr -> h_proto != sdata -> control_port_protocol ||
4227
- !ether_addr_equal (sdata -> vif .addr , ehdr -> h_source )))
4228
- goto out_free ;
4229
-
4230
- if (multicast && sdata -> vif .type == NL80211_IFTYPE_AP &&
4231
- !atomic_read (& sdata -> u .ap .num_mcast_sta ))
4232
- goto out_free ;
4233
-
4234
4206
if (unlikely (test_bit (SCAN_SW_SCANNING , & local -> scanning )) &&
4235
4207
test_bit (SDATA_STATE_OFFCHANNEL , & sdata -> state ))
4236
4208
goto out_free ;
4237
4209
4238
4210
memset (info , 0 , sizeof (* info ));
4239
4211
4240
- if (sta ) {
4241
- tid = skb -> priority & IEEE80211_QOS_CTL_TAG1D_MASK ;
4242
- tid_tx = rcu_dereference (sta -> ampdu_mlme .tid_tx [tid ]);
4243
- if (tid_tx ) {
4244
- if (!test_bit (HT_AGG_STATE_OPERATIONAL , & tid_tx -> state )) {
4245
- /* fall back to non-offload slow path */
4246
- __ieee80211_subif_start_xmit (skb , dev , 0 , 0 , NULL );
4247
- return ;
4248
- }
4249
-
4250
- info -> flags |= IEEE80211_TX_CTL_AMPDU ;
4251
- if (tid_tx -> timeout )
4252
- tid_tx -> last_tx = jiffies ;
4212
+ tid = skb -> priority & IEEE80211_QOS_CTL_TAG1D_MASK ;
4213
+ tid_tx = rcu_dereference (sta -> ampdu_mlme .tid_tx [tid ]);
4214
+ if (tid_tx ) {
4215
+ if (!test_bit (HT_AGG_STATE_OPERATIONAL , & tid_tx -> state )) {
4216
+ /* fall back to non-offload slow path */
4217
+ __ieee80211_subif_start_xmit (skb , dev , 0 , 0 , NULL );
4218
+ return ;
4253
4219
}
4220
+
4221
+ info -> flags |= IEEE80211_TX_CTL_AMPDU ;
4222
+ if (tid_tx -> timeout )
4223
+ tid_tx -> last_tx = jiffies ;
4254
4224
}
4255
4225
4256
- if (unlikely (! multicast && skb -> sk &&
4226
+ if (unlikely (skb -> sk &&
4257
4227
skb_shinfo (skb )-> tx_flags & SKBTX_WIFI_STATUS ))
4258
4228
info -> ack_frame_id = ieee80211_store_ack_skb (local , skb ,
4259
4229
& info -> flags , NULL );
4260
4230
4261
- if (unlikely (sdata -> control_port_protocol == ehdr -> h_proto )) {
4262
- if (sdata -> control_port_no_encrypt )
4263
- info -> flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT ;
4264
- info -> control .flags |= IEEE80211_TX_CTRL_PORT_CTRL_PROTO ;
4265
- }
4266
-
4267
- if (multicast )
4268
- info -> flags |= IEEE80211_TX_CTL_NO_ACK ;
4269
-
4270
4231
info -> hw_queue = sdata -> vif .hw_queue [skb_get_queue_mapping (skb )];
4271
4232
4272
4233
ieee80211_tx_stats (dev , skb -> len );
4273
4234
4274
- if (sta ) {
4275
- sta -> tx_stats .bytes [skb_get_queue_mapping (skb )] += skb -> len ;
4276
- sta -> tx_stats .packets [skb_get_queue_mapping (skb )]++ ;
4277
- }
4235
+ sta -> tx_stats .bytes [skb_get_queue_mapping (skb )] += skb -> len ;
4236
+ sta -> tx_stats .packets [skb_get_queue_mapping (skb )]++ ;
4278
4237
4279
4238
if (sdata -> vif .type == NL80211_IFTYPE_AP_VLAN )
4280
4239
sdata = container_of (sdata -> bss ,
@@ -4295,6 +4254,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8023(struct sk_buff *skb,
4295
4254
struct net_device * dev )
4296
4255
{
4297
4256
struct ieee80211_sub_if_data * sdata = IEEE80211_DEV_TO_SUB_IF (dev );
4257
+ struct ethhdr * ehdr = (struct ethhdr * )skb -> data ;
4298
4258
struct sta_info * sta ;
4299
4259
4300
4260
if (WARN_ON (!sdata -> hw_80211_encap )) {
@@ -4311,6 +4271,10 @@ netdev_tx_t ieee80211_subif_start_xmit_8023(struct sk_buff *skb,
4311
4271
4312
4272
if (ieee80211_lookup_ra_sta (sdata , skb , & sta ))
4313
4273
kfree_skb (skb );
4274
+ else if (unlikely (IS_ERR_OR_NULL (sta ) || !sta -> uploaded ||
4275
+ !test_sta_flag (sta , WLAN_STA_AUTHORIZED ) ||
4276
+ sdata -> control_port_protocol == ehdr -> h_proto ))
4277
+ ieee80211_subif_start_xmit (skb , dev );
4314
4278
else
4315
4279
ieee80211_8023_xmit (sdata , dev , sta , skb );
4316
4280
0 commit comments