wmi.c (ca0df43d211039dded5a8f8553356414c9a74731) | wmi.c (480c9df5778774117546f6389be1a8dc8cc935db) |
---|---|
1// SPDX-License-Identifier: BSD-3-Clause-Clear 2/* 3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. 4 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. 5 */ 6#include <linux/skbuff.h> 7#include <linux/ctype.h> 8#include <net/mac80211.h> --- 480 unchanged lines hidden (view full) --- 489 pdev_cap->tx_chain_mask = le32_to_cpu(mac_caps->tx_chain_mask_5g); 490 pdev_cap->rx_chain_mask = le32_to_cpu(mac_caps->rx_chain_mask_5g); 491 } else { 492 return -EINVAL; 493 } 494 495 /* tx/rx chainmask reported from fw depends on the actual hw chains used, 496 * For example, for 4x4 capable macphys, first 4 chains can be used for first | 1// SPDX-License-Identifier: BSD-3-Clause-Clear 2/* 3 * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. 4 * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. 5 */ 6#include <linux/skbuff.h> 7#include <linux/ctype.h> 8#include <net/mac80211.h> --- 480 unchanged lines hidden (view full) --- 489 pdev_cap->tx_chain_mask = le32_to_cpu(mac_caps->tx_chain_mask_5g); 490 pdev_cap->rx_chain_mask = le32_to_cpu(mac_caps->rx_chain_mask_5g); 491 } else { 492 return -EINVAL; 493 } 494 495 /* tx/rx chainmask reported from fw depends on the actual hw chains used, 496 * For example, for 4x4 capable macphys, first 4 chains can be used for first |
497 * mac and the remaing 4 chains can be used for the second mac or vice-versa. | 497 * mac and the remaining 4 chains can be used for the second mac or vice-versa. |
498 * In this case, tx/rx chainmask 0xf will be advertised for first mac and 0xf0 499 * will be advertised for second mac or vice-versa. Compute the shift value 500 * for tx/rx chainmask which will be used to advertise supported ht/vht rates to 501 * mac80211. 502 */ 503 pdev_cap->tx_chain_mask_shift = 504 find_first_bit((unsigned long *)&pdev_cap->tx_chain_mask, 32); 505 pdev_cap->rx_chain_mask_shift = --- 1232 unchanged lines hidden (view full) --- 1738{ 1739 struct ath12k_wmi_pdev *wmi = ar->wmi; 1740 struct wmi_vdev_install_key_cmd *cmd; 1741 struct wmi_tlv *tlv; 1742 struct sk_buff *skb; 1743 int ret, len, key_len_aligned; 1744 1745 /* WMI_TAG_ARRAY_BYTE needs to be aligned with 4, the actual key | 498 * In this case, tx/rx chainmask 0xf will be advertised for first mac and 0xf0 499 * will be advertised for second mac or vice-versa. Compute the shift value 500 * for tx/rx chainmask which will be used to advertise supported ht/vht rates to 501 * mac80211. 502 */ 503 pdev_cap->tx_chain_mask_shift = 504 find_first_bit((unsigned long *)&pdev_cap->tx_chain_mask, 32); 505 pdev_cap->rx_chain_mask_shift = --- 1232 unchanged lines hidden (view full) --- 1738{ 1739 struct ath12k_wmi_pdev *wmi = ar->wmi; 1740 struct wmi_vdev_install_key_cmd *cmd; 1741 struct wmi_tlv *tlv; 1742 struct sk_buff *skb; 1743 int ret, len, key_len_aligned; 1744 1745 /* WMI_TAG_ARRAY_BYTE needs to be aligned with 4, the actual key |
1746 * length is specifed in cmd->key_len. | 1746 * length is specified in cmd->key_len. |
1747 */ 1748 key_len_aligned = roundup(arg->key_len, 4); 1749 1750 len = sizeof(*cmd) + TLV_HDR_SIZE + key_len_aligned; 1751 1752 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); 1753 if (!skb) 1754 return -ENOMEM; --- 4235 unchanged lines hidden (view full) --- 5990 ev = tb[WMI_TAG_SERVICE_AVAILABLE_EVENT]; 5991 if (!ev) { 5992 ath12k_warn(ab, "failed to fetch svc available ev"); 5993 kfree(tb); 5994 return; 5995 } 5996 5997 /* TODO: Use wmi_service_segment_offset information to get the service | 1747 */ 1748 key_len_aligned = roundup(arg->key_len, 4); 1749 1750 len = sizeof(*cmd) + TLV_HDR_SIZE + key_len_aligned; 1751 1752 skb = ath12k_wmi_alloc_skb(wmi->wmi_ab, len); 1753 if (!skb) 1754 return -ENOMEM; --- 4235 unchanged lines hidden (view full) --- 5990 ev = tb[WMI_TAG_SERVICE_AVAILABLE_EVENT]; 5991 if (!ev) { 5992 ath12k_warn(ab, "failed to fetch svc available ev"); 5993 kfree(tb); 5994 return; 5995 } 5996 5997 /* TODO: Use wmi_service_segment_offset information to get the service |
5998 * especially when more services are advertised in multiple sevice | 5998 * especially when more services are advertised in multiple service |
5999 * available events. 6000 */ 6001 for (i = 0, j = WMI_MAX_SERVICE; 6002 i < WMI_SERVICE_SEGMENT_BM_SIZE32 && j < WMI_MAX_EXT_SERVICE; 6003 i++) { 6004 do { 6005 if (le32_to_cpu(ev->wmi_service_segment_bitmap[i]) & 6006 BIT(j % WMI_AVAIL_SERVICE_BITS_IN_SIZE32)) --- 594 unchanged lines hidden --- | 5999 * available events. 6000 */ 6001 for (i = 0, j = WMI_MAX_SERVICE; 6002 i < WMI_SERVICE_SEGMENT_BM_SIZE32 && j < WMI_MAX_EXT_SERVICE; 6003 i++) { 6004 do { 6005 if (le32_to_cpu(ev->wmi_service_segment_bitmap[i]) & 6006 BIT(j % WMI_AVAIL_SERVICE_BITS_IN_SIZE32)) --- 594 unchanged lines hidden --- |