From patchwork Wed May 7 07:28:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 4125901 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C958F9F23C for ; Wed, 7 May 2014 07:28:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C9CA1201FB for ; Wed, 7 May 2014 07:28:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC9EA20170 for ; Wed, 7 May 2014 07:28:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbaEGH2A (ORCPT ); Wed, 7 May 2014 03:28:00 -0400 Received: from mail-qg0-f51.google.com ([209.85.192.51]:54294 "EHLO mail-qg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135AbaEGH17 (ORCPT ); Wed, 7 May 2014 03:27:59 -0400 Received: by mail-qg0-f51.google.com with SMTP id q107so614670qgd.24 for ; Wed, 07 May 2014 00:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PYZsl5NHCtEJbAAt/o0pKIYfEaXh4H8yEnyo9dHVGTA=; b=R8EGHc+RTBBB/LMgm8uAO+9adc9NsVSBRWK28UOmfv1GjbzIXYS0DIJxCSNWlWfoCI 2dA9MvDQJK1tLL3xvaxRs8xhxRGN+NErkpVlebi4AagshkNehbK0ltGRHuAhQwEQ6ClW PhggtzQPm4FypVgh+KLYGllDCjUH62J/GmY9evqwnRzHaeIPN4Ai6pcY4tIuRd+83rYT +iDP+ehp1dOlsD6j1ai1eUVB0K5hENG/h3dv5ygOTS4Qa3ziB98cPkjwrQOeEq2xqMH1 /9MrEOp4NbbuppE8oGMxpg10infkkM/DcAnjztkzFqybHjZ243xFYn3HYFeA6HJoGUB0 GSLw== X-Received: by 10.140.40.81 with SMTP id w75mr20217490qgw.112.1399447678763; Wed, 07 May 2014 00:27:58 -0700 (PDT) Received: from hschaa-desktop.site (HSI-KBW-109-193-015-173.hsi7.kabel-badenwuerttemberg.de. [109.193.15.173]) by mx.google.com with ESMTPSA id a9sm18989671qgf.19.2014.05.07.00.27.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 May 2014 00:27:58 -0700 (PDT) From: Helmut Schaa To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, nbd@openwrt.org, Helmut Schaa Subject: [PATCH] ath9k: Allow platform override without EEPROM override Date: Wed, 7 May 2014 09:28:31 +0200 Message-Id: <1399447711-12441-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.8.4.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Add a new platform data flag "use_eeprom" that indicates that the eeprom found on the card itself should be used instead of the one present in the platform data. This allows to override the MAC address of a PCI card while preserving the eeprom data from the card itself. The default behavior is preserved. Signed-off-by: Helmut Schaa --- drivers/net/wireless/ath/ath9k/init.c | 2 +- include/linux/ath9k_platform.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index c99e50f..1af7708 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -508,7 +508,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, sc->tx99_power = MAX_RATE_POWER + 1; init_waitqueue_head(&sc->tx_wait); - if (!pdata) { + if (!pdata || pdata->use_eeprom) { ah->ah_flags |= AH_USE_EEPROM; sc->sc_ah->led_pin = -1; } else { diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h index 8598f8e..a495a95 100644 --- a/include/linux/ath9k_platform.h +++ b/include/linux/ath9k_platform.h @@ -36,6 +36,8 @@ struct ath9k_platform_data { int (*get_mac_revision)(void); int (*external_reset)(void); + + bool use_eeprom; }; #endif /* _LINUX_ATH9K_PLATFORM_H */