summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* mac80211: minstrel: fix CCK rate group streams valueFelix Fietkau2018-10-111-1/+1
| | | | | | | Fixes a harmless underflow issue when CCK rates are actively being used Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: minstrel: fix using short preamble CCK rates on HT clientsFelix Fietkau2018-10-111-3/+1
| | | | | | | | | | | mi->supported[MINSTREL_CCK_GROUP] needs to be updated short preamble rates need to be marked as supported regardless of whether it's currently enabled. Its state can change at any time without a rate_update call. Fixes: 782dda00ab8e ("mac80211: minstrel_ht: move short preamble check out of get_rate") Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: minstrel: reduce minstrel_mcs_groups sizeFelix Fietkau2018-10-113-78/+93
| | | | | | | | | | | | | | | | | By storing a shift value for all duration values of a group, we can reduce precision by a neglegible amount to make it fit into a u16 value. This improves cache footprint and reduces size: Before: text data bss dec hex filename 10024 116 0 10140 279c rc80211_minstrel_ht.o After: text data bss dec hex filename 9368 116 0 9484 250c rc80211_minstrel_ht.o Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: minstrel: merge with minstrel_ht, always enable VHT supportFelix Fietkau2018-10-1110-258/+101
| | | | | | | | | Legacy-only devices are not very common and the overhead of the extra code for HT and VHT rates is not big enough to justify all those extra lines of code to make it optional. Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: minstrel: remove unnecessary debugfs cleanup codeFelix Fietkau2018-10-116-47/+9
| | | | | | | debugfs entries are cleaned up by debugfs_remove_recursive already. Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: minstrel: Enable STBC and LDPC for VHT RatesChaitanya T K2018-10-112-8/+16
| | | | | | | | | If peer support reception of STBC and LDPC, enable them for better performance. Signed-off-by: Chaitanya TK <chaitanya.mgit@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: avoid reflecting frames back to the clientJohannes Berg2018-10-111-6/+6
| | | | | | | | | | | | | | | | I'm not really sure exactly _why_ I've been carrying a note for what's probably _years_ to check that we don't do this, but we clearly do reflect frames back to the station itself if it sends such. One way or the other, it's useless since the station doesn't really need the AP to talk to itself, so suppress it. While at it, clarify some of the logic by removing skb->data references in favour of the destination address (pointer) we already have separately. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: use netlink policy validation function for elementsJohannes Berg2018-10-111-76/+46
| | | | | | | Instead of open-coding a lot of calls to is_valid_ie_attr(), add this validation directly to the policy, now that we can. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: use policy range validation where applicableJohannes Berg2018-10-111-289/+180
| | | | | | | | | Many range checks can be done in the policy, move them there. A few in mesh are added in the code (taken out of the macros) because they don't fit into the s16 range in the policy validation. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* lib80211: don't use skcipherJohannes Berg2018-10-102-71/+40
| | | | | | | Using skcipher just makes the code longer, and mac80211 also "open-codes" the WEP encrypt/decrypt. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: drop now unused work-queue from hwsimMartin Willi2018-10-081-10/+1
| | | | | | | | | | The work-queue was used for deferred destruction of hwsim radios; this does not work well with namespaces about to exit. The one remaining user has been migrated, so drop the now unused work-queue instance. Signed-off-by: Martin Willi <martin@strongswan.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Merge remote-tracking branch 'net-next/master' into mac80211-nextJohannes Berg2018-10-08916-18972/+28401
|\ | | | | | | | | | | | | Merge net-next, which pulled in net, so I can merge a few more patches that would otherwise conflict. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * net: vhost: remove bad code lineTonghao Zhang2018-10-081-1/+0
| | | | | | | | | | Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: sched: pie: fix coding style issuesLeslie Monis2018-10-081-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix 5 warnings and 14 checks issued by checkpatch.pl: CHECK: Logical continuations should be on the previous line + if ((q->vars.qdelay < q->params.target / 2) + && (q->vars.prob < MAX_PROB / 5)) WARNING: line over 80 characters + q->params.tupdate = usecs_to_jiffies(nla_get_u32(tb[TCA_PIE_TUPDATE])); CHECK: Blank lines aren't necessary after an open brace '{' +{ + CHECK: braces {} should be used on all arms of this statement + if (qlen < QUEUE_THRESHOLD) [...] + else { [...] CHECK: Unbalanced braces around else statement + else { CHECK: No space is necessary after a cast + if (delta > (s32) (MAX_PROB / (100 / 2)) && CHECK: Unnecessary parentheses around 'qdelay == 0' + if ((qdelay == 0) && (qdelay_old == 0) && update_prob) CHECK: Unnecessary parentheses around 'qdelay_old == 0' + if ((qdelay == 0) && (qdelay_old == 0) && update_prob) CHECK: Unnecessary parentheses around 'q->vars.prob == 0' + if ((q->vars.qdelay < q->params.target / 2) && + (q->vars.qdelay_old < q->params.target / 2) && + (q->vars.prob == 0) && + (q->vars.avg_dq_rate > 0)) CHECK: Unnecessary parentheses around 'q->vars.avg_dq_rate > 0' + if ((q->vars.qdelay < q->params.target / 2) && + (q->vars.qdelay_old < q->params.target / 2) && + (q->vars.prob == 0) && + (q->vars.avg_dq_rate > 0)) CHECK: Blank lines aren't necessary before a close brace '}' + +} CHECK: Comparison to NULL could be written "!opts" + if (opts == NULL) CHECK: No space is necessary after a cast + ((u32) PSCHED_TICKS2NS(q->params.target)) / WARNING: line over 80 characters + nla_put_u32(skb, TCA_PIE_TUPDATE, jiffies_to_usecs(q->params.tupdate)) || CHECK: Blank lines aren't necessary before a close brace '}' + +} CHECK: No space is necessary after a cast + .delay = ((u32) PSCHED_TICKS2NS(q->vars.qdelay)) / WARNING: Missing a blank line after declarations + struct sk_buff *skb; + skb = qdisc_dequeue_head(sch); WARNING: Missing a blank line after declarations + struct pie_sched_data *q = qdisc_priv(sch); + qdisc_reset_queue(sch); WARNING: Missing a blank line after declarations + struct pie_sched_data *q = qdisc_priv(sch); + q->params.tupdate = 0; Signed-off-by: Leslie Monis <lesliemonis@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * bnxt_en: Remove unnecessary unsigned integer comparison and initialize variableGustavo A. R. Silva2018-10-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to compare *val.vu32* with < 0 because such variable is of type u32 (32 bits, unsigned), making it impossible to hold a negative value. Fix this by removing such comparison. Also, initialize variable *max_val* to -1, just in case it is not initialized to either BNXT_MSIX_VEC_MAX or BNXT_MSIX_VEC_MIN_MAX before using it in a comparison with val.vu32 at line 159: if (val.vu32 > max_val) Addresses-Coverity-ID: 1473915 ("Unsigned compared against 0") Addresses-Coverity-ID: 1473920 ("Uninitialized scalar variable") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * Merge tag 'wireless-drivers-next-for-davem-2018-10-07' of ↵David S. Miller2018-10-07177-5633/+6916
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.20 Second set of patches for 4.20. Heavy refactoring on mt76 continues and the usual drivers in active development (iwlwifi, qtnfmac, ath10k) getting new features. And as always, fixes and cleanup all over. Major changes: mt76 * more major refactoring to make it easier add new hardware support * more work on mt76x0e support * support for getting firmware version via ethtool * add mt7650 PCI ID iwlwifi * HE radiotap cleanup and improvements * reorder channel optimization for scans * bump the FW API version qtnfmac * fixes for 'iw' output: rates for enabled SGI, 'dump station' * expose more scan features to host: scan flush and dwell time * inform cfg80211 when OBSS is not supported by firmware wlcore * add support for optional wakeirq ath10k * retrieve MAC address from system firmware if provided * support extended board data download for dual-band QCA9984 * extended per sta tx statistics support via debugfs * average ack rssi support for data frames * speed up QCA6174 and QCA9377 firmware download using diag Copy Engine * HTT High Latency mode support needed by SDIO and USB support * get STA power save state via debugfs ath9k * add reset functionality for airtime station debugfs file ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| | * Merge tag 'mt76-for-kvalo-2018-10-05' of https://github.com/nbd168/wirelessKalle Valo2018-10-0673-2088/+1684
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mt76 patches for 4.20 * unify code between mt76x0, mt76x2 * mt76x0 fixes * another fix for rx buffer allocation regression on usb * move mt76x2 source files to mt76x2 folder * more work on mt76x0e support
| | | * mt76: move irq handler in mt76x02-lib moudleLorenzo Bianconi2018-10-0511-177/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_irq_handler handler in mt76x02_mmio.c in order to be reused in mt76x0 driver. Move mt76x02_rx_poll_complete routine in mt76x02-lib module. Moreover remove pci_core.c and mt76x2/trace.{c,h} since are empty files Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move tx_tasklet management in mt76x02-lib moudleLorenzo Bianconi2018-10-059-64/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move tx_tasklet management in mt76x02_mmio.c in order to be reused by mt76x0 driver and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mmio.cLorenzo Bianconi2018-10-0510-62/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_mmio.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_tx_complete in mt76x02-lib moduleLorenzo Bianconi2018-10-058-70/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_tx_complete mt76x02-lib module in order to be reused by mt76x0 drivers for irq unification. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_mac_poll_tx_status in mt76x02-lib moudleLorenzo Bianconi2018-10-0510-91/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_mac_poll_tx_status in mt76x02_mac.c in order to be reused by mt76x0 drivers for irq unification. Moreover introduce mt76x02_trace source file to define mt76x02 trace points Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: usb: move mt76x02u_tx_complete_skb in mt76x02_usb_core.cLorenzo Bianconi2018-10-056-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02u_tx_complete_skb and mt76x02u_remove_dma_hdr since they are used just by usb code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_tx_prepare_skb in mt76x02_txrx.cLorenzo Bianconi2018-10-055-36/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_tx_prepare_skb routine in mt76x02-lib module in order to be reused by mt76x0 driver in tx datapath Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move tpc routines in mt76x02-lib moduleLorenzo Bianconi2018-10-059-63/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_tx_get_txpwr_adj and mt76x02_tx_set_txpwr_auto routines in mt76x02-lib module since they are shared between mt76x0 and mt76x2 drivers. Moreover remove get_txpwr_adj function pointer Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x2: remove leftover function declatarionsLorenzo Bianconi2018-10-051-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove following function declarations since they have been moved to mt76x02-lib module: - mt76x2_sta_add - mt76x2_sta_remove - mt76x2_remove_interface - mt76x2_conf_tx - mt76x2_txq_init Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: rename mt76x02_util.h in mt76x02.hLorenzo Bianconi2018-10-0527-56/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename mt76x02_util.h header file in mt76x02.h since now contains all mt76x02 related definitions and not just utility routines declarations Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move txrx shared routines in mt76x02_txrx.cLorenzo Bianconi2018-10-053-141/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mt76x02_txrx.c source file in order to contain tx/rx shared routines for mt76x0 and mt76x2 drivers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_tx in mt76x02-lib moduleLorenzo Bianconi2018-10-0511-87/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_tx shared routine in mt76x02-lib module and remove duplicated code. Moreover remove mt76x0/tx.c since it is an empty file Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: unify rxwi parsing between mt76x2 and mt76x0 driversLorenzo Bianconi2018-10-0517-142/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify rxwi parsing between mt76x2 and mt76x0. Remove the following routines: - mt76x0_phy_get_rssi - mt76x0_queue_rx_skb - mt76x0_mac_process_rx Moreover remove mt76x2/common.c and mt76x0/mac.h since are empty files Enable CCMP PN sw validation Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_mac_process_rx in mt76x02-lib moduleLorenzo Bianconi2018-10-056-101/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_mac_process_rx utility routine in mt76x02-lib in order to by reused by mt76x0 driver for rxwi parsing. Add stream number check in mt76x02_mac_process_rx since mt76x0 chipsets are 1x1:1 Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x0: merge mt76x0_dev in mt76x02_devLorenzo Bianconi2018-10-0516-210/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge mt76x0_dev data structure in mt76x02_dev one and remove duplicated code. Remove unused definition in mt76x0.h. Moreover merge mt76x0_caldata and mt76x02_rx_freq_cal data structures. This is a preliminary patch for rxwi unification. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x2: move mt76x2_dev in mt76x02_util.hLorenzo Bianconi2018-10-0533-509/+537
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x2_dev in mt76x02_util.h and rename it in mt76x02_dev in order to be shared between mt76x2 and mt76x0 driver Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x0: remove hw_atomic_mutex mutex in mt76x0_devLorenzo Bianconi2018-10-053-23/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove hw_atomic_mutex mutex in mt76x0_dev data structure since mt76x0_phy_set_channel is already protected by mt76_dev mutex while mt76x0_chip_onoff is used just at device probe or cleanup Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x0: remove unused variable in mt76x0_devLorenzo Bianconi2018-10-052-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove no longer used mac_lock spinlock and data array in mt76x0_dev data structure Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x0: mac: use sta ewma estimation for rssi trackingLorenzo Bianconi2018-10-056-62/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use shared mt76x02 utility routines for rssi tracking. Moreover remove no longer used con_mon_lock spinlock and following variable: - ap_bssid - bcn_freq_off - bcn_phy_mode - avg_rssi Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_rx_get_sta and mt76x02_rx_get_sta_wcid in mt76x02_util.hLorenzo Bianconi2018-10-052-30/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_rx_get_sta and mt76x02_rx_get_sta_wcid utility routines in mt76x02-lib module since it will be used by mt76x0 driver in order to unify rxwi parsing Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_phy_get_min_avg_rssi in mt76x02_phy.cLorenzo Bianconi2018-10-056-50/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_phy_get_min_avg_rssi in mt76x02-lib module since it will be used by mt76x0 driver in order to unify rxwi parsing Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x0: init: remove unnecessary configurationsLorenzo Bianconi2018-10-051-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove leftover configuration for legacy devices in mt76x0_init_mac_registers routine. Moreover remove unnecessary msleep delay Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: usb: use mt76x02u_tx_prepare_skb to fill txwiLorenzo Bianconi2018-10-0511-130/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use mt76x02u_tx_prepare_skb routine to fill txwi in mt76x2u and mt76x0u driver and remove duplicated code. Moreover add static qualifier to mt76x02_mac_tx_rate_val and mt76x02_mac_fill_txwi routines Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_mac_write_txwi in mt76x02-lib moduleLorenzo Bianconi2018-10-057-67/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_mac_write_txwi in mt76x02_mac.c since it is shared between mt76x0 and mt76x2 drivers. This is a preliminary patch to unify txwi configuration between mt76x0 and mt76x2 drivers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: add get_tx_txpwr_adj function pointer to mt76_driver_opsLorenzo Bianconi2018-10-055-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add get_tx_txpwr_adj function pointer to mt76_driver_ops data structure as a preliminary patch to unify txwi configuration between mt76x0 and mt76x2 drivers since tpc is currently supported just by mt76x2 driver Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: move mt76x02_tx_get_max_txpwr_adj in mt76x02_util.cLorenzo Bianconi2018-10-057-51/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x02_tx_get_max_txpwr_adj routine in mt76x02-lib module since now both mt76x0 and mt76x2 drivers read rate tx power gain from rate_power data structure. Moreover remove get_max_txpwr_adj function pointer from mt76_driver_ops data structure Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x0: usb: stop cal/mac workqueues at hw stopLorenzo Bianconi2018-10-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Stop mac and calibration work stopping the hw even if the device has been removed Fixes: b11e19694dc9 ("mt76x0: add ieee80211_ops ops pointer to mt76x0_alloc_device signature") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: usb: fix hw initialization sequenceLorenzo Bianconi2018-10-052-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mt76u_alloc_queues need to be called before mt76u_mcu_init_rx since it initializes rx_page_lock spinlock used in mt76u_buf_alloc routine. Fixes: b11e19694dc9 ("mt76x0: add ieee80211_ops ops pointer to mt76x0_alloc_device signature") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: fix frag length allocation for usbStanislaw Gruszka2018-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is correct fix for c12128ce44b0 ("mt76: use a per rx queue page fragment cache"). We use wrong length when we allocate segments for MCU transmissions, which require bigger segment size than e->buf_size. Commit 481bb0432414 ("mt76: usb: make rx page_frag_cache access atomic") partially solved the problem or actually mask it by changing mt76u_mcu_init_rx() and mt76u_alloc_queues() sequence, so e->buf_size become non zero any longer, but still not big enough to handle MCU data. Patch fixes memory corruption which can manifest itself as random, not easy to reproduce crashes, during mt76 driver load or unload. Fixes: c12128ce44b0 ("mt76: use a per rx queue page fragment cache") Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76: fix header guard macro define namesColin Ian King2018-10-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The header guards that are #defined are different from those being checked. Fix this by #defining them to the correct name. Fixes clang warnings: drivers/net/wireless/mediatek/mt76/mt76x02_mcu.h:17:9: warning: '__MT76x02_MCU_H' is used as a header guard here, followed by #define of a different macro [-Wheader-guard] drivers/net/wireless/mediatek/mt76/mt76x02_usb.h:17:9: warning: '__MT76x02_USB_H' is used as a header guard here, followed by #define of a different macro [-Wheader-guard] Fixes: 905db7470199 ("mt76: usb: move mt76x02 mcu code in mt76x02-usb module") Fixes: edaa580bc830 ("mt76: move shared mcu_calibrate routine in mt76x02-lib module") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x2: move mt76x2 source files to mt76x2 folderLorenzo Bianconi2018-10-0538-119/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move mt76x2 and mt76x2u drivers to mt76x2 subfolder and leave just shared code in mt76 root folder Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | | * mt76x0: pci: add mt76x0e_cleanup routineLorenzo Bianconi2018-10-051-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add mt76x0e_cleanup routine to tidy up the device during device removal Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| | * | Merge tag 'iwlwifi-next-for-kalle-2018-10-06' of ↵Kalle Valo2018-10-0631-627/+762
| | |\ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next Third set of iwlwifi patches for 4.20 * Fix for a race condition that caused the FW to crash; * HE radiotap cleanup and improvements; * Reorder channel optimization for scans; * Bumped the FW API version supported after the last API change for this release; * Debugging improvements; * A few bug fixes; * Some cleanups in preparation for a new implementation; * Other small improvements, cleanups and fixes.