wmi.c (0da4cc6e624675c721e15cd7440ccd65b154f685) wmi.c (855aed1220d2c94425ab01a85fe7a6f5c436940f)
1/*
2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 473 unchanged lines hidden (view full) ---

482 .proxy_sta = WMI_PDEV_PARAM_UNSUPPORTED,
483 .idle_ps_config = WMI_PDEV_PARAM_UNSUPPORTED,
484 .power_gating_sleep = WMI_PDEV_PARAM_UNSUPPORTED,
485 .fast_channel_reset = WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
486 .burst_dur = WMI_10X_PDEV_PARAM_BURST_DUR,
487 .burst_enable = WMI_10X_PDEV_PARAM_BURST_ENABLE,
488};
489
1/*
2 * Copyright (c) 2005-2011 Atheros Communications Inc.
3 * Copyright (c) 2011-2013 Qualcomm Atheros, Inc.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *

--- 473 unchanged lines hidden (view full) ---

482 .proxy_sta = WMI_PDEV_PARAM_UNSUPPORTED,
483 .idle_ps_config = WMI_PDEV_PARAM_UNSUPPORTED,
484 .power_gating_sleep = WMI_PDEV_PARAM_UNSUPPORTED,
485 .fast_channel_reset = WMI_10X_PDEV_PARAM_FAST_CHANNEL_RESET,
486 .burst_dur = WMI_10X_PDEV_PARAM_BURST_DUR,
487 .burst_enable = WMI_10X_PDEV_PARAM_BURST_ENABLE,
488};
489
490/* firmware 10.2 specific mappings */
491static struct wmi_cmd_map wmi_10_2_cmd_map = {
492 .init_cmdid = WMI_10_2_INIT_CMDID,
493 .start_scan_cmdid = WMI_10_2_START_SCAN_CMDID,
494 .stop_scan_cmdid = WMI_10_2_STOP_SCAN_CMDID,
495 .scan_chan_list_cmdid = WMI_10_2_SCAN_CHAN_LIST_CMDID,
496 .scan_sch_prio_tbl_cmdid = WMI_CMD_UNSUPPORTED,
497 .pdev_set_regdomain_cmdid = WMI_10_2_PDEV_SET_REGDOMAIN_CMDID,
498 .pdev_set_channel_cmdid = WMI_10_2_PDEV_SET_CHANNEL_CMDID,
499 .pdev_set_param_cmdid = WMI_10_2_PDEV_SET_PARAM_CMDID,
500 .pdev_pktlog_enable_cmdid = WMI_10_2_PDEV_PKTLOG_ENABLE_CMDID,
501 .pdev_pktlog_disable_cmdid = WMI_10_2_PDEV_PKTLOG_DISABLE_CMDID,
502 .pdev_set_wmm_params_cmdid = WMI_10_2_PDEV_SET_WMM_PARAMS_CMDID,
503 .pdev_set_ht_cap_ie_cmdid = WMI_10_2_PDEV_SET_HT_CAP_IE_CMDID,
504 .pdev_set_vht_cap_ie_cmdid = WMI_10_2_PDEV_SET_VHT_CAP_IE_CMDID,
505 .pdev_set_quiet_mode_cmdid = WMI_10_2_PDEV_SET_QUIET_MODE_CMDID,
506 .pdev_green_ap_ps_enable_cmdid = WMI_10_2_PDEV_GREEN_AP_PS_ENABLE_CMDID,
507 .pdev_get_tpc_config_cmdid = WMI_10_2_PDEV_GET_TPC_CONFIG_CMDID,
508 .pdev_set_base_macaddr_cmdid = WMI_10_2_PDEV_SET_BASE_MACADDR_CMDID,
509 .vdev_create_cmdid = WMI_10_2_VDEV_CREATE_CMDID,
510 .vdev_delete_cmdid = WMI_10_2_VDEV_DELETE_CMDID,
511 .vdev_start_request_cmdid = WMI_10_2_VDEV_START_REQUEST_CMDID,
512 .vdev_restart_request_cmdid = WMI_10_2_VDEV_RESTART_REQUEST_CMDID,
513 .vdev_up_cmdid = WMI_10_2_VDEV_UP_CMDID,
514 .vdev_stop_cmdid = WMI_10_2_VDEV_STOP_CMDID,
515 .vdev_down_cmdid = WMI_10_2_VDEV_DOWN_CMDID,
516 .vdev_set_param_cmdid = WMI_10_2_VDEV_SET_PARAM_CMDID,
517 .vdev_install_key_cmdid = WMI_10_2_VDEV_INSTALL_KEY_CMDID,
518 .peer_create_cmdid = WMI_10_2_PEER_CREATE_CMDID,
519 .peer_delete_cmdid = WMI_10_2_PEER_DELETE_CMDID,
520 .peer_flush_tids_cmdid = WMI_10_2_PEER_FLUSH_TIDS_CMDID,
521 .peer_set_param_cmdid = WMI_10_2_PEER_SET_PARAM_CMDID,
522 .peer_assoc_cmdid = WMI_10_2_PEER_ASSOC_CMDID,
523 .peer_add_wds_entry_cmdid = WMI_10_2_PEER_ADD_WDS_ENTRY_CMDID,
524 .peer_remove_wds_entry_cmdid = WMI_10_2_PEER_REMOVE_WDS_ENTRY_CMDID,
525 .peer_mcast_group_cmdid = WMI_10_2_PEER_MCAST_GROUP_CMDID,
526 .bcn_tx_cmdid = WMI_10_2_BCN_TX_CMDID,
527 .pdev_send_bcn_cmdid = WMI_10_2_PDEV_SEND_BCN_CMDID,
528 .bcn_tmpl_cmdid = WMI_CMD_UNSUPPORTED,
529 .bcn_filter_rx_cmdid = WMI_10_2_BCN_FILTER_RX_CMDID,
530 .prb_req_filter_rx_cmdid = WMI_10_2_PRB_REQ_FILTER_RX_CMDID,
531 .mgmt_tx_cmdid = WMI_10_2_MGMT_TX_CMDID,
532 .prb_tmpl_cmdid = WMI_CMD_UNSUPPORTED,
533 .addba_clear_resp_cmdid = WMI_10_2_ADDBA_CLEAR_RESP_CMDID,
534 .addba_send_cmdid = WMI_10_2_ADDBA_SEND_CMDID,
535 .addba_status_cmdid = WMI_10_2_ADDBA_STATUS_CMDID,
536 .delba_send_cmdid = WMI_10_2_DELBA_SEND_CMDID,
537 .addba_set_resp_cmdid = WMI_10_2_ADDBA_SET_RESP_CMDID,
538 .send_singleamsdu_cmdid = WMI_10_2_SEND_SINGLEAMSDU_CMDID,
539 .sta_powersave_mode_cmdid = WMI_10_2_STA_POWERSAVE_MODE_CMDID,
540 .sta_powersave_param_cmdid = WMI_10_2_STA_POWERSAVE_PARAM_CMDID,
541 .sta_mimo_ps_mode_cmdid = WMI_10_2_STA_MIMO_PS_MODE_CMDID,
542 .pdev_dfs_enable_cmdid = WMI_10_2_PDEV_DFS_ENABLE_CMDID,
543 .pdev_dfs_disable_cmdid = WMI_10_2_PDEV_DFS_DISABLE_CMDID,
544 .roam_scan_mode = WMI_10_2_ROAM_SCAN_MODE,
545 .roam_scan_rssi_threshold = WMI_10_2_ROAM_SCAN_RSSI_THRESHOLD,
546 .roam_scan_period = WMI_10_2_ROAM_SCAN_PERIOD,
547 .roam_scan_rssi_change_threshold =
548 WMI_10_2_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
549 .roam_ap_profile = WMI_10_2_ROAM_AP_PROFILE,
550 .ofl_scan_add_ap_profile = WMI_10_2_OFL_SCAN_ADD_AP_PROFILE,
551 .ofl_scan_remove_ap_profile = WMI_10_2_OFL_SCAN_REMOVE_AP_PROFILE,
552 .ofl_scan_period = WMI_10_2_OFL_SCAN_PERIOD,
553 .p2p_dev_set_device_info = WMI_10_2_P2P_DEV_SET_DEVICE_INFO,
554 .p2p_dev_set_discoverability = WMI_10_2_P2P_DEV_SET_DISCOVERABILITY,
555 .p2p_go_set_beacon_ie = WMI_10_2_P2P_GO_SET_BEACON_IE,
556 .p2p_go_set_probe_resp_ie = WMI_10_2_P2P_GO_SET_PROBE_RESP_IE,
557 .p2p_set_vendor_ie_data_cmdid = WMI_CMD_UNSUPPORTED,
558 .ap_ps_peer_param_cmdid = WMI_10_2_AP_PS_PEER_PARAM_CMDID,
559 .ap_ps_peer_uapsd_coex_cmdid = WMI_CMD_UNSUPPORTED,
560 .peer_rate_retry_sched_cmdid = WMI_10_2_PEER_RATE_RETRY_SCHED_CMDID,
561 .wlan_profile_trigger_cmdid = WMI_10_2_WLAN_PROFILE_TRIGGER_CMDID,
562 .wlan_profile_set_hist_intvl_cmdid =
563 WMI_10_2_WLAN_PROFILE_SET_HIST_INTVL_CMDID,
564 .wlan_profile_get_profile_data_cmdid =
565 WMI_10_2_WLAN_PROFILE_GET_PROFILE_DATA_CMDID,
566 .wlan_profile_enable_profile_id_cmdid =
567 WMI_10_2_WLAN_PROFILE_ENABLE_PROFILE_ID_CMDID,
568 .wlan_profile_list_profile_id_cmdid =
569 WMI_10_2_WLAN_PROFILE_LIST_PROFILE_ID_CMDID,
570 .pdev_suspend_cmdid = WMI_10_2_PDEV_SUSPEND_CMDID,
571 .pdev_resume_cmdid = WMI_10_2_PDEV_RESUME_CMDID,
572 .add_bcn_filter_cmdid = WMI_10_2_ADD_BCN_FILTER_CMDID,
573 .rmv_bcn_filter_cmdid = WMI_10_2_RMV_BCN_FILTER_CMDID,
574 .wow_add_wake_pattern_cmdid = WMI_10_2_WOW_ADD_WAKE_PATTERN_CMDID,
575 .wow_del_wake_pattern_cmdid = WMI_10_2_WOW_DEL_WAKE_PATTERN_CMDID,
576 .wow_enable_disable_wake_event_cmdid =
577 WMI_10_2_WOW_ENABLE_DISABLE_WAKE_EVENT_CMDID,
578 .wow_enable_cmdid = WMI_10_2_WOW_ENABLE_CMDID,
579 .wow_hostwakeup_from_sleep_cmdid =
580 WMI_10_2_WOW_HOSTWAKEUP_FROM_SLEEP_CMDID,
581 .rtt_measreq_cmdid = WMI_10_2_RTT_MEASREQ_CMDID,
582 .rtt_tsf_cmdid = WMI_10_2_RTT_TSF_CMDID,
583 .vdev_spectral_scan_configure_cmdid =
584 WMI_10_2_VDEV_SPECTRAL_SCAN_CONFIGURE_CMDID,
585 .vdev_spectral_scan_enable_cmdid =
586 WMI_10_2_VDEV_SPECTRAL_SCAN_ENABLE_CMDID,
587 .request_stats_cmdid = WMI_10_2_REQUEST_STATS_CMDID,
588 .set_arp_ns_offload_cmdid = WMI_CMD_UNSUPPORTED,
589 .network_list_offload_config_cmdid = WMI_CMD_UNSUPPORTED,
590 .gtk_offload_cmdid = WMI_CMD_UNSUPPORTED,
591 .csa_offload_enable_cmdid = WMI_CMD_UNSUPPORTED,
592 .csa_offload_chanswitch_cmdid = WMI_CMD_UNSUPPORTED,
593 .chatter_set_mode_cmdid = WMI_CMD_UNSUPPORTED,
594 .peer_tid_addba_cmdid = WMI_CMD_UNSUPPORTED,
595 .peer_tid_delba_cmdid = WMI_CMD_UNSUPPORTED,
596 .sta_dtim_ps_method_cmdid = WMI_CMD_UNSUPPORTED,
597 .sta_uapsd_auto_trig_cmdid = WMI_CMD_UNSUPPORTED,
598 .sta_keepalive_cmd = WMI_CMD_UNSUPPORTED,
599 .echo_cmdid = WMI_10_2_ECHO_CMDID,
600 .pdev_utf_cmdid = WMI_10_2_PDEV_UTF_CMDID,
601 .dbglog_cfg_cmdid = WMI_10_2_DBGLOG_CFG_CMDID,
602 .pdev_qvit_cmdid = WMI_10_2_PDEV_QVIT_CMDID,
603 .pdev_ftm_intg_cmdid = WMI_CMD_UNSUPPORTED,
604 .vdev_set_keepalive_cmdid = WMI_CMD_UNSUPPORTED,
605 .vdev_get_keepalive_cmdid = WMI_CMD_UNSUPPORTED,
606 .force_fw_hang_cmdid = WMI_CMD_UNSUPPORTED,
607 .gpio_config_cmdid = WMI_10_2_GPIO_CONFIG_CMDID,
608 .gpio_output_cmdid = WMI_10_2_GPIO_OUTPUT_CMDID,
609};
610
490int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
491{
492 int ret;
493 ret = wait_for_completion_timeout(&ar->wmi.service_ready,
494 WMI_SERVICE_READY_TIMEOUT_HZ);
495 return ret;
496}
497

--- 1156 unchanged lines hidden (view full) ---

1654 i += sizeof(*tlv) + tlv_len;
1655 }
1656}
1657
1658static void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
1659 struct wmi_single_phyerr_rx_event *event,
1660 u64 tsf)
1661{
611int ath10k_wmi_wait_for_service_ready(struct ath10k *ar)
612{
613 int ret;
614 ret = wait_for_completion_timeout(&ar->wmi.service_ready,
615 WMI_SERVICE_READY_TIMEOUT_HZ);
616 return ret;
617}
618

--- 1156 unchanged lines hidden (view full) ---

1775 i += sizeof(*tlv) + tlv_len;
1776 }
1777}
1778
1779static void ath10k_wmi_event_spectral_scan(struct ath10k *ar,
1780 struct wmi_single_phyerr_rx_event *event,
1781 u64 tsf)
1782{
1662 ath10k_dbg(ATH10K_DBG_WMI, "wmi event spectral scan\n");
1783 int buf_len, tlv_len, res, i = 0;
1784 struct phyerr_tlv *tlv;
1785 u8 *tlv_buf;
1786 struct phyerr_fft_report *fftr;
1787 size_t fftr_len;
1788
1789 buf_len = __le32_to_cpu(event->hdr.buf_len);
1790
1791 while (i < buf_len) {
1792 if (i + sizeof(*tlv) > buf_len) {
1793 ath10k_warn("failed to parse phyerr tlv header at byte %d\n",
1794 i);
1795 return;
1796 }
1797
1798 tlv = (struct phyerr_tlv *)&event->bufp[i];
1799 tlv_len = __le16_to_cpu(tlv->len);
1800 tlv_buf = &event->bufp[i + sizeof(*tlv)];
1801
1802 if (i + sizeof(*tlv) + tlv_len > buf_len) {
1803 ath10k_warn("failed to parse phyerr tlv payload at byte %d\n",
1804 i);
1805 return;
1806 }
1807
1808 switch (tlv->tag) {
1809 case PHYERR_TLV_TAG_SEARCH_FFT_REPORT:
1810 if (sizeof(*fftr) > tlv_len) {
1811 ath10k_warn("failed to parse fft report at byte %d\n",
1812 i);
1813 return;
1814 }
1815
1816 fftr_len = tlv_len - sizeof(*fftr);
1817 fftr = (struct phyerr_fft_report *)tlv_buf;
1818 res = ath10k_spectral_process_fft(ar, event,
1819 fftr, fftr_len,
1820 tsf);
1821 if (res < 0) {
1822 ath10k_warn("failed to process fft report: %d\n",
1823 res);
1824 return;
1825 }
1826 break;
1827 }
1828
1829 i += sizeof(*tlv) + tlv_len;
1830 }
1663}
1664
1665static void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb)
1666{
1667 struct wmi_comb_phyerr_rx_event *comb_event;
1668 struct wmi_single_phyerr_rx_event *event;
1669 u32 count, i, buf_len, phy_err_code;
1670 u64 tsf;

--- 649 unchanged lines hidden (view full) ---

2320 default:
2321 ath10k_warn("Unknown eventid: %d\n", id);
2322 break;
2323 }
2324
2325 dev_kfree_skb(skb);
2326}
2327
1831}
1832
1833static void ath10k_wmi_event_phyerr(struct ath10k *ar, struct sk_buff *skb)
1834{
1835 struct wmi_comb_phyerr_rx_event *comb_event;
1836 struct wmi_single_phyerr_rx_event *event;
1837 u32 count, i, buf_len, phy_err_code;
1838 u64 tsf;

--- 649 unchanged lines hidden (view full) ---

2488 default:
2489 ath10k_warn("Unknown eventid: %d\n", id);
2490 break;
2491 }
2492
2493 dev_kfree_skb(skb);
2494}
2495
2496static void ath10k_wmi_10_2_process_rx(struct ath10k *ar, struct sk_buff *skb)
2497{
2498 struct wmi_cmd_hdr *cmd_hdr;
2499 enum wmi_10_2_event_id id;
2328
2500
2501 cmd_hdr = (struct wmi_cmd_hdr *)skb->data;
2502 id = MS(__le32_to_cpu(cmd_hdr->cmd_id), WMI_CMD_HDR_CMD_ID);
2503
2504 if (skb_pull(skb, sizeof(struct wmi_cmd_hdr)) == NULL)
2505 return;
2506
2507 trace_ath10k_wmi_event(id, skb->data, skb->len);
2508
2509 switch (id) {
2510 case WMI_10_2_MGMT_RX_EVENTID:
2511 ath10k_wmi_event_mgmt_rx(ar, skb);
2512 /* mgmt_rx() owns the skb now! */
2513 return;
2514 case WMI_10_2_SCAN_EVENTID:
2515 ath10k_wmi_event_scan(ar, skb);
2516 break;
2517 case WMI_10_2_CHAN_INFO_EVENTID:
2518 ath10k_wmi_event_chan_info(ar, skb);
2519 break;
2520 case WMI_10_2_ECHO_EVENTID:
2521 ath10k_wmi_event_echo(ar, skb);
2522 break;
2523 case WMI_10_2_DEBUG_MESG_EVENTID:
2524 ath10k_wmi_event_debug_mesg(ar, skb);
2525 break;
2526 case WMI_10_2_UPDATE_STATS_EVENTID:
2527 ath10k_wmi_event_update_stats(ar, skb);
2528 break;
2529 case WMI_10_2_VDEV_START_RESP_EVENTID:
2530 ath10k_wmi_event_vdev_start_resp(ar, skb);
2531 break;
2532 case WMI_10_2_VDEV_STOPPED_EVENTID:
2533 ath10k_wmi_event_vdev_stopped(ar, skb);
2534 break;
2535 case WMI_10_2_PEER_STA_KICKOUT_EVENTID:
2536 ath10k_wmi_event_peer_sta_kickout(ar, skb);
2537 break;
2538 case WMI_10_2_HOST_SWBA_EVENTID:
2539 ath10k_wmi_event_host_swba(ar, skb);
2540 break;
2541 case WMI_10_2_TBTTOFFSET_UPDATE_EVENTID:
2542 ath10k_wmi_event_tbttoffset_update(ar, skb);
2543 break;
2544 case WMI_10_2_PHYERR_EVENTID:
2545 ath10k_wmi_event_phyerr(ar, skb);
2546 break;
2547 case WMI_10_2_ROAM_EVENTID:
2548 ath10k_wmi_event_roam(ar, skb);
2549 break;
2550 case WMI_10_2_PROFILE_MATCH:
2551 ath10k_wmi_event_profile_match(ar, skb);
2552 break;
2553 case WMI_10_2_DEBUG_PRINT_EVENTID:
2554 ath10k_wmi_event_debug_print(ar, skb);
2555 break;
2556 case WMI_10_2_PDEV_QVIT_EVENTID:
2557 ath10k_wmi_event_pdev_qvit(ar, skb);
2558 break;
2559 case WMI_10_2_WLAN_PROFILE_DATA_EVENTID:
2560 ath10k_wmi_event_wlan_profile_data(ar, skb);
2561 break;
2562 case WMI_10_2_RTT_MEASUREMENT_REPORT_EVENTID:
2563 ath10k_wmi_event_rtt_measurement_report(ar, skb);
2564 break;
2565 case WMI_10_2_TSF_MEASUREMENT_REPORT_EVENTID:
2566 ath10k_wmi_event_tsf_measurement_report(ar, skb);
2567 break;
2568 case WMI_10_2_RTT_ERROR_REPORT_EVENTID:
2569 ath10k_wmi_event_rtt_error_report(ar, skb);
2570 break;
2571 case WMI_10_2_WOW_WAKEUP_HOST_EVENTID:
2572 ath10k_wmi_event_wow_wakeup_host(ar, skb);
2573 break;
2574 case WMI_10_2_DCS_INTERFERENCE_EVENTID:
2575 ath10k_wmi_event_dcs_interference(ar, skb);
2576 break;
2577 case WMI_10_2_PDEV_TPC_CONFIG_EVENTID:
2578 ath10k_wmi_event_pdev_tpc_config(ar, skb);
2579 break;
2580 case WMI_10_2_INST_RSSI_STATS_EVENTID:
2581 ath10k_wmi_event_inst_rssi_stats(ar, skb);
2582 break;
2583 case WMI_10_2_VDEV_STANDBY_REQ_EVENTID:
2584 ath10k_wmi_event_vdev_standby_req(ar, skb);
2585 break;
2586 case WMI_10_2_VDEV_RESUME_REQ_EVENTID:
2587 ath10k_wmi_event_vdev_resume_req(ar, skb);
2588 break;
2589 case WMI_10_2_SERVICE_READY_EVENTID:
2590 ath10k_wmi_10x_service_ready_event_rx(ar, skb);
2591 break;
2592 case WMI_10_2_READY_EVENTID:
2593 ath10k_wmi_ready_event_rx(ar, skb);
2594 break;
2595 case WMI_10_2_RTT_KEEPALIVE_EVENTID:
2596 case WMI_10_2_GPIO_INPUT_EVENTID:
2597 case WMI_10_2_PEER_RATECODE_LIST_EVENTID:
2598 case WMI_10_2_GENERIC_BUFFER_EVENTID:
2599 case WMI_10_2_MCAST_BUF_RELEASE_EVENTID:
2600 case WMI_10_2_MCAST_LIST_AGEOUT_EVENTID:
2601 case WMI_10_2_WDS_PEER_EVENTID:
2602 ath10k_dbg(ATH10K_DBG_WMI,
2603 "received event id %d not implemented\n", id);
2604 break;
2605 default:
2606 ath10k_warn("Unknown eventid: %d\n", id);
2607 break;
2608 }
2609
2610 dev_kfree_skb(skb);
2611}
2612
2329static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
2330{
2613static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
2614{
2331 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
2332 ath10k_wmi_10x_process_rx(ar, skb);
2333 else
2615 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
2616 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
2617 ath10k_wmi_10_2_process_rx(ar, skb);
2618 else
2619 ath10k_wmi_10x_process_rx(ar, skb);
2620 } else {
2334 ath10k_wmi_main_process_rx(ar, skb);
2621 ath10k_wmi_main_process_rx(ar, skb);
2622 }
2335}
2336
2337/* WMI Initialization functions */
2338int ath10k_wmi_attach(struct ath10k *ar)
2339{
2340 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
2623}
2624
2625/* WMI Initialization functions */
2626int ath10k_wmi_attach(struct ath10k *ar)
2627{
2628 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
2341 ar->wmi.cmd = &wmi_10x_cmd_map;
2629 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
2630 ar->wmi.cmd = &wmi_10_2_cmd_map;
2631 else
2632 ar->wmi.cmd = &wmi_10x_cmd_map;
2633
2342 ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
2343 ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
2344 } else {
2345 ar->wmi.cmd = &wmi_cmd_map;
2346 ar->wmi.vdev_param = &wmi_vdev_param_map;
2347 ar->wmi.pdev_param = &wmi_pdev_param_map;
2348 }
2349

--- 383 unchanged lines hidden (view full) ---

2733 }
2734out:
2735 memcpy(&cmd->resource_config, &config, sizeof(config));
2736
2737 ath10k_dbg(ATH10K_DBG_WMI, "wmi init 10x\n");
2738 return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid);
2739}
2740
2634 ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
2635 ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
2636 } else {
2637 ar->wmi.cmd = &wmi_cmd_map;
2638 ar->wmi.vdev_param = &wmi_vdev_param_map;
2639 ar->wmi.pdev_param = &wmi_pdev_param_map;
2640 }
2641

--- 383 unchanged lines hidden (view full) ---

3025 }
3026out:
3027 memcpy(&cmd->resource_config, &config, sizeof(config));
3028
3029 ath10k_dbg(ATH10K_DBG_WMI, "wmi init 10x\n");
3030 return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid);
3031}
3032
3033static int ath10k_wmi_10_2_cmd_init(struct ath10k *ar)
3034{
3035 struct wmi_init_cmd_10_2 *cmd;
3036 struct sk_buff *buf;
3037 struct wmi_resource_config_10x config = {};
3038 u32 len, val;
3039 int i;
3040
3041 config.num_vdevs = __cpu_to_le32(TARGET_10X_NUM_VDEVS);
3042 config.num_peers = __cpu_to_le32(TARGET_10X_NUM_PEERS);
3043 config.num_peer_keys = __cpu_to_le32(TARGET_10X_NUM_PEER_KEYS);
3044 config.num_tids = __cpu_to_le32(TARGET_10X_NUM_TIDS);
3045 config.ast_skid_limit = __cpu_to_le32(TARGET_10X_AST_SKID_LIMIT);
3046 config.tx_chain_mask = __cpu_to_le32(TARGET_10X_TX_CHAIN_MASK);
3047 config.rx_chain_mask = __cpu_to_le32(TARGET_10X_RX_CHAIN_MASK);
3048 config.rx_timeout_pri_vo = __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI);
3049 config.rx_timeout_pri_vi = __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI);
3050 config.rx_timeout_pri_be = __cpu_to_le32(TARGET_10X_RX_TIMEOUT_LO_PRI);
3051 config.rx_timeout_pri_bk = __cpu_to_le32(TARGET_10X_RX_TIMEOUT_HI_PRI);
3052 config.rx_decap_mode = __cpu_to_le32(TARGET_10X_RX_DECAP_MODE);
3053
3054 config.scan_max_pending_reqs =
3055 __cpu_to_le32(TARGET_10X_SCAN_MAX_PENDING_REQS);
3056
3057 config.bmiss_offload_max_vdev =
3058 __cpu_to_le32(TARGET_10X_BMISS_OFFLOAD_MAX_VDEV);
3059
3060 config.roam_offload_max_vdev =
3061 __cpu_to_le32(TARGET_10X_ROAM_OFFLOAD_MAX_VDEV);
3062
3063 config.roam_offload_max_ap_profiles =
3064 __cpu_to_le32(TARGET_10X_ROAM_OFFLOAD_MAX_AP_PROFILES);
3065
3066 config.num_mcast_groups = __cpu_to_le32(TARGET_10X_NUM_MCAST_GROUPS);
3067 config.num_mcast_table_elems =
3068 __cpu_to_le32(TARGET_10X_NUM_MCAST_TABLE_ELEMS);
3069
3070 config.mcast2ucast_mode = __cpu_to_le32(TARGET_10X_MCAST2UCAST_MODE);
3071 config.tx_dbg_log_size = __cpu_to_le32(TARGET_10X_TX_DBG_LOG_SIZE);
3072 config.num_wds_entries = __cpu_to_le32(TARGET_10X_NUM_WDS_ENTRIES);
3073 config.dma_burst_size = __cpu_to_le32(TARGET_10X_DMA_BURST_SIZE);
3074 config.mac_aggr_delim = __cpu_to_le32(TARGET_10X_MAC_AGGR_DELIM);
3075
3076 val = TARGET_10X_RX_SKIP_DEFRAG_TIMEOUT_DUP_DETECTION_CHECK;
3077 config.rx_skip_defrag_timeout_dup_detection_check = __cpu_to_le32(val);
3078
3079 config.vow_config = __cpu_to_le32(TARGET_10X_VOW_CONFIG);
3080
3081 config.num_msdu_desc = __cpu_to_le32(TARGET_10X_NUM_MSDU_DESC);
3082 config.max_frag_entries = __cpu_to_le32(TARGET_10X_MAX_FRAG_ENTRIES);
3083
3084 len = sizeof(*cmd) +
3085 (sizeof(struct host_memory_chunk) * ar->wmi.num_mem_chunks);
3086
3087 buf = ath10k_wmi_alloc_skb(len);
3088 if (!buf)
3089 return -ENOMEM;
3090
3091 cmd = (struct wmi_init_cmd_10_2 *)buf->data;
3092
3093 if (ar->wmi.num_mem_chunks == 0) {
3094 cmd->num_host_mem_chunks = 0;
3095 goto out;
3096 }
3097
3098 ath10k_dbg(ATH10K_DBG_WMI, "wmi sending %d memory chunks info.\n",
3099 ar->wmi.num_mem_chunks);
3100
3101 cmd->num_host_mem_chunks = __cpu_to_le32(ar->wmi.num_mem_chunks);
3102
3103 for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
3104 cmd->host_mem_chunks[i].ptr =
3105 __cpu_to_le32(ar->wmi.mem_chunks[i].paddr);
3106 cmd->host_mem_chunks[i].size =
3107 __cpu_to_le32(ar->wmi.mem_chunks[i].len);
3108 cmd->host_mem_chunks[i].req_id =
3109 __cpu_to_le32(ar->wmi.mem_chunks[i].req_id);
3110
3111 ath10k_dbg(ATH10K_DBG_WMI,
3112 "wmi chunk %d len %d requested, addr 0x%llx\n",
3113 i,
3114 ar->wmi.mem_chunks[i].len,
3115 (unsigned long long)ar->wmi.mem_chunks[i].paddr);
3116 }
3117out:
3118 memcpy(&cmd->resource_config.common, &config, sizeof(config));
3119
3120 ath10k_dbg(ATH10K_DBG_WMI, "wmi init 10.2\n");
3121 return ath10k_wmi_cmd_send(ar, buf, ar->wmi.cmd->init_cmdid);
3122}
3123
2741int ath10k_wmi_cmd_init(struct ath10k *ar)
2742{
2743 int ret;
2744
3124int ath10k_wmi_cmd_init(struct ath10k *ar)
3125{
3126 int ret;
3127
2745 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features))
2746 ret = ath10k_wmi_10x_cmd_init(ar);
2747 else
3128 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
3129 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
3130 ret = ath10k_wmi_10_2_cmd_init(ar);
3131 else
3132 ret = ath10k_wmi_10x_cmd_init(ar);
3133 } else {
2748 ret = ath10k_wmi_main_cmd_init(ar);
3134 ret = ath10k_wmi_main_cmd_init(ar);
3135 }
2749
2750 return ret;
2751}
2752
2753static int ath10k_wmi_start_scan_calc_len(struct ath10k *ar,
2754 const struct wmi_start_scan_arg *arg)
2755{
2756 int len;

--- 103 unchanged lines hidden (view full) ---

2860 off = sizeof(struct wmi_start_scan_cmd);
2861
2862 if (arg->n_channels) {
2863 channels = (void *)skb->data + off;
2864 channels->tag = __cpu_to_le32(WMI_CHAN_LIST_TAG);
2865 channels->num_chan = __cpu_to_le32(arg->n_channels);
2866
2867 for (i = 0; i < arg->n_channels; i++)
3136
3137 return ret;
3138}
3139
3140static int ath10k_wmi_start_scan_calc_len(struct ath10k *ar,
3141 const struct wmi_start_scan_arg *arg)
3142{
3143 int len;

--- 103 unchanged lines hidden (view full) ---

3247 off = sizeof(struct wmi_start_scan_cmd);
3248
3249 if (arg->n_channels) {
3250 channels = (void *)skb->data + off;
3251 channels->tag = __cpu_to_le32(WMI_CHAN_LIST_TAG);
3252 channels->num_chan = __cpu_to_le32(arg->n_channels);
3253
3254 for (i = 0; i < arg->n_channels; i++)
2868 channels->channel_list[i] =
2869 __cpu_to_le32(arg->channels[i]);
3255 channels->channel_list[i].freq =
3256 __cpu_to_le16(arg->channels[i]);
2870
2871 off += sizeof(*channels);
2872 off += sizeof(__le32) * arg->n_channels;
2873 }
2874
2875 if (arg->n_ssids) {
2876 ssids = (void *)skb->data + off;
2877 ssids->tag = __cpu_to_le32(WMI_SSID_LIST_TAG);

--- 353 unchanged lines hidden (view full) ---

3231
3232 ath10k_dbg(ATH10K_DBG_WMI,
3233 "wmi vdev install key idx %d cipher %d len %d\n",
3234 arg->key_idx, arg->key_cipher, arg->key_len);
3235 return ath10k_wmi_cmd_send(ar, skb,
3236 ar->wmi.cmd->vdev_install_key_cmdid);
3237}
3238
3257
3258 off += sizeof(*channels);
3259 off += sizeof(__le32) * arg->n_channels;
3260 }
3261
3262 if (arg->n_ssids) {
3263 ssids = (void *)skb->data + off;
3264 ssids->tag = __cpu_to_le32(WMI_SSID_LIST_TAG);

--- 353 unchanged lines hidden (view full) ---

3618
3619 ath10k_dbg(ATH10K_DBG_WMI,
3620 "wmi vdev install key idx %d cipher %d len %d\n",
3621 arg->key_idx, arg->key_cipher, arg->key_len);
3622 return ath10k_wmi_cmd_send(ar, skb,
3623 ar->wmi.cmd->vdev_install_key_cmdid);
3624}
3625
3626int ath10k_wmi_vdev_spectral_conf(struct ath10k *ar,
3627 const struct wmi_vdev_spectral_conf_arg *arg)
3628{
3629 struct wmi_vdev_spectral_conf_cmd *cmd;
3630 struct sk_buff *skb;
3631 u32 cmdid;
3632
3633 skb = ath10k_wmi_alloc_skb(sizeof(*cmd));
3634 if (!skb)
3635 return -ENOMEM;
3636
3637 cmd = (struct wmi_vdev_spectral_conf_cmd *)skb->data;
3638 cmd->vdev_id = __cpu_to_le32(arg->vdev_id);
3639 cmd->scan_count = __cpu_to_le32(arg->scan_count);
3640 cmd->scan_period = __cpu_to_le32(arg->scan_period);
3641 cmd->scan_priority = __cpu_to_le32(arg->scan_priority);
3642 cmd->scan_fft_size = __cpu_to_le32(arg->scan_fft_size);
3643 cmd->scan_gc_ena = __cpu_to_le32(arg->scan_gc_ena);
3644 cmd->scan_restart_ena = __cpu_to_le32(arg->scan_restart_ena);
3645 cmd->scan_noise_floor_ref = __cpu_to_le32(arg->scan_noise_floor_ref);
3646 cmd->scan_init_delay = __cpu_to_le32(arg->scan_init_delay);
3647 cmd->scan_nb_tone_thr = __cpu_to_le32(arg->scan_nb_tone_thr);
3648 cmd->scan_str_bin_thr = __cpu_to_le32(arg->scan_str_bin_thr);
3649 cmd->scan_wb_rpt_mode = __cpu_to_le32(arg->scan_wb_rpt_mode);
3650 cmd->scan_rssi_rpt_mode = __cpu_to_le32(arg->scan_rssi_rpt_mode);
3651 cmd->scan_rssi_thr = __cpu_to_le32(arg->scan_rssi_thr);
3652 cmd->scan_pwr_format = __cpu_to_le32(arg->scan_pwr_format);
3653 cmd->scan_rpt_mode = __cpu_to_le32(arg->scan_rpt_mode);
3654 cmd->scan_bin_scale = __cpu_to_le32(arg->scan_bin_scale);
3655 cmd->scan_dbm_adj = __cpu_to_le32(arg->scan_dbm_adj);
3656 cmd->scan_chn_mask = __cpu_to_le32(arg->scan_chn_mask);
3657
3658 cmdid = ar->wmi.cmd->vdev_spectral_scan_configure_cmdid;
3659 return ath10k_wmi_cmd_send(ar, skb, cmdid);
3660}
3661
3662int ath10k_wmi_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, u32 trigger,
3663 u32 enable)
3664{
3665 struct wmi_vdev_spectral_enable_cmd *cmd;
3666 struct sk_buff *skb;
3667 u32 cmdid;
3668
3669 skb = ath10k_wmi_alloc_skb(sizeof(*cmd));
3670 if (!skb)
3671 return -ENOMEM;
3672
3673 cmd = (struct wmi_vdev_spectral_enable_cmd *)skb->data;
3674 cmd->vdev_id = __cpu_to_le32(vdev_id);
3675 cmd->trigger_cmd = __cpu_to_le32(trigger);
3676 cmd->enable_cmd = __cpu_to_le32(enable);
3677
3678 cmdid = ar->wmi.cmd->vdev_spectral_scan_enable_cmdid;
3679 return ath10k_wmi_cmd_send(ar, skb, cmdid);
3680}
3681
3239int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
3240 const u8 peer_addr[ETH_ALEN])
3241{
3242 struct wmi_peer_create_cmd *cmd;
3243 struct sk_buff *skb;
3244
3245 skb = ath10k_wmi_alloc_skb(sizeof(*cmd));
3246 if (!skb)

--- 195 unchanged lines hidden (view full) ---

3442 /* mode & flags share storage */
3443 ci->mode = ch->mode;
3444 ci->flags |= __cpu_to_le32(flags);
3445 }
3446
3447 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->scan_chan_list_cmdid);
3448}
3449
3682int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id,
3683 const u8 peer_addr[ETH_ALEN])
3684{
3685 struct wmi_peer_create_cmd *cmd;
3686 struct sk_buff *skb;
3687
3688 skb = ath10k_wmi_alloc_skb(sizeof(*cmd));
3689 if (!skb)

--- 195 unchanged lines hidden (view full) ---

3885 /* mode & flags share storage */
3886 ci->mode = ch->mode;
3887 ci->flags |= __cpu_to_le32(flags);
3888 }
3889
3890 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->scan_chan_list_cmdid);
3891}
3892
3450int ath10k_wmi_peer_assoc(struct ath10k *ar,
3451 const struct wmi_peer_assoc_complete_arg *arg)
3893static void
3894ath10k_wmi_peer_assoc_fill(struct ath10k *ar, void *buf,
3895 const struct wmi_peer_assoc_complete_arg *arg)
3452{
3896{
3453 struct wmi_peer_assoc_complete_cmd *cmd;
3454 struct sk_buff *skb;
3897 struct wmi_common_peer_assoc_complete_cmd *cmd = buf;
3455
3898
3456 if (arg->peer_mpdu_density > 16)
3457 return -EINVAL;
3458 if (arg->peer_legacy_rates.num_rates > MAX_SUPPORTED_RATES)
3459 return -EINVAL;
3460 if (arg->peer_ht_rates.num_rates > MAX_SUPPORTED_RATES)
3461 return -EINVAL;
3462
3463 skb = ath10k_wmi_alloc_skb(sizeof(*cmd));
3464 if (!skb)
3465 return -ENOMEM;
3466
3467 cmd = (struct wmi_peer_assoc_complete_cmd *)skb->data;
3468 cmd->vdev_id = __cpu_to_le32(arg->vdev_id);
3469 cmd->peer_new_assoc = __cpu_to_le32(arg->peer_reassoc ? 0 : 1);
3470 cmd->peer_associd = __cpu_to_le32(arg->peer_aid);
3471 cmd->peer_flags = __cpu_to_le32(arg->peer_flags);
3472 cmd->peer_caps = __cpu_to_le32(arg->peer_caps);
3473 cmd->peer_listen_intval = __cpu_to_le32(arg->peer_listen_intval);
3474 cmd->peer_ht_caps = __cpu_to_le32(arg->peer_ht_caps);
3475 cmd->peer_max_mpdu = __cpu_to_le32(arg->peer_max_mpdu);

--- 18 unchanged lines hidden (view full) ---

3494 cmd->peer_vht_rates.rx_max_rate =
3495 __cpu_to_le32(arg->peer_vht_rates.rx_max_rate);
3496 cmd->peer_vht_rates.rx_mcs_set =
3497 __cpu_to_le32(arg->peer_vht_rates.rx_mcs_set);
3498 cmd->peer_vht_rates.tx_max_rate =
3499 __cpu_to_le32(arg->peer_vht_rates.tx_max_rate);
3500 cmd->peer_vht_rates.tx_mcs_set =
3501 __cpu_to_le32(arg->peer_vht_rates.tx_mcs_set);
3899 cmd->vdev_id = __cpu_to_le32(arg->vdev_id);
3900 cmd->peer_new_assoc = __cpu_to_le32(arg->peer_reassoc ? 0 : 1);
3901 cmd->peer_associd = __cpu_to_le32(arg->peer_aid);
3902 cmd->peer_flags = __cpu_to_le32(arg->peer_flags);
3903 cmd->peer_caps = __cpu_to_le32(arg->peer_caps);
3904 cmd->peer_listen_intval = __cpu_to_le32(arg->peer_listen_intval);
3905 cmd->peer_ht_caps = __cpu_to_le32(arg->peer_ht_caps);
3906 cmd->peer_max_mpdu = __cpu_to_le32(arg->peer_max_mpdu);

--- 18 unchanged lines hidden (view full) ---

3925 cmd->peer_vht_rates.rx_max_rate =
3926 __cpu_to_le32(arg->peer_vht_rates.rx_max_rate);
3927 cmd->peer_vht_rates.rx_mcs_set =
3928 __cpu_to_le32(arg->peer_vht_rates.rx_mcs_set);
3929 cmd->peer_vht_rates.tx_max_rate =
3930 __cpu_to_le32(arg->peer_vht_rates.tx_max_rate);
3931 cmd->peer_vht_rates.tx_mcs_set =
3932 __cpu_to_le32(arg->peer_vht_rates.tx_mcs_set);
3933}
3502
3934
3935static void
3936ath10k_wmi_peer_assoc_fill_main(struct ath10k *ar, void *buf,
3937 const struct wmi_peer_assoc_complete_arg *arg)
3938{
3939 struct wmi_main_peer_assoc_complete_cmd *cmd = buf;
3940
3941 ath10k_wmi_peer_assoc_fill(ar, buf, arg);
3942 memset(cmd->peer_ht_info, 0, sizeof(cmd->peer_ht_info));
3943}
3944
3945static void
3946ath10k_wmi_peer_assoc_fill_10_1(struct ath10k *ar, void *buf,
3947 const struct wmi_peer_assoc_complete_arg *arg)
3948{
3949 ath10k_wmi_peer_assoc_fill(ar, buf, arg);
3950}
3951
3952static void
3953ath10k_wmi_peer_assoc_fill_10_2(struct ath10k *ar, void *buf,
3954 const struct wmi_peer_assoc_complete_arg *arg)
3955{
3956 struct wmi_10_2_peer_assoc_complete_cmd *cmd = buf;
3957 int max_mcs, max_nss;
3958 u32 info0;
3959
3960 /* TODO: Is using max values okay with firmware? */
3961 max_mcs = 0xf;
3962 max_nss = 0xf;
3963
3964 info0 = SM(max_mcs, WMI_PEER_ASSOC_INFO0_MAX_MCS_IDX) |
3965 SM(max_nss, WMI_PEER_ASSOC_INFO0_MAX_NSS);
3966
3967 ath10k_wmi_peer_assoc_fill(ar, buf, arg);
3968 cmd->info0 = __cpu_to_le32(info0);
3969}
3970
3971int ath10k_wmi_peer_assoc(struct ath10k *ar,
3972 const struct wmi_peer_assoc_complete_arg *arg)
3973{
3974 struct sk_buff *skb;
3975 int len;
3976
3977 if (arg->peer_mpdu_density > 16)
3978 return -EINVAL;
3979 if (arg->peer_legacy_rates.num_rates > MAX_SUPPORTED_RATES)
3980 return -EINVAL;
3981 if (arg->peer_ht_rates.num_rates > MAX_SUPPORTED_RATES)
3982 return -EINVAL;
3983
3984 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
3985 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
3986 len = sizeof(struct wmi_10_2_peer_assoc_complete_cmd);
3987 else
3988 len = sizeof(struct wmi_10_1_peer_assoc_complete_cmd);
3989 } else {
3990 len = sizeof(struct wmi_main_peer_assoc_complete_cmd);
3991 }
3992
3993 skb = ath10k_wmi_alloc_skb(len);
3994 if (!skb)
3995 return -ENOMEM;
3996
3997 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
3998 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
3999 ath10k_wmi_peer_assoc_fill_10_1(ar, skb->data, arg);
4000 else
4001 ath10k_wmi_peer_assoc_fill_10_2(ar, skb->data, arg);
4002 } else {
4003 ath10k_wmi_peer_assoc_fill_main(ar, skb->data, arg);
4004 }
4005
3503 ath10k_dbg(ATH10K_DBG_WMI,
3504 "wmi peer assoc vdev %d addr %pM (%s)\n",
3505 arg->vdev_id, arg->addr,
3506 arg->peer_reassoc ? "reassociate" : "new");
3507 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_assoc_cmdid);
3508}
3509
3510/* This function assumes the beacon is already DMA mapped */

--- 16 unchanged lines hidden (view full) ---

3527
3528 cmd = (struct wmi_bcn_tx_ref_cmd *)skb->data;
3529 cmd->vdev_id = __cpu_to_le32(arvif->vdev_id);
3530 cmd->data_len = __cpu_to_le32(beacon->len);
3531 cmd->data_ptr = __cpu_to_le32(ATH10K_SKB_CB(beacon)->paddr);
3532 cmd->msdu_id = 0;
3533 cmd->frame_control = __cpu_to_le32(fc);
3534 cmd->flags = 0;
4006 ath10k_dbg(ATH10K_DBG_WMI,
4007 "wmi peer assoc vdev %d addr %pM (%s)\n",
4008 arg->vdev_id, arg->addr,
4009 arg->peer_reassoc ? "reassociate" : "new");
4010 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->peer_assoc_cmdid);
4011}
4012
4013/* This function assumes the beacon is already DMA mapped */

--- 16 unchanged lines hidden (view full) ---

4030
4031 cmd = (struct wmi_bcn_tx_ref_cmd *)skb->data;
4032 cmd->vdev_id = __cpu_to_le32(arvif->vdev_id);
4033 cmd->data_len = __cpu_to_le32(beacon->len);
4034 cmd->data_ptr = __cpu_to_le32(ATH10K_SKB_CB(beacon)->paddr);
4035 cmd->msdu_id = 0;
4036 cmd->frame_control = __cpu_to_le32(fc);
4037 cmd->flags = 0;
4038 cmd->antenna_mask = __cpu_to_le32(WMI_BCN_TX_REF_DEF_ANTENNA);
3535
3536 if (ATH10K_SKB_CB(beacon)->bcn.dtim_zero)
3537 cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO);
3538
3539 if (ATH10K_SKB_CB(beacon)->bcn.deliver_cab)
3540 cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB);
3541
3542 ret = ath10k_wmi_cmd_send_nowait(ar, skb,

--- 111 unchanged lines hidden ---
4039
4040 if (ATH10K_SKB_CB(beacon)->bcn.dtim_zero)
4041 cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO);
4042
4043 if (ATH10K_SKB_CB(beacon)->bcn.deliver_cab)
4044 cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB);
4045
4046 ret = ath10k_wmi_cmd_send_nowait(ar, skb,

--- 111 unchanged lines hidden ---