From patchwork Fri Mar 20 11:02:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Puzyniak X-Patchwork-Id: 6055561 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E37F79F318 for ; Fri, 20 Mar 2015 11:01:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA7C3204D1 for ; Fri, 20 Mar 2015 11:01:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5715204D5 for ; Fri, 20 Mar 2015 11:01:07 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYufo-0003sy-Bn; Fri, 20 Mar 2015 11:01:04 +0000 Received: from mail-la0-x234.google.com ([2a00:1450:4010:c03::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YYufl-0003fl-4i for ath10k@lists.infradead.org; Fri, 20 Mar 2015 11:01:02 +0000 Received: by labe2 with SMTP id e2so8695388lab.3 for ; Fri, 20 Mar 2015 04:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RFDU+oDjzu7eS6KfiEAUc89ie5cnifeB7NF0R5zzSIk=; b=gP2h9sTceay/oKlp4kYbq4R1UWizTYuN9i3hVqprR1ejSJRAXufeG2t6bZ5eL9Dfc+ nR0LWqhTqnHy6OMYaXCG0rCUJbnyS8og/p/GdQV5dsn9Mf618rHyBNs5Fe1niSHT9X5e o9MMcO+VDAex3fTDyMa4kjdt+T4K2OG5DPcVo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RFDU+oDjzu7eS6KfiEAUc89ie5cnifeB7NF0R5zzSIk=; b=W1SB5BVSDZ5sjDhM2wEk/xOC/fZ4nH6txmMmUdnqHaZCrUlMuGKNk+icFrj9dMmRTz T8jV5W22kBWQJbGsHxQmhq+2NZZtZy4+odRUpChvVyKBWLc+upWUZe9bYsIbToJrNiBb rJIQGSfeMZJDLaUKNiMymMlIVwhq8wQ1vq/16095e0PN7pMklnOYlBWaTQcnQh99FM/a JNeqhhMpfHMSifdxyWr4kVNq6HvGKNbDaBCjIKKuSZZSqluHhu42oh+7UmOYVGUs54HM equGvnLEseVLPqzRXsbsrUq7V3vFuYGxczyj/ujXZWQ5r6vs2roq8dJhJOpvdSIBLf8X lP9Q== X-Gm-Message-State: ALoCoQlrvvLZAfwNK1I1XcNU9c+kljQMPravchnkAEp9hcaQOlCPPhjNCFcsaRGpAgi7PACOklnoePjli573cVUdBmv7WWHMjKT8QvOKwzUX0yxFL3WTH+8x9tLcDbxrsigNR3E8fk5Y X-Received: by 10.112.64.2 with SMTP id k2mr73810086lbs.54.1426849238754; Fri, 20 Mar 2015 04:00:38 -0700 (PDT) Received: from dell-lap.com ([91.198.246.8]) by mx.google.com with ESMTPSA id ds8sm856282lbb.18.2015.03.20.04.00.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 20 Mar 2015 04:00:37 -0700 (PDT) From: Marek Puzyniak To: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [PATCH v4 2/6] ath10k: make peer type configurable Date: Fri, 20 Mar 2015 12:02:55 +0100 Message-Id: <1426849379-7562-3-git-send-email-marek.puzyniak@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1426849379-7562-1-git-send-email-marek.puzyniak@tieto.com> References: <1426849379-7562-1-git-send-email-marek.puzyniak@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150320_040101_605245_6767C88C X-CRM114-Status: GOOD ( 10.97 ) X-Spam-Score: -0.8 (/) Cc: Marek Kwaczynski , Marek Puzyniak X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Peer type was hardcoded to default value. For future implementation it is required to make is configurable. Signed-off-by: Marek Puzyniak Signed-off-by: Marek Kwaczynski --- drivers/net/wireless/ath/ath10k/mac.c | 17 +++++++++++------ drivers/net/wireless/ath/ath10k/wmi-ops.h | 8 +++++--- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 5 +++-- drivers/net/wireless/ath/ath10k/wmi.c | 3 ++- drivers/net/wireless/ath/ath10k/wmi.h | 6 ++++++ 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 6b07ef6..866c948 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -428,7 +428,8 @@ static u8 ath10k_parse_mpdudensity(u8 mpdudensity) } } -static int ath10k_peer_create(struct ath10k *ar, u32 vdev_id, const u8 *addr) +static int ath10k_peer_create(struct ath10k *ar, u32 vdev_id, const u8 *addr, + enum wmi_peer_type peer_type) { int ret; @@ -437,7 +438,7 @@ static int ath10k_peer_create(struct ath10k *ar, u32 vdev_id, const u8 *addr) if (ar->num_peers >= ar->max_num_peers) return -ENOBUFS; - ret = ath10k_wmi_peer_create(ar, vdev_id, addr); + ret = ath10k_wmi_peer_create(ar, vdev_id, addr, peer_type); if (ret) { ath10k_warn(ar, "failed to create wmi peer %pM on vdev %i: %i\n", addr, vdev_id, ret); @@ -1288,7 +1289,8 @@ static void ath10k_control_ibss(struct ath10k_vif *arvif, return; } - ret = ath10k_peer_create(arvif->ar, arvif->vdev_id, self_peer); + ret = ath10k_peer_create(arvif->ar, arvif->vdev_id, self_peer, + WMI_PEER_TYPE_DEFAULT); if (ret) { ath10k_warn(ar, "failed to create IBSS self peer %pM for vdev %d: %d\n", self_peer, arvif->vdev_id, ret); @@ -2753,7 +2755,8 @@ void ath10k_offchan_tx_work(struct work_struct *work) peer_addr, vdev_id); if (!peer) { - ret = ath10k_peer_create(ar, vdev_id, peer_addr); + ret = ath10k_peer_create(ar, vdev_id, peer_addr, + WMI_PEER_TYPE_DEFAULT); if (ret) ath10k_warn(ar, "failed to create peer %pM on vdev %d: %d\n", peer_addr, vdev_id, ret); @@ -3660,7 +3663,8 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, } if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { - ret = ath10k_peer_create(ar, arvif->vdev_id, vif->addr); + ret = ath10k_peer_create(ar, arvif->vdev_id, vif->addr, + WMI_PEER_TYPE_DEFAULT); if (ret) { ath10k_warn(ar, "failed to create vdev %i peer for AP: %d\n", arvif->vdev_id, ret); @@ -4456,7 +4460,8 @@ static int ath10k_sta_state(struct ieee80211_hw *hw, goto exit; } - ret = ath10k_peer_create(ar, arvif->vdev_id, sta->addr); + ret = ath10k_peer_create(ar, arvif->vdev_id, sta->addr, + WMI_PEER_TYPE_DEFAULT); if (ret) { ath10k_warn(ar, "failed to add peer %pM for vdev %d when adding a new sta: %i\n", sta->addr, arvif->vdev_id, ret); diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index f0a8b8d..28d042c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -83,7 +83,8 @@ struct wmi_ops { struct sk_buff *(*gen_vdev_wmm_conf)(struct ath10k *ar, u32 vdev_id, const struct wmi_wmm_params_all_arg *arg); struct sk_buff *(*gen_peer_create)(struct ath10k *ar, u32 vdev_id, - const u8 peer_addr[ETH_ALEN]); + const u8 peer_addr[ETH_ALEN], + enum wmi_peer_type peer_type); struct sk_buff *(*gen_peer_delete)(struct ath10k *ar, u32 vdev_id, const u8 peer_addr[ETH_ALEN]); struct sk_buff *(*gen_peer_flush)(struct ath10k *ar, u32 vdev_id, @@ -636,14 +637,15 @@ ath10k_wmi_vdev_wmm_conf(struct ath10k *ar, u32 vdev_id, static inline int ath10k_wmi_peer_create(struct ath10k *ar, u32 vdev_id, - const u8 peer_addr[ETH_ALEN]) + const u8 peer_addr[ETH_ALEN], + enum wmi_peer_type peer_type) { struct sk_buff *skb; if (!ar->wmi.ops->gen_peer_create) return -EOPNOTSUPP; - skb = ar->wmi.ops->gen_peer_create(ar, vdev_id, peer_addr); + skb = ar->wmi.ops->gen_peer_create(ar, vdev_id, peer_addr, peer_type); if (IS_ERR(skb)) return PTR_ERR(skb); diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 3eec042..a65e11b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -1860,7 +1860,8 @@ ath10k_wmi_tlv_op_gen_sta_keepalive(struct ath10k *ar, static struct sk_buff * ath10k_wmi_tlv_op_gen_peer_create(struct ath10k *ar, u32 vdev_id, - const u8 peer_addr[ETH_ALEN]) + const u8 peer_addr[ETH_ALEN], + enum wmi_peer_type peer_type) { struct wmi_tlv_peer_create_cmd *cmd; struct wmi_tlv *tlv; @@ -1875,7 +1876,7 @@ ath10k_wmi_tlv_op_gen_peer_create(struct ath10k *ar, u32 vdev_id, tlv->len = __cpu_to_le16(sizeof(*cmd)); cmd = (void *)tlv->value; cmd->vdev_id = __cpu_to_le32(vdev_id); - cmd->peer_type = __cpu_to_le32(WMI_TLV_PEER_TYPE_DEFAULT); /* FIXME */ + cmd->peer_type = __cpu_to_le32(peer_type); ether_addr_copy(cmd->peer_addr.addr, peer_addr); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv peer create\n"); diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 54430a1..e78dd2b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -4510,7 +4510,8 @@ ath10k_wmi_op_gen_vdev_spectral_enable(struct ath10k *ar, u32 vdev_id, static struct sk_buff * ath10k_wmi_op_gen_peer_create(struct ath10k *ar, u32 vdev_id, - const u8 peer_addr[ETH_ALEN]) + const u8 peer_addr[ETH_ALEN], + enum wmi_peer_type peer_type) { struct wmi_peer_create_cmd *cmd; struct sk_buff *skb; diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index 938e652..3dddd47 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -4333,6 +4333,12 @@ struct wmi_peer_create_cmd { struct wmi_mac_addr peer_macaddr; } __packed; +enum wmi_peer_type { + WMI_PEER_TYPE_DEFAULT = 0, + WMI_PEER_TYPE_BSS = 1, + WMI_PEER_TYPE_TDLS = 2, +}; + struct wmi_peer_delete_cmd { __le32 vdev_id; struct wmi_mac_addr peer_macaddr;