From 5e5499c612a667837c714fc4a41b7347e334ce14 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 18 May 2017 13:47:00 +0200 Subject: [PATCH] mac80211: rt2x00: remove unneccessary code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Use chanreg and dccal helpers to reduce the size of ePA code. Signed-off-by: Tomislav Požega Signed-off-by: Daniel Golle [daniel@makrotopia.org: fixed white-space so patch applies] --- .../651-rt2x00-remove-unneccesary-code.patch | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 package/kernel/mac80211/patches/651-rt2x00-remove-unneccesary-code.patch diff --git a/package/kernel/mac80211/patches/651-rt2x00-remove-unneccesary-code.patch b/package/kernel/mac80211/patches/651-rt2x00-remove-unneccesary-code.patch new file mode 100644 index 0000000000..6c913fba14 --- /dev/null +++ b/package/kernel/mac80211/patches/651-rt2x00-remove-unneccesary-code.patch @@ -0,0 +1,134 @@ +From pozega.tomislav@gmail.com Thu May 18 12:42:27 2017 +Return-path: +Envelope-to: daniel@makrotopia.org +Delivery-date: Thu, 18 May 2017 12:42:27 +0200 +Received: from mail by fudo.makrotopia.org with sa-checked (Exim 4.88) + (envelope-from ) + id 1dBIsy-00088b-PU + for daniel@makrotopia.org; Thu, 18 May 2017 12:42:27 +0200 +X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on fudo.makrotopia.org +X-Spam-Level: +X-Spam-Status: No, score=-0.8 required=2.5 tests=DKIM_SIGNED,DKIM_VALID, + DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW shortcircuit=no + autolearn=ham autolearn_force=no version=3.4.1 +Received: from mail-oi0-x22a.google.com ([2607:f8b0:4003:c06::22a]) + by fudo.makrotopia.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) + (Exim 4.88) + (envelope-from ) + id 1dBIsv-00088Q-Dq + for daniel@makrotopia.org; Thu, 18 May 2017 12:42:24 +0200 +Received: by mail-oi0-x22a.google.com with SMTP id w10so48782189oif.0 + for ; Thu, 18 May 2017 03:42:21 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=20161025; + h=mime-version:from:date:message-id:subject:to; + bh=9dF7PHDassYY74+N6dAhmsL/B9i5oG3SEuMzHuazhJo=; + b=cBGJ44v+o4ASyCPmHCBRMmRYnJCv4Gx6lzDiScKn0XqYmNHYpZTPg5cAY1GZFUhHdz + 9QT5fzhJKFikBliSuJc/7/pI8KzvyEAdvawiWA7/5fbeiTZ+zjJnzRVGezqkYDKxjR6u + 7TsoJxR2/oFwo7bOFlThhee+Nwf7qaX8AVal7JdkqovekX79JQ5vsKAa4LapDp7Cl0wr + KCh0WRUHGEgpTLJFyQ3ThPmLqc8bhmu+6/V/LJ53VOY7uksZHMhvaKkk9vDCoOuPnBMK + Cj2/c7z9RTErz/xlHg6HxnBe/pPc31XUsuPJUleOEdZASczPsreEEKacKCONVlP1wjAB + iOkA== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20161025; + h=x-gm-message-state:mime-version:from:date:message-id:subject:to; + bh=9dF7PHDassYY74+N6dAhmsL/B9i5oG3SEuMzHuazhJo=; + b=LJAe4ZwS9aNJypROW7j+I9aNfRBWyDYy0c8ABnDbLrIoF9P2AA/Vs/Cli5f7GjaAxr + 1JCx602ach+7R7QjQq/nqNmLuhRCfSvB0TGrq4R4v+CJ4ADO541+PddnFiU1dlIXQRP2 + TE2FOydSO0FGJBMg+kY0eFiidBtYj1T5x7IHAhQzufiuiF6/1xZS8h61CYJjLzt/aR5y + JxOxsVvu3W2YQ0T5wKmAPlKtarFH6ZZgs446bRYt1MX5KAWzIoBM1+IPMMv7lSCpCaDR + fwH05aDyaJW2IzXH5R9Tq7gGYycYjx/SnO7JupJXJVvOzKgBJxp60JwJhCfqCwESDuuD + 8nNA== +X-Gm-Message-State: AODbwcDOpdFZgbxAxFsVsqFdCBN3pRGDvEclZ1heVg2byNZ9BuG5kqJg + GvZ9x4NGt0v8lVGa3esDw0N1KiJENg== +X-Received: by 10.157.17.217 with SMTP id y25mr1310632oty.137.1495104134863; + Thu, 18 May 2017 03:42:14 -0700 (PDT) +MIME-Version: 1.0 +Received: by 10.157.0.105 with HTTP; Thu, 18 May 2017 03:42:14 -0700 (PDT) +From: Tom Psyborg +Date: Thu, 18 May 2017 12:42:14 +0200 +Message-ID: +Subject: [PATCH] rt2x00: remove unneccesary code +To: linux-wireless , + Linux Kernel Mailing List , Arnd Bergmann , + Jes Sorensen , Stanislaw Gruszka , + David Miller , Helmut Schaa , + Kalle Valo , Daniel Golle , + Mathias Kresin , Johannes Berg , + Serge Vasilugin , Roman Yeryomin , + Networking +Content-Type: multipart/alternative; boundary="94eb2c1905d2dc6361054fca0e62" +Status: RO +Content-Length: 11079 +Lines: 178 + +--94eb2c1905d2dc6361054fca0e62 +Content-Type: text/plain; charset="UTF-8" +Content-Transfer-Encoding: quoted-printable + +Use chanreg and dccal helpers to reduce the size of ePA code. + +Signed-off-by: Tomislav Po=C5=BEega +Signed-off-by: Daniel Golle +[daniel@makrotopia.org: fixed white-space so patch applies] +--- + +Index: compat-wireless-2017-01-31/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +=================================================================== +--- compat-wireless-2017-01-31.orig/drivers/net/wireless/ralink/rt2x00/rt2800lib.c ++++ compat-wireless-2017-01-31/drivers/net/wireless/ralink/rt2x00/rt2800lib.c +@@ -4137,38 +4137,22 @@ static void rt2800_config_channel(struct + reg |= 0x00000101; + rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); + +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 43, 0x73); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 43, 0x73); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 44, 0x73); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 44, 0x73); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 45, 0x73); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0x73); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 46, 0x27); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 46, 0x27); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 47, 0xC8); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 47, 0xC8); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 48, 0xA4); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 48, 0xA4); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 49, 0x05); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 49, 0x05); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 54, 0x27); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 54, 0x27); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 55, 0xC8); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 55, 0xC8); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 56, 0xA4); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 56, 0xA4); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 57, 0x05); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 57, 0x05); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 58, 0x27); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 58, 0x27); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 59, 0xC8); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 59, 0xC8); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 60, 0xA4); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 60, 0xA4); +- rt2800_rfcsr_write_bank(rt2x00dev, 4, 61, 0x05); +- rt2800_rfcsr_write_bank(rt2x00dev, 6, 61, 0x05); +- rt2800_rfcsr_write_bank(rt2x00dev, 5, 05, 0x00); +- rt2800_rfcsr_write_bank(rt2x00dev, 7, 05, 0x00); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 43, 0x73); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 44, 0x73); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 45, 0x73); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 46, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 47, 0xC8); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 48, 0xA4); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 49, 0x05); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 54, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 55, 0xC8); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 56, 0xA4); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 57, 0x05); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 58, 0x27); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 59, 0xC8); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 60, 0xA4); ++ rt2800_rfcsr_write_chanreg(rt2x00dev, 61, 0x05); ++ rt2800_rfcsr_write_dccal(rt2x00dev, 05, 0x00); + + rt2800_register_write(rt2x00dev, TX0_RF_GAIN_CORRECT, + 0x36303636); -- 2.25.1