From patchwork Mon Jan 25 07:35:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 8104101 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D43BFBEEE5 for ; Mon, 25 Jan 2016 07:43:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02F9D203A1 for ; Mon, 25 Jan 2016 07:43:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17DDB203A0 for ; Mon, 25 Jan 2016 07:43:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932122AbcAYHnH (ORCPT ); Mon, 25 Jan 2016 02:43:07 -0500 Received: from eusmtp01.atmel.com ([212.144.249.243]:40904 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932100AbcAYHnF (ORCPT ); Mon, 25 Jan 2016 02:43:05 -0500 Received: from glen-ubuntu.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.31) with Microsoft SMTP Server id 14.3.235.1; Mon, 25 Jan 2016 08:43:01 +0100 From: Glen Lee To: CC: , , , , , , , Subject: [PATCH V2 09/26] staging: wilc1000: use unified firmware Date: Mon, 25 Jan 2016 16:35:13 +0900 Message-ID: <1453707330-13526-10-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1453707330-13526-1-git-send-email-glen.lee@atmel.com> References: <1453707330-13526-1-git-send-email-glen.lee@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Use a unified firmware for all mode of operations which are station, ap and p2p. Two firmware are introduced for 1002 and 1003 chipset. Signed-off-by: Glen Lee --- Changes in V2: - fix checkpatch ERROR: space required before the open parenthesis --- drivers/staging/wilc1000/Makefile | 5 ++--- drivers/staging/wilc1000/linux_wlan.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index 20a5cb9..90c3760 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -1,8 +1,7 @@ obj-$(CONFIG_WILC1000) += wilc1000.o -ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ - -DAP_FIRMWARE=\"atmel/wilc1000_ap_fw.bin\" \ - -DP2P_CONCURRENCY_FIRMWARE=\"atmel/wilc1000_p2p_fw.bin\" +ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ + -DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\" ccflags-y += -I$(src)/ -DWILC_ASIC_A0 -DWILC_DEBUGFS #ccflags-y += -DTCP_ACK_FILTER diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index 58837d7..006f75f7 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -416,21 +416,21 @@ int wilc_wlan_get_firmware(struct net_device *dev) { struct wilc_vif *vif; struct wilc *wilc; - int ret = 0; + int chip_id, ret = 0; const struct firmware *wilc_firmware; char *firmware; vif = netdev_priv(dev); wilc = vif->wilc; - if (vif->iftype == AP_MODE) { - firmware = AP_FIRMWARE; - } else if (vif->iftype == STATION_MODE) { - firmware = STA_FIRMWARE; - } else { - PRINT_D(INIT_DBG, "Get P2P_CONCURRENCY_FIRMWARE\n"); - firmware = P2P_CONCURRENCY_FIRMWARE; - } + chip_id = wilc_get_chipid(wilc, 0); + + if (chip_id < 0x1003a0) + firmware = FIRMWARE_1002; + else + firmware = FIRMWARE_1003; + + netdev_info(dev, "loading firmware %s\n", firmware); if (!vif) { PRINT_ER("vif is NULL\n");