linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Gertjan van Wingerde <gwingerde@gmail.com>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
	Ivo van Doorn <ivdoorn@gmail.com>,
	linux-kernel@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH 22/41] rt2800pci: add rt2800_mcu_request() wrapper
Date: Wed, 04 Nov 2009 18:34:39 +0100	[thread overview]
Message-ID: <20091104173439.28463.20951.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20091104173151.28463.68742.sendpatchset@localhost.localdomain>

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] rt2800pci: add rt2800_mcu_request() wrapper

Part of preparations for later code unification.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2800pci.c |   25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

Index: b/drivers/net/wireless/rt2x00/rt2800pci.c
===================================================================
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -276,6 +276,13 @@ static void rt2800pci_mcu_request(struct
 	mutex_unlock(&rt2x00dev->csr_mutex);
 }
 
+static inline void rt2800_mcu_request(struct rt2x00_dev *rt2x00dev,
+				      const u8 command, const u8 token,
+				      const u8 arg0, const u8 arg1)
+{
+	rt2800pci_mcu_request(rt2x00dev, command, token, arg0, arg1);
+}
+
 static void rt2800pci_mcu_status(struct rt2x00_dev *rt2x00dev, const u8 token)
 {
 	unsigned int i;
@@ -467,10 +474,10 @@ static void rt2800pci_brightness_set(str
 				   EEPROM_FREQ_LED_MODE);
 
 	if (led->type == LED_TYPE_RADIO) {
-		rt2800pci_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
+		rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
 				      enabled ? 0x20 : 0);
 	} else if (led->type == LED_TYPE_ASSOC) {
-		rt2800pci_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
+		rt2800_mcu_request(led->rt2x00dev, MCU_LED, 0xff, ledmode,
 				      enabled ? (bg_mode ? 0x60 : 0xa0) : 0x20);
 	} else if (led->type == LED_TYPE_QUALITY) {
 		/*
@@ -481,7 +488,7 @@ static void rt2800pci_brightness_set(str
 		 * work with bitshifting:
 		 *	(1 << level) - 1
 		 */
-		rt2800pci_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff,
+		rt2800_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff,
 				      (1 << brightness / (LED_FULL / 6)) - 1,
 				      polarity);
 	}
@@ -2037,7 +2044,7 @@ static int rt2800pci_enable_radio(struct
 	/*
 	 * Send signal to firmware during boot time.
 	 */
-	rt2800pci_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0);
+	rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0);
 
 	/*
 	 * Enable RX.
@@ -2063,15 +2070,15 @@ static int rt2800pci_enable_radio(struct
 	 * Initialize LED control
 	 */
 	rt2x00_eeprom_read(rt2x00dev, EEPROM_LED1, &word);
-	rt2800pci_mcu_request(rt2x00dev, MCU_LED_1, 0xff,
+	rt2800_mcu_request(rt2x00dev, MCU_LED_1, 0xff,
 			      word & 0xff, (word >> 8) & 0xff);
 
 	rt2x00_eeprom_read(rt2x00dev, EEPROM_LED2, &word);
-	rt2800pci_mcu_request(rt2x00dev, MCU_LED_2, 0xff,
+	rt2800_mcu_request(rt2x00dev, MCU_LED_2, 0xff,
 			      word & 0xff, (word >> 8) & 0xff);
 
 	rt2x00_eeprom_read(rt2x00dev, EEPROM_LED3, &word);
-	rt2800pci_mcu_request(rt2x00dev, MCU_LED_3, 0xff,
+	rt2800_mcu_request(rt2x00dev, MCU_LED_3, 0xff,
 			      word & 0xff, (word >> 8) & 0xff);
 
 	return 0;
@@ -2120,10 +2127,10 @@ static int rt2800pci_set_state(struct rt
 	 * if the device is booting and wasn't asleep it will return
 	 * failure when attempting to wakeup.
 	 */
-	rt2800pci_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2);
+	rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2);
 
 	if (state == STATE_AWAKE) {
-		rt2800pci_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0);
+		rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, TOKEN_WAKUP, 0, 0);
 		rt2800pci_mcu_status(rt2x00dev, TOKEN_WAKUP);
 	}
 

  parent reply	other threads:[~2009-11-04 17:34 UTC|newest]

Thread overview: 143+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-04 17:31 [PATCH 00/41] rewritten rt2800 drivers Bartlomiej Zolnierkiewicz
2009-11-04 17:31 ` [PATCH 01/41] rt2800usb: make Kconfig help entry more helpful Bartlomiej Zolnierkiewicz
2009-11-04 18:22   ` Gertjan van Wingerde
2009-11-05 18:40   ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 02/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 18:26   ` Gertjan van Wingerde
2009-11-06 16:13     ` Bartlomiej Zolnierkiewicz
2009-11-06 19:53       ` Gertjan van Wingerde
2009-11-05 18:41   ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 03/41] rt2800usb: fix rt2800usb_rfcsr_read() Bartlomiej Zolnierkiewicz
2009-11-04 18:28   ` Gertjan van Wingerde
2009-11-05 18:41   ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 04/41] rt2800pci: fix crypto in TX frame Bartlomiej Zolnierkiewicz
2009-11-04 18:30   ` Gertjan van Wingerde
2009-11-05 18:41   ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 05/41] rt2800pci: fix comment about register access Bartlomiej Zolnierkiewicz
2009-11-04 18:34   ` Gertjan van Wingerde
2009-11-05 18:41   ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 06/41] rt2800pci: fix comment about IV/EIV fields Bartlomiej Zolnierkiewicz
2009-11-04 18:36   ` Gertjan van Wingerde
2009-11-05 18:41   ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 07/41] rt2x00: fix rt2x00usb_register_read() comment Bartlomiej Zolnierkiewicz
2009-11-04 18:43   ` Gertjan van Wingerde
2009-11-05 18:42   ` Ivo van Doorn
2009-11-04 17:32 ` [PATCH 08/41] rt2800usb: use rt2x00usb_register_multiwrite() to set key entries Bartlomiej Zolnierkiewicz
2009-11-04 18:44   ` Gertjan van Wingerde
2009-11-05 18:42   ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 09/41] rt2800usb: add rt2800_register_[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:08   ` Gertjan van Wingerde
2009-11-05 18:44   ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 10/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:16   ` Gertjan van Wingerde
2009-11-06 16:13     ` Bartlomiej Zolnierkiewicz
2009-11-06 19:55       ` Gertjan van Wingerde
2009-11-05 18:45   ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 11/41] rt2800usb: add rt2800_register_multi[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:18   ` Gertjan van Wingerde
2009-11-05 18:46   ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 12/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:20   ` Gertjan van Wingerde
2009-11-05 18:47   ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 13/41] rt2800usb: add rt2800_regbusy_read() wrapper Bartlomiej Zolnierkiewicz
2009-11-04 19:21   ` Gertjan van Wingerde
2009-11-05 18:49   ` Ivo van Doorn
2009-11-06 16:23     ` Bartlomiej Zolnierkiewicz
2009-11-06 18:20       ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 14/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:24   ` Gertjan van Wingerde
2009-11-05 18:49   ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 15/41] rt2800usb: add rt2800_bbp_[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:30   ` Gertjan van Wingerde
2009-11-05 18:50   ` Ivo van Doorn
2009-11-04 17:33 ` [PATCH 16/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:31   ` Gertjan van Wingerde
2009-11-05 18:50   ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 17/41] rt2800usb: add rt2800_rfcsr_[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:34   ` Gertjan van Wingerde
2009-11-05 18:50   ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 18/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:44   ` Gertjan van Wingerde
2009-11-05 18:50   ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 19/41] rt2800usb: add rt2800_rf_[read,write]() wrappers Bartlomiej Zolnierkiewicz
2009-11-04 19:46   ` Gertjan van Wingerde
2009-11-05 18:51   ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 20/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:47   ` Gertjan van Wingerde
2009-11-05 18:51   ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 21/41] rt2800usb: add rt2800_mcu_request() wrapper Bartlomiej Zolnierkiewicz
2009-11-04 19:48   ` Gertjan van Wingerde
2009-11-05 18:51   ` Ivo van Doorn
2009-11-04 17:34 ` Bartlomiej Zolnierkiewicz [this message]
2009-11-04 20:21   ` [PATCH 22/41] rt2800pci: " Gertjan van Wingerde
2009-11-05 18:52   ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 23/41] rt2x00: add driver private field to struct rt2x00_dev Bartlomiej Zolnierkiewicz
2009-11-04 19:55   ` Gertjan van Wingerde
2009-11-05 18:52   ` Ivo van Doorn
2009-11-05 18:57     ` Ivo van Doorn
2009-11-06 16:27       ` Bartlomiej Zolnierkiewicz
2009-11-06 18:22         ` Ivo van Doorn
2009-11-04 17:34 ` [PATCH 24/41] rt2800usb: convert to use struct rt2800_ops methods Bartlomiej Zolnierkiewicz
2009-11-04 20:22   ` Gertjan van Wingerde
2009-11-05 18:53   ` Ivo van Doorn
2009-11-05 18:57     ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 25/41] rt2800pci: " Bartlomiej Zolnierkiewicz
2009-11-04 19:56   ` Gertjan van Wingerde
2009-11-05 18:57   ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 26/41] rt2x00: fix rt2x00usb_register_multiwrite() arguments Bartlomiej Zolnierkiewicz
2009-11-04 19:59   ` Gertjan van Wingerde
2009-11-05 18:58   ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 27/41] rt2x00: fix rt2x00usb_regbusy_read() arguments Bartlomiej Zolnierkiewicz
2009-11-04 20:01   ` Gertjan van Wingerde
2009-11-05 18:59   ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 28/41] rt2x00: fix rt2x00pci_register_multi[read,write]() arguments Bartlomiej Zolnierkiewicz
2009-11-04 20:04   ` Gertjan van Wingerde
2009-11-05 18:59   ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 29/41] rt2800: add rt2800lib.h Bartlomiej Zolnierkiewicz
2009-11-04 20:09   ` Gertjan van Wingerde
2009-11-05 19:00   ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 30/41] rt2800usb: fix comments in rt2800usb.h Bartlomiej Zolnierkiewicz
2009-11-04 20:12   ` Gertjan van Wingerde
2009-11-05 19:01   ` Ivo van Doorn
2009-11-04 17:35 ` [PATCH 31/41] rt2800usb: add RXINFO_DESC_SIZE definition Bartlomiej Zolnierkiewicz
2009-11-05 19:02   ` Ivo van Doorn
2009-11-05 20:33   ` Gertjan van Wingerde
2009-11-04 17:35 ` [PATCH 32/41] rt2800: fix duplication in header files Bartlomiej Zolnierkiewicz
2009-11-05 19:04   ` Ivo van Doorn
2009-11-05 20:37   ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 33/41] rt2800: fix comments in rt2800.h Bartlomiej Zolnierkiewicz
2009-11-05 19:05   ` Ivo van Doorn
2009-11-05 20:38   ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 34/41] rt2x00: add support for different chipset interfaces Bartlomiej Zolnierkiewicz
2009-11-05 19:06   ` Ivo van Doorn
2009-11-05 20:39   ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 35/41] rt2800: prepare for rt2800lib addition Bartlomiej Zolnierkiewicz
2009-11-05 19:07   ` Ivo van Doorn
2009-11-05 20:43   ` Gertjan van Wingerde
2009-11-06 18:24   ` Ivo van Doorn
2009-11-04 17:36 ` [PATCH 36/41] rt2800: add rt2800lib (part one) Bartlomiej Zolnierkiewicz
2009-11-05 19:09   ` Ivo van Doorn
2009-11-05 20:44   ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 37/41] rt2x00: remove needless ifdefs from rt2x00leds.h Bartlomiej Zolnierkiewicz
2009-11-05 19:09   ` Ivo van Doorn
2009-11-05 20:45   ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 38/41] rt2800: add rt2800lib (part two) Bartlomiej Zolnierkiewicz
2009-11-05 19:10   ` Ivo van Doorn
2009-11-05 20:50   ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 39/41] rt2x00: move REGISTER_BUSY_* definitions to rt2x00.h Bartlomiej Zolnierkiewicz
2009-11-05 19:10   ` Ivo van Doorn
2009-11-05 20:51   ` Gertjan van Wingerde
2009-11-04 17:36 ` [PATCH 40/41] rt2800: add rt2800lib (part three) Bartlomiej Zolnierkiewicz
2009-11-05 19:11   ` Ivo van Doorn
2009-11-05 20:56   ` Gertjan van Wingerde
2009-11-04 17:37 ` [PATCH 41/41] rt2800: add rt2800lib (part four) Bartlomiej Zolnierkiewicz
2009-11-05 19:12   ` Ivo van Doorn
2009-11-05 20:57   ` Gertjan van Wingerde
2009-11-04 20:19 ` [PATCH 00/41] rewritten rt2800 drivers Gertjan van Wingerde
2009-11-04 22:55   ` Julian Calaby
2009-11-06 18:15     ` Bartlomiej Zolnierkiewicz
2009-11-05 20:59   ` Gertjan van Wingerde
2009-11-05 21:06     ` Luis R. Rodriguez
2009-11-05 21:17       ` Gertjan van Wingerde
2009-11-06 16:28         ` Bartlomiej Zolnierkiewicz
2009-11-06 19:56           ` Gertjan van Wingerde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091104173439.28463.20951.sendpatchset@localhost.localdomain \
    --to=bzolnier@gmail.com \
    --cc=gwingerde@gmail.com \
    --cc=ivdoorn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).