sta_info.c (c316cf670491def52a396d3bdc5a63ad01f7fefa) sta_info.c (484a54c2e597dbc4ace79c1687022282905afba0)
1/*
2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
4 * Copyright 2013-2014 Intel Mobile Communications GmbH
5 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 6 unchanged lines hidden (view full) ---

15#include <linux/netdevice.h>
16#include <linux/types.h>
17#include <linux/slab.h>
18#include <linux/skbuff.h>
19#include <linux/if_arp.h>
20#include <linux/timer.h>
21#include <linux/rtnetlink.h>
22
1/*
2 * Copyright 2002-2005, Instant802 Networks, Inc.
3 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
4 * Copyright 2013-2014 Intel Mobile Communications GmbH
5 * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 6 unchanged lines hidden (view full) ---

15#include <linux/netdevice.h>
16#include <linux/types.h>
17#include <linux/slab.h>
18#include <linux/skbuff.h>
19#include <linux/if_arp.h>
20#include <linux/timer.h>
21#include <linux/rtnetlink.h>
22
23#include <net/codel.h>
23#include <net/mac80211.h>
24#include "ieee80211_i.h"
25#include "driver-ops.h"
26#include "rate.h"
27#include "sta_info.h"
28#include "debugfs_sta.h"
29#include "mesh.h"
30#include "wme.h"

--- 389 unchanged lines hidden (view full) ---

420 break;
421 default:
422 WARN_ON(1);
423 }
424 }
425
426 sta->sta.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA;
427
24#include <net/mac80211.h>
25#include "ieee80211_i.h"
26#include "driver-ops.h"
27#include "rate.h"
28#include "sta_info.h"
29#include "debugfs_sta.h"
30#include "mesh.h"
31#include "wme.h"

--- 389 unchanged lines hidden (view full) ---

421 break;
422 default:
423 WARN_ON(1);
424 }
425 }
426
427 sta->sta.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA;
428
429 sta->cparams.ce_threshold = CODEL_DISABLED_THRESHOLD;
430 sta->cparams.target = MS2TIME(20);
431 sta->cparams.interval = MS2TIME(100);
432 sta->cparams.ecn = true;
433
428 sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr);
429
430 return sta;
431
432free_txq:
433 if (sta->sta.txq[0])
434 kfree(to_txq_info(sta->sta.txq[0]));
435free:

--- 1869 unchanged lines hidden (view full) ---

2305unsigned long ieee80211_sta_last_active(struct sta_info *sta)
2306{
2307 struct ieee80211_sta_rx_stats *stats = sta_get_last_rx_stats(sta);
2308
2309 if (time_after(stats->last_rx, sta->status_stats.last_ack))
2310 return stats->last_rx;
2311 return sta->status_stats.last_ack;
2312}
434 sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr);
435
436 return sta;
437
438free_txq:
439 if (sta->sta.txq[0])
440 kfree(to_txq_info(sta->sta.txq[0]));
441free:

--- 1869 unchanged lines hidden (view full) ---

2311unsigned long ieee80211_sta_last_active(struct sta_info *sta)
2312{
2313 struct ieee80211_sta_rx_stats *stats = sta_get_last_rx_stats(sta);
2314
2315 if (time_after(stats->last_rx, sta->status_stats.last_ack))
2316 return stats->last_rx;
2317 return sta->status_stats.last_ack;
2318}
2319
2320static void sta_update_codel_params(struct sta_info *sta, u32 thr)
2321{
2322 if (!sta->sdata->local->ops->wake_tx_queue)
2323 return;
2324
2325 if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) {
2326 sta->cparams.target = MS2TIME(50);
2327 sta->cparams.interval = MS2TIME(300);
2328 sta->cparams.ecn = false;
2329 } else {
2330 sta->cparams.target = MS2TIME(20);
2331 sta->cparams.interval = MS2TIME(100);
2332 sta->cparams.ecn = true;
2333 }
2334}
2335
2336void ieee80211_sta_set_expected_throughput(struct ieee80211_sta *pubsta,
2337 u32 thr)
2338{
2339 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
2340
2341 sta_update_codel_params(sta, thr);
2342}