mbox series

[v3,00/14] Add mt76x0 driver

Message ID 1533040864-9026-1-git-send-email-sgruszka@redhat.com (mailing list archive)
Headers show
Series Add mt76x0 driver | expand

Message

Stanislaw Gruszka July 31, 2018, 12:40 p.m. UTC
Add mt76x0 driver for MT7610U based USB dongles. Currently driver
support only STA mode.

mt76x0 is based on Jakub's mt7601u driver already included
in the kernel. I would like the driver be integrated as part
of mt76 (instead of separate driver in mediatek dir like mt7601u)
to utilize mt76 code for adding support for MT76x0 PCIe devices
in further development.

To do not collide with current mt76x2u work from Lorenzo, I did not
remove some code duplication. This will be done in the future as well
as add support for MT76x0 PCIe devices (i.e. MT7630E).

My and Lorenzo integration efforts can be traced here:
https://github.com/sgruszka/wireless-drivers-next/commits/mt76x0-draft-v2

mt7610u.bin file will be posted to linux-firmware tree as 
Sean Wang at Mediatek gave us permission to do so.

Patches has to be applied on top of mt76x2u:
https://marc.info/?l=linux-wireless&m=153302456826820&w=2

v2 -> v3
 - fixup monitor mode config
 - declare some functions static (reported by kbuild test)
 - change firmware location and add "u" suffix
 - fix MCU intialization after system reboot

v1 -> v2:
 - add missed mac.c file!
 - fix uninitialized variables reported by kbuild test
 - fix rate estimation
 - check for skb allocation

Stanislaw Gruszka (14):
  mt76x0: core files
  mt76x0: mac files
  mt76x0: usb files
  mt76x0: mcu files
  mt76x0: phy files
  mt76x0: init files
  mt76x0: eeprom files
  mt76x0: trace and debugfs files
  mt76x0: dma and tx files
  mt76x0: main file
  mt76: add more states
  mt76: Kconfig and Makefile for mt76x0 driver
  mt76x0: disable HW before probe
  mt76x0: load firmware from mediatek subdir

 drivers/net/wireless/mediatek/mt76/Kconfig         |    7 +
 drivers/net/wireless/mediatek/mt76/Makefile        |    1 +
 drivers/net/wireless/mediatek/mt76/mt76.h          |    2 +
 drivers/net/wireless/mediatek/mt76/mt76x0/Makefile |    7 +
 drivers/net/wireless/mediatek/mt76/mt76x0/core.c   |   34 +
 .../net/wireless/mediatek/mt76/mt76x0/debugfs.c    |  166 ++++
 drivers/net/wireless/mediatek/mt76/mt76x0/dma.c    |  522 ++++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/dma.h    |  126 +++
 drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c |  445 +++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h |  149 +++
 drivers/net/wireless/mediatek/mt76/mt76x0/init.c   |  720 ++++++++++++++
 .../net/wireless/mediatek/mt76/mt76x0/initvals.h   |  282 ++++++
 .../wireless/mediatek/mt76/mt76x0/initvals_phy.h   |  772 +++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/mac.c    |  660 +++++++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/mac.h    |  154 +++
 drivers/net/wireless/mediatek/mt76/mt76x0/main.c   |  403 ++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c    |  656 +++++++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/mcu.h    |  101 ++
 drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h |  336 +++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/phy.c    | 1008 ++++++++++++++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/phy.h    |   81 ++
 drivers/net/wireless/mediatek/mt76/mt76x0/regs.h   |  651 +++++++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/trace.c  |   21 +
 drivers/net/wireless/mediatek/mt76/mt76x0/trace.h  |  366 +++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/tx.c     |  270 ++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c    |  381 ++++++++
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.h    |   61 ++
 drivers/net/wireless/mediatek/mt76/mt76x0/util.c   |   42 +
 28 files changed, 8424 insertions(+)
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/Makefile
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/core.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/debugfs.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/dma.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/dma.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/init.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/initvals.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/initvals_phy.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/mac.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/mac.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/main.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/mcu.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/mt76x0.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/phy.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/regs.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/trace.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/trace.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/usb.h
 create mode 100644 drivers/net/wireless/mediatek/mt76/mt76x0/util.c

Comments

Kalle Valo Aug. 1, 2018, 7:39 a.m. UTC | #1
Stanislaw Gruszka <sgruszka@redhat.com> writes:

> Add mt76x0 driver for MT7610U based USB dongles. Currently driver
> support only STA mode.
>
> mt76x0 is based on Jakub's mt7601u driver already included
> in the kernel. I would like the driver be integrated as part
> of mt76 (instead of separate driver in mediatek dir like mt7601u)
> to utilize mt76 code for adding support for MT76x0 PCIe devices
> in further development.

So what's the future for mt7601u, are we going to delete it? What's
Jakub's opinion about all this? And what's the delta featurewise between
mt7601u and this driver? Which one will be loaded by default?

Also I noticed that mt76 is missing an entry in MAINTAINERS file? Could
someone send a separate patch to add that, please?
Lorenzo Bianconi Aug. 1, 2018, 8:13 a.m. UTC | #2
On Aug 01, Kalle Valo wrote:
> Stanislaw Gruszka <sgruszka@redhat.com> writes:
> 
> > Add mt76x0 driver for MT7610U based USB dongles. Currently driver
> > support only STA mode.
> >
> > mt76x0 is based on Jakub's mt7601u driver already included
> > in the kernel. I would like the driver be integrated as part
> > of mt76 (instead of separate driver in mediatek dir like mt7601u)
> > to utilize mt76 code for adding support for MT76x0 PCIe devices
> > in further development.
> 
> So what's the future for mt7601u, are we going to delete it? What's
> Jakub's opinion about all this? And what's the delta featurewise between
> mt7601u and this driver? Which one will be loaded by default?

I think we can integrate mt7601u in mt76 as soon as mt76x0 is merged since the
code path is pretty similar. Jakub what do you think? (That was actually on my
ToDo list :))
For the moment I guess both drivers can coexist since the usb_device_id lists
seem different

Regards,
Lorenzo

> 
> Also I noticed that mt76 is missing an entry in MAINTAINERS file? Could
> someone send a separate patch to add that, please?
> 
> -- 
> Kalle Valo
Kalle Valo Aug. 1, 2018, 8:19 a.m. UTC | #3
Lorenzo Bianconi <lorenzo.bianconi@redhat.com> writes:

> On Aug 01, Kalle Valo wrote:
>> Stanislaw Gruszka <sgruszka@redhat.com> writes:
>> 
>> > Add mt76x0 driver for MT7610U based USB dongles. Currently driver
>> > support only STA mode.
>> >
>> > mt76x0 is based on Jakub's mt7601u driver already included
>> > in the kernel. I would like the driver be integrated as part
>> > of mt76 (instead of separate driver in mediatek dir like mt7601u)
>> > to utilize mt76 code for adding support for MT76x0 PCIe devices
>> > in further development.
>> 
>> So what's the future for mt7601u, are we going to delete it? What's
>> Jakub's opinion about all this? And what's the delta featurewise between
>> mt7601u and this driver? Which one will be loaded by default?
>
> I think we can integrate mt7601u in mt76 as soon as mt76x0 is merged since the
> code path is pretty similar. Jakub what do you think? (That was actually on my
> ToDo list :))
>
> For the moment I guess both drivers can coexist since the
> usb_device_id lists seem different

Ah, I didn't realise that. I was exactly worried that if we would now
have two drivers supporting same device ids, but very good if that's not
the case.
Stanislaw Gruszka Aug. 1, 2018, 8:25 a.m. UTC | #4
On Wed, Aug 01, 2018 at 10:39:58AM +0300, Kalle Valo wrote:
> Stanislaw Gruszka <sgruszka@redhat.com> writes:
> 
> > Add mt76x0 driver for MT7610U based USB dongles. Currently driver
> > support only STA mode.
> >
> > mt76x0 is based on Jakub's mt7601u driver already included
> > in the kernel. I would like the driver be integrated as part
> > of mt76 (instead of separate driver in mediatek dir like mt7601u)
> > to utilize mt76 code for adding support for MT76x0 PCIe devices
> > in further development.
> 
> So what's the future for mt7601u, are we going to delete it? What's
> Jakub's opinion about all this? And what's the delta featurewise between
> mt7601u and this driver? Which one will be loaded by default?

mt7601u is driver for different chip: MT7601. This driver if for MT7610
chip. There are lot of similarities between the drivers, but there are
bunch of differences too. And in the future development of mt76x0, due
to integration into mt76 and mt76x2u and adding support for PCIe chips,
the differences against mt7601u will be much be bigger.

> Also I noticed that mt76 is missing an entry in MAINTAINERS file? Could
> someone send a separate patch to add that, please?

The question is if Felix would like to be the maintainer? Otherwise who would
want to do this job? I think the best option would be to get some
commitment from Mediatek if that possible, maybe Sean Wang could aggree
to be the maintainer ? :-)

Thanks
Stanislaw
Lorenzo Bianconi Aug. 1, 2018, 8:40 a.m. UTC | #5
On Aug 01, Stanislaw Gruszka wrote:
> On Wed, Aug 01, 2018 at 10:39:58AM +0300, Kalle Valo wrote:
> > Stanislaw Gruszka <sgruszka@redhat.com> writes:
> > 
> > > Add mt76x0 driver for MT7610U based USB dongles. Currently driver
> > > support only STA mode.
> > >
> > > mt76x0 is based on Jakub's mt7601u driver already included
> > > in the kernel. I would like the driver be integrated as part
> > > of mt76 (instead of separate driver in mediatek dir like mt7601u)
> > > to utilize mt76 code for adding support for MT76x0 PCIe devices
> > > in further development.
> > 
> > So what's the future for mt7601u, are we going to delete it? What's
> > Jakub's opinion about all this? And what's the delta featurewise between
> > mt7601u and this driver? Which one will be loaded by default?
> 
> mt7601u is driver for different chip: MT7601. This driver if for MT7610
> chip. There are lot of similarities between the drivers, but there are
> bunch of differences too. And in the future development of mt76x0, due
> to integration into mt76 and mt76x2u and adding support for PCIe chips,
> the differences against mt7601u will be much be bigger.
> 
> > Also I noticed that mt76 is missing an entry in MAINTAINERS file? Could
> > someone send a separate patch to add that, please?
> 
> The question is if Felix would like to be the maintainer? Otherwise who would
> want to do this job? I think the best option would be to get some
> commitment from Mediatek if that possible, maybe Sean Wang could aggree
> to be the maintainer ? :-)

Maybe add multiple maintainers? I think the best option is Felix (if he agrees)
since he started the work and he has more experience/knowledge of the code

Regards,
Lorenzo

> 
> Thanks
> Stanislaw
Kalle Valo Aug. 2, 2018, 5:20 p.m. UTC | #6
Lorenzo Bianconi <lorenzo.bianconi@redhat.com> writes:

> On Aug 01, Stanislaw Gruszka wrote:
>> On Wed, Aug 01, 2018 at 10:39:58AM +0300, Kalle Valo wrote:
>> > Stanislaw Gruszka <sgruszka@redhat.com> writes:
>> > 
>> > > Add mt76x0 driver for MT7610U based USB dongles. Currently driver
>> > > support only STA mode.
>> > >
>> > > mt76x0 is based on Jakub's mt7601u driver already included
>> > > in the kernel. I would like the driver be integrated as part
>> > > of mt76 (instead of separate driver in mediatek dir like mt7601u)
>> > > to utilize mt76 code for adding support for MT76x0 PCIe devices
>> > > in further development.
>> > 
>> > So what's the future for mt7601u, are we going to delete it? What's
>> > Jakub's opinion about all this? And what's the delta featurewise between
>> > mt7601u and this driver? Which one will be loaded by default?
>> 
>> mt7601u is driver for different chip: MT7601. This driver if for MT7610
>> chip. There are lot of similarities between the drivers, but there are
>> bunch of differences too. And in the future development of mt76x0, due
>> to integration into mt76 and mt76x2u and adding support for PCIe chips,
>> the differences against mt7601u will be much be bigger.
>> 
>> > Also I noticed that mt76 is missing an entry in MAINTAINERS file? Could
>> > someone send a separate patch to add that, please?
>> 
>> The question is if Felix would like to be the maintainer? Otherwise who would
>> want to do this job? I think the best option would be to get some
>> commitment from Mediatek if that possible, maybe Sean Wang could aggree
>> to be the maintainer ? :-)
>
> Maybe add multiple maintainers? I think the best option is Felix (if he agrees)
> since he started the work and he has more experience/knowledge of the code

Yeah, multiple maintainers would also work. Another option is to have
one maintainer and one or more reviewers:

        R: Designated reviewer: FullName <address@domain>
           These reviewers should be CCed on patches.

And even better if Mediatek could actively join the development and
review.