From patchwork Fri Mar 30 07:19:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping-Ke Shih X-Patchwork-Id: 10317161 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 B59CF60212 for ; Fri, 30 Mar 2018 07:20:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E9632A49E for ; Fri, 30 Mar 2018 07:20:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 935C82A55A; Fri, 30 Mar 2018 07:20:34 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 E81BA2A49E for ; Fri, 30 Mar 2018 07:20:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752549AbeC3HUc (ORCPT ); Fri, 30 Mar 2018 03:20:32 -0400 Received: from rtits2.realtek.com ([211.75.126.72]:34470 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752655AbeC3HTl (ORCPT ); Fri, 30 Mar 2018 03:19:41 -0400 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID w2U7JRQC012915, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtitcasv01.realtek.com.tw [172.21.6.18]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTP id w2U7JRQC012915; Fri, 30 Mar 2018 15:19:27 +0800 Received: from localhost.localdomain (172.21.69.140) by RTITCASV01.realtek.com.tw (172.21.6.18) with Microsoft SMTP Server id 14.3.294.0; Fri, 30 Mar 2018 15:19:27 +0800 From: To: CC: , Subject: [PATCH 01/17] rtlwifi: add halmac structure to wifi.h Date: Fri, 30 Mar 2018 15:19:00 +0800 Message-ID: <20180330071916.23360-2-pkshih@realtek.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180330071916.23360-1-pkshih@realtek.com> References: <20180330071916.23360-1-pkshih@realtek.com> MIME-Version: 1.0 X-Originating-IP: [172.21.69.140] 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 with halmac and other modules. Signed-off-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtlwifi/wifi.h | 58 +++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index d27e33960e77..b7709b7c8411 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -2305,6 +2305,13 @@ 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 { @@ -2687,6 +2694,54 @@ struct rtl_btc_ops { bool (*btc_is_bt_lps_on)(struct rtl_priv *rtlpriv); }; +struct rtl_halmac_ops { + int (*halmac_init_adapter)(struct rtl_priv *rtlpriv); + int (*halmac_deinit_adapter)(struct rtl_priv *rtlpriv); + int (*halmac_init_hal)(struct rtl_priv *rtlpriv); + int (*halmac_deinit_hal)(struct rtl_priv *rtlpriv); + int (*halmac_poweron)(struct rtl_priv *rtlpriv); + int (*halmac_poweroff)(struct rtl_priv *rtlpriv); + + 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); + int (*halmac_iqk)(struct rtl_priv *rtlpriv, u8 clear, u8 segment); +}; + +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 */ +}; + struct proxim { bool proxim_on; @@ -2792,6 +2847,9 @@ struct rtl_priv { /*for bt coexist use*/ struct bt_coexist_info btcoexist; + /* halmac for newer ICs */ + struct rtl_halmac halmac; + /* separate 92ee from other ICs, * 92ee use new trx flow. */