Lines Matching +full:- +full:0

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2009-2012 Realtek Corporation.*/
23 if (((val_hmetfr >> boxnum) & BIT(0)) == 0 && val_mcutst_1 == 0) in _rtl8723e_check_fw_read_last_h2c()
34 u16 box_reg = 0, box_extreg = 0; in _rtl8723e_fill_h2c_command()
37 u8 buf_index = 0; in _rtl8723e_fill_h2c_command()
42 u32 h2c_waitcounter = 0; in _rtl8723e_fill_h2c_command()
49 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); in _rtl8723e_fill_h2c_command()
50 if (rtlhal->h2c_setinprogress) { in _rtl8723e_fill_h2c_command()
55 while (rtlhal->h2c_setinprogress) { in _rtl8723e_fill_h2c_command()
56 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, in _rtl8723e_fill_h2c_command()
66 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, in _rtl8723e_fill_h2c_command()
69 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); in _rtl8723e_fill_h2c_command()
71 rtlhal->h2c_setinprogress = true; in _rtl8723e_fill_h2c_command()
72 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); in _rtl8723e_fill_h2c_command()
78 wait_writeh2c_limmit--; in _rtl8723e_fill_h2c_command()
79 if (wait_writeh2c_limmit == 0) { in _rtl8723e_fill_h2c_command()
84 boxnum = rtlhal->last_hmeboxnum; in _rtl8723e_fill_h2c_command()
86 case 0: in _rtl8723e_fill_h2c_command()
111 wait_h2c_limmit--; in _rtl8723e_fill_h2c_command()
112 if (wait_h2c_limmit == 0) { in _rtl8723e_fill_h2c_command()
123 u1b_tmp = rtl_read_byte(rtlpriv, 0x1BF); in _rtl8723e_fill_h2c_command()
125 "Waiting for FW read clear HMEBox(%d)!!! 0x1BF = %2x\n", in _rtl8723e_fill_h2c_command()
136 memset(boxcontent, 0, sizeof(boxcontent)); in _rtl8723e_fill_h2c_command()
137 memset(boxextcontent, 0, sizeof(boxextcontent)); in _rtl8723e_fill_h2c_command()
138 boxcontent[0] = element_id; in _rtl8723e_fill_h2c_command()
145 boxcontent[0] &= ~(BIT(7)); in _rtl8723e_fill_h2c_command()
149 for (idx = 0; idx < 4; idx++) { in _rtl8723e_fill_h2c_command()
155 boxcontent[0] &= ~(BIT(7)); in _rtl8723e_fill_h2c_command()
159 for (idx = 0; idx < 4; idx++) { in _rtl8723e_fill_h2c_command()
165 boxcontent[0] &= ~(BIT(7)); in _rtl8723e_fill_h2c_command()
169 for (idx = 0; idx < 4; idx++) { in _rtl8723e_fill_h2c_command()
175 boxcontent[0] |= (BIT(7)); in _rtl8723e_fill_h2c_command()
181 for (idx = 0; idx < 2; idx++) { in _rtl8723e_fill_h2c_command()
186 for (idx = 0; idx < 4; idx++) { in _rtl8723e_fill_h2c_command()
192 boxcontent[0] |= (BIT(7)); in _rtl8723e_fill_h2c_command()
198 for (idx = 0; idx < 2; idx++) { in _rtl8723e_fill_h2c_command()
203 for (idx = 0; idx < 4; idx++) { in _rtl8723e_fill_h2c_command()
216 rtlhal->last_hmeboxnum = boxnum + 1; in _rtl8723e_fill_h2c_command()
217 if (rtlhal->last_hmeboxnum == 4) in _rtl8723e_fill_h2c_command()
218 rtlhal->last_hmeboxnum = 0; in _rtl8723e_fill_h2c_command()
221 "pHalData->last_hmeboxnum = %d\n", in _rtl8723e_fill_h2c_command()
222 rtlhal->last_hmeboxnum); in _rtl8723e_fill_h2c_command()
225 spin_lock_irqsave(&rtlpriv->locks.h2c_lock, flag); in _rtl8723e_fill_h2c_command()
226 rtlhal->h2c_setinprogress = false; in _rtl8723e_fill_h2c_command()
227 spin_unlock_irqrestore(&rtlpriv->locks.h2c_lock, flag); in _rtl8723e_fill_h2c_command()
238 if (!rtlhal->fw_ready) { in rtl8723e_fill_h2c_cmd()
243 memset(tmp_cmdbuf, 0, 8); in rtl8723e_fill_h2c_cmd()
252 u8 u1_h2c_set_pwrmode[3] = { 0 }; in rtl8723e_set_fw_pwrmode_cmd()
259 (rtlpriv->mac80211.p2p) ? ppsc->smart_ps : 1); in rtl8723e_set_fw_pwrmode_cmd()
261 ppsc->reg_max_lps_awakeintvl); in rtl8723e_set_fw_pwrmode_cmd()
269 #define BEACON_PG 0 /* ->1 */
272 #define PROBERSP_PG 4 /* ->5 */
277 /* page 0 beacon */
278 0x80, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF,
279 0xFF, 0xFF, 0x00, 0xE0, 0x4C, 0x76, 0x00, 0x42,
280 0x00, 0x40, 0x10, 0x10, 0x00, 0x03, 0x50, 0x08,
281 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
282 0x64, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x6C, 0x69,
283 0x6E, 0x6B, 0x73, 0x79, 0x73, 0x5F, 0x77, 0x6C,
284 0x61, 0x6E, 0x01, 0x04, 0x82, 0x84, 0x8B, 0x96,
285 0x03, 0x01, 0x01, 0x06, 0x02, 0x00, 0x00, 0x2A,
286 0x01, 0x00, 0x32, 0x08, 0x24, 0x30, 0x48, 0x6C,
287 0x0C, 0x12, 0x18, 0x60, 0x2D, 0x1A, 0x6C, 0x18,
288 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
289 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
290 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
291 0x3D, 0x00, 0xDD, 0x06, 0x00, 0xE0, 0x4C, 0x02,
292 0x01, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
293 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
296 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
298 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
299 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
300 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
301 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
302 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
303 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
304 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
305 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
306 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
307 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
308 0x10, 0x00, 0x20, 0x8C, 0x00, 0x12, 0x10, 0x00,
309 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
310 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
311 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
313 /* page 2 ps-poll */
314 0xA4, 0x10, 0x01, 0xC0, 0x00, 0x40, 0x10, 0x10,
315 0x00, 0x03, 0x00, 0xE0, 0x4C, 0x76, 0x00, 0x42,
316 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
317 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
318 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
319 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
320 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
321 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
322 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
323 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
324 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
325 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
326 0x18, 0x00, 0x20, 0x8C, 0x00, 0x12, 0x00, 0x00,
327 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
328 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
329 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
332 0x48, 0x01, 0x00, 0x00, 0x00, 0x40, 0x10, 0x10,
333 0x00, 0x03, 0x00, 0xE0, 0x4C, 0x76, 0x00, 0x42,
334 0x00, 0x40, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00,
335 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
336 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
337 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
338 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
339 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
340 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
342 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
343 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
344 0x72, 0x00, 0x20, 0x8C, 0x00, 0x12, 0x00, 0x00,
345 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
346 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
347 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
350 0x50, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x10,
351 0x00, 0x03, 0x00, 0xE0, 0x4C, 0x76, 0x00, 0x42,
352 0x00, 0x40, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00,
353 0x9E, 0x46, 0x15, 0x32, 0x27, 0xF2, 0x2D, 0x00,
354 0x64, 0x00, 0x00, 0x04, 0x00, 0x0C, 0x6C, 0x69,
355 0x6E, 0x6B, 0x73, 0x79, 0x73, 0x5F, 0x77, 0x6C,
356 0x61, 0x6E, 0x01, 0x04, 0x82, 0x84, 0x8B, 0x96,
357 0x03, 0x01, 0x01, 0x06, 0x02, 0x00, 0x00, 0x2A,
358 0x01, 0x00, 0x32, 0x08, 0x24, 0x30, 0x48, 0x6C,
359 0x0C, 0x12, 0x18, 0x60, 0x2D, 0x1A, 0x6C, 0x18,
360 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
361 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
362 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
363 0x3D, 0x00, 0xDD, 0x06, 0x00, 0xE0, 0x4C, 0x02,
364 0x01, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
365 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
368 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
369 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
370 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
371 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
372 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
373 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
374 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
375 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
376 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
377 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
378 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
379 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
380 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
381 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
382 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
383 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
393 u8 u1rsvdpageloc[3] = { 0 }; in rtl8723e_set_fw_rsvdpagepkt()
400 /*--------------------------------------------------------- in rtl8723e_set_fw_rsvdpagepkt()
402 *--------------------------------------------------------- in rtl8723e_set_fw_rsvdpagepkt()
405 SET_80211_HDR_ADDRESS2(beacon, mac->mac_addr); in rtl8723e_set_fw_rsvdpagepkt()
406 SET_80211_HDR_ADDRESS3(beacon, mac->bssid); in rtl8723e_set_fw_rsvdpagepkt()
408 /*------------------------------------------------------- in rtl8723e_set_fw_rsvdpagepkt()
409 * (2) ps-poll in rtl8723e_set_fw_rsvdpagepkt()
410 *-------------------------------------------------------- in rtl8723e_set_fw_rsvdpagepkt()
413 SET_80211_PS_POLL_AID(p_pspoll, (mac->assoc_id | 0xc000)); in rtl8723e_set_fw_rsvdpagepkt()
414 SET_80211_PS_POLL_BSSID(p_pspoll, mac->bssid); in rtl8723e_set_fw_rsvdpagepkt()
415 SET_80211_PS_POLL_TA(p_pspoll, mac->mac_addr); in rtl8723e_set_fw_rsvdpagepkt()
419 /*-------------------------------------------------------- in rtl8723e_set_fw_rsvdpagepkt()
421 *--------------------------------------------------------- in rtl8723e_set_fw_rsvdpagepkt()
424 SET_80211_HDR_ADDRESS1(nullfunc, mac->bssid); in rtl8723e_set_fw_rsvdpagepkt()
425 SET_80211_HDR_ADDRESS2(nullfunc, mac->mac_addr); in rtl8723e_set_fw_rsvdpagepkt()
426 SET_80211_HDR_ADDRESS3(nullfunc, mac->bssid); in rtl8723e_set_fw_rsvdpagepkt()
430 /*--------------------------------------------------------- in rtl8723e_set_fw_rsvdpagepkt()
432 *---------------------------------------------------------- in rtl8723e_set_fw_rsvdpagepkt()
435 SET_80211_HDR_ADDRESS1(p_probersp, mac->bssid); in rtl8723e_set_fw_rsvdpagepkt()
436 SET_80211_HDR_ADDRESS2(p_probersp, mac->mac_addr); in rtl8723e_set_fw_rsvdpagepkt()
437 SET_80211_HDR_ADDRESS3(p_probersp, mac->bssid); in rtl8723e_set_fw_rsvdpagepkt()
445 &reserved_page_packet[0], totalpacketlen); in rtl8723e_set_fw_rsvdpagepkt()
475 u8 u1_joinbssrpt_parm[1] = { 0 }; in rtl8723e_set_fw_joinbss_report_cmd()
496 struct rtl_p2p_ps_info *p2pinfo = &(rtlps->p2p_ps_info); in rtl8723e_set_p2p_ps_offload_cmd()
497 struct p2p_ps_offload_t *p2p_ps_offload = &rtlhal->p2p_ps_offload; in rtl8723e_set_p2p_ps_offload_cmd()
505 memset(p2p_ps_offload, 0, sizeof(*p2p_ps_offload)); in rtl8723e_set_p2p_ps_offload_cmd()
510 if (p2pinfo->ctwindow > 0) { in rtl8723e_set_p2p_ps_offload_cmd()
511 p2p_ps_offload->ctwindow_en = 1; in rtl8723e_set_p2p_ps_offload_cmd()
512 ctwindow = p2pinfo->ctwindow; in rtl8723e_set_p2p_ps_offload_cmd()
517 for (i = 0 ; i < p2pinfo->noa_num ; i++) { in rtl8723e_set_p2p_ps_offload_cmd()
519 rtl_write_byte(rtlpriv, 0x5cf, (i << 4)); in rtl8723e_set_p2p_ps_offload_cmd()
520 if (i == 0) in rtl8723e_set_p2p_ps_offload_cmd()
521 p2p_ps_offload->noa0_en = 1; in rtl8723e_set_p2p_ps_offload_cmd()
523 p2p_ps_offload->noa1_en = 1; in rtl8723e_set_p2p_ps_offload_cmd()
526 rtl_write_dword(rtlpriv, 0x5E0, in rtl8723e_set_p2p_ps_offload_cmd()
527 p2pinfo->noa_duration[i]); in rtl8723e_set_p2p_ps_offload_cmd()
528 rtl_write_dword(rtlpriv, 0x5E4, in rtl8723e_set_p2p_ps_offload_cmd()
529 p2pinfo->noa_interval[i]); in rtl8723e_set_p2p_ps_offload_cmd()
534 start_time = p2pinfo->noa_start_time[i]; in rtl8723e_set_p2p_ps_offload_cmd()
535 if (p2pinfo->noa_count_type[i] != 1) { in rtl8723e_set_p2p_ps_offload_cmd()
539 p2pinfo->noa_interval[i]; in rtl8723e_set_p2p_ps_offload_cmd()
540 if (p2pinfo->noa_count_type[i] != 255) in rtl8723e_set_p2p_ps_offload_cmd()
541 p2pinfo->noa_count_type[i]--; in rtl8723e_set_p2p_ps_offload_cmd()
544 rtl_write_dword(rtlpriv, 0x5E8, start_time); in rtl8723e_set_p2p_ps_offload_cmd()
545 rtl_write_dword(rtlpriv, 0x5EC, in rtl8723e_set_p2p_ps_offload_cmd()
546 p2pinfo->noa_count_type[i]); in rtl8723e_set_p2p_ps_offload_cmd()
550 if ((p2pinfo->opp_ps == 1) || (p2pinfo->noa_num > 0)) { in rtl8723e_set_p2p_ps_offload_cmd()
554 p2p_ps_offload->offload_en = 1; in rtl8723e_set_p2p_ps_offload_cmd()
556 if (P2P_ROLE_GO == rtlpriv->mac80211.p2p) { in rtl8723e_set_p2p_ps_offload_cmd()
557 p2p_ps_offload->role = 1; in rtl8723e_set_p2p_ps_offload_cmd()
558 p2p_ps_offload->allstasleep = 0; in rtl8723e_set_p2p_ps_offload_cmd()
560 p2p_ps_offload->role = 0; in rtl8723e_set_p2p_ps_offload_cmd()
563 p2p_ps_offload->discovery = 0; in rtl8723e_set_p2p_ps_offload_cmd()
568 p2p_ps_offload->discovery = 1; in rtl8723e_set_p2p_ps_offload_cmd()
572 p2p_ps_offload->discovery = 0; in rtl8723e_set_p2p_ps_offload_cmd()
573 p2pinfo->p2p_ps_state = P2P_PS_ENABLE; in rtl8723e_set_p2p_ps_offload_cmd()