summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
Commit message (Collapse)AuthorAgeFilesLines
* wifi: mt76: mt76x02: fix return value check in mt76x02_mac_process_rxYuanjun Gong2023-07-311-1/+2
| | | | | | | | in mt76x02_mac_process_rx(), return an error code if an unexpected result is returned by pskb_trim. Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* wifi: mt76: add missing locking to protect against concurrent rx/status callsFelix Fietkau2023-04-171-1/+4
| | | | | | | | | | According to the documentation, ieee80211_rx_list must not run concurrently with ieee80211_tx_status (or its variants). Cc: stable@vger.kernel.org Fixes: 88046b2c9f6d ("mt76: add support for reporting tx status with skb") Reported-by: Brian Coverstone <brian@mainsequence.net> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* wifi: mt76: move aggr_stats array in mt76_phyLorenzo Bianconi2022-12-011-3/+3
| | | | | | | | Move aggregation stats array per-phy instead of share it between multiple interfaces. This is a preliminary patch to add mt7996 driver support. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* wifi: mac80211: make smps_mode per-linkBenjamin Berg2022-09-061-1/+1
| | | | | | | | The SMPS power save mode needs to be per-link rather than being shared for all links. As such, move it into struct ieee80211_link_sta. Signed-off-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mt76: mt76x02: improve reliability of the beacon hang checkFelix Fietkau2022-07-111-3/+8
| | | | | | | | Increment the counter only when writing beacons to the hardware in order to avoid triggering restarts if beacons are disabled. Additionally, avoid resetting the MAC if stopping it failed Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mac80211: prepare sta handling for MLO supportSriram R2022-04-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently in mac80211 each STA object is represented using sta_info datastructure with the associated STA specific information and drivers access ieee80211_sta part of it. With MLO (Multi Link Operation) support being added in 802.11be standard, though the association is logically with a single Multi Link capable STA, at the physical level communication can happen via different advertised links (uniquely identified by Channel, operating class, BSSID) and hence the need to handle multiple link STA parameters within a composite sta_info object called the MLD STA. The different link STA part of MLD STA are identified using the link address which can be same or different as the MLD STA address and unique link id based on the link vif. To support extension of such a model, the sta_info datastructure is modified to hold multiple link STA objects with link specific params currently within sta_info moved to this new structure. Similarly this is done for ieee80211_sta as well which will be accessed within mac80211 as well as by drivers, hence trivial driver changes are expected to support this. For current non MLO supported drivers, only one link STA is present and link information is accessed via 'deflink' member. For MLO drivers, we still need to define the APIs etc. to get the correct link ID and access the correct part of the station info. Currently in mac80211, all link STA info are accessed directly via deflink. These will be updated to access via link pointers indexed by link id with MLO support patches, with link id being 0 for non MLO supported cases. Except for couple of macro related changes, below spatch takes care of updating mac80211 and driver code to access to the link STA info via deflink. @ieee80211_sta@ struct ieee80211_sta *s; struct sta_info *si; identifier var = {supp_rates, ht_cap, vht_cap, he_cap, he_6ghz_capa, eht_cap, rx_nss, bandwidth, txpwr}; @@ ( s-> - var + deflink.var | si->sta. - var + deflink.var ) @sta_info@ struct sta_info *si; identifier var = {gtk, pcpu_rx_stats, rx_stats, rx_stats_avg, status_stats, tx_stats, cur_max_bandwidth}; @@ ( si-> - var + deflink.var ) Signed-off-by: Sriram R <quic_srirrama@quicinc.com> Link: https://lore.kernel.org/r/1649086883-13246-1-git-send-email-quic_srirrama@quicinc.com [remove MLO-drivers notes from commit message, not clear yet; run spatch] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mt76: improve signal strength reportingFelix Fietkau2022-02-241-2/+0
| | | | | | | | | Instead of just taking the maximum per-chain signal strength values, add an approximation for the sum of the combined signal. This should more accurately reflect the real signal strength, especially if the per-chain signal strength values are close to each other Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x02: improve mac error check/reset reliabilityFelix Fietkau2022-02-031-6/+19
| | | | | | | On AP mode devices, check beacon tx counters to detect MAC errors. When an error is detected, stop the MAC before resetting it Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: remove mt76_wcid pointer from mt76_tx_status_check signatureLorenzo Bianconi2021-10-201-1/+1
| | | | | | | | | Remove mt76_wcid pointer from mt76_tx_status_check signature since it is always set to NULL Tested-by: mrkiko.rs@gmail.com Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: fix endianness warnings in mt76x02_mac.cLorenzo Bianconi2021-10-201-6/+7
| | | | | | | | | | | | | | | | Fix the following sparse warning in mt76x02_mac_write_txwi and mt76x02_mac_tx_rate_val routines: drivers/net/wireless/mediatek/mt76/mt76x02_mac.c:237:19: warning: restricted __le16 degrades to intege warning: cast from restricted __le16 drivers/net/wireless/mediatek/mt76/mt76x02_mac.c:383:28: warning: incorrect type in assignment (different base types) expected restricted __le16 [usertype] rate got unsigned long Fixes: db9f11d3433f7 ("mt76: store wcid tx rate info in one u32 reduce locking") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: fix iv and CCMP header insertionRyder Lee2021-06-191-14/+14
| | | | | | | | | | The iv from RXD is only for TKIP_RSC/CCMP_PN/GCMP_PN, and it needs a check for CCMP header insertion. Move mt76_cipher_type to mt76.h to reduce duplicated code. Signed-off-by: Xing Song <xing.song@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: make mt76_update_survey() per phyRyder Lee2021-06-191-4/+4
| | | | | | | Reduce duplicated survey for DBDC. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: add support for 802.3 rx framesFelix Fietkau2021-04-111-1/+3
| | | | | | Do not try to access the header when receiving them Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move chainmask in mt76_phyLorenzo Bianconi2021-01-261-3/+3
| | | | | | | | | | | Move chainmask from driver phy to mt76_phy since it is used by all drivers. This is a preliminary patch to create a common mcu library used by mt7615 and mt7921 drivers Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mac_work in mt76_core moduleLorenzo Bianconi2021-01-261-2/+2
| | | | | | | | | | | Move mac_work delayed_work and mac_work_count in mt76_phy since it is used by all drivers. This is a preliminary patch to create a common mcu library used by mt7615 and mt7921 drivers Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move hw mac_addr in mt76_phyLorenzo Bianconi2020-12-041-8/+8
| | | | | | | This is a preliminary patch to properly support mt7915 dbdc Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: Use fallthrough pseudo-keywordGustavo A. R. Silva2020-09-241-3/+3
| | | | | | | | | | | Replace the existing /* fall through */ comments and its variants with the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary fall-through markings when it is the case. [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: rely on AQL for burst size limits on tx queueingFelix Fietkau2020-09-241-1/+1
| | | | | | | | | | | | Now that AQL works well on all mt76 drivers, completely replace the arbitrary burst sizing and number of bursts logic for tx scheduling. For the short period of time in which AQL does not work well yet, limit each stations to 16 in-flight packets that have no estimated tx time. This should avoid filling the queue if a station connects and queues up a large number of packets before rate control information is available, especially with hardware rate control Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: remove qid argument to drv->tx_complete_skbFelix Fietkau2020-09-241-2/+1
| | | | | | It is not needed Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76_check_agg_ssn to driver tx_prepare callsFelix Fietkau2020-09-241-0/+2
| | | | | | | mt7615 and newer drivers do not need this, since they use sequence number offload Moving this code also reduces the number of callsites to make it easier to review Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: fix per-driver wcid range checks after wcid array size bumpFelix Fietkau2020-05-281-1/+1
| | | | | | | | | All drivers before MT7915 have a limit of 128 WCID entries. Stop relying on ARRAY_SIZE(dev->mt76.wcid), since it no longer reflects that limit. Fixes: 49e649c3e0a6 ("mt76: adjust wcid size to support new 802.11ax generation") Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: fix A-MPDU density handlingFelix Fietkau2020-05-121-2/+5
| | | | | | | | | | The hardware requirements for A-MPDU density are entirely on the tx side, not the rx side. Because of that, the IE value should stay at 0 and the minimum value should instead be enforced in WTBL/TXWI MT7615 has no restrictions here Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: rely on mac80211 utility routines to compute airtimeLorenzo Bianconi2020-02-141-1/+1
| | | | | | | | | Rely on mac80211 airitme utility routines and remove mt76 duplicated code to estimate tx/rx airtime Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Acked-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mac_txdone tracepoint in mt76 moduleLorenzo Bianconi2020-02-141-1/+2
| | | | | | | | Move mac_txdone tracepoint in common code in order to be reused by mt7603 and mt7615 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: split beaconingMarkus Theil2020-02-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | Sending beacons to the hardware always happens in batches. In order to speed up beacon processing on usb devices, this patch splits out common code an calls it only once. Beacons are sequentially written into the beacon memory area, by tracking its usage with the dev->beacon_data_count. For MBSS support and buffered traffic dev->beacon_data_count is used to create the bypass mask. The code is also adapted for the mmio part of the driver, but should not have any performance implication there. MBSS tests were performed with AVM AC860 USB NIC with temporary support for 5 BSS'. Different combinations of active vifs were created and brought up. Afterwards connection and data transfer was tested for the announced BSS'. Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move ampdu_ref from mt76_dev to driver structFelix Fietkau2020-02-141-3/+3
| | | | | | It is only used by the driver Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move txpower_conf back to driver specific structsFelix Fietkau2020-02-141-1/+1
| | | | | | Nothing in the core uses it Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move chainmask back to driver specific structsFelix Fietkau2020-02-141-3/+3
| | | | | | Nothing in the core uses it Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move state from struct mt76_dev to mt76_phyFelix Fietkau2020-02-141-2/+2
| | | | | | Allows keeping per-wiphy state separate Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move channel state to struct mt76_phyFelix Fietkau2020-02-141-9/+9
| | | | | | | | Add support for an extra wiphy in mt76_set_channel and mt76_get_survey This is preparation for supporting multiple wiphys per device to support the concurrent dual-band feature of MT7615D Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: refactor cc_lock locking schemeLorenzo Bianconi2019-11-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Read busy counters not holding cc_lock spinlock since usb read can't be performed in interrupt context. Move cc_active and cc_rx counters out of cc_lock since they are not modified in interrupt context. Grab cc_lock updating cur_cc_bss_rx in mt76_airtime_report and do not hold rx_lock in mt76_update_survey. Moreover grab mt76 mutex in mt76_get_survey before running mt76_update_survey. This patch fixes the following 'schedule while atomic' [ 291.790866] BUG: scheduling while atomic: iw/2161/0x00000202 [ 291.791002] Preemption disabled at: [ 291.791007] [<0000000000000000>] 0x0 [ 291.791015] CPU: 0 PID: 2161 Comm: iw Tainted: G W 5.4.= 0-rc2-3-ARCH-00104-g9e208aa06c21 #1 [ 291.791017] Hardware name: LENOVO 2349QM6/2349QM6, BIOS G1ETC2WW (2.82=) 08/07/2019 [ 291.791019] Call Trace: [ 291.791042] dump_stack+0x5c/0x80 [ 291.791049] __schedule_bug.cold+0x8e/0x9b [ 291.791055] __schedule+0x5f8/0x770 [ 291.791062] schedule+0x43/0xd0 [ 291.791068] schedule_preempt_disabled+0x14/0x20 [ 291.791074] __mutex_lock.isra.0+0x18a/0x530 [ 291.791099] mt76u_rr+0x1f/0x40 [mt76_usb] [ 291.791113] mt76x02_update_channel+0x22/0x40 [mt76x02_lib] [ 291.791122] mt76_update_survey+0x42/0xe0 [mt76] [ 291.791129] mt76_get_survey+0x2f/0x1b0 [mt76] [ 291.791170] ieee80211_dump_survey+0x5e/0x140 [mac80211] [ 291.791217] nl80211_dump_survey+0x13c/0x2f0 [cfg80211] [ 291.791222] ? __kmalloc_reserve.isra.0+0x2d/0x70 [ 291.791225] ? __alloc_skb+0x96/0x1d0 [ 291.791229] netlink_dump+0x17b/0x370 [ 291.791247] __netlink_dump_start+0x16f/0x1e0 [ 291.791253] genl_family_rcv_msg+0x396/0x410 [ 291.791290] ? nl80211_prepare_wdev_dump+0x1b0/0x1b0 [cfg80211] [ 291.791297] ? _raw_spin_unlock_irqrestore+0x20/0x40 [ 291.791312] ? __wake_up_common_lock+0x8a/0xc0 [ 291.791316] genl_rcv_msg+0x47/0x90 [ 291.791320] ? genl_family_rcv_msg+0x410/0x410 [ 291.791323] netlink_rcv_skb+0x49/0x110 [ 291.791329] genl_rcv+0x24/0x40 [ 291.791333] netlink_unicast+0x171/0x200 [ 291.791340] netlink_sendmsg+0x208/0x3d0 [ 291.791358] sock_sendmsg+0x5e/0x60 [ 291.791361] ___sys_sendmsg+0x2ae/0x330 [ 291.791368] ? filemap_map_pages+0x272/0x390 [ 291.791374] ? _raw_spin_unlock+0x16/0x30 [ 291.791379] ? __handle_mm_fault+0x112f/0x1390 [ 291.791388] __sys_sendmsg+0x59/0xa0 [ 291.791396] do_syscall_64+0x5b/0x1a0 [ 291.791400] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 291.791404] RIP: 0033:0x7f5d0c7f37b7 [ 291.791418] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 0= 0 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 2e 00 00 00 0f 05= <48> 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 89 54 24 1c 48 89 74 24 10 [ 291.791421] RSP: 002b:00007ffe8b5d0538 EFLAGS: 00000246 ORIG_RAX: 0000= 00000000002e [ 291.791426] RAX: ffffffffffffffda RBX: 000055a038e6c390 RCX: 00007f5d0= c7f37b7 [ 291.791430] RDX: 0000000000000000 RSI: 00007ffe8b5d0570 RDI: 000000000= 0000003 [ 291.791434] RBP: 000055a038e718c0 R08: 000055a038e6c02a R09: 000000000= 0000002 [ 291.791438] R10: 000055a03808cb00 R11: 0000000000000246 R12: 000055a03= 8e71780 [ 291.791440] R13: 00007ffe8b5d0570 R14: 000055a038e717d0 R15: 000055a03= 8e718c0 [ 291.791480] NOHZ: local_softirq_pending 202 Fixes: 168aea24f4bb ("mt76: mt76x02u: enable survey support") Tested-by: Markus Theil <markus.theil@tu-ilmenau.de> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: track approximate tx airtime for airtime fairness and surveyFelix Fietkau2019-11-201-7/+42
| | | | | | | Estimate by calculating duration for EWMA packet size + estimated A-MPDU length on tx status events Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: move MT_CH_TIME_CFG init to mt76x02_mac_cc_resetFelix Fietkau2019-11-201-0/+9
| | | | | | Reduces code duplication and adds missing bits for USB variants Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify channel survey update codeFelix Fietkau2019-11-201-9/+11
| | | | | | | | Host time is used to calculate the channel active time on mt7603 and mt7615. Use the same on mt76x02 and move the lock to core code to get rid of some duplicated code. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: track rx airtime for airtime fairness and surveyFelix Fietkau2019-11-201-2/+2
| | | | | | | | | Report total rx airtime for valid stations as BSS rx time in survey mt7615 is left out for now, it will be supported later by reading hardware counters instead of calculating airtime in software Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: store current channel survey_state in struct mt76_devFelix Fietkau2019-11-201-1/+1
| | | | | | | Move mt76_channel_state() from mt76.h to mac80211.c Preparation for updating channel state from more places in the drivers/core Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: report rx a-mpdu subframe statusFelix Fietkau2019-11-201-0/+15
| | | | | | | This can be used in monitor mode to figure out which subframes were sent as part of which A-MPDU Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move aggr_stats array in mt76_devLorenzo Bianconi2019-11-201-3/+3
| | | | | | | | Move aggr_stats array from mt76x02_dev to mt76_dev in order to be reused adding aggregation stats for mt7603/mt7615 drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: move mac_reset_counter in mt76x02_lib moduleLorenzo Bianconi2019-11-201-0/+21
| | | | | | | | Unify mac_reset_counter routine and move it in mt76x02_lib module since it is shared by all mt76x02 drivers (pci/usb) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: switch to SPDX tag instead of verbose boilerplate textRyder Lee2019-09-051-12/+1
| | | | | | | | | No functional change intended. Add SPDX identifiers to all remaining files in /mt76. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: fix some checkpatch warningsRyder Lee2019-09-051-8/+8
| | | | | | | | | | | | | | | This fixes the following checkpatch warnings: ERROR: code indent should use tabs where possible CHECK: Alignment should match open parenthesis CHECK: No space is necessary after a cast CHECK: Please don't use multiple blank lines CHECK: Avoid precedence issues in macro WARNING: Statements should start on a tabstop WARNING: Unnecessary space before function pointer arguments Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: fix tx status reporting issuesFelix Fietkau2019-06-271-17/+85
| | | | | | | | | | | | | | | | | | | | | | | | | When the hardware falls back to lower rates for a transmit attempt, only the first status report will show the number of retries correctly. The frames that follow will report the correct final rate, but number of retries set to 0. This can cause the rate control module to vastly underestimate the number of retransmissions per rate. To fix this, we need to keep track of the initial requested tx rate per packet and pass it to the status information. For frames with tx status requested, this is simple: use the rate configured in info->control.rates[0] as reference. For no-skb tx status information, we have to encode the requested tx rate in the packet id (and make it possible to distinguish it from real packet ids). To do that, reduce the packet id field size by one bit, and use that bit to indicate packet id vs rate. This change also improves reporting by filling the status rate array with rates from first rate to final rate, taking the same steps as the hardware fallback table. This matters in corner cases like MCS8 on HT, where the fallback target is MCS0, not MCS7. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: remove enable from mt76x02_edcca_init signatureLorenzo Bianconi2019-06-251-2/+2
| | | | | | | | Remove enable parameter from mt76x02_edcca_init routine signature since it is always true Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move beacon_mask in mt76_devLorenzo Bianconi2019-05-011-1/+1
| | | | | | | | Move beacon_mask in mt76_dev data structure since it is used by all drivers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: mt76x02: remove irqsave/restore in locking for tx status fifoFelix Fietkau2019-05-011-3/+4
| | | | | | | Use a separate lock and spin_trylock to avoid disabling interrupts. Should improve performance and latency Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: set txwi_size according to the driver valueLorenzo Bianconi2019-05-011-1/+3
| | | | | | | | Dynamically allocate txwi since new chipsets will use longer txwi descriptors Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mac_work in mt76_devLorenzo Bianconi2019-05-011-2/+2
| | | | | | | | | Move mac_work delayed work in mt76_dev data structure since it is used by all drivers and it will be reused adding mac work to mt7615 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: store wcid tx rate info in one u32 reduce lockingFelix Fietkau2019-05-011-9/+17
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x02: introduce mt76x02_beacon.cStanislaw Gruszka2019-05-011-138/+0
| | | | | | | | | Move most of beaconing code into separate file and separate beacon initialization for USB and MMIO as pre TBTT implementation for USB will be different. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: remove mt76_queue dependency from tx_complete_skb function pointerLorenzo Bianconi2019-05-011-2/+2
| | | | | | | | | | Remove mt76_queue dependency from tx_complete_skb function pointer and rely on mt76_tx_qid instead. Remove flush from tx_complete_skb signature. This is a preliminary patch to introduce mt76_sw_queue support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>