From patchwork Wed Nov 4 17:34:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 57734 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA4HlOf0015848 for ; Wed, 4 Nov 2009 17:47:27 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932276AbZKDRe4 (ORCPT ); Wed, 4 Nov 2009 12:34:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932269AbZKDRez (ORCPT ); Wed, 4 Nov 2009 12:34:55 -0500 Received: from fg-out-1718.google.com ([72.14.220.157]:5665 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932244AbZKDRev (ORCPT ); Wed, 4 Nov 2009 12:34:51 -0500 Received: by fg-out-1718.google.com with SMTP id 16so386425fgg.1 for ; Wed, 04 Nov 2009 09:34:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=YtQTqmVGtGWZT6UjARt4gjDeh/AoWdvjvBlxvHLi2z4=; b=DE6iJmDrG1z6MLl6yNYWHALQRL97D+EX1mHYSGIWFf5yJN0OIkQUOG9z36ORJHULbr T7UdPuYzZpibJigXRGixfM8YlqLUg2adBiV7/ZkY2JnXNOgbbW3Uz+F8rA7HUcexUU7M efebb9cO/TGrr4NOTlN/wpgDXpWqxbbkxhbZ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=rA3UyKQDWk8m08bpghC+DA0Cu+jSws9oTyvQcfzPtBLtsrXu3nKJ1i/LwmpPumB1qg oS2+RS2Ah8q1uM6yJRUJvxUXoiBxmhJH2aIKYZX1qmVLC2KV/DNrmrXRGJFiCRYYfO0d KChE9duH0QgN7q+u8yMQyvfdTWmq+bN7EInmY= Received: by 10.86.214.20 with SMTP id m20mr4189410fgg.4.1257356096040; Wed, 04 Nov 2009 09:34:56 -0800 (PST) Received: from localhost.localdomain (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id e11sm1619975fga.17.2009.11.04.09.34.55 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Nov 2009 09:34:55 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-wireless@vger.kernel.org Cc: Ivo van Doorn , Bartlomiej Zolnierkiewicz , Gertjan van Wingerde , linux-kernel@vger.kernel.org, "John W. Linville" Date: Wed, 04 Nov 2009 18:34:32 +0100 Message-Id: <20091104173432.28463.51210.sendpatchset@localhost.localdomain> In-Reply-To: <20091104173151.28463.68742.sendpatchset@localhost.localdomain> References: <20091104173151.28463.68742.sendpatchset@localhost.localdomain> Subject: [PATCH 21/41] rt2800usb: add rt2800_mcu_request() wrapper Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Index: b/drivers/net/wireless/rt2x00/rt2800usb.c =================================================================== --- a/drivers/net/wireless/rt2x00/rt2800usb.c +++ b/drivers/net/wireless/rt2x00/rt2800usb.c @@ -259,6 +259,13 @@ static void rt2800usb_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) +{ + rt2800usb_mcu_request(rt2x00dev, command, token, arg0, arg1); +} + #ifdef CONFIG_RT2X00_LIB_DEBUGFS static const struct rt2x00debug rt2800usb_rt2x00debug = { .owner = THIS_MODULE, @@ -319,10 +326,10 @@ static void rt2800usb_brightness_set(str EEPROM_FREQ_LED_MODE); if (led->type == LED_TYPE_RADIO) { - rt2800usb_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) { - rt2800usb_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) { /* @@ -333,7 +340,7 @@ static void rt2800usb_brightness_set(str * work with bitshifting: * (1 << level) - 1 */ - rt2800usb_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff, + rt2800_mcu_request(led->rt2x00dev, MCU_LED_STRENGTH, 0xff, (1 << brightness / (LED_FULL / 6)) - 1, polarity); } @@ -1243,13 +1250,13 @@ static int rt2800usb_load_firmware(struc /* * Send signal to firmware during boot time. */ - rt2800usb_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0); + rt2800_mcu_request(rt2x00dev, MCU_BOOT_SIGNAL, 0xff, 0, 0); if ((chipset == 0x3070) || (chipset == 0x3071) || (chipset == 0x3572)) { udelay(200); - rt2800usb_mcu_request(rt2x00dev, MCU_CURRENT, 0, 0, 0); + rt2800_mcu_request(rt2x00dev, MCU_CURRENT, 0, 0, 0); udelay(10); } @@ -1885,15 +1892,15 @@ static int rt2800usb_enable_radio(struct * Initialize LED control */ rt2x00_eeprom_read(rt2x00dev, EEPROM_LED1, &word); - rt2800usb_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); - rt2800usb_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); - rt2800usb_mcu_request(rt2x00dev, MCU_LED_3, 0xff, + rt2800_mcu_request(rt2x00dev, MCU_LED_3, 0xff, word & 0xff, (word >> 8) & 0xff); return 0; @@ -1922,9 +1929,9 @@ static int rt2800usb_set_state(struct rt enum dev_state state) { if (state == STATE_AWAKE) - rt2800usb_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 0); + rt2800_mcu_request(rt2x00dev, MCU_WAKEUP, 0xff, 0, 0); else - rt2800usb_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2); + rt2800_mcu_request(rt2x00dev, MCU_SLEEP, 0xff, 0, 2); return 0; }