diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/wmi.c')
| -rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 62 | 
1 files changed, 56 insertions, 6 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 54df425bb0fc..c893314a191f 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -785,7 +785,6 @@ static struct wmi_vdev_param_map wmi_vdev_param_map = {  	.meru_vc = WMI_VDEV_PARAM_UNSUPPORTED,  	.rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED,  	.bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED, -	.set_tsf = WMI_VDEV_PARAM_UNSUPPORTED,  };  /* 10.X WMI VDEV param map */ @@ -861,7 +860,6 @@ static struct wmi_vdev_param_map wmi_10x_vdev_param_map = {  	.meru_vc = WMI_VDEV_PARAM_UNSUPPORTED,  	.rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED,  	.bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED, -	.set_tsf = WMI_VDEV_PARAM_UNSUPPORTED,  };  static struct wmi_vdev_param_map wmi_10_2_4_vdev_param_map = { @@ -936,7 +934,6 @@ static struct wmi_vdev_param_map wmi_10_2_4_vdev_param_map = {  	.meru_vc = WMI_VDEV_PARAM_UNSUPPORTED,  	.rx_decap_type = WMI_VDEV_PARAM_UNSUPPORTED,  	.bw_nss_ratemask = WMI_VDEV_PARAM_UNSUPPORTED, -	.set_tsf = WMI_10X_VDEV_PARAM_TSF_INCREMENT,  };  static struct wmi_vdev_param_map wmi_10_4_vdev_param_map = { @@ -1012,7 +1009,8 @@ static struct wmi_vdev_param_map wmi_10_4_vdev_param_map = {  	.meru_vc = WMI_10_4_VDEV_PARAM_MERU_VC,  	.rx_decap_type = WMI_10_4_VDEV_PARAM_RX_DECAP_TYPE,  	.bw_nss_ratemask = WMI_10_4_VDEV_PARAM_BW_NSS_RATEMASK, -	.set_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT, +	.inc_tsf = WMI_10_4_VDEV_PARAM_TSF_INCREMENT, +	.dec_tsf = WMI_10_4_VDEV_PARAM_TSF_DECREMENT,  };  static struct wmi_pdev_param_map wmi_pdev_param_map = { @@ -4489,7 +4487,7 @@ static int ath10k_wmi_alloc_chunk(struct ath10k *ar, u32 req_id,  	if (!num_units)  		return -ENOMEM; -	paddr = dma_map_single(ar->dev, vaddr, pool_size, DMA_TO_DEVICE); +	paddr = dma_map_single(ar->dev, vaddr, pool_size, DMA_BIDIRECTIONAL);  	if (dma_mapping_error(ar->dev, paddr)) {  		kfree(vaddr);  		return -ENOMEM; @@ -4676,7 +4674,7 @@ static void ath10k_wmi_event_service_ready_work(struct work_struct *work)  	ar->fw_version_build = (__le32_to_cpu(arg.sw_ver1) & 0x0000ffff);  	ar->phy_capability = __le32_to_cpu(arg.phy_capab);  	ar->num_rf_chains = __le32_to_cpu(arg.num_rf_chains); -	ar->ath_common.regulatory.current_rd = __le32_to_cpu(arg.eeprom_rd); +	ar->hw_eeprom_rd = __le32_to_cpu(arg.eeprom_rd);  	ath10k_dbg_dump(ar, ATH10K_DBG_WMI, NULL, "wmi svc: ",  			arg.service_map, arg.service_map_len); @@ -4931,6 +4929,23 @@ exit:  	return 0;  } +static inline void ath10k_wmi_queue_set_coverage_class_work(struct ath10k *ar) +{ +	if (ar->hw_params.hw_ops->set_coverage_class) { +		spin_lock_bh(&ar->data_lock); + +		/* This call only ensures that the modified coverage class +		 * persists in case the firmware sets the registers back to +		 * their default value. So calling it is only necessary if the +		 * coverage class has a non-zero value. +		 */ +		if (ar->fw_coverage.coverage_class) +			queue_work(ar->workqueue, &ar->set_coverage_class_work); + +		spin_unlock_bh(&ar->data_lock); +	} +} +  static void ath10k_wmi_op_rx(struct ath10k *ar, struct sk_buff *skb)  {  	struct wmi_cmd_hdr *cmd_hdr; @@ -4951,6 +4966,7 @@ static void ath10k_wmi_op_rx(struct ath10k *ar, struct sk_buff *skb)  		return;  	case WMI_SCAN_EVENTID:  		ath10k_wmi_event_scan(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_CHAN_INFO_EVENTID:  		ath10k_wmi_event_chan_info(ar, skb); @@ -4960,15 +4976,18 @@ static void ath10k_wmi_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_DEBUG_MESG_EVENTID:  		ath10k_wmi_event_debug_mesg(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_UPDATE_STATS_EVENTID:  		ath10k_wmi_event_update_stats(ar, skb);  		break;  	case WMI_VDEV_START_RESP_EVENTID:  		ath10k_wmi_event_vdev_start_resp(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_VDEV_STOPPED_EVENTID:  		ath10k_wmi_event_vdev_stopped(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_PEER_STA_KICKOUT_EVENTID:  		ath10k_wmi_event_peer_sta_kickout(ar, skb); @@ -4984,12 +5003,14 @@ static void ath10k_wmi_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_ROAM_EVENTID:  		ath10k_wmi_event_roam(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_PROFILE_MATCH:  		ath10k_wmi_event_profile_match(ar, skb);  		break;  	case WMI_DEBUG_PRINT_EVENTID:  		ath10k_wmi_event_debug_print(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_PDEV_QVIT_EVENTID:  		ath10k_wmi_event_pdev_qvit(ar, skb); @@ -5038,6 +5059,7 @@ static void ath10k_wmi_op_rx(struct ath10k *ar, struct sk_buff *skb)  		return;  	case WMI_READY_EVENTID:  		ath10k_wmi_event_ready(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	default:  		ath10k_warn(ar, "Unknown eventid: %d\n", id); @@ -5081,6 +5103,7 @@ static void ath10k_wmi_10_1_op_rx(struct ath10k *ar, struct sk_buff *skb)  		return;  	case WMI_10X_SCAN_EVENTID:  		ath10k_wmi_event_scan(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10X_CHAN_INFO_EVENTID:  		ath10k_wmi_event_chan_info(ar, skb); @@ -5090,15 +5113,18 @@ static void ath10k_wmi_10_1_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_10X_DEBUG_MESG_EVENTID:  		ath10k_wmi_event_debug_mesg(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10X_UPDATE_STATS_EVENTID:  		ath10k_wmi_event_update_stats(ar, skb);  		break;  	case WMI_10X_VDEV_START_RESP_EVENTID:  		ath10k_wmi_event_vdev_start_resp(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10X_VDEV_STOPPED_EVENTID:  		ath10k_wmi_event_vdev_stopped(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10X_PEER_STA_KICKOUT_EVENTID:  		ath10k_wmi_event_peer_sta_kickout(ar, skb); @@ -5114,12 +5140,14 @@ static void ath10k_wmi_10_1_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_10X_ROAM_EVENTID:  		ath10k_wmi_event_roam(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10X_PROFILE_MATCH:  		ath10k_wmi_event_profile_match(ar, skb);  		break;  	case WMI_10X_DEBUG_PRINT_EVENTID:  		ath10k_wmi_event_debug_print(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10X_PDEV_QVIT_EVENTID:  		ath10k_wmi_event_pdev_qvit(ar, skb); @@ -5159,6 +5187,7 @@ static void ath10k_wmi_10_1_op_rx(struct ath10k *ar, struct sk_buff *skb)  		return;  	case WMI_10X_READY_EVENTID:  		ath10k_wmi_event_ready(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10X_PDEV_UTF_EVENTID:  		/* ignore utf events */ @@ -5205,6 +5234,7 @@ static void ath10k_wmi_10_2_op_rx(struct ath10k *ar, struct sk_buff *skb)  		return;  	case WMI_10_2_SCAN_EVENTID:  		ath10k_wmi_event_scan(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_CHAN_INFO_EVENTID:  		ath10k_wmi_event_chan_info(ar, skb); @@ -5214,15 +5244,18 @@ static void ath10k_wmi_10_2_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_10_2_DEBUG_MESG_EVENTID:  		ath10k_wmi_event_debug_mesg(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_UPDATE_STATS_EVENTID:  		ath10k_wmi_event_update_stats(ar, skb);  		break;  	case WMI_10_2_VDEV_START_RESP_EVENTID:  		ath10k_wmi_event_vdev_start_resp(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_VDEV_STOPPED_EVENTID:  		ath10k_wmi_event_vdev_stopped(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_PEER_STA_KICKOUT_EVENTID:  		ath10k_wmi_event_peer_sta_kickout(ar, skb); @@ -5238,12 +5271,14 @@ static void ath10k_wmi_10_2_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_10_2_ROAM_EVENTID:  		ath10k_wmi_event_roam(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_PROFILE_MATCH:  		ath10k_wmi_event_profile_match(ar, skb);  		break;  	case WMI_10_2_DEBUG_PRINT_EVENTID:  		ath10k_wmi_event_debug_print(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_PDEV_QVIT_EVENTID:  		ath10k_wmi_event_pdev_qvit(ar, skb); @@ -5274,15 +5309,18 @@ static void ath10k_wmi_10_2_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_10_2_VDEV_STANDBY_REQ_EVENTID:  		ath10k_wmi_event_vdev_standby_req(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_VDEV_RESUME_REQ_EVENTID:  		ath10k_wmi_event_vdev_resume_req(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_SERVICE_READY_EVENTID:  		ath10k_wmi_event_service_ready(ar, skb);  		return;  	case WMI_10_2_READY_EVENTID:  		ath10k_wmi_event_ready(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_2_PDEV_TEMPERATURE_EVENTID:  		ath10k_wmi_event_temperature(ar, skb); @@ -5345,12 +5383,14 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_10_4_DEBUG_MESG_EVENTID:  		ath10k_wmi_event_debug_mesg(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_4_SERVICE_READY_EVENTID:  		ath10k_wmi_event_service_ready(ar, skb);  		return;  	case WMI_10_4_SCAN_EVENTID:  		ath10k_wmi_event_scan(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_4_CHAN_INFO_EVENTID:  		ath10k_wmi_event_chan_info(ar, skb); @@ -5360,12 +5400,14 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_10_4_READY_EVENTID:  		ath10k_wmi_event_ready(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_4_PEER_STA_KICKOUT_EVENTID:  		ath10k_wmi_event_peer_sta_kickout(ar, skb);  		break;  	case WMI_10_4_ROAM_EVENTID:  		ath10k_wmi_event_roam(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_4_HOST_SWBA_EVENTID:  		ath10k_wmi_event_host_swba(ar, skb); @@ -5375,12 +5417,15 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)  		break;  	case WMI_10_4_DEBUG_PRINT_EVENTID:  		ath10k_wmi_event_debug_print(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_4_VDEV_START_RESP_EVENTID:  		ath10k_wmi_event_vdev_start_resp(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_4_VDEV_STOPPED_EVENTID:  		ath10k_wmi_event_vdev_stopped(ar, skb); +		ath10k_wmi_queue_set_coverage_class_work(ar);  		break;  	case WMI_10_4_WOW_WAKEUP_HOST_EVENTID:  	case WMI_10_4_PEER_RATECODE_LIST_EVENTID: @@ -5397,6 +5442,9 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)  	case WMI_10_4_PDEV_BSS_CHAN_INFO_EVENTID:  		ath10k_wmi_event_pdev_bss_chan_info(ar, skb);  		break; +	case WMI_10_4_PDEV_TPC_CONFIG_EVENTID: +		ath10k_wmi_event_pdev_tpc_config(ar, skb); +		break;  	default:  		ath10k_warn(ar, "Unknown eventid: %d\n", id);  		break; @@ -6096,6 +6144,7 @@ void ath10k_wmi_start_scan_init(struct ath10k *ar,  		| WMI_SCAN_EVENT_COMPLETED  		| WMI_SCAN_EVENT_BSS_CHANNEL  		| WMI_SCAN_EVENT_FOREIGN_CHANNEL +		| WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT  		| WMI_SCAN_EVENT_DEQUEUED;  	arg->scan_ctrl_flags |= WMI_SCAN_CHAN_STAT_EVENT;  	arg->n_bssids = 1; @@ -8153,6 +8202,7 @@ static const struct wmi_ops wmi_10_4_ops = {  	.get_vdev_subtype = ath10k_wmi_10_4_op_get_vdev_subtype,  	.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,  	.gen_echo = ath10k_wmi_op_gen_echo, +	.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,  };  int ath10k_wmi_attach(struct ath10k *ar)  |