From patchwork Tue Jan 3 16:11:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 9495203 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 C87C6606B4 for ; Tue, 3 Jan 2017 16:43:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1394272F9 for ; Tue, 3 Jan 2017 16:43:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93FCC276D6; Tue, 3 Jan 2017 16:43:00 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 4E385276D6 for ; Tue, 3 Jan 2017 16:42:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935356AbdACQmz (ORCPT ); Tue, 3 Jan 2017 11:42:55 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:34443 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759515AbdACQmj (ORCPT ); Tue, 3 Jan 2017 11:42:39 -0500 Received: by mail-lf0-f68.google.com with SMTP id d16so30583455lfb.1 for ; Tue, 03 Jan 2017 08:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N8RvCdxf7631+iKShifJciUT3DPApHFenH2klwVOr5U=; b=ejfhWB/01Kzk0J+vDms96AzrAOHOmreNGYgxgD4N6XzVCuTtpWA0bZj+AL6qFazvxp feBbQBkBA+Yn7+3vRSarTp5ccXL+EbzfwbN2A9np1Rrz4yS9yE1HIdp3s6/WtR5IZv+3 x+LyeQzjAc/cF6mFtsg0wY03grNqRohOTvyHBu4cSAYR95d2OeTvmyjxs0b1DzRRGjaq aHujD4PRGl4XyoTAd9Vr8ENUYAkHR08e1cct8cS4ncbkSr2eszru8Y2msWzxkFh2igNG 35/wZ4SOFIz2tVWdiXjt9sNJu9jeRmR0VUYo/KG91ZQrmebWyG/A5c9LfU62oE+uQGy3 yxmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N8RvCdxf7631+iKShifJciUT3DPApHFenH2klwVOr5U=; b=qOuQs5AB+crMP/GYGDfkGVgE8VFze5y8KYcXetPyP+wPpNT02g044Wjj1p8Y8EpIjD GrQ8b0TPJ8MYuFAqtZtztV1Y62W1+OiIkp6yPplQFzJKpfDwt/sc5T52NY/zl2zberHV nQDRwZ4Vmx7fJuWZCNio2dj+xEC/KJEO49EUzw7iu53U70M8bLQBssBNkOR49p3de+64 8Op2Rr1yVYbrqmK9nMFHudqvUfG/igqUBDTr92nF2i0ryrH8PMF9e3OFsusosh7JnSdR Dmd8YXGqNb+hAt/3vTwefRd8RNVSioCKe9I+IhelbGs1kBZ+1C+1ahhfiJQheYx4ms4h LncQ== X-Gm-Message-State: AIkVDXIculhmnBV92hA1IIzXHBGbeCqP/FoXrXFeO2Qgme++IdPbO+al6AVrOsUbRTc86g== X-Received: by 10.25.227.72 with SMTP id c8mr22874145lfk.106.1483459912114; Tue, 03 Jan 2017 08:11:52 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id d16sm17223728lfj.14.2017.01.03.08.11.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2017 08:11:51 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo Cc: Arend van Spriel , Franky Lin , Hante Meuleman , Pieter-Paul Giesberts , Franky Lin , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH] brcmfmac: check if we can support used firmware API version Date: Tue, 3 Jan 2017 17:11:40 +0100 Message-Id: <20170103161140.16919-1-zajec5@gmail.com> X-Mailer: git-send-email 2.10.1 MIME-Version: 1.0 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: Rafał Miłecki Every new firmware API will most likely require changes in our code to support it. Right now we support 2 versions only. Refuse to init if we detect newer version. Signed-off-by: Rafał Miłecki --- Hi Arend, I think you were concerned about possible firmware API changes. Please review this patch, I hope it's a proper check for running unsupported firmware version which could result in broken communication between host driver and a device. --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 0babfc7..c69ae84 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -6816,6 +6816,11 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, brcmf_err("Failed to get D11 version (%d)\n", err); goto priv_out; } + if (io_type > BRCMU_D11AC_IOTYPE) { + brcmf_err("Unsupported IO version %d\n", io_type); + goto priv_out; + } + cfg->d11inf.io_type = (u8)io_type; brcmu_d11_attach(&cfg->d11inf);