Commit Graph
23 Commits
Author SHA1 Message Date
Lorenzo BianconiandFelix Fietkau 01b9432957 mt76: move mt76_mcu_send_firmware in common module
Move mt76_mcu_send_firmware routine in common code since it is actually
shared between mt7615, mt7663, mt7603 and mt7915 devices

Signed-off-by: Lorenzo Bianconi <[email protected]>
2020-11-10 13:19:53 +01:00
Felix Fietkau 082b261810 mt76: implement functions to get the response skb for MCU calls
Can be used by the caller to get the response data directly instead of using the
hack of storing the result in internal data structures from .mcu_parse_response

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 05:35:49 +02:00
Felix Fietkau a4d71501ba mt76: make mcu_ops->mcu_send_msg optional
Remove it from mt7615 and mt7915 and implement it in core code instead

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 05:35:49 +02:00
Felix Fietkau 477caa196f mt76: move waiting and locking out of mcu_ops->mcu_skb_send_msg
This removes some code duplication and prepares the code for making
the MCU API more flexible

Signed-off-by: Felix Fietkau <[email protected]>
2020-09-30 05:35:49 +02:00
Lorenzo BianconiandFelix Fietkau 72c9380e70 mt76: add headroom and tailroom to mt76_mcu_ops data structure
Introduce headroom and tailroom to mt76_mcu_ops data structure in order
to unify the routine used for mcu message allocation. This is a
preliminary patch to add mt7663u support

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-04-06 12:20:12 +02:00
Lorenzo BianconiandFelix Fietkau 7fbd2a57ce mt76: always init to 0 mcu messages
Always initialize to 0 mcu messages since if they are not propely
configured they could hang the firmware.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2020-03-17 17:50:15 +01:00
Lorenzo BianconiandFelix Fietkau f408a2b756 mt76: Introduce mt76_mcu data structure
Introduce mt76_mcu data structure to contain common fields between
mt76u_mcu and mt76e_mcu.
Initialize mcu common fields in mt76_alloc_device().
Rely on mt76_mcu in mt76_mcu_rx_event and in mt76_mcu_get_response
in order to reuse them in usb code

Signed-off-by: Lorenzo Bianconi <[email protected]>
2020-02-14 10:16:16 +01:00
Felix Fietkau 0f06914acf mt76: mt7615: implement hardware reset support
When the firmware detects a problem, it needs the host to stop/reset DMA and
resume it again when the hardware state has been reset.

Signed-off-by: Felix Fietkau <[email protected]>
2020-01-31 16:37:02 +01:00
Ryder LeeandFelix Fietkau f625afcedc mt76: switch to SPDX tag instead of verbose boilerplate text
No functional change intended.

Add SPDX identifiers to all remaining files in /mt76.

Signed-off-by: Ryder Lee <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-08-20 15:22:20 +02:00
Lorenzo BianconiandFelix Fietkau 1763cb0d38 mt76: move mt76_mcu_rx_event in mt76-core
Move mt76_mcu_rx_event i mt76-core module and remove duplicated code.
mt76_mcu_rx_event will be reused adding support for mt7603 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:44 +01:00
Lorenzo BianconiandFelix Fietkau 4637f95417 mt76: move mt76_mcu_get_response in mt76-core
Move mt76_mcu_get_response in mt76-core module and remove duplicated
code. mt76_mcu_get_response will be reused adding support for mt7603
driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:44 +01:00
Lorenzo BianconiandFelix Fietkau 6e33ce6d73 mt76: move mt76_mcu_msg_alloc in mt76-core
Move mt76_mcu_msg_alloc in mt76-core module and remove duplicated code.
mt76_mcu_msg_alloc will be reused adding support for mt7603 driver

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
2019-02-07 14:48:34 +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 31c11fdb05 replace mt76 prefix with mt76x2 in preparation for splitting the driver for more chipset support
Signed-off-by: Felix Fietkau <[email protected]>
2015-12-06 16:54:53 +01:00
Felix Fietkau 9ec1f17795 mcu: skip ROM patch check/locking on mt7612, always apply patch
Signed-off-by: Felix Fietkau <[email protected]>
2015-09-26 02:37:40 +02:00
Felix Fietkau 9f5f5d283e mcu: set MAC co-clock option based on EEPROM data
Signed-off-by: Felix Fietkau <[email protected]>
2015-08-05 18:37:30 +02:00
Felix Fietkau a02ed80058 mcu: fix uninitialized variable
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-27 20:44:19 +02:00
Felix Fietkau a2015fbffc dma: add dma_ops function for queueing mcu command messages
Signed-off-by: Felix Fietkau <[email protected]>
2015-07-17 19:30:27 +02:00
Jakub KicinskiandFelix Fietkau 7d8c14df00 mt76_mcu_function_select() should be static
Signed-off-by: Jakub Kicinski <[email protected]>
2015-06-17 10:19:45 +02:00
Jakub Kicinski 295951c20a use precision to cap length of firmware strings
It is the precision not field width in the format
which limits length of printed string.

Fixes: 28f93be713 ("remove get_string helper")
Signed-off-by: Jakub Kicinski <[email protected]>
2015-02-23 19:00:07 +01:00
Jakub Kicinski a4498bb148 remember to release firmware
Signed-off-by: Jakub Kicinski <[email protected]>
2015-02-01 11:15:47 +01:00
Jakub Kicinski 28f93be713 remove get_string helper
There is no need to copy strings, printk will not read past field
width and strings in firmware are padded with '_' so we will not
save any space by not using field widths.

Signed-off-by: Jakub Kicinski <[email protected]>
2015-02-01 11:08:38 +01:00
Felix Fietkau 9e7049b1d1 Initial import
Signed-off-by: Felix Fietkau <[email protected]>
2014-11-20 21:21:19 +01:00