From patchwork Mon Jun 10 09:40:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karthikeyan periyasamy X-Patchwork-Id: 10984581 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C123614E5 for ; Mon, 10 Jun 2019 09:40:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4E69283BF for ; Mon, 10 Jun 2019 09:40:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 919BF2818E; Mon, 10 Jun 2019 09:40:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5D33C22B39 for ; Mon, 10 Jun 2019 09:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=s5FDb10ZRokXZvi0PJdC2PMhKLAzfTRRwq571cjVybY=; b=ftS ma6B/GOgx8wIzPhF4C+lLwd9F4015SyY4Kv7UufjdzDGMCS9bWDWq38+f+qeMBS6cBM3wxZnUohlQ +lW0GV5U0fY53dHnus0+tKURXlvIA7S2yTocWEhtVSAgHwstt6BGaHrDTAENWTVJHCtcobKNrAajR wZmaQo2JrEpPTrXBPPk997c7eNrcKhGp4MaYq99ascOCW2aeLJ7aacJin0zVndapgSJuharqAgqoC A23xpnbmdPudCZtqeEr6Airs9S670QZ4oyMnZHeZObVdYQzI7WpoFqgRVWQYWnbKfPCvbCjRiFMHS jsdiLdPU9ree311Zn6/TzyaQqefWQRg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1haGn9-0006xw-GO; Mon, 10 Jun 2019 09:40:39 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1haGn6-0006xN-6u for ath11k@lists.infradead.org; Mon, 10 Jun 2019 09:40:38 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EDE3A60132; Mon, 10 Jun 2019 09:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560159635; bh=EsIWCVkQnaP0m4TC/aUs6VmY00yHla8cNc/PRhkGzbQ=; h=From:To:Cc:Subject:Date:From; b=aLMDbMAPycO43pa7IFyGe5kDOe3Mni7njFv3iXRQU7TbLdbHGRVJG3o+tCCepm2V+ YoNWg374A3E+fvhczaBq82PoFqNyc62Yu5c2s6ZpXao5oZXiYHHeQnSG99ztZTtHmi WKHFGEZRqShadA5IBPvfzjJSZvOjj0bHLxmxg2vc= Received: from CHECSTP284781-LIN.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: periyasa@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id BC609601E8; Mon, 10 Jun 2019 09:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1560159634; bh=EsIWCVkQnaP0m4TC/aUs6VmY00yHla8cNc/PRhkGzbQ=; h=From:To:Cc:Subject:Date:From; b=d8RdgrIC0vR/QofcnyZkHv1vFex0xJoMuk2T+rNYctZmjDUrZjSm9j44ZMqYEQHvP Ik2yrl9oQPHqWee141O0xq3ex4gbrnidclDjSp36qpBF547PLtwTWfstw+oaXkVJoj NsdPh8/zMiS3As7xfPH0EoOzpfYKJamTYrarsfMs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BC609601E8 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=periyasa@codeaurora.org From: Karthikeyan Periyasamy To: ath11k@lists.infradead.org Subject: [PATCH] ath11k: cleanup in rx data path Date: Mon, 10 Jun 2019 15:10:11 +0530 Message-Id: <1560159611-5864-1-git-send-email-periyasa@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190610_024036_288661_37D8C069 X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Karthikeyan Periyasamy MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Removed all unused function definition from dp_rx. Moved all non exposed API inside the dp_rx. Removed inline attribute and let the compiler handle the optimization. Signed-off-by: Karthikeyan Periyasamy --- drivers/net/wireless/ath/ath11k/dp_rx.c | 310 ++++++++++++++++++++++++++++---- drivers/net/wireless/ath/ath11k/dp_rx.h | 307 ------------------------------- 2 files changed, 274 insertions(+), 343 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c index 84e4dd1..49d80fb 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.c +++ b/drivers/net/wireless/ath/ath11k/dp_rx.c @@ -12,6 +12,255 @@ #include "hal_rx.h" #include "dp_tx.h" +static u8 *ath11k_dp_rx_h_80211_hdr(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return rxd->hdr_status; +} + +static enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + if (!(__le32_to_cpu(rxd->mpdu_start.info1) & + RX_MPDU_START_INFO1_ENCRYPT_INFO_VALID)) + return HAL_ENCRYPT_TYPE_OPEN; + + return FIELD_GET(RX_MPDU_START_INFO2_ENC_TYPE, + __le32_to_cpu(rxd->mpdu_start.info2)); +} + +static u8 ath11k_dp_rx_h_mpdu_start_decap_type(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return FIELD_GET(RX_MPDU_START_INFO5_DECAP_TYPE, + __le32_to_cpu(rxd->mpdu_start.info5)); +} + +static bool ath11k_dp_rx_h_attn_msdu_done(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return !!FIELD_GET(RX_ATTENTION_INFO2_MSDU_DONE, + __le32_to_cpu(rxd->attention.info2)); +} + +static bool ath11k_dp_rx_h_attn_first_mpdu(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return !!FIELD_GET(RX_ATTENTION_INFO1_FIRST_MPDU, + __le32_to_cpu(rxd->attention.info1)); +} + +static bool ath11k_dp_rx_h_attn_l4_cksum_fail(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return !!FIELD_GET(RX_ATTENTION_INFO1_TCP_UDP_CKSUM_FAIL, + __le32_to_cpu(rxd->attention.info1)); +} + +static bool ath11k_dp_rx_h_attn_ip_cksum_fail(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return !!FIELD_GET(RX_ATTENTION_INFO1_IP_CKSUM_FAIL, + __le32_to_cpu(rxd->attention.info1)); +} + +static bool ath11k_dp_rx_h_attn_is_decrypted(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return (FIELD_GET(RX_ATTENTION_INFO2_DCRYPT_STATUS_CODE, + __le32_to_cpu(rxd->attention.info2)) == + RX_DESC_DECRYPT_STATUS_CODE_OK); +} + +static u32 ath11k_dp_rx_h_attn_mpdu_err(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + u32 info = __le32_to_cpu(rxd->attention.info1); + u32 errmap = 0; + + if (info & RX_ATTENTION_INFO1_FCS_ERR) + errmap |= DP_RX_MPDU_ERR_FCS; + + if (info & RX_ATTENTION_INFO1_DECRYPT_ERR) + errmap |= DP_RX_MPDU_ERR_DECRYPT; + + if (info & RX_ATTENTION_INFO1_TKIP_MIC_ERR) + errmap |= DP_RX_MPDU_ERR_TKIP_MIC; + + if (info & RX_ATTENTION_INFO1_A_MSDU_ERROR) + errmap |= DP_RX_MPDU_ERR_AMSDU_ERR; + + if (info & RX_ATTENTION_INFO1_OVERFLOW_ERR) + errmap |= DP_RX_MPDU_ERR_OVERFLOW; + + if (info & RX_ATTENTION_INFO1_MSDU_LEN_ERR) + errmap |= DP_RX_MPDU_ERR_MSDU_LEN; + + if (info & RX_ATTENTION_INFO1_MPDU_LEN_ERR) + errmap |= DP_RX_MPDU_ERR_MPDU_LEN; + + return errmap; +} + +static u16 ath11k_dp_rx_h_msdu_start_msdu_len(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return FIELD_GET(RX_MSDU_START_INFO1_MSDU_LENGTH, + __le32_to_cpu(rxd->msdu_start.info1)); +} + +static u8 ath11k_dp_rx_h_msdu_start_sgi(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return FIELD_GET(RX_MSDU_START_INFO3_SGI, + __le32_to_cpu(rxd->msdu_start.info3)); +} + +static u8 ath11k_dp_rx_h_msdu_start_rate_mcs(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return FIELD_GET(RX_MSDU_START_INFO3_RATE_MCS, + __le32_to_cpu(rxd->msdu_start.info3)); +} + +static u8 ath11k_dp_rx_h_msdu_start_rx_bw(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return FIELD_GET(RX_MSDU_START_INFO3_RECV_BW, + __le32_to_cpu(rxd->msdu_start.info3)); +} + +static u8 ath11k_dp_rx_h_msdu_start_rssi(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return FIELD_GET(RX_MSDU_START_INFO3_USER_RSSI, + __le32_to_cpu(rxd->msdu_start.info3)); +} + +static u32 ath11k_dp_rx_h_msdu_start_freq(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return __le32_to_cpu(rxd->msdu_start.phy_meta_data); +} + +static u8 ath11k_dp_rx_h_msdu_start_pkt_type(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return FIELD_GET(RX_MSDU_START_INFO3_PKT_TYPE, + __le32_to_cpu(rxd->msdu_start.info3)); +} + +static u8 ath11k_dp_rx_h_msdu_start_nss(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + u8 mimo_ss_bitmap = FIELD_GET(RX_MSDU_START_INFO3_MIMO_SS_BITMAP, + __le32_to_cpu(rxd->msdu_start.info3)); + + return hweight8(mimo_ss_bitmap); +} + +static u8 ath11k_dp_rx_h_msdu_end_l3pad(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return FIELD_GET(RX_MSDU_END_INFO2_L3_HDR_PADDING, + __le32_to_cpu(rxd->msdu_end.info2)); +} + +static bool ath11k_dp_rx_h_msdu_end_first_msdu(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return !!FIELD_GET(RX_MSDU_END_INFO2_FIRST_MSDU, + __le32_to_cpu(rxd->msdu_end.info2)); +} + +static bool ath11k_dp_rx_h_msdu_end_last_msdu(u8 *desc) +{ + struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; + + return !!FIELD_GET(RX_MSDU_END_INFO2_LAST_MSDU, + __le32_to_cpu(rxd->msdu_end.info2)); +} + +static void ath11k_dp_rx_desc_end_tlv_copy(u8 *first, u8 *last) +{ + struct hal_rx_desc *fdesc = (struct hal_rx_desc *)first; + struct hal_rx_desc *ldesc = (struct hal_rx_desc *)last; + + memcpy((u8 *)&fdesc->msdu_end, (u8 *)&ldesc->msdu_end, + sizeof(struct rx_msdu_end)); + memcpy((u8 *)&fdesc->attention, (u8 *)&ldesc->attention, + sizeof(struct rx_attention)); + memcpy((u8 *)&fdesc->mpdu_end, (u8 *)&ldesc->mpdu_end, + sizeof(struct rx_mpdu_end)); +} + +static u32 ath11k_dp_rxdesc_get_mpdulen_err(void *hw_desc_addr) +{ + struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; + struct rx_attention *rx_attn; + + rx_attn = &rx_desc->attention; + + return FIELD_GET(RX_ATTENTION_INFO1_MPDU_LEN_ERR, + __le32_to_cpu(rx_attn->info1)); +} + +static u32 ath11k_dp_rxdesc_get_decap_format(void *hw_desc_addr) +{ + struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; + struct rx_msdu_start *rx_msdu_start; + + rx_msdu_start = &rx_desc->msdu_start; + + return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, + __le32_to_cpu(rx_msdu_start->info2)); +} + +static u8 *ath11k_dp_rxdesc_get_80211hdr(void *hw_desc_addr) +{ + struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; + u8 *rx_pkt_hdr; + + rx_pkt_hdr = &rx_desc->msdu_payload[0]; + + return rx_pkt_hdr; +} + +static bool ath11k_dp_rxdesc_mpdu_valid(void *hw_desc_addr) +{ + struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; + u32 tlv_tag; + + tlv_tag = FIELD_GET(HAL_TLV_HDR_TAG, + __le32_to_cpu(rx_desc->mpdu_start_tag)); + + return tlv_tag == HAL_RX_MPDU_START ? true : false; +} + +static u32 ath11k_dp_rxdesc_get_ppduid(void *hw_desc_addr) +{ + struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; + + return __le16_to_cpu(rx_desc->mpdu_start.phy_ppdu_id); +} + /* Returns number of Rx buffers replenished */ int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, struct dp_rxdma_ring *rx_ring, @@ -652,8 +901,8 @@ int ath11k_dp_rx_ampdu_stop(struct ath11k *ar, return ret; } -static inline int ath11k_get_ppdu_user_index(struct htt_ppdu_stats *ppdu_stats, - u16 peer_id) +static int ath11k_get_ppdu_user_index(struct htt_ppdu_stats *ppdu_stats, + u16 peer_id) { int i; @@ -790,7 +1039,7 @@ int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, return 0; } -static inline u8 ath11k_bw_to_mac80211_bw(u8 bw) +static u8 ath11k_bw_to_mac80211_bw(u8 bw) { u8 ret = 0; @@ -812,7 +1061,7 @@ static inline u8 ath11k_bw_to_mac80211_bw(u8 bw) return ret; } -static inline u32 ath11k_bw_to_mac80211_bwflags(u8 bw) +static u32 ath11k_bw_to_mac80211_bwflags(u8 bw) { u32 bwflags = 0; @@ -1027,7 +1276,8 @@ struct htt_ppdu_stats_info *ath11k_dp_htt_get_ppdu_desc(struct ath11k *ar, } static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab, - struct sk_buff *skb) { + struct sk_buff *skb) +{ u8 *data = (u8 *)skb->data; struct htt_ppdu_stats_info *ppdu_info; struct ath11k *ar; @@ -1064,8 +1314,7 @@ static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab, return 0; } -static void ath11k_htt_pktlog(struct ath11k_base *ab, - struct sk_buff *skb) +static void ath11k_htt_pktlog(struct ath11k_base *ab, struct sk_buff *skb) { u32 *data = (u32 *)skb->data, len; struct ath11k *ar; @@ -3235,17 +3484,7 @@ int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int mac_id) return 0; } -static inline bool ath11k_get_rx_status_done(u8 *rx_tlv) -{ - struct hal_tlv_hdr *thdr = (struct hal_tlv_hdr *)rx_tlv; - u32 tlv_tag; - - tlv_tag = FIELD_GET(HAL_TLV_HDR_TAG, thdr->tl); - - return (tlv_tag == HAL_RX_STATUS_BUFFER_DONE); -} - -static inline void ath11k_dp_mon_set_frag_len(u32 *total_len, u32 *frag_len) +static void ath11k_dp_mon_set_frag_len(u32 *total_len, u32 *frag_len) { if (*total_len >= (DP_RX_BUFFER_SIZE - sizeof(struct hal_rx_desc))) { *frag_len = DP_RX_BUFFER_SIZE - sizeof(struct hal_rx_desc); @@ -3256,7 +3495,7 @@ static inline void ath11k_dp_mon_set_frag_len(u32 *total_len, u32 *frag_len) } } -static inline +static int ath11k_dp_rx_monitor_link_desc_return(struct ath11k *ar, void *p_last_buf_addr_info, u8 mac_id) @@ -3289,7 +3528,7 @@ int ath11k_dp_rx_monitor_link_desc_return(struct ath11k *ar, return ret; } -static inline +static void ath11k_dp_rx_mon_next_link_desc_get(void *rx_msdu_link_desc, dma_addr_t *paddr, u32 *sw_cookie, void **pp_buf_addr_info) @@ -3306,7 +3545,7 @@ void ath11k_dp_rx_mon_next_link_desc_get(void *rx_msdu_link_desc, *pp_buf_addr_info = (void *)buf_addr_info; } -static inline int ath11k_dp_pkt_set_pktlen(struct sk_buff *skb, u32 len) +static int ath11k_dp_pkt_set_pktlen(struct sk_buff *skb, u32 len) { if (skb->len > len) { skb_trim(skb, len); @@ -3324,11 +3563,10 @@ static inline int ath11k_dp_pkt_set_pktlen(struct sk_buff *skb, u32 len) return 0; } -static inline void -ath11k_hal_rx_msdu_list_get(struct ath11k *ar, - void *msdu_link_desc, - struct hal_rx_msdu_list *msdu_list, - u16 *num_msdus) +static void ath11k_hal_rx_msdu_list_get(struct ath11k *ar, + void *msdu_link_desc, + struct hal_rx_msdu_list *msdu_list, + u16 *num_msdus) { struct hal_rx_msdu_details *msdu_details = NULL; struct rx_msdu_desc *msdu_desc_info = NULL; @@ -3368,8 +3606,8 @@ static inline int ath11k_dp_pkt_set_pktlen(struct sk_buff *skb, u32 len) *num_msdus = i; } -static inline u32 ath11k_dp_rx_mon_comp_ppduid(u32 msdu_ppdu_id, u32 *ppdu_id, - u32 *rx_bufs_used) +static u32 ath11k_dp_rx_mon_comp_ppduid(u32 msdu_ppdu_id, u32 *ppdu_id, + u32 *rx_bufs_used) { u32 ret = 0; @@ -3389,9 +3627,9 @@ static inline u32 ath11k_dp_rx_mon_comp_ppduid(u32 msdu_ppdu_id, u32 *ppdu_id, return ret; } -static inline void ath11k_dp_mon_get_buf_len(struct hal_rx_msdu_desc_info *info, - bool *is_frag, u32 *total_len, - u32 *frag_len, u32 *msdu_cnt) +static void ath11k_dp_mon_get_buf_len(struct hal_rx_msdu_desc_info *info, + bool *is_frag, u32 *total_len, + u32 *frag_len, u32 *msdu_cnt) { if (info->msdu_flags & RX_MSDU_DESC_INFO0_MSDU_CONTINUATION) { if (!*is_frag) { @@ -3584,7 +3822,7 @@ static inline void ath11k_dp_mon_get_buf_len(struct hal_rx_msdu_desc_info *info, return rx_bufs_used; } -static inline void ath11k_dp_rx_msdus_set_payload(struct sk_buff *msdu) +static void ath11k_dp_rx_msdus_set_payload(struct sk_buff *msdu) { u32 rx_pkt_offset, l2_hdr_offset; @@ -3593,7 +3831,7 @@ static inline void ath11k_dp_rx_msdus_set_payload(struct sk_buff *msdu) skb_pull(msdu, rx_pkt_offset + l2_hdr_offset); } -static inline struct sk_buff * +static struct sk_buff * ath11k_dp_rx_mon_merg_msdus(struct ath11k *ar, u32 mac_id, struct sk_buff *head_msdu, struct sk_buff *last_msdu, @@ -3818,9 +4056,9 @@ static void ath11k_dp_rx_mon_dest_process(struct ath11k *ar, u32 quota, } } -static inline void ath11k_dp_rx_mon_status_process_tlv(struct ath11k *ar, - u32 quota, - struct napi_struct *napi) +static void ath11k_dp_rx_mon_status_process_tlv(struct ath11k *ar, + u32 quota, + struct napi_struct *napi) { struct ath11k_pdev_dp *dp = &ar->dp; struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data; diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.h b/drivers/net/wireless/ath/ath11k/dp_rx.h index 75d9150..1fae945 100644 --- a/drivers/net/wireless/ath/ath11k/dp_rx.h +++ b/drivers/net/wireless/ath/ath11k/dp_rx.h @@ -39,313 +39,6 @@ struct ath11k_dp_rfc1042_hdr { __be16 snap_type; } __packed; -static inline u8 * -ath11k_dp_rx_h_80211_hdr(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return rxd->hdr_status; -} - -static inline bool -ath11k_dp_rx_h_mpdu_start_valid_encrypt(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return !!FIELD_GET(RX_MPDU_START_INFO1_ENCRYPT_INFO_VALID, - __le32_to_cpu(rxd->mpdu_start.info1)); -} - -static inline void -ath11k_dp_rx_h_mpdu_start_dump_pn(struct ath11k_base *ab, u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - ath11k_info(ab, "Dump PN number: %x %x %x %x\n", - __le32_to_cpu(rxd->mpdu_start.pn[0]), - __le32_to_cpu(rxd->mpdu_start.pn[1]), - __le32_to_cpu(rxd->mpdu_start.pn[2]), - __le32_to_cpu(rxd->mpdu_start.pn[3])); -} - -static inline enum hal_encrypt_type -ath11k_dp_rx_h_mpdu_start_enctype(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - if (!(__le32_to_cpu(rxd->mpdu_start.info1) & - RX_MPDU_START_INFO1_ENCRYPT_INFO_VALID)) - return HAL_ENCRYPT_TYPE_OPEN; - - return FIELD_GET(RX_MPDU_START_INFO2_ENC_TYPE, - __le32_to_cpu(rxd->mpdu_start.info2)); -} - -static inline u8 -ath11k_dp_rx_h_mpdu_start_decap_type(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MPDU_START_INFO5_DECAP_TYPE, - __le32_to_cpu(rxd->mpdu_start.info5)); -} - -static inline bool -ath11k_dp_rx_h_attn_msdu_done(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return !!FIELD_GET(RX_ATTENTION_INFO2_MSDU_DONE, - __le32_to_cpu(rxd->attention.info2)); -} - -static inline bool -ath11k_dp_rx_h_attn_first_mpdu(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return !!FIELD_GET(RX_ATTENTION_INFO1_FIRST_MPDU, - __le32_to_cpu(rxd->attention.info1)); -} - -static inline bool -ath11k_dp_rx_h_attn_l4_cksum_fail(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return !!FIELD_GET(RX_ATTENTION_INFO1_TCP_UDP_CKSUM_FAIL, - __le32_to_cpu(rxd->attention.info1)); -} - -static inline bool -ath11k_dp_rx_h_attn_ip_cksum_fail(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return !!FIELD_GET(RX_ATTENTION_INFO1_IP_CKSUM_FAIL, - __le32_to_cpu(rxd->attention.info1)); -} - -static inline bool -ath11k_dp_rx_h_attn_is_decrypted(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return (FIELD_GET(RX_ATTENTION_INFO2_DCRYPT_STATUS_CODE, - __le32_to_cpu(rxd->attention.info2)) == - RX_DESC_DECRYPT_STATUS_CODE_OK); -} - -static inline u32 -ath11k_dp_rx_h_attn_mpdu_err(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - u32 info = __le32_to_cpu(rxd->attention.info1); - u32 errmap = 0; - - if (info & RX_ATTENTION_INFO1_FCS_ERR) - errmap |= DP_RX_MPDU_ERR_FCS; - - if (info & RX_ATTENTION_INFO1_DECRYPT_ERR) - errmap |= DP_RX_MPDU_ERR_DECRYPT; - - if (info & RX_ATTENTION_INFO1_TKIP_MIC_ERR) - errmap |= DP_RX_MPDU_ERR_TKIP_MIC; - - if (info & RX_ATTENTION_INFO1_A_MSDU_ERROR) - errmap |= DP_RX_MPDU_ERR_AMSDU_ERR; - - if (info & RX_ATTENTION_INFO1_OVERFLOW_ERR) - errmap |= DP_RX_MPDU_ERR_OVERFLOW; - - if (info & RX_ATTENTION_INFO1_MSDU_LEN_ERR) - errmap |= DP_RX_MPDU_ERR_MSDU_LEN; - - if (info & RX_ATTENTION_INFO1_MPDU_LEN_ERR) - errmap |= DP_RX_MPDU_ERR_MPDU_LEN; - - return errmap; -} - -static inline u16 -ath11k_dp_rx_h_msdu_start_msdu_len(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MSDU_START_INFO1_MSDU_LENGTH, - __le32_to_cpu(rxd->msdu_start.info1)); -} - -static inline u8 -ath11k_dp_rx_h_msdu_start_sgi(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MSDU_START_INFO3_SGI, - __le32_to_cpu(rxd->msdu_start.info3)); -} - -static inline u8 -ath11k_dp_rx_h_msdu_start_rate_mcs(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MSDU_START_INFO3_RATE_MCS, - __le32_to_cpu(rxd->msdu_start.info3)); -} - -static inline u8 -ath11k_dp_rx_h_msdu_start_rx_bw(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MSDU_START_INFO3_RECV_BW, - __le32_to_cpu(rxd->msdu_start.info3)); -} - -static inline u8 -ath11k_dp_rx_h_msdu_start_recption_type(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MSDU_START_INFO3_RECEPTION_TYPE, - __le32_to_cpu(rxd->msdu_start.info3)); -} - -static inline u32 -ath11k_dp_rx_h_msdu_start_flow_id(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return __le32_to_cpu(rxd->msdu_start.flow_id_toeplitz); -} - -static inline u8 -ath11k_dp_rx_h_msdu_start_rssi(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MSDU_START_INFO3_USER_RSSI, - __le32_to_cpu(rxd->msdu_start.info3)); -} - -static inline u32 -ath11k_dp_rx_h_msdu_start_freq(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return __le32_to_cpu(rxd->msdu_start.phy_meta_data); -} - -static inline u8 -ath11k_dp_rx_h_msdu_start_pkt_type(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MSDU_START_INFO3_PKT_TYPE, - __le32_to_cpu(rxd->msdu_start.info3)); -} - -static inline u8 -ath11k_dp_rx_h_msdu_start_nss(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - u8 mimo_ss_bitmap = FIELD_GET(RX_MSDU_START_INFO3_MIMO_SS_BITMAP, - __le32_to_cpu(rxd->msdu_start.info3)); - - return hweight8(mimo_ss_bitmap); -} - -static inline u8 -ath11k_dp_rx_h_msdu_end_l3pad(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return FIELD_GET(RX_MSDU_END_INFO2_L3_HDR_PADDING, - __le32_to_cpu(rxd->msdu_end.info2)); -} - -static inline bool -ath11k_dp_rx_h_msdu_end_first_msdu(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return !!FIELD_GET(RX_MSDU_END_INFO2_FIRST_MSDU, - __le32_to_cpu(rxd->msdu_end.info2)); -} - -static inline bool -ath11k_dp_rx_h_msdu_end_last_msdu(u8 *desc) -{ - struct hal_rx_desc *rxd = (struct hal_rx_desc *)desc; - - return !!FIELD_GET(RX_MSDU_END_INFO2_LAST_MSDU, - __le32_to_cpu(rxd->msdu_end.info2)); -} - -static inline void ath11k_dp_rx_desc_end_tlv_copy(u8 *first, u8 *last) -{ - struct hal_rx_desc *fdesc = (struct hal_rx_desc *)first; - struct hal_rx_desc *ldesc = (struct hal_rx_desc *)last; - - memcpy((u8 *)&fdesc->msdu_end, (u8 *)&ldesc->msdu_end, - sizeof(struct rx_msdu_end)); - memcpy((u8 *)&fdesc->attention, (u8 *)&ldesc->attention, - sizeof(struct rx_attention)); - memcpy((u8 *)&fdesc->mpdu_end, (u8 *)&ldesc->mpdu_end, - sizeof(struct rx_mpdu_end)); -} - -static inline u32 ath11k_dp_rxdesc_get_mpdulen_err(void *hw_desc_addr) -{ - struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; - struct rx_attention *rx_attn; - - rx_attn = &rx_desc->attention; - - return FIELD_GET(RX_ATTENTION_INFO1_MPDU_LEN_ERR, - __le32_to_cpu(rx_attn->info1)); -} - -static inline u32 ath11k_dp_rxdesc_get_decap_format(void *hw_desc_addr) -{ - struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; - struct rx_msdu_start *rx_msdu_start; - - rx_msdu_start = &rx_desc->msdu_start; - - return FIELD_GET(RX_MSDU_START_INFO2_DECAP_FORMAT, - __le32_to_cpu(rx_msdu_start->info2)); -} - -static inline u8 *ath11k_dp_rxdesc_get_80211hdr(void *hw_desc_addr) -{ - struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; - u8 *rx_pkt_hdr; - - rx_pkt_hdr = &rx_desc->msdu_payload[0]; - - return rx_pkt_hdr; -} - -static inline bool ath11k_dp_rxdesc_mpdu_valid(void *hw_desc_addr) -{ - struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; - u32 tlv_tag; - - tlv_tag = FIELD_GET(HAL_TLV_HDR_TAG, - __le32_to_cpu(rx_desc->mpdu_start_tag)); - - return tlv_tag == HAL_RX_MPDU_START ? true : false; -} - -static inline u32 ath11k_dp_rxdesc_get_ppduid(void *hw_desc_addr) -{ - struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)hw_desc_addr; - - return __le16_to_cpu(rx_desc->mpdu_start.phy_ppdu_id); -} - int ath11k_dp_rx_ampdu_start(struct ath11k *ar, struct ieee80211_ampdu_params *params); int ath11k_dp_rx_ampdu_stop(struct ath11k *ar,