Skip to content

Commit cf29576

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2019-03-01' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== wireless-drivers-next patches for 5.1 Last set of patches. A new hardware support for mt76 otherwise quite normal. Major changes: mt76 * add driver for MT7603E/MT7628 ath10k * more preparation for SDIO support wil6210 * support up to 20 stations in AP mode ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 2a8e499 + 501faf7 commit cf29576

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+7121
-768
lines changed

Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ This node provides properties for configuring the MediaTek mt76xx wireless
44
device. The node is expected to be specified as a child node of the PCI
55
controller to which the wireless chip is connected.
66

7+
Alternatively, it can specify the wireless part of the MT7628/MT7688 SoC.
8+
For SoC, use the compatible string "mediatek,mt7628-wmac" and the following
9+
properties:
10+
11+
- reg: Address and length of the register set for the device.
12+
- interrupts: Main device interrupt
13+
714
Optional properties:
815

916
- mac-address: See ethernet.txt in the parent directory
@@ -30,3 +37,15 @@ Optional nodes:
3037
};
3138
};
3239
};
40+
41+
MT7628 example:
42+
43+
wmac: wmac@10300000 {
44+
compatible = "mediatek,mt7628-wmac";
45+
reg = <0x10300000 0x100000>;
46+
47+
interrupt-parent = <&cpuintc>;
48+
interrupts = <6>;
49+
50+
mediatek,mtd-eeprom = <&factory 0x0000>;
51+
};

drivers/net/wireless/ath/ath10k/ce.c

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,8 @@ EXPORT_SYMBOL(ath10k_ce_revoke_recv_next);
10661066
* Guts of ath10k_ce_completed_send_next.
10671067
* The caller takes responsibility for any necessary locking.
10681068
*/
1069-
int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
1070-
void **per_transfer_contextp)
1069+
static int _ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
1070+
void **per_transfer_contextp)
10711071
{
10721072
struct ath10k_ce_ring *src_ring = ce_state->src_ring;
10731073
u32 ctrl_addr = ce_state->ctrl_addr;
@@ -1118,6 +1118,66 @@ int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
11181118

11191119
return 0;
11201120
}
1121+
1122+
static int _ath10k_ce_completed_send_next_nolock_64(struct ath10k_ce_pipe *ce_state,
1123+
void **per_transfer_contextp)
1124+
{
1125+
struct ath10k_ce_ring *src_ring = ce_state->src_ring;
1126+
u32 ctrl_addr = ce_state->ctrl_addr;
1127+
struct ath10k *ar = ce_state->ar;
1128+
unsigned int nentries_mask = src_ring->nentries_mask;
1129+
unsigned int sw_index = src_ring->sw_index;
1130+
unsigned int read_index;
1131+
struct ce_desc_64 *desc;
1132+
1133+
if (src_ring->hw_index == sw_index) {
1134+
/*
1135+
* The SW completion index has caught up with the cached
1136+
* version of the HW completion index.
1137+
* Update the cached HW completion index to see whether
1138+
* the SW has really caught up to the HW, or if the cached
1139+
* value of the HW index has become stale.
1140+
*/
1141+
1142+
read_index = ath10k_ce_src_ring_read_index_get(ar, ctrl_addr);
1143+
if (read_index == 0xffffffff)
1144+
return -ENODEV;
1145+
1146+
read_index &= nentries_mask;
1147+
src_ring->hw_index = read_index;
1148+
}
1149+
1150+
if (ar->hw_params.rri_on_ddr)
1151+
read_index = ath10k_ce_src_ring_read_index_get(ar, ctrl_addr);
1152+
else
1153+
read_index = src_ring->hw_index;
1154+
1155+
if (read_index == sw_index)
1156+
return -EIO;
1157+
1158+
if (per_transfer_contextp)
1159+
*per_transfer_contextp =
1160+
src_ring->per_transfer_context[sw_index];
1161+
1162+
/* sanity */
1163+
src_ring->per_transfer_context[sw_index] = NULL;
1164+
desc = CE_SRC_RING_TO_DESC_64(src_ring->base_addr_owner_space,
1165+
sw_index);
1166+
desc->nbytes = 0;
1167+
1168+
/* Update sw_index */
1169+
sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index);
1170+
src_ring->sw_index = sw_index;
1171+
1172+
return 0;
1173+
}
1174+
1175+
int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
1176+
void **per_transfer_contextp)
1177+
{
1178+
return ce_state->ops->ce_completed_send_next_nolock(ce_state,
1179+
per_transfer_contextp);
1180+
}
11211181
EXPORT_SYMBOL(ath10k_ce_completed_send_next_nolock);
11221182

11231183
static void ath10k_ce_extract_desc_data(struct ath10k *ar,
@@ -1839,6 +1899,7 @@ static const struct ath10k_ce_ops ce_ops = {
18391899
.ce_send_nolock = _ath10k_ce_send_nolock,
18401900
.ce_set_src_ring_base_addr_hi = NULL,
18411901
.ce_set_dest_ring_base_addr_hi = NULL,
1902+
.ce_completed_send_next_nolock = _ath10k_ce_completed_send_next_nolock,
18421903
};
18431904

18441905
static const struct ath10k_ce_ops ce_64_ops = {
@@ -1853,6 +1914,7 @@ static const struct ath10k_ce_ops ce_64_ops = {
18531914
.ce_send_nolock = _ath10k_ce_send_nolock_64,
18541915
.ce_set_src_ring_base_addr_hi = ath10k_ce_set_src_ring_base_addr_hi,
18551916
.ce_set_dest_ring_base_addr_hi = ath10k_ce_set_dest_ring_base_addr_hi,
1917+
.ce_completed_send_next_nolock = _ath10k_ce_completed_send_next_nolock_64,
18561918
};
18571919

18581920
static void ath10k_ce_set_ops(struct ath10k *ar,

drivers/net/wireless/ath/ath10k/ce.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ struct ath10k_ce_ops {
329329
void (*ce_set_dest_ring_base_addr_hi)(struct ath10k *ar,
330330
u32 ce_ctrl_addr,
331331
u64 addr);
332+
int (*ce_completed_send_next_nolock)(struct ath10k_ce_pipe *ce_state,
333+
void **per_transfer_contextp);
332334
};
333335

334336
static inline u32 ath10k_ce_base_address(struct ath10k *ar, unsigned int ce_id)

drivers/net/wireless/ath/ath10k/core.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,10 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
549549
.sw_decrypt_mcast_mgmt = true,
550550
.hw_ops = &wcn3990_ops,
551551
.decap_align_bytes = 1,
552-
.num_peers = TARGET_HL_10_TLV_NUM_PEERS,
552+
.num_peers = TARGET_HL_TLV_NUM_PEERS,
553553
.n_cipher_suites = 11,
554-
.ast_skid_limit = TARGET_HL_10_TLV_AST_SKID_LIMIT,
555-
.num_wds_entries = TARGET_HL_10_TLV_NUM_WDS_ENTRIES,
554+
.ast_skid_limit = TARGET_HL_TLV_AST_SKID_LIMIT,
555+
.num_wds_entries = TARGET_HL_TLV_NUM_WDS_ENTRIES,
556556
.target_64bit = true,
557557
.rx_ring_fill_level = HTT_RX_RING_FILL_LEVEL_DUAL_MAC,
558558
.per_ce_irq = true,
@@ -637,11 +637,24 @@ static void ath10k_init_sdio(struct ath10k *ar)
637637
ath10k_bmi_write32(ar, hi_mbox_isr_yield_limit, 99);
638638
ath10k_bmi_read32(ar, hi_acs_flags, &param);
639639

640-
param |= (HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET |
641-
HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET |
642-
HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE);
640+
/* Data transfer is not initiated, when reduced Tx completion
641+
* is used for SDIO. disable it until fixed
642+
*/
643+
param &= ~HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET;
643644

645+
/* Alternate credit size of 1544 as used by SDIO firmware is
646+
* not big enough for mac80211 / native wifi frames. disable it
647+
*/
648+
param &= ~HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE;
649+
param |= HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET;
644650
ath10k_bmi_write32(ar, hi_acs_flags, param);
651+
652+
/* Explicitly set fwlog prints to zero as target may turn it on
653+
* based on scratch registers.
654+
*/
655+
ath10k_bmi_read32(ar, hi_option_flag, &param);
656+
param |= HI_OPTION_DISABLE_DBGLOG;
657+
ath10k_bmi_write32(ar, hi_option_flag, param);
645658
}
646659

647660
static int ath10k_init_configure_target(struct ath10k *ar)
@@ -2304,8 +2317,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
23042317
else
23052318
ar->htt.max_num_pending_tx = TARGET_TLV_NUM_MSDU_DESC;
23062319
ar->wow.max_num_patterns = TARGET_TLV_NUM_WOW_PATTERNS;
2307-
ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
2308-
WMI_STAT_PEER;
2320+
ar->fw_stats_req_mask = WMI_TLV_STAT_PDEV | WMI_TLV_STAT_VDEV |
2321+
WMI_TLV_STAT_PEER | WMI_TLV_STAT_PEER_EXTD;
23092322
ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM;
23102323
ar->wmi.mgmt_max_num_pending_tx = TARGET_TLV_MGMT_NUM_MSDU_DESC;
23112324
break;

drivers/net/wireless/ath/ath10k/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct ath10k_fw_stats_peer {
189189
u32 peer_rssi;
190190
u32 peer_tx_rate;
191191
u32 peer_rx_rate; /* 10x only */
192-
u32 rx_duration;
192+
u64 rx_duration;
193193
};
194194

195195
struct ath10k_fw_extd_stats_peer {

drivers/net/wireless/ath/ath10k/debug.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,9 @@ static int ath10k_debug_cal_data_fetch(struct ath10k *ar)
12521252
if (WARN_ON(ar->hw_params.cal_data_len > ATH10K_DEBUG_CAL_DATA_LEN))
12531253
return -EINVAL;
12541254

1255+
if (ar->hw_params.cal_data_len == 0)
1256+
return -EOPNOTSUPP;
1257+
12551258
hi_addr = host_interest_item_address(HI_ITEM(hi_board_data));
12561259

12571260
ret = ath10k_hif_diag_read(ar, hi_addr, &addr, sizeof(addr));

drivers/net/wireless/ath/ath10k/debugfs_sta.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,11 +685,12 @@ static ssize_t ath10k_dbg_sta_dump_tx_stats(struct file *file,
685685
" %llu ", stats->ht[j][i]);
686686
len += scnprintf(buf + len, size - len, "\n");
687687
len += scnprintf(buf + len, size - len,
688-
" BW %s (20,40,80,160 MHz)\n", str[j]);
688+
" BW %s (20,5,10,40,80,160 MHz)\n", str[j]);
689689
len += scnprintf(buf + len, size - len,
690-
" %llu %llu %llu %llu\n",
690+
" %llu %llu %llu %llu %llu %llu\n",
691691
stats->bw[j][0], stats->bw[j][1],
692-
stats->bw[j][2], stats->bw[j][3]);
692+
stats->bw[j][2], stats->bw[j][3],
693+
stats->bw[j][4], stats->bw[j][5]);
693694
len += scnprintf(buf + len, size - len,
694695
" NSS %s (1x1,2x2,3x3,4x4)\n", str[j]);
695696
len += scnprintf(buf + len, size - len,

drivers/net/wireless/ath/ath10k/htt.h

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,10 @@ struct htt_mgmt_tx_completion {
578578
#define HTT_TX_CMPL_FLAG_PA_PRESENT BIT(2)
579579
#define HTT_TX_CMPL_FLAG_PPDU_DURATION_PRESENT BIT(3)
580580

581+
#define HTT_TX_DATA_RSSI_ENABLE_WCN3990 BIT(3)
582+
#define HTT_TX_DATA_APPEND_RETRIES BIT(0)
583+
#define HTT_TX_DATA_APPEND_TIMESTAMP BIT(1)
584+
581585
struct htt_rx_indication_hdr {
582586
u8 info0; /* %HTT_RX_INDICATION_INFO0_ */
583587
__le16 peer_id;
@@ -852,6 +856,88 @@ enum htt_data_tx_flags {
852856

853857
#define HTT_TX_COMPL_INV_MSDU_ID 0xFFFF
854858

859+
struct htt_append_retries {
860+
__le16 msdu_id;
861+
u8 tx_retries;
862+
u8 flag;
863+
} __packed;
864+
865+
struct htt_data_tx_completion_ext {
866+
struct htt_append_retries a_retries;
867+
__le32 t_stamp;
868+
__le16 msdus_rssi[0];
869+
} __packed;
870+
871+
/**
872+
* @brief target -> host TX completion indication message definition
873+
*
874+
* @details
875+
* The following diagram shows the format of the TX completion indication sent
876+
* from the target to the host
877+
*
878+
* |31 28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
879+
* |-------------------------------------------------------------|
880+
* header: |rsvd |A2|TP|A1|A0| num | t_i| tid |status| msg_type |
881+
* |-------------------------------------------------------------|
882+
* payload: | MSDU1 ID | MSDU0 ID |
883+
* |-------------------------------------------------------------|
884+
* : MSDU3 ID : MSDU2 ID :
885+
* |-------------------------------------------------------------|
886+
* | struct htt_tx_compl_ind_append_retries |
887+
* |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
888+
* | struct htt_tx_compl_ind_append_tx_tstamp |
889+
* |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
890+
* | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
891+
* |-------------------------------------------------------------|
892+
* : MSDU3 ACK RSSI : MSDU2 ACK RSSI :
893+
* |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
894+
* -msg_type
895+
* Bits 7:0
896+
* Purpose: identifies this as HTT TX completion indication
897+
* -status
898+
* Bits 10:8
899+
* Purpose: the TX completion status of payload fragmentations descriptors
900+
* Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
901+
* -tid
902+
* Bits 14:11
903+
* Purpose: the tid associated with those fragmentation descriptors. It is
904+
* valid or not, depending on the tid_invalid bit.
905+
* Value: 0 to 15
906+
* -tid_invalid
907+
* Bits 15:15
908+
* Purpose: this bit indicates whether the tid field is valid or not
909+
* Value: 0 indicates valid, 1 indicates invalid
910+
* -num
911+
* Bits 23:16
912+
* Purpose: the number of payload in this indication
913+
* Value: 1 to 255
914+
* -A0 = append
915+
* Bits 24:24
916+
* Purpose: append the struct htt_tx_compl_ind_append_retries which contains
917+
* the number of tx retries for one MSDU at the end of this message
918+
* Value: 0 indicates no appending, 1 indicates appending
919+
* -A1 = append1
920+
* Bits 25:25
921+
* Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
922+
* contains the timestamp info for each TX msdu id in payload.
923+
* Value: 0 indicates no appending, 1 indicates appending
924+
* -TP = MSDU tx power presence
925+
* Bits 26:26
926+
* Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
927+
* for each MSDU referenced by the TX_COMPL_IND message.
928+
* The order of the per-MSDU tx power reports matches the order
929+
* of the MSDU IDs.
930+
* Value: 0 indicates not appending, 1 indicates appending
931+
* -A2 = append2
932+
* Bits 27:27
933+
* Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
934+
* TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
935+
* matches the order of the MSDU IDs.
936+
* The ACK RSSI values are valid when status is COMPLETE_OK (and
937+
* this append2 bit is set).
938+
* Value: 0 indicates not appending, 1 indicates appending
939+
*/
940+
855941
struct htt_data_tx_completion {
856942
union {
857943
u8 flags;

0 commit comments

Comments
 (0)