From patchwork Fri Jul 21 04:24:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 9856033 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.web.codeaurora.org (Postfix) with ESMTP id 284E7601C0 for ; Fri, 21 Jul 2017 04:25:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F46028734 for ; Fri, 21 Jul 2017 04:25:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03A4C28759; Fri, 21 Jul 2017 04:25:04 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EE4328734 for ; Fri, 21 Jul 2017 04:25:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750857AbdGUEY7 (ORCPT ); Fri, 21 Jul 2017 00:24:59 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:36877 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbdGUEY5 (ORCPT ); Fri, 21 Jul 2017 00:24:57 -0400 Received: by mail-oi0-f67.google.com with SMTP id q4so3924927oif.4 for ; Thu, 20 Jul 2017 21:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=JRJVneocjjDywD7X5rxIehEZUCkS1r20W6P+i6VFXGU=; b=Voyspj49pFKI4g3BgZBdEEXEhU5GWLuu2Ct1HqSafufZk9f4SsaXptTS0R5zgChNdM PCs04cO7CgWgwLNHmBjUF+IxqZJWP1cE5D4GWAM1kpftwiRyW4nyFPYJt4dEEf9nRz35 UivExPnTbL0TlIMXW/k6LkA7RMjtDgq9J8/aV5rmmU2l8tta5szGPPRP3sKqLFjMAwNk /EkpD+VAmUT2hBFlB5ZyVke5KTVOEPkeWs0/GdTN/Q0Vsxb26+FYHPxbfj4UW0yDSFd4 qQhvvDHWoqi1ovWny3FjWETj9L3pV79YG/9GwNobWcq2y/ym6B62vdzHyOxk4DYsHWKF Zolg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=JRJVneocjjDywD7X5rxIehEZUCkS1r20W6P+i6VFXGU=; b=it35giq4bloinKN/yXfAf7jk1vstCFiVv+tH1jVcgRKWrX3iPY52pgxsoJ9hpFL1Oj AsaKNa+neb5i73m96e6TP82yNbspNofWeJ4Ppqgy3inEs6PjkJ0GjPBgkhITsHO7L1ip xwVL1nfPbtErRDGygBOblvdzk7rBeqdlgpLi0ykIOx29S5sw1ufstvvlJ5H7yTijbCK8 O2CKjELlJuZf0i+0mQ4zYp7S314JxgEmN9ijs/bNrD+K1Zg2WKSSkxWpKnlO313gzFy3 q1WAci5e8e+y2mVgx4NnLlgiA6p8bMbW1qK61ypfXYdTMbePM1cPXd4kBrzKzk/8z7il iwAg== X-Gm-Message-State: AIVw112GpHD0NLhQzSi12jBKVbsTJltHFTEMgcB+Uke/Ma46UZ/tUMHj Fnfrbt8z3233ZHc3 X-Received: by 10.202.10.198 with SMTP id k67mr1531811oiy.44.1500611097237; Thu, 20 Jul 2017 21:24:57 -0700 (PDT) Received: from linux-4v1g.suse (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id s69sm1832947ois.15.2017.07.20.21.24.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Jul 2017 21:24:56 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Ping-Ke Shih , Larry Finger , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH 09/10] rtlwifi: Add halmac structure to wifi.h Date: Thu, 20 Jul 2017 23:24:39 -0500 Message-Id: <20170721042440.15839-10-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170721042440.15839-1-Larry.Finger@lwfinger.net> References: <20170721042440.15839-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ping-Ke Shih Add structure and ops to interact between halmac and other modules. Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- drivers/net/wireless/realtek/rtlwifi/wifi.h | 64 +++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 6c261b16a17d..92ce00819d2c 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -2229,6 +2229,11 @@ struct rtl_hal_ops { u16 (*get_available_desc)(struct ieee80211_hw *hw, u8 q_idx); void (*c2h_content_parsing)(struct ieee80211_hw *hw, u8 tag, u8 len, u8 *val); + /* ops for halmac cb */ + bool (*halmac_cb_init_mac_register)(struct rtl_priv *rtlpriv); + bool (*halmac_cb_init_bb_rf_register)(struct rtl_priv *rtlpriv); + bool (*halmac_cb_write_data_rsvd_page)(struct rtl_priv *rtlpriv, u8 *buf, u32 size); + bool (*halmac_cb_write_data_h2c)(struct rtl_priv *rtlpriv, u8 *buf, u32 size); }; struct rtl_intf_ops { @@ -2613,6 +2618,61 @@ struct rtl_btc_ops { }; +struct rtl_halmac_ops { + int (*halmac_init_adapter)(struct rtl_priv *); + int (*halmac_deinit_adapter)(struct rtl_priv *); + int (*halmac_init_hal)(struct rtl_priv *); + int (*halmac_deinit_hal)(struct rtl_priv *); + int (*halmac_poweron)(struct rtl_priv *); + int (*halmac_poweroff)(struct rtl_priv *); + + int (*halmac_phy_power_switch)(struct rtl_priv *rtlpriv, u8 enable); + int (*halmac_set_mac_address)(struct rtl_priv *rtlpriv, u8 hwport, + u8 *addr); + int (*halmac_set_bssid)(struct rtl_priv *rtlpriv, u8 hwport, u8 *addr); + + int (*halmac_get_physical_efuse_size)(struct rtl_priv *rtlpriv, + u32 *size); + int (*halmac_read_physical_efuse_map)(struct rtl_priv *rtlpriv, + u8 *map, u32 size); + int (*halmac_get_logical_efuse_size)(struct rtl_priv *rtlpriv, + u32 *size); + int (*halmac_read_logical_efuse_map)(struct rtl_priv *rtlpriv, u8 *map, + u32 size); + + int (*halmac_set_bandwidth)(struct rtl_priv *rtlpriv, u8 channel, + u8 pri_ch_idx, u8 bw); + + int (*halmac_c2h_handle)(struct rtl_priv *rtlpriv, u8 *c2h, u32 size); + + int (*halmac_chk_txdesc)(struct rtl_priv *rtlpriv, u8 *txdesc, + u32 size); +}; + +struct rtl_halmac_indicator { + struct completion *comp; + u32 wait_ms; + + u8 *buffer; + u32 buf_size; + u32 ret_size; + u32 status; +}; + +struct rtl_halmac { + struct rtl_halmac_ops *ops; /* halmac ops (halmac.ko own this object) */ + void *internal; /* internal context of halmac, i.e. PHALMAC_ADAPTER */ + struct rtl_halmac_indicator *indicator; /* size=10 */ + + /* flags */ + /* + * send_general_info + * 0: no need to call halmac_send_general_info() + * 1: need to call halmac_send_general_info() + */ + u8 send_general_info; +}; + struct proxim { bool proxim_on; @@ -2825,6 +2886,9 @@ struct rtl_priv { /* phydm for newer IC. (e.g. 8822B) */ struct rtl_phydm phydm; + /* halmac for newer IC. (e.g. 8822B) */ + struct rtl_halmac halmac; + /* separate 92ee from other ICs, * 92ee use new trx flow. */