summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_mcu.h
Commit message (Collapse)AuthorAgeFilesLines
* mt76: move mt76_mcu_msg_alloc in mt76-coreLorenzo Bianconi2019-02-181-0/+6
| | | | | | | | 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 <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: remove wait argument from mt76x02_mcu_calibrateStanislaw Gruszka2018-11-301-2/+1Star
| | | | | | | | | We always wait for CMD_CALIBRATION_OP mcu message, but wait argument is used for do additional MT_MCU_COM_REG0 register operations, which are needed for mt76x2e devices and we can use appropriate check instead of wait argument. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: remove wait argument from mt76x02_mcu_set_radio_stateStanislaw Gruszka2018-11-301-2/+1Star
| | | | | | | | | | Remove wait argument from mt76x02_mcu_set_radio_state and newer wait for response when sending CMD_POWER_SAVING_OP mcu command. Note this change behaviour for PCIe devices, but the change is in align with vendor driver. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: remove wait argument from mt76x02_mcu_function_selectStanislaw Gruszka2018-11-301-3/+2Star
| | | | | | | | | | | | | Remove wait argument from mt76x02_mcu_function_select and wait for response when function is not Q_SELECT, what is the same behaviour like in vendor driver. Note this change behaviour for PCIe devices for Q_SELECT function form wait to no-wait, and for mt76x0u BW_SETTING from no-wait to wait. But the change is in align with vendor driver. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: remove mcu_msg_allocStanislaw Gruszka2018-11-301-3/+2Star
| | | | | | | | | | | | We almost always use patter like this: skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); return mt76_mcu_send_msg(dev, skb, CMD_FUN_SET_OP, wait_resp); This is not needed, we can allocate skb in mcu_send_msg routine. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mcu.cLorenzo Bianconi2018-10-131-6/+8
| | | | | | | | Use mt76x02_dev data structure as reference in mt76x02_mcu.c instead of mt76_dev 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-051-1/+1
| | | | | | | | | | | | | | | | | | | 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>
* mt76: report firmware version using ethtoolDavide Caratti2018-10-011-0/+2
| | | | | | | | | print fw_ver and build_ver members of struct mt76x02_fw_header, similarly to what appears in the output of 'dmesg' when the MCU firmware is loaded. Reported-by: Sid Hayn <sidhayn@gmail.com> Signed-off-by: Davide Caratti <dcaratti@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: pci: add fw uploading routineLorenzo Bianconi2018-10-011-0/+9
| | | | | | | | | Add pci load firmware routine. Move some shared mcu definitions in mt76x02_mcu.h Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move shared mcu_calibrate routine in mt76x02-lib moduleLorenzo Bianconi2018-09-191-0/+2
| | | | | | | | | Move mcu_calibrate routine in mt76x02-lib module since it is shared between USB and PCI code. Moreover remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76{0,2} mcu shared code in mt76x02_mcu.cLorenzo Bianconi2018-09-191-0/+10
| | | | | | | | Move shared mt76x2/mt76x0 mcu shared code in a common file and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify firmware header between mt76x0 and mt76x2Lorenzo Bianconi2018-09-191-0/+17
| | | | | | | | Move mt76x2_fw_header definition in mt76x02_mcu.h and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76x0 and mt76x2 mcu shared defs in mt76x02_mcu.hLorenzo Bianconi2018-09-191-0/+71
Move mt76x0 and mt76x2 mcu shared definition in mt76x02_mcu.h and remove duplicated code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>