From patchwork Thu May 31 09:10:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Matyukevich X-Patchwork-Id: 10440561 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 74BB5602BF for ; Thu, 31 May 2018 09:11:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DF25290A1 for ; Thu, 31 May 2018 09:11:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62298291B9; Thu, 31 May 2018 09:11:31 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, 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 C9B05290A1 for ; Thu, 31 May 2018 09:11:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754242AbeEaJL2 (ORCPT ); Thu, 31 May 2018 05:11:28 -0400 Received: from mail-by2nam01on0082.outbound.protection.outlook.com ([104.47.34.82]:40832 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754093AbeEaJLV (ORCPT ); Thu, 31 May 2018 05:11:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantenna.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aMlkzta0rP92D+b2NNSH2hKp4zsX3WUiKcz4YvWVnhw=; b=Z7tfUftlUvm7dH3tGBsupsocucgStTtvd3O9eLBPagsWfpE8UxEsw0c/9STmweMXr+Eb8GwWO+k0wnGfAG/TtWVjjuOZw7/NUXu/+CqsXxo0GPA1+cwJ3eDaTY0joT4WJ6C/otqMFFA3gU2CdWGJM7jhvsImG9jGdNtASxZf7Io= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=sergey.matyukevich.os@quantenna.com; Received: from bars.quantenna.com (195.182.157.78) by BY2PR05MB1926.namprd05.prod.outlook.com (2a01:111:e400:58f7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.5; Thu, 31 May 2018 09:11:19 +0000 From: Sergey Matyukevich To: linux-wireless@vger.kernel.org Cc: Igor Mitsyanko , Andrey Shevchenko , Sergei Maksimenko Subject: [PATCH 3/6] qtnfmac: implement cfg80211 power management callback Date: Thu, 31 May 2018 12:10:59 +0300 Message-Id: <20180531091102.28666-4-sergey.matyukevich.os@quantenna.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180531091102.28666-1-sergey.matyukevich.os@quantenna.com> References: <20180531091102.28666-1-sergey.matyukevich.os@quantenna.com> MIME-Version: 1.0 X-Originating-IP: [195.182.157.78] X-ClientProxiedBy: AM6PR0102CA0019.eurprd01.prod.exchangelabs.com (2603:10a6:209:14::32) To BY2PR05MB1926.namprd05.prod.outlook.com (2a01:111:e400:58f7::12) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:BY2PR05MB1926; X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1926; 3:eIAhuRZJv1nds4QSKnCvD0U47nkXNw+fmqiY+WHaLPGKRIpP+BE8TMm++kn8UikZvYUixZN6A8vwx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F4MZzNKGKzmQpLPIZPc5tVAo4siiiu/Fdx2C86E6ylgJE87GydVOIFNDqg4UspaBBZbx8gcWHMzNjJYDneWyOeA6PFbSijtKRvdgJc5R6/4DRsLybH9lD2dNOfK/ZhUt7FjGZ/hFNDFZsKEALMQR0sQdM0cBovd5M4KMpa2fvs/soHa4Zd/cnSDbnR58pmoz8vpc8BBB9oa0a/qBR/iPVB2a8tPgosaTQS8PZ3MfWQgNvvyfQvqeT8+xCWIRUdL8ToyBgHX21; 4:xVw6miAOeK5IQnP4YSP94AFfrafwq2jBTnt2JhP8rv5u0kQlAPPHwtG2xOoW6S5E/510kjMMcX56KbF5rOhfXJuV/hqjapGjXocCD7R1li/+tz6i3Y8Fp5pTA+CShB0Oon7MZZ1KcXUoNLLaYmDC5CpQBTSho2CrhhDzknqQ5scv0LikwyuKLrd+Bybwyl/51LRP//PuEolmsp6yWgq4+ZjITh1rET2Ue3pKKohFsW/kEO4UWoaX7oOxPPqLb2oQPt9b7kIXjuUKqhBXIiU5lg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:BY2PR05MB1926; BCL:0; PCL:0; RULEID:; SRVR:BY2PR05MB1926; X-Forefront-PRVS: 06891E23FB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(39850400004)(396003)(39380400002)(346002)(199004)(189003)(52116002)(2906002)(68736007)(6116002)(6916009)(59450400001)(48376002)(3846002)(11346002)(2351001)(106356001)(7696005)(2616005)(476003)(81156014)(53936002)(76176011)(105586002)(956004)(2361001)(1076002)(26005)(16526019)(186003)(386003)(6666003)(36756003)(5660300001)(81166006)(51416003)(8936002)(478600001)(8676002)(54906003)(16586007)(86362001)(6486002)(50226002)(316002)(53416004)(446003)(25786009)(50466002)(69596002)(7736002)(47776003)(486006)(305945005)(107886003)(4326008)(97736004)(103116003)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR05MB1926; H:bars.quantenna.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: quantenna.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR05MB1926; 23:oyXpGU8l8Hxx1KXWiflFecDifLfwMRqGoxBHw1eJI?= =?us-ascii?Q?TsBokpQZqUHP3k/mc64pnCvx1To1SIbFgYNsC4/KS5ySGMhto7vhrmsuWJt2?= =?us-ascii?Q?I/7vxeVPbbMP6/ern5iECvuVOahVX8WqrB/ejoOcxnDYO0dYst41WsI/Wn0w?= =?us-ascii?Q?ZQC4BhvOmetp8aoCGoKhrqv+bh1EqenhVCFzpr3/lRzvDrO7pE3caCSljQti?= =?us-ascii?Q?pY+tO6dtc3DgQueiv8ci+NBz+2nP4El0Nnb0K5e55vRGTgkbevxLViA1kdBA?= =?us-ascii?Q?rUJVg63JQhuGEs5Lj7eojIJUnRG4KTB8PR2mNlLnP8aGxFXJutSe9zioNy5y?= =?us-ascii?Q?LyZE5LZ4DLRvSGGvCsRR9eFlMg3f/pM/m8tszny11kfOtllgkOI+KLwwLvKf?= =?us-ascii?Q?UbJMNS4VUCSXCiSoN6iuLzF5sUUEPszTZUn/HeZ7DweHYQZPzcEvUmdjncMB?= =?us-ascii?Q?r0jmOe+hn+cD5hzIVKc/HkUCHtapMiuiNn5EHuSkW7w97oVmdkCnZPe4p876?= =?us-ascii?Q?LBRS2+b4JtqZOi6GIlbZ3Zw3Bldd/MYgltoHcIS7VTit+EDgIDcsCFw8VvXc?= =?us-ascii?Q?oS+q779QnehtxwFkZZktVGv5r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dtGj1r6AmqdX2l0GWKPdHltEWxPcSu1ge3pFYhGz4bcvgmNEZYlW47aR4SDnvFkogBLFbvRL2B0w1YoRYEl X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1926; 6:3uyP0jL92lbReH8XjF1aHC+YA4rR0sK4Fr81To4wW29fPegSPots7pNuqczGksJjxuTl3QvmwjAGrw21Od4RQqR4BKfRmQN787vRLrLTuLkO7QhJHyyKCz3BR0PJ/MeWq6M6xLfnewuiVigEM+HJSkAc5C4JX7t7nch3csSXWl5PkD4lhTx4j+wavt8SIWGMnJkRAsYfFSFWeuVeLtIPT7F9WrSWzlV+pKS+9YnrdPQLRfGuWs493hHyiBgr/riofknO7g19QJhhysZN10kh6zmSuPkvzNjBryvmq2E7UIZH2khTH3JVfsRCFeteg3PPHsdfN2orxaWpN5AoNAKpJASUUt3syKESjLma43UDH5uupYAfQAFg55Ipa2HDwzB8hmhlKhlWa/K7Nc1k7iMj3AqxWfuGZD/H50rfIMOcbYZrONi0QHwhePkv2SRJ1AP5BZsD4n1oK746MUAM46XG8Q==; 5:qJxSu+qsNuTUzxz3yFcaqHuYybbx9N6EPYcaoiNk0i4LAILgWqRSRNkhK3oSS/vQs7HLWKAY5X0M9UmdLS1gp4h9qr2UhD4NV2gCsWMx72nrs3nBSJhtggHWqrRqcpDLO3bbpDJLZOEtByyU+X3z1SY/h5IBV+OordQWb/uvF/o=; 24:3finSumhvqge7wJMCULzHXlkLgFwl7/0w3BeIRCjmvqb1FUWe8yWM2wkUhhl2U5tkjY3z/8HuI/NBovih9w1W7MuvKZo+LgLCR6/btuiWQo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR05MB1926; 7:keHUCjzJgmCgrqWICm1Mbu3rLAZrJbpINjBVtIesgbqnaUlpAQaHzt1As5aRpQWEoBYhRtV6XaQCnS6avvh/Qge2cWiwcEN4aYqbNoL8liPHl2T3rEHwmbVvNamtgOWSpVBZpP5f5bNYOcebAw7y3iEre2f/pIM6ROpmQ5R3sctwa8Tg0oCJ0CFU8hdLy7kNZHkXa7JZTwR5Ahtz9DzWVuQjvVldHoPrgrsvYvrlU2YsCdfkKwtSHmBm1u0ebkX7 X-MS-Office365-Filtering-Correlation-Id: 492076a9-4408-4065-46f0-08d5c6d67946 X-OriginatorOrg: quantenna.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2018 09:11:19.0933 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 492076a9-4408-4065-46f0-08d5c6d67946 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a355dbce-62b4-4789-9446-c1d5582180ff X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR05MB1926 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: Sergei Maksimenko Implement set_power_mgmt() callback that forwards power saving settings to the device firmware. Signed-off-by: Sergei Maksimenko --- drivers/net/wireless/quantenna/qtnfmac/cfg80211.c | 21 ++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/commands.c | 34 +++++++++++++++++++++++ drivers/net/wireless/quantenna/qtnfmac/commands.h | 1 + drivers/net/wireless/quantenna/qtnfmac/qlink.h | 26 +++++++++++++++++ 4 files changed, 82 insertions(+) diff --git a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c index 23366be9e394..15bc26c9933f 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c +++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c @@ -844,6 +844,22 @@ static int qtnf_set_mac_acl(struct wiphy *wiphy, return ret; } +static int qtnf_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, + bool enabled, int timeout) +{ + struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); + int ret; + + ret = qtnf_cmd_send_pm_set(vif, enabled ? QLINK_PM_AUTO_STANDBY : + QLINK_PM_OFF, timeout); + if (ret) { + pr_err("%s: failed to set PM mode ret=%d\n", dev->name, ret); + return ret; + } + + return ret; +} + static struct cfg80211_ops qtn_cfg80211_ops = { .add_virtual_intf = qtnf_add_virtual_intf, .change_virtual_intf = qtnf_change_virtual_intf, @@ -870,6 +886,7 @@ static struct cfg80211_ops qtn_cfg80211_ops = { .channel_switch = qtnf_channel_switch, .start_radar_detection = qtnf_start_radar_detection, .set_mac_acl = qtnf_set_mac_acl, + .set_power_mgmt = qtnf_set_power_mgmt, }; static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy_in, @@ -922,6 +939,9 @@ struct wiphy *qtnf_wiphy_allocate(struct qtnf_bus *bus) if (bus->hw_info.hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD) qtn_cfg80211_ops.start_radar_detection = NULL; + if (!(bus->hw_info.hw_capab & QLINK_HW_CAPAB_PWR_MGMT)) + qtn_cfg80211_ops.set_power_mgmt = NULL; + wiphy = wiphy_new(&qtn_cfg80211_ops, sizeof(struct qtnf_wmac)); if (!wiphy) return NULL; @@ -995,6 +1015,7 @@ int qtnf_wiphy_register(struct qtnf_hw_info *hw_info, struct qtnf_wmac *mac) WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | WIPHY_FLAG_AP_UAPSD | WIPHY_FLAG_HAS_CHANNEL_SWITCH; + wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD) wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_DFS_OFFLOAD); diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.c b/drivers/net/wireless/quantenna/qtnfmac/commands.c index 710806466bd9..a96d58f72c07 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.c +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.c @@ -2799,3 +2799,37 @@ int qtnf_cmd_set_mac_acl(const struct qtnf_vif *vif, return ret; } + +int qtnf_cmd_send_pm_set(const struct qtnf_vif *vif, u8 pm_mode, int timeout) +{ + struct qtnf_bus *bus = vif->mac->bus; + struct sk_buff *cmd_skb; + u16 res_code = QLINK_CMD_RESULT_OK; + struct qlink_cmd_pm_set *cmd; + int ret = 0; + + cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, + QLINK_CMD_PM_SET, sizeof(*cmd)); + if (!cmd_skb) + return -ENOMEM; + + cmd = (struct qlink_cmd_pm_set *)cmd_skb->data; + cmd->pm_mode = pm_mode; + cmd->pm_standby_timer = cpu_to_le32(timeout); + + qtnf_bus_lock(bus); + + ret = qtnf_cmd_send(bus, cmd_skb, &res_code); + + if (unlikely(ret)) + goto out; + + if (unlikely(res_code != QLINK_CMD_RESULT_OK)) { + pr_err("cmd exec failed: 0x%.4X\n", res_code); + ret = -EFAULT; + } + +out: + qtnf_bus_unlock(bus); + return ret; +} diff --git a/drivers/net/wireless/quantenna/qtnfmac/commands.h b/drivers/net/wireless/quantenna/qtnfmac/commands.h index cf9274add26d..03a57e37a665 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/commands.h +++ b/drivers/net/wireless/quantenna/qtnfmac/commands.h @@ -76,5 +76,6 @@ int qtnf_cmd_start_cac(const struct qtnf_vif *vif, u32 cac_time_ms); int qtnf_cmd_set_mac_acl(const struct qtnf_vif *vif, const struct cfg80211_acl_data *params); +int qtnf_cmd_send_pm_set(const struct qtnf_vif *vif, u8 pm_mode, int timeout); #endif /* QLINK_COMMANDS_H_ */ diff --git a/drivers/net/wireless/quantenna/qtnfmac/qlink.h b/drivers/net/wireless/quantenna/qtnfmac/qlink.h index 4a32967d0479..cbdebf0410df 100644 --- a/drivers/net/wireless/quantenna/qtnfmac/qlink.h +++ b/drivers/net/wireless/quantenna/qtnfmac/qlink.h @@ -77,6 +77,7 @@ enum qlink_hw_capab { QLINK_HW_CAPAB_STA_INACT_TIMEOUT = BIT(1), QLINK_HW_CAPAB_DFS_OFFLOAD = BIT(2), QLINK_HW_CAPAB_SCAN_RANDOM_MAC_ADDR = BIT(3), + QLINK_HW_CAPAB_PWR_MGMT = BIT(4), }; enum qlink_iface_type { @@ -256,6 +257,7 @@ enum qlink_cmd_type { QLINK_CMD_CHAN_STATS = 0x0054, QLINK_CMD_CONNECT = 0x0060, QLINK_CMD_DISCONNECT = 0x0061, + QLINK_CMD_PM_SET = 0x0062, }; /** @@ -668,6 +670,30 @@ struct qlink_acl_data { struct qlink_mac_address mac_addrs[0]; } __packed; +/** + * enum qlink_pm_mode - Power Management mode + * + * @QLINK_PM_OFF: normal mode, no power saving enabled + * @QLINK_PM_AUTO_STANDBY: enable auto power save mode + */ +enum qlink_pm_mode { + QLINK_PM_OFF = 0, + QLINK_PM_AUTO_STANDBY = 1, +}; + +/** + * struct qlink_cmd_pm_set - data for QLINK_CMD_PM_SET command + * + * @pm_standby timer: period of network inactivity in seconds before + * putting a radio in power save mode + * @pm_mode: power management mode + */ +struct qlink_cmd_pm_set { + struct qlink_cmd chdr; + __le32 pm_standby_timer; + u8 pm_mode; +} __packed; + /* QLINK Command Responses messages related definitions */