Skip to content

Commit 24a72b7

Browse files
committed
Merge tag 'wireless-drivers-next-for-davem-2017-06-25' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next
Kalle Valo says: ==================== wireless-drivers-next patches for 4.13 New features and bug fixes to quite a few different drivers, but nothing really special standing out. What makes me happy that we have now more vendors actively contributing to upstream drivers. In this pull request we have patches from Broadcom, Intel, Qualcomm, Realtek and Redpine Signals, and I still have patches from Marvell and Quantenna pending in patchwork. Now that's something comparing to how things looked 11 years ago in Jeff Garzik's "State of the Union: Wireless" email: https://lkml.org/lkml/2006/1/5/671 Major changes: wil6210 * add low level RF sector interface via nl80211 vendor commands * add module parameter ftm_mode to load separate firmware for factory testing * support devices with different PCIe bar size * add support for PCIe D3hot in system suspend * remove ioctl interface which should not be in a wireless driver ath10k * go back to using dma_alloc_coherent() for firmware scratch memory * add per chain RSSI reporting brcmfmac * add support multi-scheduled scan * add scheduled scan support for specified BSSIDs * add support for brcm43430 revision 0 wlcore * add wil1285 compatible rsi * add RS9113 USB support iwlwifi * FW API documentation improvements (for tools and htmldoc) * continuing work for the new A000 family * bump the maximum supported FW API to 31 * improve the differentiation between 8000, 9000 and A000 families ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents ca7bbc8 + 52f8c93 commit 24a72b7

File tree

147 files changed

+5602
-1821
lines changed

Some content is hidden

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

147 files changed

+5602
-1821
lines changed

Documentation/devicetree/bindings/net/wireless/ti,wlcore.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Required properties:
1010
* "ti,wl1273"
1111
* "ti,wl1281"
1212
* "ti,wl1283"
13+
* "ti,wl1285"
1314
* "ti,wl1801"
1415
* "ti,wl1805"
1516
* "ti,wl1807"

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ enum bmi_cmd_id {
8383
#define BMI_NVRAM_SEG_NAME_SZ 16
8484

8585
#define BMI_PARAM_GET_EEPROM_BOARD_ID 0x10
86+
#define BMI_PARAM_GET_FLASH_BOARD_ID 0x8000
87+
#define BMI_PARAM_FLASH_SECTION_ALL 0x10000
8688

8789
#define ATH10K_BMI_BOARD_ID_FROM_OTP_MASK 0x7c00
8890
#define ATH10K_BMI_BOARD_ID_FROM_OTP_LSB 10
@@ -188,8 +190,8 @@ struct bmi_target_info {
188190
u32 type;
189191
};
190192

191-
/* in msec */
192-
#define BMI_COMMUNICATION_TIMEOUT_HZ (2 * HZ)
193+
/* in jiffies */
194+
#define BMI_COMMUNICATION_TIMEOUT_HZ (3 * HZ)
193195

194196
#define BMI_CE_NUM_TO_TARG 0
195197
#define BMI_CE_NUM_TO_HOST 1

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

Lines changed: 105 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -59,205 +59,243 @@
5959
* the buffer is sent/received.
6060
*/
6161

62+
static inline unsigned int
63+
ath10k_set_ring_byte(unsigned int offset,
64+
struct ath10k_hw_ce_regs_addr_map *addr_map)
65+
{
66+
return ((offset << addr_map->lsb) & addr_map->mask);
67+
}
68+
69+
static inline unsigned int
70+
ath10k_get_ring_byte(unsigned int offset,
71+
struct ath10k_hw_ce_regs_addr_map *addr_map)
72+
{
73+
return ((offset & addr_map->mask) >> (addr_map->lsb));
74+
}
75+
6276
static inline void ath10k_ce_dest_ring_write_index_set(struct ath10k *ar,
6377
u32 ce_ctrl_addr,
6478
unsigned int n)
6579
{
66-
ath10k_pci_write32(ar, ce_ctrl_addr + DST_WR_INDEX_ADDRESS, n);
80+
ath10k_pci_write32(ar, ce_ctrl_addr +
81+
ar->hw_ce_regs->dst_wr_index_addr, n);
6782
}
6883

6984
static inline u32 ath10k_ce_dest_ring_write_index_get(struct ath10k *ar,
7085
u32 ce_ctrl_addr)
7186
{
72-
return ath10k_pci_read32(ar, ce_ctrl_addr + DST_WR_INDEX_ADDRESS);
87+
return ath10k_pci_read32(ar, ce_ctrl_addr +
88+
ar->hw_ce_regs->dst_wr_index_addr);
7389
}
7490

7591
static inline void ath10k_ce_src_ring_write_index_set(struct ath10k *ar,
7692
u32 ce_ctrl_addr,
7793
unsigned int n)
7894
{
79-
ath10k_pci_write32(ar, ce_ctrl_addr + SR_WR_INDEX_ADDRESS, n);
95+
ath10k_pci_write32(ar, ce_ctrl_addr +
96+
ar->hw_ce_regs->sr_wr_index_addr, n);
8097
}
8198

8299
static inline u32 ath10k_ce_src_ring_write_index_get(struct ath10k *ar,
83100
u32 ce_ctrl_addr)
84101
{
85-
return ath10k_pci_read32(ar, ce_ctrl_addr + SR_WR_INDEX_ADDRESS);
102+
return ath10k_pci_read32(ar, ce_ctrl_addr +
103+
ar->hw_ce_regs->sr_wr_index_addr);
86104
}
87105

88106
static inline u32 ath10k_ce_src_ring_read_index_get(struct ath10k *ar,
89107
u32 ce_ctrl_addr)
90108
{
91-
return ath10k_pci_read32(ar, ce_ctrl_addr + CURRENT_SRRI_ADDRESS);
109+
return ath10k_pci_read32(ar, ce_ctrl_addr +
110+
ar->hw_ce_regs->current_srri_addr);
92111
}
93112

94113
static inline void ath10k_ce_src_ring_base_addr_set(struct ath10k *ar,
95114
u32 ce_ctrl_addr,
96115
unsigned int addr)
97116
{
98-
ath10k_pci_write32(ar, ce_ctrl_addr + SR_BA_ADDRESS, addr);
117+
ath10k_pci_write32(ar, ce_ctrl_addr +
118+
ar->hw_ce_regs->sr_base_addr, addr);
99119
}
100120

101121
static inline void ath10k_ce_src_ring_size_set(struct ath10k *ar,
102122
u32 ce_ctrl_addr,
103123
unsigned int n)
104124
{
105-
ath10k_pci_write32(ar, ce_ctrl_addr + SR_SIZE_ADDRESS, n);
125+
ath10k_pci_write32(ar, ce_ctrl_addr +
126+
ar->hw_ce_regs->sr_size_addr, n);
106127
}
107128

108129
static inline void ath10k_ce_src_ring_dmax_set(struct ath10k *ar,
109130
u32 ce_ctrl_addr,
110131
unsigned int n)
111132
{
112-
u32 ctrl1_addr = ath10k_pci_read32((ar),
113-
(ce_ctrl_addr) + CE_CTRL1_ADDRESS);
133+
struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs;
134+
u32 ctrl1_addr = ath10k_pci_read32(ar,
135+
ce_ctrl_addr + ctrl_regs->addr);
114136

115-
ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS,
116-
(ctrl1_addr & ~CE_CTRL1_DMAX_LENGTH_MASK) |
117-
CE_CTRL1_DMAX_LENGTH_SET(n));
137+
ath10k_pci_write32(ar, ce_ctrl_addr + ctrl_regs->addr,
138+
(ctrl1_addr & ~(ctrl_regs->dmax->mask)) |
139+
ath10k_set_ring_byte(n, ctrl_regs->dmax));
118140
}
119141

120142
static inline void ath10k_ce_src_ring_byte_swap_set(struct ath10k *ar,
121143
u32 ce_ctrl_addr,
122144
unsigned int n)
123145
{
124-
u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS);
146+
struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs;
147+
u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + ctrl_regs->addr);
125148

126-
ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS,
127-
(ctrl1_addr & ~CE_CTRL1_SRC_RING_BYTE_SWAP_EN_MASK) |
128-
CE_CTRL1_SRC_RING_BYTE_SWAP_EN_SET(n));
149+
ath10k_pci_write32(ar, ce_ctrl_addr + ctrl_regs->addr,
150+
(ctrl1_addr & ~(ctrl_regs->src_ring->mask)) |
151+
ath10k_set_ring_byte(n, ctrl_regs->src_ring));
129152
}
130153

131154
static inline void ath10k_ce_dest_ring_byte_swap_set(struct ath10k *ar,
132155
u32 ce_ctrl_addr,
133156
unsigned int n)
134157
{
135-
u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS);
158+
struct ath10k_hw_ce_ctrl1 *ctrl_regs = ar->hw_ce_regs->ctrl1_regs;
159+
u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + ctrl_regs->addr);
136160

137-
ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS,
138-
(ctrl1_addr & ~CE_CTRL1_DST_RING_BYTE_SWAP_EN_MASK) |
139-
CE_CTRL1_DST_RING_BYTE_SWAP_EN_SET(n));
161+
ath10k_pci_write32(ar, ce_ctrl_addr + ctrl_regs->addr,
162+
(ctrl1_addr & ~(ctrl_regs->dst_ring->mask)) |
163+
ath10k_set_ring_byte(n, ctrl_regs->dst_ring));
140164
}
141165

142166
static inline u32 ath10k_ce_dest_ring_read_index_get(struct ath10k *ar,
143167
u32 ce_ctrl_addr)
144168
{
145-
return ath10k_pci_read32(ar, ce_ctrl_addr + CURRENT_DRRI_ADDRESS);
169+
return ath10k_pci_read32(ar, ce_ctrl_addr +
170+
ar->hw_ce_regs->current_drri_addr);
146171
}
147172

148173
static inline void ath10k_ce_dest_ring_base_addr_set(struct ath10k *ar,
149174
u32 ce_ctrl_addr,
150175
u32 addr)
151176
{
152-
ath10k_pci_write32(ar, ce_ctrl_addr + DR_BA_ADDRESS, addr);
177+
ath10k_pci_write32(ar, ce_ctrl_addr +
178+
ar->hw_ce_regs->dr_base_addr, addr);
153179
}
154180

155181
static inline void ath10k_ce_dest_ring_size_set(struct ath10k *ar,
156182
u32 ce_ctrl_addr,
157183
unsigned int n)
158184
{
159-
ath10k_pci_write32(ar, ce_ctrl_addr + DR_SIZE_ADDRESS, n);
185+
ath10k_pci_write32(ar, ce_ctrl_addr +
186+
ar->hw_ce_regs->dr_size_addr, n);
160187
}
161188

162189
static inline void ath10k_ce_src_ring_highmark_set(struct ath10k *ar,
163190
u32 ce_ctrl_addr,
164191
unsigned int n)
165192
{
166-
u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS);
193+
struct ath10k_hw_ce_dst_src_wm_regs *srcr_wm = ar->hw_ce_regs->wm_srcr;
194+
u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + srcr_wm->addr);
167195

168-
ath10k_pci_write32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS,
169-
(addr & ~SRC_WATERMARK_HIGH_MASK) |
170-
SRC_WATERMARK_HIGH_SET(n));
196+
ath10k_pci_write32(ar, ce_ctrl_addr + srcr_wm->addr,
197+
(addr & ~(srcr_wm->wm_high->mask)) |
198+
(ath10k_set_ring_byte(n, srcr_wm->wm_high)));
171199
}
172200

173201
static inline void ath10k_ce_src_ring_lowmark_set(struct ath10k *ar,
174202
u32 ce_ctrl_addr,
175203
unsigned int n)
176204
{
177-
u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS);
205+
struct ath10k_hw_ce_dst_src_wm_regs *srcr_wm = ar->hw_ce_regs->wm_srcr;
206+
u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + srcr_wm->addr);
178207

179-
ath10k_pci_write32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS,
180-
(addr & ~SRC_WATERMARK_LOW_MASK) |
181-
SRC_WATERMARK_LOW_SET(n));
208+
ath10k_pci_write32(ar, ce_ctrl_addr + srcr_wm->addr,
209+
(addr & ~(srcr_wm->wm_low->mask)) |
210+
(ath10k_set_ring_byte(n, srcr_wm->wm_low)));
182211
}
183212

184213
static inline void ath10k_ce_dest_ring_highmark_set(struct ath10k *ar,
185214
u32 ce_ctrl_addr,
186215
unsigned int n)
187216
{
188-
u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS);
217+
struct ath10k_hw_ce_dst_src_wm_regs *dstr_wm = ar->hw_ce_regs->wm_dstr;
218+
u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + dstr_wm->addr);
189219

190-
ath10k_pci_write32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS,
191-
(addr & ~DST_WATERMARK_HIGH_MASK) |
192-
DST_WATERMARK_HIGH_SET(n));
220+
ath10k_pci_write32(ar, ce_ctrl_addr + dstr_wm->addr,
221+
(addr & ~(dstr_wm->wm_high->mask)) |
222+
(ath10k_set_ring_byte(n, dstr_wm->wm_high)));
193223
}
194224

195225
static inline void ath10k_ce_dest_ring_lowmark_set(struct ath10k *ar,
196226
u32 ce_ctrl_addr,
197227
unsigned int n)
198228
{
199-
u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS);
229+
struct ath10k_hw_ce_dst_src_wm_regs *dstr_wm = ar->hw_ce_regs->wm_dstr;
230+
u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + dstr_wm->addr);
200231

201-
ath10k_pci_write32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS,
202-
(addr & ~DST_WATERMARK_LOW_MASK) |
203-
DST_WATERMARK_LOW_SET(n));
232+
ath10k_pci_write32(ar, ce_ctrl_addr + dstr_wm->addr,
233+
(addr & ~(dstr_wm->wm_low->mask)) |
234+
(ath10k_set_ring_byte(n, dstr_wm->wm_low)));
204235
}
205236

206237
static inline void ath10k_ce_copy_complete_inter_enable(struct ath10k *ar,
207238
u32 ce_ctrl_addr)
208239
{
209-
u32 host_ie_addr = ath10k_pci_read32(ar,
210-
ce_ctrl_addr + HOST_IE_ADDRESS);
240+
struct ath10k_hw_ce_host_ie *host_ie = ar->hw_ce_regs->host_ie;
241+
u32 host_ie_addr = ath10k_pci_read32(ar, ce_ctrl_addr +
242+
ar->hw_ce_regs->host_ie_addr);
211243

212-
ath10k_pci_write32(ar, ce_ctrl_addr + HOST_IE_ADDRESS,
213-
host_ie_addr | HOST_IE_COPY_COMPLETE_MASK);
244+
ath10k_pci_write32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr,
245+
host_ie_addr | host_ie->copy_complete->mask);
214246
}
215247

216248
static inline void ath10k_ce_copy_complete_intr_disable(struct ath10k *ar,
217249
u32 ce_ctrl_addr)
218250
{
219-
u32 host_ie_addr = ath10k_pci_read32(ar,
220-
ce_ctrl_addr + HOST_IE_ADDRESS);
251+
struct ath10k_hw_ce_host_ie *host_ie = ar->hw_ce_regs->host_ie;
252+
u32 host_ie_addr = ath10k_pci_read32(ar, ce_ctrl_addr +
253+
ar->hw_ce_regs->host_ie_addr);
221254

222-
ath10k_pci_write32(ar, ce_ctrl_addr + HOST_IE_ADDRESS,
223-
host_ie_addr & ~HOST_IE_COPY_COMPLETE_MASK);
255+
ath10k_pci_write32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr,
256+
host_ie_addr & ~(host_ie->copy_complete->mask));
224257
}
225258

226259
static inline void ath10k_ce_watermark_intr_disable(struct ath10k *ar,
227260
u32 ce_ctrl_addr)
228261
{
229-
u32 host_ie_addr = ath10k_pci_read32(ar,
230-
ce_ctrl_addr + HOST_IE_ADDRESS);
262+
struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs;
263+
u32 host_ie_addr = ath10k_pci_read32(ar, ce_ctrl_addr +
264+
ar->hw_ce_regs->host_ie_addr);
231265

232-
ath10k_pci_write32(ar, ce_ctrl_addr + HOST_IE_ADDRESS,
233-
host_ie_addr & ~CE_WATERMARK_MASK);
266+
ath10k_pci_write32(ar, ce_ctrl_addr + ar->hw_ce_regs->host_ie_addr,
267+
host_ie_addr & ~(wm_regs->wm_mask));
234268
}
235269

236270
static inline void ath10k_ce_error_intr_enable(struct ath10k *ar,
237271
u32 ce_ctrl_addr)
238272
{
239-
u32 misc_ie_addr = ath10k_pci_read32(ar,
240-
ce_ctrl_addr + MISC_IE_ADDRESS);
273+
struct ath10k_hw_ce_misc_regs *misc_regs = ar->hw_ce_regs->misc_regs;
274+
u32 misc_ie_addr = ath10k_pci_read32(ar, ce_ctrl_addr +
275+
ar->hw_ce_regs->misc_ie_addr);
241276

242-
ath10k_pci_write32(ar, ce_ctrl_addr + MISC_IE_ADDRESS,
243-
misc_ie_addr | CE_ERROR_MASK);
277+
ath10k_pci_write32(ar, ce_ctrl_addr + ar->hw_ce_regs->misc_ie_addr,
278+
misc_ie_addr | misc_regs->err_mask);
244279
}
245280

246281
static inline void ath10k_ce_error_intr_disable(struct ath10k *ar,
247282
u32 ce_ctrl_addr)
248283
{
249-
u32 misc_ie_addr = ath10k_pci_read32(ar,
250-
ce_ctrl_addr + MISC_IE_ADDRESS);
284+
struct ath10k_hw_ce_misc_regs *misc_regs = ar->hw_ce_regs->misc_regs;
285+
u32 misc_ie_addr = ath10k_pci_read32(ar, ce_ctrl_addr +
286+
ar->hw_ce_regs->misc_ie_addr);
251287

252-
ath10k_pci_write32(ar, ce_ctrl_addr + MISC_IE_ADDRESS,
253-
misc_ie_addr & ~CE_ERROR_MASK);
288+
ath10k_pci_write32(ar, ce_ctrl_addr + ar->hw_ce_regs->misc_ie_addr,
289+
misc_ie_addr & ~(misc_regs->err_mask));
254290
}
255291

256292
static inline void ath10k_ce_engine_int_status_clear(struct ath10k *ar,
257293
u32 ce_ctrl_addr,
258294
unsigned int mask)
259295
{
260-
ath10k_pci_write32(ar, ce_ctrl_addr + HOST_IS_ADDRESS, mask);
296+
struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs;
297+
298+
ath10k_pci_write32(ar, ce_ctrl_addr + wm_regs->addr, mask);
261299
}
262300

263301
/*
@@ -594,6 +632,7 @@ int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
594632
unsigned int nentries_mask = src_ring->nentries_mask;
595633
unsigned int sw_index = src_ring->sw_index;
596634
unsigned int read_index;
635+
struct ce_desc *desc;
597636

598637
if (src_ring->hw_index == sw_index) {
599638
/*
@@ -623,6 +662,9 @@ int ath10k_ce_completed_send_next_nolock(struct ath10k_ce_pipe *ce_state,
623662

624663
/* sanity */
625664
src_ring->per_transfer_context[sw_index] = NULL;
665+
desc = CE_SRC_RING_TO_DESC(src_ring->base_addr_owner_space,
666+
sw_index);
667+
desc->nbytes = 0;
626668

627669
/* Update sw_index */
628670
sw_index = CE_RING_IDX_INCR(nentries_mask, sw_index);
@@ -715,13 +757,13 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id)
715757
{
716758
struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
717759
struct ath10k_ce_pipe *ce_state = &ar_pci->ce_states[ce_id];
760+
struct ath10k_hw_ce_host_wm_regs *wm_regs = ar->hw_ce_regs->wm_regs;
718761
u32 ctrl_addr = ce_state->ctrl_addr;
719762

720763
spin_lock_bh(&ar_pci->ce_lock);
721764

722765
/* Clear the copy-complete interrupts that will be handled here. */
723-
ath10k_ce_engine_int_status_clear(ar, ctrl_addr,
724-
HOST_IS_COPY_COMPLETE_MASK);
766+
ath10k_ce_engine_int_status_clear(ar, ctrl_addr, wm_regs->cc_mask);
725767

726768
spin_unlock_bh(&ar_pci->ce_lock);
727769

@@ -737,7 +779,7 @@ void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id)
737779
* Misc CE interrupts are not being handled, but still need
738780
* to be cleared.
739781
*/
740-
ath10k_ce_engine_int_status_clear(ar, ctrl_addr, CE_WATERMARK_MASK);
782+
ath10k_ce_engine_int_status_clear(ar, ctrl_addr, wm_regs->wm_mask);
741783

742784
spin_unlock_bh(&ar_pci->ce_lock);
743785
}

0 commit comments

Comments
 (0)