Commit Graph
21 Commits
Author SHA1 Message Date
Cai HuoqingandFelix Fietkau fd25a55096 mt76: Make use of the helper macro kthread_run()
Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Signed-off-by: Cai Huoqing <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2021-10-23 07:27:31 +02:00
Felix Fietkau 974486ec26 util: in worker setup, only overwrite function pointer if not NULL
Can be used to set up the worker function pointer earlier

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-24 20:46:05 +02:00
Felix Fietkau 87a6942906 mt76: add utility functions for deferring work to a kernel thread
In order to avoid keeping work like tx scheduling pinned to the CPU it was
scheduled from, it makes sense to switch from tasklets to kernel threads.

Signed-off-by: Felix Fietkau <[email protected]>
2020-08-22 15:56:57 +02:00
Felix Fietkau 984a172609 mt76: fix wcid allocation issues
mt76 core uses ffs() to find the next free bit. This works well for 32 bit
architectures where BITS_PER_LONG is 32. ffs only checks 32 bit values, so
allocation fails on 64 bit architectures.
Additionally, the wcid mask array was too small in cases where the array
was not a multiple of BITS_PER_LONG.
Fix this by making the wcid mask array u32 instead and use DIV_ROUND_UP
for the size, just in case we ever bump it to a value that's not a multiple
of 32.

Signed-off-by: Felix Fietkau <[email protected]>
2020-05-23 14:42:49 +02:00
Thomas GleixnerandFelix Fietkau 5dc6f6fcc0 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174
Based on 1 normalized pattern(s):

  this program is free software you can redistribute it and or modify
  it under the terms of the gnu general public license version 2 as
  published by the free software foundation this program is
  distributed in the hope that it will be useful but without any
  warranty without even the implied warranty of merchantability or
  fitness for a particular purpose see the gnu general public license
  for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 655 file(s).

Signed-off-by: Thomas Gleixner <[email protected]>
Reviewed-by: Allison Randal <[email protected]>
Reviewed-by: Kate Stewart <[email protected]>
Reviewed-by: Richard Fontana <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-12-13 22:34:44 +01:00
Felix Fietkau e5e755a7a6 mt76: add support for an extra wiphy in mt76_sta_state()
This is preparation for supporting multiple wiphys per device to support the
concurrent dual-band feature of MT7615D

Signed-off-by: Felix Fietkau <[email protected]>
2019-11-20 12:54:17 +01:00
Ryder LeeandFelix Fietkau 37673a4181 mt76: fix some checkpatch warnings
This fixes the following checkpatch warnings:
CHECK: Alignment should match open parenthesis
CHECK: No space is necessary after a cast

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-22 09:26:30 +02:00
Felix Fietkau 05e961782d move mt76_insert_hdr_pad to mt76x2_tx.c
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 18:06:48 +02:00
Felix Fietkau 01c63035b6 move mt76_remove_hdr_pad to mt76x2_mac.c
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 18:05:40 +02:00
Felix Fietkau b300bdc42e use the new bitfield accessor macros
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 17:37:26 +02:00
Felix Fietkau 53c1b7f6ac update my email address
Signed-off-by: Felix Fietkau <[email protected]>
2016-09-04 17:33:28 +02:00
Felix Fietkau 079ad90fe2 update copyright lines
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-25 18:09:13 +01:00
Felix Fietkau 33189cedfa mt7603: fix wcid leak
Signed-off-by: Felix Fietkau <[email protected]>
2016-02-19 09:26:42 +01:00
Felix Fietkau b9484962c7 move mt76_wcid_alloc to core
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-20 22:40:53 +01:00
Felix Fietkau 43d5b84989 move tx scheduling code to common
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-16 19:04:06 +01:00
Felix Fietkau 7150f5222f move GENMASK definition to util.h
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 18:13:34 +01:00
Felix Fietkau 4784fc1ed4 include linux/skbuff.h from util.h
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 17:25:42 +01:00
Felix Fietkau 1212107d7b move header pad insert/remove functions and utility header to a new core module
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 17:01:42 +01:00
Felix Fietkau a0ee20716f add a mt76x2_ prefix to all files
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 16:54:53 +01:00
Felix Fietkau 00c6c3d012 util: add explicit typecasts for MT76_GET/MT76_SET
Signed-off-by: Felix Fietkau <[email protected]>
2014-11-27 17:35:46 +01:00
Felix Fietkau 9e7049b1d1 Initial import
Signed-off-by: Felix Fietkau <[email protected]>
2014-11-20 21:21:19 +01:00