From patchwork Tue Nov 13 17:28:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Mikityanskiy X-Patchwork-Id: 1735711 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 582E83FC64 for ; Tue, 13 Nov 2012 17:28:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755360Ab2KMR2y (ORCPT ); Tue, 13 Nov 2012 12:28:54 -0500 Received: from mail-ea0-f174.google.com ([209.85.215.174]:42671 "EHLO mail-ea0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903Ab2KMR2x (ORCPT ); Tue, 13 Nov 2012 12:28:53 -0500 Received: by mail-ea0-f174.google.com with SMTP id e13so10386eaa.19 for ; Tue, 13 Nov 2012 09:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=1xXchwdluLkw2fh0duyOcfMIX9wQfWXpO9/pDG4r/VM=; b=hFwE4h1CpFalvQagVsnx+Gr15cKi6572kTV3u1vQVDDwbsbbA7iPdxtFNHv0va+9OW HSMVhyyQwN8bbWVaShEpElAA99ZrK8w8ZsINDnDPsn1hBaVbcZOfNnQomVXeewzfJ2LJ Gt14BMa8eA0ogb4bZHOIx9cVyODC1r5ISvW8egZ6yJ2NY/EOL+2Z2sOO3mkByUcd4nBT S5+EB8nLFH1JD69w4dD3r1oF7YZPmKEMVhvB92+j69nhaK6wEUC/zTYwxIfumxmsog3U 6OjTVGBuYmM9g6greXuslcPbXEhcmHFcbRthf2lgoNrE4BUlR1T3sPDhclNnX8HP8b8r fA3g== Received: by 10.14.203.3 with SMTP id e3mr77069695eeo.35.1352827732403; Tue, 13 Nov 2012 09:28:52 -0800 (PST) Received: from laptop.olymp.linuxd.org (78-22-179-94.pool.ukrtel.net. [94.179.22.78]) by mx.google.com with ESMTPS id 42sm23845800eee.0.2012.11.13.09.28.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 13 Nov 2012 09:28:51 -0800 (PST) From: Maxim Mikityanskiy To: greg@kroah.com, Larry.Finger@lwfinger.net, linux-wireless@vger.kernel.org Cc: Maxim Mikityanskiy Subject: [PATCH 02/17] staging: rtl8187se: Removed legacy rtl8225_rf_set_chan() Date: Tue, 13 Nov 2012 19:28:08 +0200 Message-Id: <1352827703-4659-3-git-send-email-maxtram95@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1352827703-4659-1-git-send-email-maxtram95@gmail.com> References: <1352827703-4659-1-git-send-email-maxtram95@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Removed rtl8225_rf_set_chan() and corresponding arrays, changed its usage to rtl8225z2_rf_set_chan() Signed-off-by: Maxim Mikityanskiy --- drivers/staging/rtl8187se/r8180_core.c | 41 ------- drivers/staging/rtl8187se/r8180_rtl8225z2.c | 160 +-------------------------- 2 files changed, 3 insertions(+), 198 deletions(-) diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index 8ed94d1..1a76cc9 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c @@ -444,24 +444,6 @@ void buffer_free(struct net_device *dev, struct buffer **buffer, int len, short *buffer = NULL; } -void print_buffer(u32 *buffer, int len) -{ - int i; - u8 *buf = (u8 *)buffer; - - printk("ASCII BUFFER DUMP (len: %x):\n", len); - - for (i = 0; i < len; i++) - printk("%c", buf[i]); - - printk("\nBINARY BUFFER DUMP (len: %x):\n", len); - - for (i = 0; i < len; i++) - printk("%02x", buf[i]); - - printk("\n"); -} - int get_curr_tx_free_desc(struct net_device *dev, int priority) { struct r8180_priv *priv = ieee80211_priv(dev); @@ -2970,29 +2952,6 @@ void write_phy_cck(struct net_device *dev, u8 adr, u32 data) rtl8185_write_phy(dev, adr, data | 0x10000); } -void rtl8185_set_rate(struct net_device *dev) -{ - int i; - u16 word; - int basic_rate, min_rr_rate, max_rr_rate; - - basic_rate = ieeerate2rtlrate(240); - min_rr_rate = ieeerate2rtlrate(60); - max_rr_rate = ieeerate2rtlrate(240); - - write_nic_byte(dev, RESP_RATE, - max_rr_rate<chtxpwr[ch]; - u8 ofdm_power_level = 0xff & priv->chtxpwr_ofdm[ch]; - - max_cck_power_level = 35; - max_ofdm_power_level = 35; - min_ofdm_power_level = 0; - - if (cck_power_level > max_cck_power_level) - cck_power_level = max_cck_power_level; - - GainIdx = cck_power_level % 6; - GainSetting = cck_power_level / 6; - - if (ch == 14) - cck_power_table = rtl8225_tx_power_cck_ch14; - else - cck_power_table = rtl8225_tx_power_cck; - - write_nic_byte(dev, TX_GAIN_CCK, - rtl8225_tx_gain_cck_ofdm[GainSetting] >> 1); - - for (i = 0; i < 8; i++) { - power = cck_power_table[GainIdx * 8 + i]; - write_phy_cck(dev, 0x44 + i, power); - } - - /* FIXME Is this delay really needed ? */ - force_pci_posting(dev); - mdelay(1); - - if (ofdm_power_level > (max_ofdm_power_level - min_ofdm_power_level)) - ofdm_power_level = max_ofdm_power_level; - else - ofdm_power_level += min_ofdm_power_level; - - if (ofdm_power_level > 35) - ofdm_power_level = 35; - - GainIdx = ofdm_power_level % 6; - GainSetting = ofdm_power_level / 6; - - rtl8185_set_anaparam2(dev, RTL8225_ANAPARAM2_ON); - - write_phy_ofdm(dev, 2, 0x42); - write_phy_ofdm(dev, 6, 0x00); - write_phy_ofdm(dev, 8, 0x00); - - write_nic_byte(dev, TX_GAIN_OFDM, - rtl8225_tx_gain_cck_ofdm[GainSetting] >> 1); - - power = rtl8225_tx_power_ofdm[GainIdx]; - - write_phy_ofdm(dev, 5, power); - write_phy_ofdm(dev, 7, power); - - force_pci_posting(dev); - mdelay(1); -} - static const u8 rtl8225z2_threshold[] = { 0x8d, 0x8d, 0x8d, 0x8d, 0x9d, 0xad, 0xbd, }; @@ -263,15 +157,6 @@ static const u16 rtl8225z2_rxgain[] = { }; -static const u8 ZEBRA2_CCK_OFDM_GAIN_SETTING[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, - 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, - 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, - 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, - 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, -}; - static const u8 rtl8225z2_tx_power_ofdm[] = { 0x42, 0x00, 0x40, 0x00, 0x40 }; @@ -508,8 +393,7 @@ void rtl8225z2_SetTXPowerLevel(struct net_device *dev, short ch) if (cck_power_level > 35) cck_power_level = 35; - write_nic_byte(dev, CCK_TXAGC, - (ZEBRA2_CCK_OFDM_GAIN_SETTING[(u8)cck_power_level])); + write_nic_byte(dev, CCK_TXAGC, cck_power_level); force_pci_posting(dev); mdelay(1); @@ -524,8 +408,7 @@ void rtl8225z2_SetTXPowerLevel(struct net_device *dev, short ch) write_phy_ofdm(dev, 8, 0x40); } - write_nic_byte(dev, OFDM_TXAGC, - ZEBRA2_CCK_OFDM_GAIN_SETTING[(u8)ofdm_power_level]); + write_nic_byte(dev, OFDM_TXAGC, ofdm_power_level); if (ofdm_power_level <= 11) { write_phy_ofdm(dev, 0x07, 0x5c); @@ -576,43 +459,6 @@ static void rtl8225_host_pci_init(struct net_device *dev) write_nic_word(dev, GP_ENABLE, 0xff & (~(1 << 6))); } -static void rtl8225_rf_set_chan(struct net_device *dev, short ch) -{ - struct r8180_priv *priv = ieee80211_priv(dev); - short gset = (priv->ieee80211->state == IEEE80211_LINKED && - ieee80211_is_54g(&priv->ieee80211->current_network)) || - priv->ieee80211->iw_mode == IW_MODE_MONITOR; - - rtl8225_SetTXPowerLevel(dev, ch); - - write_rtl8225(dev, 0x7, rtl8225_chan[ch]); - - force_pci_posting(dev); - mdelay(10); - - if (gset) { - write_nic_byte(dev, SIFS, 0x22); - write_nic_byte(dev, DIFS, 0x14); - } else { - write_nic_byte(dev, SIFS, 0x44); - write_nic_byte(dev, DIFS, 0x24); - } - - if (priv->ieee80211->state == IEEE80211_LINKED && - ieee80211_is_shortslot(&priv->ieee80211->current_network)) - write_nic_byte(dev, SLOT, 0x9); - else - write_nic_byte(dev, SLOT, 0x14); - - if (gset) { - write_nic_byte(dev, EIFS, 81); - write_nic_byte(dev, CW_VAL, 0x73); - } else { - write_nic_byte(dev, EIFS, 81); - write_nic_byte(dev, CW_VAL, 0xa5); - } -} - void rtl8225z2_rf_init(struct net_device *dev) { struct r8180_priv *priv = ieee80211_priv(dev); @@ -792,7 +638,7 @@ void rtl8225z2_rf_init(struct net_device *dev) write_nic_dword(dev, 0x94, 0x15c00002); rtl8185_rf_pins_enable(dev); - rtl8225_rf_set_chan(dev, priv->chan); + rtl8225z2_rf_set_chan(dev, priv->chan); } void rtl8225z2_rf_set_mode(struct net_device *dev)