mbox series

pull request: mt76 2018-11-30

Message ID b65d2a36-4cf4-1536-fd0f-f3bcbaf000fc@nbd.name (mailing list archive)
State Accepted
Delegated to: Kalle Valo
Headers show
Series pull request: mt76 2018-11-30 | expand

Pull-request

https://github.com/nbd168/wireless tags/mt76-for-kvalo-2018-11-30

Message

Felix Fietkau Nov. 30, 2018, 11:34 a.m. UTC
Hi Kalle,

here's my first pull request for 4.21

- Felix

The following changes since commit b72c51a58e6d63ef673ac96b8ab5bc98799c5f7b:

  brcmfmac: Fix out of bounds memory access during fw load (2018-11-29 17:33:10 +0200)

are available in the Git repository at:

  https://github.com/nbd168/wireless tags/mt76-for-kvalo-2018-11-30

for you to fetch changes up to e28487ea84a9c081c6d8d7da319427f7fcc32ff5:

  mt76: replace sta_add/remove ops with common sta_state function (2018-11-30 12:30:37 +0100)

----------------------------------------------------------------
first batch of mt76 patches for 4.21

* use the same firmware for mt76x2e and mt76x2u
* mt76x2 fixes
* mt76x0 fixes
* mt76x0e survey support
* more unification between mt76x2 and mt76x0
* mt76x0e AP mode support
* mt76x0e DFS support
* rework and fix tx status handling for mt76x0 and mt76x2

----------------------------------------------------------------
Felix Fietkau (13):
      mt76: clean up unused leftover EXPORT_SYMBOLs
      mt76: mt76x0: handle chip specific initval differences
      mt76: clean up more unused EXPORT_SYMBOLs
      mt76: mt76x02: skip station tx status for non-sta wcid entries
      mt76: mt76x02: only override control->sta on sw-encrypted tx
      mt76: add support for reporting tx status with skb
      mt76: avoid queue/status spinlocks while passing tx status to mac80211
      mt76: do not wake tx queues during flush
      mt76: fix race condition in station removal
      mt76: add mt76_sta_remove helper
      mt76: mt76x02: make group_wcid the first member in struct mt76x02_vif
      mt76: mt76x02: remove mt76x02_txq_init
      mt76: replace sta_add/remove ops with common sta_state function

Lorenzo Bianconi (49):
      mt76x2: align mt76x2 and mt76x2u firmware
      mt76x2u: align channel gain logic to mt76x2 one
      mt76x0: phy: use proper name convention
      mt76x0: phy: simplify rf configuration routines
      mt76x0: phy: improve code readability in initvals_phy.h
      mt76x0: pci: add get_survey support
      mt76: move mt76x02_mac_work routine in mt76x02-lib module
      mt76: move mt76x02_debugfs in mt76x02-lib module
      mt76x0: use shared debugfs implementation
      mt76x0: use mt76x02_mac_work as stats handler
      mt76x2u: introduce mac workqueue support
      mt76x0: phy: unify calibration between mt76x0u and mt76x0e
      mt76: usb: fix static tracepoints
      mt76x0: init: simplify mt76x0_init_mac_registers
      mt76x0: pci: add missing MODULE_FIRMWARE macro
      mt76x0: mac: remove mt76x0_mac_set_ampdu_factor
      mt76x0: align mt76x0u and mt76x0e fw version
      mt76: move mt76x02_mac_set_short_preamble in mt76x02_mac.c
      mt76: move mt76x02_init_device in mt76x02-lib module
      mt76: move mac beacon routines in mt76x02-lib module
      mt76: move tx beacon routines in mt76x02-lib module
      mt76x0: pci: add pre_tbtt_tasklet support
      mt76: move mt76x02_sw_scan and mt76x02_sw_scan_complete in mt76x02-lib module
      mt76: move mt76x02_get_txpower in mt76x02_util.c
      mt76: move mt76x02_sta_ps in mt76x02-lib module
      mt76: introduce mt76x02_init_beacon_config routine
      mt76x0: pci: enable AP support
      mt76: move mt76x02_set_tx_ackto in mt76x02-lib module
      mt76x0: update init vals for MT_TX_PROT registers
      mt76: move tx protection routines in mt76x02-lib module
      mt76: move mt76x02_bss_info_changed in mt76x02-lib module
      mt76: move dfs support in mt76x02-lib module
      mt76x0: pci: add DFS support
      mt76x0: phy: use mt76_poll_msec in mt76x0_phy_temp_sensor
      mt76x0: init: use mt76x02_mac_shared_key_setup in mt76x0_init_hardware
      mt76x2: move wcid_tx_rate conf at bootstrap
      mt76x0: init: use mt76x02_mac_wcid_setup for wcid configuration
      mt76x2u: init: remove not useful configuration
      mt76x2u: init: use common routines for wcid/key initialization
      mt76: move mt76x02_eeprom_copy in mt76x02-lib module
      mt76x0: phy: introduce tssi calibration support
      mt76x0: phy: use tssi reported value to configure tx power if available
      mt76x0: dfs: fix IBI_R11 configuration on non-radar channels
      mt76: introduce mt76x02_config_mac_addr_list routine
      mt76x0: pci: enable VHT rates in IBSS mode
      mt76x2u: phy: add TX_SHAPING calibration
      mt76x2u: phy: run phy_channel_calibrate after channel switch
      mt76x2u: main: use mt76x02_bss_info_changed utility routine
      mt76x2u: init: remove mt76x2u_init_beacon_offsets routine

Stanislaw Gruszka (10):
      mt76x0: do not perform MCU calibration for MT7630
      mt76x0: antenna select corrections
      mt76x0: do not overwrite other MT_BBP(AGC, 8) fields
      mt76x0: use band parameter for LC calibration
      mt76: remove mcu_msg_alloc
      mt76: remove wait argument from mt76x02_mcu_function_select
      mt76: remove wait argument from mt76x02_mcu_set_radio_state
      mt76x02: run calibration after scanning
      mt76x02: assure we update gain after scan
      mt76: remove wait argument from mt76x02_mcu_calibrate

 drivers/net/wireless/mediatek/mt76/Makefile                                |    3 +-
 drivers/net/wireless/mediatek/mt76/dma.c                                   |   14 +-
 drivers/net/wireless/mediatek/mt76/mac80211.c                              |   80 +++++
 drivers/net/wireless/mediatek/mt76/mt76.h                                  |   60 +++-
 drivers/net/wireless/mediatek/mt76/mt76x0/Makefile                         |    6 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c                        |   87 -----
 drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c                         |   22 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/init.c                           |  137 ++------
 drivers/net/wireless/mediatek/mt76/mt76x0/initvals.h                       |   15 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/initvals_phy.h                   | 1313 +++++++++++++++++++++++++++++++++-----------------------------------------
 drivers/net/wireless/mediatek/mt76/mt76x0/mac.c                            |  197 -----------
 drivers/net/wireless/mediatek/mt76/mt76x0/main.c                           |  100 +-----
 drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h                         |   36 +--
 drivers/net/wireless/mediatek/mt76/mt76x0/pci.c                            |   35 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/pci_mcu.c                        |    4 -
 drivers/net/wireless/mediatek/mt76/mt76x0/phy.c                            |  898 +++++++++++++++++++++++++++++++++-----------------
 drivers/net/wireless/mediatek/mt76/mt76x0/phy.h                            |   17 +
 drivers/net/wireless/mediatek/mt76/mt76x0/trace.c                          |   21 --
 drivers/net/wireless/mediatek/mt76/mt76x0/trace.h                          |  312 ------------------
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c                            |   18 +-
 drivers/net/wireless/mediatek/mt76/mt76x0/usb_mcu.c                        |   23 +-
 drivers/net/wireless/mediatek/mt76/mt76x02.h                               |   43 ++-
 drivers/net/wireless/mediatek/mt76/{mt76x2/debugfs.c => mt76x02_debugfs.c} |   22 +-
 drivers/net/wireless/mediatek/mt76/{mt76x2/pci_dfs.c => mt76x02_dfs.c}     |  153 +++++----
 drivers/net/wireless/mediatek/mt76/mt76x02_dfs.h                           |    5 +
 drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.c                        |   12 +
 drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.h                        |   15 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.c                           |  324 +++++++++++++++----
 drivers/net/wireless/mediatek/mt76/mt76x02_mac.h                           |   38 +--
 drivers/net/wireless/mediatek/mt76/mt76x02_mcu.c                           |   44 ++-
 drivers/net/wireless/mediatek/mt76/mt76x02_mcu.h                           |   16 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c                          |  128 +++++++-
 drivers/net/wireless/mediatek/mt76/mt76x02_phy.c                           |    1 +
 drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c                          |   31 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c                      |   42 ++-
 drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c                       |   18 +-
 drivers/net/wireless/mediatek/mt76/mt76x02_util.c                          |  334 ++++++++++++++++---
 drivers/net/wireless/mediatek/mt76/mt76x2/Makefile                         |    6 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/dfs.h                            |   26 --
 drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c                         |   15 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/init.c                           |   32 --
 drivers/net/wireless/mediatek/mt76/mt76x2/mac.h                            |    7 -
 drivers/net/wireless/mediatek/mt76/mt76x2/mcu.c                            |   22 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h                         |   20 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2u.h                        |    3 -
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c                       |  134 +-------
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c                        |  203 ------------
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c                       |  123 +------
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_mcu.c                        |    3 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_phy.c                        |  114 +------
 drivers/net/wireless/mediatek/mt76/mt76x2/pci_tx.c                         |  142 --------
 drivers/net/wireless/mediatek/mt76/mt76x2/phy.c                            |   95 +++++-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c                            |    4 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_init.c                       |   44 +--
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c                       |   55 +---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_mcu.c                        |   32 +-
 drivers/net/wireless/mediatek/mt76/mt76x2/usb_phy.c                        |   78 ++---
 drivers/net/wireless/mediatek/mt76/tx.c                                    |  153 ++++++++-
 drivers/net/wireless/mediatek/mt76/usb.c                                   |   12 +-
 drivers/net/wireless/mediatek/mt76/usb_trace.h                             |   29 +-
 60 files changed, 2783 insertions(+), 3193 deletions(-)
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/trace.c
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/trace.h
 rename drivers/net/wireless/mediatek/mt76/{mt76x2/debugfs.c => mt76x02_debugfs.c} (86%)
 rename drivers/net/wireless/mediatek/mt76/{mt76x2/pci_dfs.c => mt76x02_dfs.c} (84%)
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2/dfs.h
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2/pci_mac.c
 delete mode 100644 drivers/net/wireless/mediatek/mt76/mt76x2/pci_tx.c

Comments

Kalle Valo Dec. 5, 2018, 7:33 a.m. UTC | #1
Felix Fietkau <nbd@nbd.name> writes:

> here's my first pull request for 4.21
>
> - Felix
>
> The following changes since commit b72c51a58e6d63ef673ac96b8ab5bc98799c5f7b:
>
>   brcmfmac: Fix out of bounds memory access during fw load (2018-11-29 17:33:10 +0200)
>
> are available in the Git repository at:
>
>   https://github.com/nbd168/wireless tags/mt76-for-kvalo-2018-11-30
>
> for you to fetch changes up to e28487ea84a9c081c6d8d7da319427f7fcc32ff5:
>
>   mt76: replace sta_add/remove ops with common sta_state function (2018-11-30 12:30:37 +0100)
>
> ----------------------------------------------------------------
> first batch of mt76 patches for 4.21
>
> * use the same firmware for mt76x2e and mt76x2u
> * mt76x2 fixes
> * mt76x0 fixes
> * mt76x0e survey support
> * more unification between mt76x2 and mt76x0
> * mt76x0e AP mode support
> * mt76x0e DFS support
> * rework and fix tx status handling for mt76x0 and mt76x2
>
> ----------------------------------------------------------------

I fast forwarded w-d-next to net-next and now there's a conflict. I did
a test merge in the pending branch, please double check:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=e69caab09bf98d0d8b559d06887364cc0090097c

This was the conflict:

diff --cc drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
index 3f001bd6806c,b54a32397486..000000000000
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
@@@ -264,21 -173,6 +173,24 @@@ static int mt76x2_get_antenna(struct ie
  	return 0;
  }
  
++<<<<<<< HEAD
 +static int
 +mt76x2_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
 +{
 +	struct mt76x02_dev *dev = hw->priv;
 +
 +	if (val != ~0 && val > 0xffff)
 +		return -EINVAL;
 +
 +	mutex_lock(&dev->mt76.mutex);
 +	mt76x2_mac_set_tx_protection(dev, val);
 +	mutex_unlock(&dev->mt76.mutex);
 +
 +	return 0;
 +}
 +
++=======
++>>>>>>> 1b0adb0ab8649a1ed44f9840724878cffaaa6896
  const struct ieee80211_ops mt76x2_ops = {
  	.tx = mt76x02_tx,
  	.start = mt76x2_start,

I solved it by removing mt76x2_set_rts_threshold(). After there was also
a compilation error which I fixed like this:

diff --cc drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
index 3f001bd6806c,b54a32397486..000000000000
--- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
index 3a70e5bf7d42..38bd466cff16 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
@@ -462,9 +462,9 @@ int mt76x02_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
 	if (val != ~0 && val > 0xffff)
 		return -EINVAL;
 
-	mutex_lock(&dev->mutex);
+	mutex_lock(&dev->mt76.mutex);
 	mt76x02_mac_set_tx_protection(dev, val);
-	mutex_unlock(&dev->mutex);
+	mutex_unlock(&dev->mt76.mutex);
 
 	return 0;
 }
Lorenzo Bianconi Dec. 5, 2018, 9:04 a.m. UTC | #2
> Felix Fietkau <nbd@nbd.name> writes:
>
> > here's my first pull request for 4.21
> >
> > - Felix
> >
> > The following changes since commit b72c51a58e6d63ef673ac96b8ab5bc98799c5f7b:
> >
> >   brcmfmac: Fix out of bounds memory access during fw load (2018-11-29 17:33:10 +0200)
> >
> > are available in the Git repository at:
> >
> >   https://github.com/nbd168/wireless tags/mt76-for-kvalo-2018-11-30
> >
> > for you to fetch changes up to e28487ea84a9c081c6d8d7da319427f7fcc32ff5:
> >
> >   mt76: replace sta_add/remove ops with common sta_state function (2018-11-30 12:30:37 +0100)
> >
> > ----------------------------------------------------------------
> > first batch of mt76 patches for 4.21
> >
> > * use the same firmware for mt76x2e and mt76x2u
> > * mt76x2 fixes
> > * mt76x0 fixes
> > * mt76x0e survey support
> > * more unification between mt76x2 and mt76x0
> > * mt76x0e AP mode support
> > * mt76x0e DFS support
> > * rework and fix tx status handling for mt76x0 and mt76x2
> >
> > ----------------------------------------------------------------
>
> I fast forwarded w-d-next to net-next and now there's a conflict. I did
> a test merge in the pending branch, please double check:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=e69caab09bf98d0d8b559d06887364cc0090097c
>

ack

> This was the conflict:
>
> diff --cc drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
> index 3f001bd6806c,b54a32397486..000000000000
> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
> @@@ -264,21 -173,6 +173,24 @@@ static int mt76x2_get_antenna(struct ie
>         return 0;
>   }
>
> ++<<<<<<< HEAD
>  +static int
>  +mt76x2_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
>  +{
>  +      struct mt76x02_dev *dev = hw->priv;
>  +
>  +      if (val != ~0 && val > 0xffff)
>  +              return -EINVAL;
>  +
>  +      mutex_lock(&dev->mt76.mutex);
>  +      mt76x2_mac_set_tx_protection(dev, val);
>  +      mutex_unlock(&dev->mt76.mutex);
>  +
>  +      return 0;
>  +}
>  +
> ++=======
> ++>>>>>>> 1b0adb0ab8649a1ed44f9840724878cffaaa6896
>   const struct ieee80211_ops mt76x2_ops = {
>         .tx = mt76x02_tx,
>         .start = mt76x2_start,
>
> I solved it by removing mt76x2_set_rts_threshold(). After there was also
> a compilation error which I fixed like this:

correct, mt76x2_set_rts_threshold has been moved to mt76x02_util.c

>
> diff --cc drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
> index 3f001bd6806c,b54a32397486..000000000000
> --- a/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> index 3a70e5bf7d42..38bd466cff16 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x02_util.c
> @@ -462,9 +462,9 @@ int mt76x02_set_rts_threshold(struct ieee80211_hw *hw, u32 val)
>         if (val != ~0 && val > 0xffff)
>                 return -EINVAL;
>
> -       mutex_lock(&dev->mutex);
> +       mutex_lock(&dev->mt76.mutex);
>         mt76x02_mac_set_tx_protection(dev, val);
> -       mutex_unlock(&dev->mutex);
> +       mutex_unlock(&dev->mt76.mutex);
>
>         return 0;
>  }

correct

Regards,
Lorenzo

>
> --
> Kalle Valo
Kalle Valo Dec. 7, 2018, 10:54 a.m. UTC | #3
Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> writes:

>> Felix Fietkau <nbd@nbd.name> writes:
>>
>> > here's my first pull request for 4.21
>> >
>> > - Felix
>> >
>> > The following changes since commit b72c51a58e6d63ef673ac96b8ab5bc98799c5f7b:
>> >
>> >   brcmfmac: Fix out of bounds memory access during fw load (2018-11-29 17:33:10 +0200)
>> >
>> > are available in the Git repository at:
>> >
>> >   https://github.com/nbd168/wireless tags/mt76-for-kvalo-2018-11-30
>> >
>> > for you to fetch changes up to e28487ea84a9c081c6d8d7da319427f7fcc32ff5:
>> >
>> >   mt76: replace sta_add/remove ops with common sta_state function
>> > (2018-11-30 12:30:37 +0100)
>> >
>> > ----------------------------------------------------------------
>> > first batch of mt76 patches for 4.21
>> >
>> > * use the same firmware for mt76x2e and mt76x2u
>> > * mt76x2 fixes
>> > * mt76x0 fixes
>> > * mt76x0e survey support
>> > * more unification between mt76x2 and mt76x0
>> > * mt76x0e AP mode support
>> > * mt76x0e DFS support
>> > * rework and fix tx status handling for mt76x0 and mt76x2
>> >
>> > ----------------------------------------------------------------
>>
>> I fast forwarded w-d-next to net-next and now there's a conflict. I did
>> a test merge in the pending branch, please double check:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?h=pending&id=e69caab09bf98d0d8b559d06887364cc0090097c
>>
>
> ack

Thanks for checking, I'll pull this soon.
Kalle Valo Dec. 13, 2018, 2:04 p.m. UTC | #4
Felix Fietkau <nbd@nbd.name> writes:

> Hi Kalle,
>
> here's my first pull request for 4.21
>
> - Felix
>
> The following changes since commit b72c51a58e6d63ef673ac96b8ab5bc98799c5f7b:
>
>   brcmfmac: Fix out of bounds memory access during fw load (2018-11-29 17:33:10 +0200)
>
> are available in the Git repository at:
>
>   https://github.com/nbd168/wireless tags/mt76-for-kvalo-2018-11-30
>
> for you to fetch changes up to e28487ea84a9c081c6d8d7da319427f7fcc32ff5:
>
>   mt76: replace sta_add/remove ops with common sta_state function (2018-11-30 12:30:37 +0100)
>
> ----------------------------------------------------------------
> first batch of mt76 patches for 4.21
>
> * use the same firmware for mt76x2e and mt76x2u
> * mt76x2 fixes
> * mt76x0 fixes
> * mt76x0e survey support
> * more unification between mt76x2 and mt76x0
> * mt76x0e AP mode support
> * mt76x0e DFS support
> * rework and fix tx status handling for mt76x0 and mt76x2
>
> ----------------------------------------------------------------

Pulled, thanks.