Move tear-down routines in mt76x0_mac_stop function.
mt76x0_mac_stop routines will be reused in mt76x0_suspend
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Fix memory leak during hw probe if mt76x0_register_device fails
since MT76_STATE_INITIALIZED has not set yet and mt76x0_cleanup
does not free tx/rx queues and mcu buffers
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
swap mt76u_mcu_init_rx and mt76x0_mcu_function_select in
mt76x0_mcu_cmd_init routine in order to allocate mcu buffers
first and then send mcu commands
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Move mt76x2_rate definition in mt76x02-lib module and rename it in
mt76x02_rates in order to be reused in mt76x0 driver.
Moreover remove unused mt76_rate definition
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Since it is actually used in a single place and it just
runs mt76x0_chip_onoff routine, remove mt76x0_stop_hardware
and use mt76x0_chip_onoff directly
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
We need to truncate skb to proper length. This fix below message:
wlan0: associating with AP with corrupt beacon and probe response
Fixes: 9d87d9fad47e ("mt76x0: unify tx/rx datapath with mt76x2u driver")
Signed-off-by: Stanislaw Gruszka <[email protected]>
Initialize wake_tx_queue function pointer in ieee80211_ops
in order to enable per-sta tx queueing. Moreover set driver
private txq size
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Remove unused tx_status workqueue since now tx feedbacks are
processed by mt76-usb layer
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Remove unused dma.c source file since dma related routines are no
longer used
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Set maximum number of tx fragments according to usb controller
features
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Use mt76/mt76-usb shared routine for tx/rx datapath.
Initialize mt76-usb tx/rx queues in mt76x0_init_hardware and
deallocate them in mt76x0_cleanup routine.
Moreover remove data padding in mt76_mac_process_rx routine.
Furthermore remove unused skb2q routine
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Introduce mt76x0_queue_rx_skb routine as mt76x0 driver
frame rx handler. mt76x0_queue_rx_skb will be run by mt76-usb layer
rx datapath
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Set MT76_STATE_RUNNING flag in mt76x0_start routine and
clear it in mt76x0_stop one
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
In order to use zero-copying, disable usb rx bulk aggregation
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Init mt76_driver_ops callbacks in mt76x0_alloc_device.
mt76_driver_ops callbacks will be used by mt76-usb module
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Add mt76x0_tx_prepare_skb routine as tx txwi handler.
mt76x0_tx_prepare_skb will be used by mt76-usb layer
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Move mt76x2u_remove_dma_hdr in mt76x02-lib module and rename it in
mt76x02_remove_dma_hdr. Moreover use mt76x02_remove_hdr_pad routine
in mt76x02_remove_dma_hdr function.
Furthermore remove mt76x0_tx_skb_remove_dma_overhead routine
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Stanislaw Gruszka <[email protected]>
Allocate skg with enough headroom by mac80211 , this eliminate need
to add extra skb headroom by the mt76x0 driver.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Use common sta_rate_tbl_update on mt76x0 and mt76x2.
mt76x0 do not have support TPC (transmision power control) implmented,
msta->wcid.max_txpwr_adj is only set for mt76x2.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Make common add_interface for mt76x0 and mt76x2e. This change behavior
for mt76x0, but it should work with the new implementation.
mt76x2u has different implementation. Maybe it can use common one,
but for now leave it as is.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Use one conf_tx implementation in mt76x0 and mt76x2. Note this change
conf_tx for mt76x0, but it should work with mt76x2 version.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Use the same AC to hardware queue mappings for all subdrivers.
Note: this change BK and BE mappings for USB drivers.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Use mt76x2_ampdu_action as common function, mt76x0 ampdu_action was
diffrent, but mt76x2 version should work for this driver as well.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Merge mt76x0 and mt76x0 sta add/remove callback. We drop
mt76x0_mac_set_ampdu_factor() for now. Need to consider to add
it to common code, but mt76x2 don't do it so perhaps mt76x0 don't
need it as well.
Signed-off-by: Stanislaw Gruszka <[email protected]>
All current MT devices including new MT7603 type chips support 128
WCIDs, we can unify wcid data in common mt76_dev structure.
Signed-off-by: Stanislaw Gruszka <[email protected]>
Remove the following unused routines for usb buffer
allocation/free/submit:
- mt76x0_usb_alloc_buf
- mt76x0_usb_free_buf
- mt76x0_usb_submit_buf
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Use mt76u_mcu_fw_send_data utility routine for firmware uploading and
remove unused __mt76x0_dma_fw/mt76x0_dma_fw functions
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Use mt76u_mcu_send_msg/__mt76u_mcu_send_msg utility routines to
send commands to usb mcu. Remove following unused routines:
- mt76x0_mcu_wait_resp
- __mt76x0_mcu_msg_send
- mt76x0_mcu_msg_send
- mt76x0_dma_skb_wrap_cmd
- trace_mt_mcu_msg_send_cs
- mt76x0_mcu_cmd_deinit
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>