From patchwork Thu Aug 27 00:16:06 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hin-Tak Leung X-Patchwork-Id: 44158 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 n7R0GCOg010336 for ; Thu, 27 Aug 2009 00:16:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754374AbZH0AQH (ORCPT ); Wed, 26 Aug 2009 20:16:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754377AbZH0AQH (ORCPT ); Wed, 26 Aug 2009 20:16:07 -0400 Received: from ey-out-2122.google.com ([74.125.78.26]:64398 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754363AbZH0AQG (ORCPT ); Wed, 26 Aug 2009 20:16:06 -0400 Received: by ey-out-2122.google.com with SMTP id 25so147987eya.19 for ; Wed, 26 Aug 2009 17:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=gPJUIdyZnmOc9r0BarDpiK+4fcqg0ZphA9q1rrKZNE8=; b=ZJ/K61cUeNEpqAlP6jHgoIVhWfrp9abWU09ocZerb+KhgsMfgLwr5j8UipsRopdtLQ VzlFwKc+NdDq3fF860Zau15xLbWGdwR1kmTODGqiJLkqEdnodZfz+vXyeWXr2AeZnhwm Ino58WEIu4soTSzqCtNVnk6+mKz7xu6Fl0oW0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=x1++IcPp+NvCkGhCRY0Cgapr8ExN9isjIoVi2/DOH3v6hlP8/y78s6JbEizF4iotfp 5tczPh7x2c0mXF6sLYaRrt7D6bxpnsTn1NEv69aBZgrc8yTCAsTcfD8yovr4aKxLMyj/ rmb+iPi0/gRJMUKAU5P7VBrpCxN1cz+lJiPSE= MIME-Version: 1.0 Received: by 10.216.11.211 with SMTP id 61mr1735656wex.68.1251332166984; Wed, 26 Aug 2009 17:16:06 -0700 (PDT) In-Reply-To: <43e72e890908261645n24a040cds84f012095a40c15b@mail.gmail.com> References: <3ace41890908261511i3056c049kca82831015ff2aa0@mail.gmail.com> <43e72e890908261528m23b8fe78w209e305f27e68fa1@mail.gmail.com> <3ace41890908261555g339e65d1n6627cc3d1713287e@mail.gmail.com> <43e72e890908261645n24a040cds84f012095a40c15b@mail.gmail.com> Date: Thu, 27 Aug 2009 01:16:06 +0100 Message-ID: <3ace41890908261716m52f948c9g97db8eeac4fdda56@mail.gmail.com> Subject: Re: hal, rfkill and compat-wireless (Re: [RFC/RFT] rtl8187: Implement rfkill support) From: Hin-Tak Leung To: "Luis R. Rodriguez" Cc: Johannes Berg , hal@lists.freedesktop.org, htl10@users.sourceforge.net, Larry Finger , Herton Ronaldo Krzesinski , linux-wireless@vger.kernel.org Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Thu, Aug 27, 2009 at 12:45 AM, Luis R. Rodriguez wrote: > Johannes, did kernels < 2.6.31 have /sys/class/rfkill ? 2.6.30 has /sys/class/rfkill (it is exposed by the vendor as-shipped rfkill.ko). But I just tried something like this, and it seems to work - the patch is simple enough and just 3 hunks - what it does: 1) 'make unload' should unload rfkill also, 2) remove the compat-wireless class renaming hunk (so it advertise itself as 'rfkill' rather than 'rfkill_backport') 3) remove the compat-wireless input hander renaming hunk. I am not sure what the input handle->name (3) is for, somebody care to explain? Is there any reason why I should do something like outlined here in the patch? Hin-Tak diff --git a/compat/patches/03-rfkill.patch b/compat/patches/03-rfkill.patch index 61eb762..368767f 100644 --- a/compat/patches/03-rfkill.patch +++ b/compat/patches/03-rfkill.patch @@ -34,15 +34,6 @@ just keep /dev/rfkill and not /dev/rfkill_backport. #include #include "rfkill.h" -@@ -229,7 +233,7 @@ static int rfkill_connect(struct input_h - - handle->dev = dev; - handle->handler = handler; -- handle->name = "rfkill"; -+ handle->name = "rfkill_backport"; - - /* causes rfkill_start() to be called */ - error = input_register_handle(handle); --- a/net/rfkill/core.c 2009-08-20 13:48:36.083267397 -0700 +++ b/net/rfkill/core.c 2009-08-20 13:48:37.051267098 -0700 @@ -26,7 +26,7 @@ @@ -81,15 +72,6 @@ just keep /dev/rfkill and not /dev/rfkill_backport. static atomic_t rfkill_input_disabled = ATOMIC_INIT(0); /** -@@ -776,7 +776,7 @@ - } - - static struct class rfkill_class = { -- .name = "rfkill", -+ .name = "rfkill_backport", - .dev_release = rfkill_release, - .dev_attrs = rfkill_dev_attrs, - .dev_uevent = rfkill_dev_uevent, @@ -922,7 +922,7 @@ if (!rfkill->persistent || rfkill_epo_lock_active) { schedule_work(&rfkill->sync_work); diff --git a/scripts/unload.sh b/scripts/unload.sh index 75bbfc9..0537056 100755 --- a/scripts/unload.sh +++ b/scripts/unload.sh @@ -25,6 +25,7 @@ MODULES="$MODULES rndis_wlan rndis_host cdc_ether usbnet" # eeprom_93cx6 is used by rt2x00 (rt61pci, rt2500pci, rt2400pci) # and Realtek drivers ( rtl8187, rtl8180) MODULES="$MODULES eeprom_93cx6" +MODULES="$MODULES rfkill" MODULES="$MODULES lib80211_crypt_ccmp lib80211_crypt_tkip lib80211_crypt_wep" MODULES="$MODULES mac80211 cfg80211 lib80211" MADWIFI_MODULES="ath_pci ath_rate_sample wlan_scan_sta wlan ath_hal"