- 06 7月, 2018 1 次提交
-
-
由 Uwe Kleine-König 提交于
Given that activating a trigger can fail, let the callback return an indication. This prevents to have a trigger active according to the "trigger" sysfs attribute but not functional. All users are changed accordingly to return 0 for now. There is no intended change in behaviour. Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NJacek Anaszewski <jacek.anaszewski@gmail.com>
-
- 23 5月, 2018 2 次提交
-
-
由 João Paulo Rechi Vita 提交于
Creates a new trigger rfkill-none, as a complement to rfkill-any, which drives LEDs when any radio is enabled. The new trigger is meant to turn a LED ON whenever all radios are OFF, and turn it OFF otherwise. Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 João Paulo Rechi Vita 提交于
Rename these functions to rfkill_global_led_trigger*, as they are going to be extended to handle another global rfkill led trigger. This commit does not change any functionality. Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 12 2月, 2018 1 次提交
-
-
由 Linus Torvalds 提交于
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: NAl Viro <viro@zeniv.linux.org.uk> Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
-
- 28 11月, 2017 1 次提交
-
-
由 Al Viro 提交于
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
-
- 09 1月, 2017 1 次提交
-
-
由 Michał Kępień 提交于
Add a new "global" (i.e. not per-rfkill device) LED trigger, rfkill-any, which may be useful on laptops with a single "radio LED" and multiple radio transmitters. The trigger is meant to turn a LED on whenever there is at least one radio transmitter active and turn it off otherwise. Signed-off-by: NMichał Kępień <kernel@kempniu.pl> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 20 12月, 2016 1 次提交
-
-
由 Johannes Berg 提交于
This reverts commit 73f4f76a. As Mike reported, and I should've seen in review, we can't call the new LED functions, which acquire the mutex, from places like rfkill_set_sw_state() that are documented to be callable from any context the user likes to use. For Mike's case it led to a deadlock, but other scenarios are possible. Reported-by: NМихаил Кринкин <krinkin.m.u@gmail.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 16 12月, 2016 1 次提交
-
-
由 Arnd Bergmann 提交于
A cleanup introduced a harmless warning in some configurations: net/rfkill/core.c: In function 'rfkill_init': net/rfkill/core.c:1350:1: warning: label 'error_input' defined but not used [-Wunused-label] This adds another #ifdef around the label to match that around the caller. Fixes: 6124c53e ("rfkill: Cleanup error handling in rfkill_init()") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 13 12月, 2016 3 次提交
-
-
由 Michał Kępień 提交于
Add a new "global" (i.e. not per-rfkill device) LED trigger, rfkill-any, which may be useful on laptops with a single "radio LED" and multiple radio transmitters. The trigger is meant to turn a LED on whenever there is at least one radio transmitter active and turn it off otherwise. This requires taking rfkill_global_mutex before calling rfkill_set_block() in rfkill_resume(): since __rfkill_any_led_trigger_event() is called from rfkill_set_block() unconditionally, each caller of the latter needs to take care of locking rfkill_global_mutex. Signed-off-by: NMichał Kępień <kernel@kempniu.pl> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 Michał Kępień 提交于
Use a separate label per error condition in rfkill_init() to make it a bit cleaner and easier to extend. Signed-off-by: NMichał Kępień <kernel@kempniu.pl> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 Johannes Berg 提交于
Simplify the two conditions gating the schedule_work() into a single one and get rid of the additional exit point from the function in doing so. Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 05 4月, 2016 1 次提交
-
-
由 João Paulo Rechi Vita 提交于
Using a switch to handle different ev.op values in rfkill_fop_write() makes the code easier to extend, as out-of-range values can always be handled by the default case. Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> [roll in fix for RFKILL_OP_CHANGE from Jouni] Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 24 2月, 2016 8 次提交
-
-
由 João Paulo Rechi Vita 提交于
Factor all assignments to rfkill_global_states[].cur into a single function rfkill_update_global_state(). Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 João Paulo Rechi Vita 提交于
Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 João Paulo Rechi Vita 提交于
Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 Heikki Krogerus 提交于
Helper for finding the type based on name. Useful if the type needs to be determined based on device property. Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com> [modify rfkill_types array and BUILD_BUG_ON to not cause errors] Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 João Paulo Rechi Vita 提交于
This was scheduled to be removed in 2012 by: commit 69c86373 Author: florian@mickler.org <florian@mickler.org> Date: Wed Feb 24 12:05:16 2010 +0100 Document the rfkill sysfs ABI This moves sysfs ABI info from Documentation/rfkill.txt to the ABI subfolder and reformats it. This also schedules the deprecated sysfs parts to be removed in 2012 (claim file) and 2014 (state file). Signed-off-by: NFlorian Mickler <florian@mickler.org> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com> Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 João Paulo Rechi Vita 提交于
__rfkill_set_hw_state() is only one used in rfkill_set_hw_state(), and none of them are long or complicated, so merging the two makes the code easier to read. Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 João Paulo Rechi Vita 提交于
RFKILL_BLOCK_SW value have just been saved to prev, no need to check it again in the if expression. This makes code a little bit easier to read. Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 Johannes Berg 提交于
When suspended while polling is paused, polling will erroneously resume at resume time. Fix this by tracking pause and suspend in separate state variable and adding the necessary checks. Clarify the documentation on this as well. Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 26 1月, 2016 1 次提交
-
-
由 Johannes Berg 提交于
The code within wait_event_interruptible() is called with !TASK_RUNNING, so mustn't call any functions that can sleep, like mutex_lock(). Since we re-check the list_empty() in a loop after the wait, it's safe to simply use list_empty() without locking. This bug has existed forever, but was only discovered now because all userspace implementations, including the default 'rfkill' tool, use poll() or select() to get a readable fd before attempting to read. Cc: stable@vger.kernel.org Fixes: c64fb016 ("rfkill: create useful userspace interface") Reported-by: NDmitry Vyukov <dvyukov@google.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 10 12月, 2015 1 次提交
-
-
由 Johannes Berg 提交于
Some users of rfkill, like NFC and cfg80211, use a dynamic name when allocating rfkill, in those cases dev_name(). Therefore, the pointer passed to rfkill_alloc() might not be valid forever, I specifically found the case that the rfkill name was quite obviously an invalid pointer (or at least garbage) when the wiphy had been renamed. Fix this by making a copy of the rfkill name in rfkill_alloc(). Cc: stable@vger.kernel.org Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 04 9月, 2015 1 次提交
-
-
由 João Paulo Rechi Vita 提交于
When switching the state of all RFKill switches of type all we need to replicate the RFKILL_TYPE_ALL global state to all the other types global state, so it is used to initialize persistent RFKill switches on register. Signed-off-by: NJoão Paulo Rechi Vita <jprvita@endlessm.com> Acked-by: NMarcel Holtmann <marcel@holtmann.org> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 20 5月, 2015 1 次提交
-
-
由 Lars-Peter Clausen 提交于
Use dev_pm_ops instead of the legacy suspend/resume callbacks for the rfkill class suspend and resume operations. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 09 10月, 2014 2 次提交
-
-
由 Fabian Frederick 提交于
Correct the kernel-doc, the parameter is called "blocked" not "state". Signed-off-by: NFabian Frederick <fabf@skynet.be> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
由 Fabian Frederick 提交于
s/state/blocked Signed-off-by: NFabian Frederick <fabf@skynet.be> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
-
- 05 2月, 2014 1 次提交
-
-
由 Shaibal Dutta 提交于
This patch moves the rfkill poll_work to the power efficient workqueue. This work does not have to be bound to the CPU that scheduled it, hence the selection of CPU that executes it would be left to the scheduler. Net result is that CPU idle times would be extended, resulting in power savings. This behaviour is enabled when CONFIG_WQ_POWER_EFFICIENT is selected. Cc: "John W. Linville" <linville@tuxdriver.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: NShaibal Dutta <shaibal.dutta@broadcom.com> [zoran.markovic@linaro.org: Rebased to latest kernel, added commit message. Fixed workqueue selection after suspend/resume cycle.] Signed-off-by: NZoran Markovic <zoran.markovic@linaro.org> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 11 12月, 2013 1 次提交
-
-
由 Jeff Kirsher 提交于
Several files refer to an old address for the Free Software Foundation in the file header comment. Resolve by replacing the address with the URL <http://www.gnu.org/licenses/> so that we do not have to keep updating the header comments anytime the address changes. CC: linux-wireless@vger.kernel.org Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
-
- 26 7月, 2013 1 次提交
-
-
由 Greg Kroah-Hartman 提交于
The dev_attrs field of struct class is going away soon, dev_groups should be used instead. This converts the rfkill class code to use the correct field. Cc: John W. Linville <linville@tuxdriver.com> Reviewed-by: NJohannes Berg <johannes@sipsolutions.net> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- 12 4月, 2013 1 次提交
-
-
由 Samuel Ortiz 提交于
And return the proper string for it. Acked-by: NJohannes Berg <johannes@sipsolutions.net> Acked-by: NMarcel Holtmann <marcel@holtmann.org> Signed-off-by: NSamuel Ortiz <sameo@linux.intel.com>
-
- 25 10月, 2012 1 次提交
-
-
由 Alan Cox 提交于
Signed-off-by: NAlan Cox <alan@linux.intel.com> Signed-off-by: NJiri Kosina <jkosina@suse.cz>
-
- 24 9月, 2012 1 次提交
-
-
由 Vitaly Wool 提交于
Prevent unnecessary rfkill event generation when the state has not actually changed. These events have to be delivered to relevant userspace processes, causing these processes to wake up and do something while they could as well have slept. This obviously results in more CPU usage, longer time-to-sleep-again and therefore higher power consumption. Signed-off-by: NVitaly Wool <vitalywool@gmail.com> Signed-off-by: NMykyta Iziumtsev <nikita.izyumtsev@gmail.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 22 8月, 2012 1 次提交
-
-
由 AceLan Kao 提交于
This reverts commit 2e48928d. Those functions are needed and should not be removed, or there is no way to set the rfkill led trigger name. Signed-off-by: NAceLan Kao <acelan.kao@canonical.com> Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
-
- 07 6月, 2012 1 次提交
-
-
由 Alex Hung 提交于
__rfkill_switch_all() switches the state of devices of a given type; however, it does not switch devices of all type (RFKILL_TYPE_ALL). As a result, it ignores the keycode "KEY_RFKILL" from another module, i.e. eeepc-wmi. This fix is to make __rfkill_switch_all() to be able to switch not only devices of a given type but also all devices. Signed-off-by: NAlex Hung <alex.hung@canonical.com> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
-
- 12 3月, 2012 1 次提交
-
-
由 Paul Gortmaker 提交于
For files that are actively using linux/device.h, make sure that they call it out. This will allow us to clean up some of the implicit uses of linux/device.h within include/* without introducing build regressions. Yes, this was created by "cheating" -- i.e. the headers were cleaned up, and then the fallout was found and fixed, and then the two commits were reordered. This ensures we don't introduce build regressions into the git history. Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
-
- 10 11月, 2011 1 次提交
-
-
由 Julia Lawall 提交于
Use kstrtoul, etc instead of the now deprecated strict_strtoul, etc. A semantic patch rule for the kstrtoul case is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression a,b; {int,long} *c; @@ -strict_strtoul +kstrtoul (a,b,c) // </smpl> Signed-off-by: NJulia Lawall <julia@diku.dk> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
-
- 20 9月, 2011 1 次提交
-
-
由 Mohammed Shafi Shajakhan 提交于
Signed-off-by: NMohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
-
- 17 5月, 2011 1 次提交
-
-
由 Julia Lawall 提交于
The list_for_each_entry loop can fail, in which case the list element is not removed from the list rfkill_fds. Since this list is not accessed by the loop, the addition of &data->list into the list is just moved after the loop. The sematic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression E,E1,E2; identifier l; @@ *list_add(&E->l,E1); ... when != E1 when != list_del(&E->l) when != list_del_init(&E->l) when != E = E2 *kfree(E);// </smpl> Signed-off-by: NJulia Lawall <julia@diku.dk> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
-
- 16 11月, 2010 1 次提交
-
-
由 Stephen Hemminger 提交于
The following code is defined but never used. Signed-off-by: NStephen Hemminger <shemminger@vyatta.com> Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
-
- 15 10月, 2010 1 次提交
-
-
由 Arnd Bergmann 提交于
All file_operations should get a .llseek operation so we can make nonseekable_open the default for future file operations without a .llseek pointer. The three cases that we can automatically detect are no_llseek, seq_lseek and default_llseek. For cases where we can we can automatically prove that the file offset is always ignored, we use noop_llseek, which maintains the current behavior of not returning an error from a seek. New drivers should normally not use noop_llseek but instead use no_llseek and call nonseekable_open at open time. Existing drivers can be converted to do the same when the maintainer knows for certain that no user code relies on calling seek on the device file. The generated code is often incorrectly indented and right now contains comments that clarify for each added line why a specific variant was chosen. In the version that gets submitted upstream, the comments will be gone and I will manually fix the indentation, because there does not seem to be a way to do that using coccinelle. Some amount of new code is currently sitting in linux-next that should get the same modifications, which I will do at the end of the merge window. Many thanks to Julia Lawall for helping me learn to write a semantic patch that does all this. ===== begin semantic patch ===== // This adds an llseek= method to all file operations, // as a preparation for making no_llseek the default. // // The rules are // - use no_llseek explicitly if we do nonseekable_open // - use seq_lseek for sequential files // - use default_llseek if we know we access f_pos // - use noop_llseek if we know we don't access f_pos, // but we still want to allow users to call lseek // @ open1 exists @ identifier nested_open; @@ nested_open(...) { <+... nonseekable_open(...) ...+> } @ open exists@ identifier open_f; identifier i, f; identifier open1.nested_open; @@ int open_f(struct inode *i, struct file *f) { <+... ( nonseekable_open(...) | nested_open(...) ) ...+> } @ read disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ read_no_fpos disable optional_qualifier exists @ identifier read_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off) { ... when != off } @ write @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; expression E; identifier func; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { <+... ( *off = E | *off += E | func(..., off, ...) | E = *off ) ...+> } @ write_no_fpos @ identifier write_f; identifier f, p, s, off; type ssize_t, size_t, loff_t; @@ ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off) { ... when != off } @ fops0 @ identifier fops; @@ struct file_operations fops = { ... }; @ has_llseek depends on fops0 @ identifier fops0.fops; identifier llseek_f; @@ struct file_operations fops = { ... .llseek = llseek_f, ... }; @ has_read depends on fops0 @ identifier fops0.fops; identifier read_f; @@ struct file_operations fops = { ... .read = read_f, ... }; @ has_write depends on fops0 @ identifier fops0.fops; identifier write_f; @@ struct file_operations fops = { ... .write = write_f, ... }; @ has_open depends on fops0 @ identifier fops0.fops; identifier open_f; @@ struct file_operations fops = { ... .open = open_f, ... }; // use no_llseek if we call nonseekable_open //////////////////////////////////////////// @ nonseekable1 depends on !has_llseek && has_open @ identifier fops0.fops; identifier nso ~= "nonseekable_open"; @@ struct file_operations fops = { ... .open = nso, ... +.llseek = no_llseek, /* nonseekable */ }; @ nonseekable2 depends on !has_llseek @ identifier fops0.fops; identifier open.open_f; @@ struct file_operations fops = { ... .open = open_f, ... +.llseek = no_llseek, /* open uses nonseekable */ }; // use seq_lseek for sequential files ///////////////////////////////////// @ seq depends on !has_llseek @ identifier fops0.fops; identifier sr ~= "seq_read"; @@ struct file_operations fops = { ... .read = sr, ... +.llseek = seq_lseek, /* we have seq_read */ }; // use default_llseek if there is a readdir /////////////////////////////////////////// @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier readdir_e; @@ // any other fop is used that changes pos struct file_operations fops = { ... .readdir = readdir_e, ... +.llseek = default_llseek, /* readdir is present */ }; // use default_llseek if at least one of read/write touches f_pos ///////////////////////////////////////////////////////////////// @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read.read_f; @@ // read fops use offset struct file_operations fops = { ... .read = read_f, ... +.llseek = default_llseek, /* read accesses f_pos */ }; @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, ... + .llseek = default_llseek, /* write accesses f_pos */ }; // Use noop_llseek if neither read nor write accesses f_pos /////////////////////////////////////////////////////////// @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; identifier write_no_fpos.write_f; @@ // write fops use offset struct file_operations fops = { ... .write = write_f, .read = read_f, ... +.llseek = noop_llseek, /* read and write both use no f_pos */ }; @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier write_no_fpos.write_f; @@ struct file_operations fops = { ... .write = write_f, ... +.llseek = noop_llseek, /* write uses no f_pos */ }; @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; identifier read_no_fpos.read_f; @@ struct file_operations fops = { ... .read = read_f, ... +.llseek = noop_llseek, /* read uses no f_pos */ }; @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @ identifier fops0.fops; @@ struct file_operations fops = { ... +.llseek = noop_llseek, /* no read or write fn */ }; ===== End semantic patch ===== Signed-off-by: NArnd Bergmann <arnd@arndb.de> Cc: Julia Lawall <julia@diku.dk> Cc: Christoph Hellwig <hch@infradead.org>
-