aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* HID: uhid: add documentationDavid Herrmann2012-08-161-0/+169
| | | | | | | | | This describes the protocol used by uhid for user-space applications. It describes the details like non-blocking I/O and readv/writev for multiple events per syscall. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: implement feature requestsDavid Herrmann2012-08-162-1/+136
| | | | | | | | | | | | | | | | | | | | | | | | HID standard allows sending a feature request to the device which is answered by an HID report. uhid implements this by sending a UHID_FEATURE event to user-space which then must answer with UHID_FEATURE_ANSWER. If it doesn't do this in a timely manner, the request is discarded silently. We serialize the feature requests, that is, there is always only a single active feature-request sent to user-space, other requests have to wait. HIDP and USB-HID do it the same way. Because we discard feature-requests silently, we must make sure to match a response to the corresponding request. We use sequence-IDs for this so user-space must copy the ID from the request into the answer. Feature-answers are ignored if they do not contain the same ID as the currently pending feature request. Internally, we must make sure that feature-requests are synchronized with UHID_DESTROY and close() events. We must not dead-lock when closing the HID device, either, so we have to use separate locks. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: forward raw output reports to user-spaceDavid Herrmann2012-08-162-1/+47
| | | | | | | | | | | | | | | | | Some drivers that use non-standard HID features require raw output reports sent to the device. We now forward these requests directly to user-space so the transport-level driver can correctly send it to the device or handle it correspondingly. There is no way to signal back whether the transmission was successful, moreover, there might be lots of messages coming out from the driver flushing the output-queue. However, there is currently no driver that causes this so we are safe. If some drivers need to transmit lots of data this way, we need a method to synchronize this and can implement another UHID_OUTPUT_SYNC event. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: forward output request to user-spaceDavid Herrmann2012-08-162-0/+26
| | | | | | | | | If the hid-driver wants to send standardized data to the device it uses a linux input_event. We forward this to the user-space transport-level driver so they can perform the requested action on the device. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: forward open/close events to user-spaceDavid Herrmann2012-08-162-1/+8
| | | | | | | | | | | HID core notifies us with *_open/*_close callbacks when there is an actual user of our device. We forward these to user-space so they can react on this. This allows user-space to skip I/O unless they receive an OPEN event. When they receive a CLOSE event they can stop I/O again to save energy. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: add UHID_START and UHID_STOP eventsDavid Herrmann2012-08-162-1/+9
| | | | | | | | | | | We send UHID_START and UHID_STOP events to user-space when the HID core starts/stops the device. This notifies user-space about driver readiness and data-I/O can start now. This directly forwards the callbacks from hid-core to user-space. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: forward hid report-descriptor to hid coreDavid Herrmann2012-08-161-1/+3
| | | | | | | | When the uhid_hid_parse callback is called we simply forward it to hid_parse_report() with the data that we got in the UHID_CREATE event. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: allow feeding input data into uhid devicesDavid Herrmann2012-08-162-0/+23
| | | | | | | | | | | | This adds a new event type UHID_INPUT which allows user-space to feed raw HID reports into the HID subsystem. We copy the data into kernel memory and directly feed it into the HID core. There is no error handling of the events couldn't be parsed so user-space should consider all events successfull unless read() returns an error. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: add UHID_CREATE and UHID_DESTROY eventsDavid Herrmann2012-08-162-1/+164
| | | | | | | | | | | | | UHID_CREATE and UHID_DESTROY are used to create and destroy a device on an open uhid char-device. Internally, we allocate and register an HID device with the HID core and immediately start the device. From now on events may be received or sent to the device. The UHID_CREATE event has a payload similar to the data used by Bluetooth-HIDP when creating a new connection. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: implement write() on uhid devicesDavid Herrmann2012-08-161-1/+30
| | | | | | | | | | | | Similar to read() you can only write() a single event with one call to an uhid device. To write multiple events use writev() which is supported by uhid. We currently always return -EOPNOTSUPP but other events will be added in later patches. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: implement read() on uhid devicesDavid Herrmann2012-08-161-1/+45
| | | | | | | | | | | | | | | | | User-space can use read() to get a single event from uhid devices. read() does never return multiple events. This allows us to extend the event structure and still keep backwards compatibility. If user-space wants to get multiple events in one syscall, they should use the readv()/writev() syscalls which are supported by uhid. This introduces a new lock which helps us synchronizing simultaneous reads from user-space. We also correctly return -EINVAL/-EFAULT only on errors and retry the read() when some other thread captured the event faster than we did. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: allow poll()'ing on uhid devicesDavid Herrmann2012-08-161-0/+7
| | | | | | | | | | | | | | | | As long as the internal buffer is not empty, we return POLLIN to user-space. uhid->head and uhid->tail are no atomics so the comparison may return inexact results. However, this doesn't matter here as user-space would need to poll() in two threads simultaneously to trigger this. And in this case it doesn't matter if a cached result is returned or the exact new result as user-space does not know which thread returns first from poll() and the following read(). So it is safe to compare the values without locking. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: add internal message bufferDavid Herrmann2012-08-163-0/+99
| | | | | | | | | | | | | | | | | | | | | | | When receiving messages from the HID subsystem, we need to process them and store them in an internal buffer so user-space can read() on the char device to retrieve the messages. This adds a static buffer for 32 messages to each uhid device. Each message is dynamically allocated so the uhid_device structure does not get too big. uhid_queue() adds a message to the buffer. If the buffer is full, the message is discarded. uhid_queue_event() is an helper for messages without payload. This also adds a public header: uhid.h. It contains the declarations for the user-space API. It is built around "struct uhid_event" which contains a type field which specifies the event type and each event can then add a variable-length payload. For now, there is only a dummy event but later patches will add new event types and payloads. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: uhid: introduce user-space I/O driver support for HIDDavid Herrmann2012-08-163-0/+110
| | | | | | | | | | | | This adds a dummy driver that will support user-space I/O drivers for the HID subsystem. This allows to write transport-level drivers like USB-HID and Bluetooth-HID in user-space. Low-Energy Bluetooth needs this to feed HID data that is parsed in user-space back into the kernel. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* mmc: Make sure host is disabled on suspendDmitry Shmidt2012-08-161-0/+1
| | | | | Change-Id: Ie0bf2004e173cef8dad66722a152658d7727ab65 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcm4329: Remove obsolete filesDmitry Shmidt2012-08-132-287/+0
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* netfilter: xt_IDLETIMER: Rename INTERFACE to LABEL in netlink notification.Ashish Sharma2012-08-131-6/+6
| | | | Signed-off-by: Ashish Sharma <ashishsharma@google.com>
* net: wireless: bcmdhd: Use correct time from boot for TSFDmitry Shmidt2012-08-131-4/+4
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* scripts/Kbuild.include: Fix portability problem of "echo -e"Bernhard Walle2012-08-081-1/+1
| | | | | | | | | | | | | | | | | "echo -e" is a GNU extension. When cross-compiling the kernel on a BSD-like operating system (Mac OS X in my case), this doesn't work. One could install a GNU version of echo, put that in the $PATH before the system echo and use "/usr/bin/env echo", but the solution with printf is simpler. Since it is no disadvantage on Linux, I hope that gets accepted even if cross-compiling the Linux kernel on another Unix operating system is quite a rare use case. Signed-off-by: Bernhard Walle <bernhard@bwalle.de> Andreas Bießmann <andreas@biessmann.de> Signed-off-by: Michal Marek <mmarek@suse.cz>
* USB: gadget: f_audio_source: Fix error handling and increase packet sizeMike Lockwood2012-08-021-4/+2
| | | | | | | Fixes watchdog reset on USB disconnect Larger packet size fixes performance in fullspeed mode Signed-off-by: Mike Lockwood <lockwood@google.com>
* net: wireless: bcmdhd: Fill station_info packet fieldsDmitry Shmidt2012-07-271-0/+14
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Prevent HT Avail request failure to flood the logDmitry Shmidt2012-07-183-12/+31
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Use proper jiffie-related functionsDmitry Shmidt2012-07-176-34/+26
| | | | | | | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com> Conflicts: drivers/net/wireless/bcmdhd/wl_cfg80211.c drivers/net/wireless/bcmdhd/wl_iw.c
* net: wireless: bcmdhd: Adjust driver/fw/chip info formatDmitry Shmidt2012-07-171-2/+2
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* x86: Call idle notifiersGerman Monroy2012-07-161-0/+2
| | | | | | | | | | | | | | | | | | | | BZ: 35303 Google patched the idle loop for x86-64 (commit 1fd57f722c) and for ARM (commit 41fa406c26), but they forgot x86-32. This is preventing their interactive governor from upshifting CPU frequencies in intel's SOC platforms (e.g. Medfield, etc.). Fixing that. NOTE: The notifier calls are not located in the same exact place in the idle loop for x86-64 and ARM. The notifier is called inside the `while(!need_resched)' loop in x86-64 and outside of it in ARM. Since Google has likely tuned this governor for ARM, leaving it as in ARM. Change-Id: Ibefd0c8f08e4b4c24c4a5c32dcdc574f9090b2b9 Signed-off-by: German Monroy <german.monroy@intel.com>
* net: wireless: bcmdhd: Add info_string param with driver/fw/chip infoDmitry Shmidt2012-07-123-5/+45
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Remove country update from wl_update_wiphybandsDmitry Shmidt2012-07-123-24/+5
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Fix P2P GO hang issueNeeraj Kumar Garg2012-07-122-28/+37
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Update wiphy bands on band changeDmitry Shmidt2012-07-125-4/+38
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Init locks in dhd_attach() at the beginningAndrey Vagin2012-07-121-11/+12
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcm4329: Init locks in dhd_attach() at the beginningAndrey Vagin2012-07-121-11/+11
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Add mutex to wl_update_wiphybands()Dmitry Shmidt2012-07-121-3/+10
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Skip country setting if unnecessaryDmitry Shmidt2012-07-121-13/+14
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Return wl_construct_reginfo() callDmitry Shmidt2012-07-121-2/+0
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Add wiphyband update for country changeDmitry Shmidt2012-07-121-1/+5
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Skip inaccurate wl_construct_reginfo() callDmitry Shmidt2012-06-281-1/+3
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Ignore error if "chanspecs" command is not supportedDmitry Shmidt2012-06-201-1/+4
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Reduce priority for dhd_dpc and watchdogDmitry Shmidt2012-06-191-3/+2
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Reload FW in case of constant scan failureDmitry Shmidt2012-06-194-1/+12
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Combined P2P fixesDmitry Shmidt2012-06-132-32/+77
| | | | | | | | - Fix p2p scan - Fix p2p processing for channels 12 and 13 - Fix service discovery Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* ext4: add missing save_error_info() to ext4_error()Theodore Ts'o2012-06-081-0/+1
| | | | | | | | | | | | | | | The ext4_error() function is missing a call to save_error_info(). Since this is the function which marks the file system as containing an error, this oversight (which was introduced in 2.6.36) is quite significant, and should be backported to older stable kernels with high urgency. Change-Id: Ia1eb8d91f37ceb67faf3b79d6bc79b899f1d6bfc Reported-by: Ken Sumrall <ksumrall@google.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: ksumrall@google.com Cc: stable@kernel.org Signed-off-by: Ken Sumrall <ksumrall@android.com>
* net: wireless: bcmdhd: Update to version 5.90.195.75Dmitry Shmidt2012-05-3113-142/+764
| | | | | | | - Fix false PCB-OVERLAP issue - Fix simultanious connect request on two P2P devices Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Fix P2P driver crash for MFG firmwareLeslie Yu2012-05-301-2/+2
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Make responce waiting uninterruptibleDmitry Shmidt2012-05-302-28/+12
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* USB: gadget: f_audio_source: Adjust packet timing to reduce glitchesMike Lockwood2012-05-291-8/+9
| | | | | | | Increase max packet size and clean up timing logic so we can better recover from not getting an interrupt in time for a SOF. Signed-off-by: Mike Lockwood <lockwood@google.com>
* usb: gadget: android: Fix product nameBenoit Goby2012-05-291-4/+1
| | | | | | | | Product names may contain spaces and scanf %s only matches the 1st word. Use strlcpy instead. Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0 Signed-off-by: Benoit Goby <benoit@android.com>
* net: wireless: bcmdhd: Fix WPS PBC overlap failureNeeraj Kumar Garg2012-05-241-0/+2
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* usb: gadget: composite: Fix corruption when changing configurationBenoit Goby2012-05-211-4/+6
| | | | | | | | | | Remove the config from the configs list before releasing the spinlock. Otherwise the other cpu might be processing a SET_CONFIGURATION that will switch to the configuration that is being released. Bug: 6521576 Change-Id: Id4da0d0e18ead63e20cb236cd1d3e8e6d116acce Signed-off-by: Benoit Goby <benoit@android.com>
* net: wireless: bcmdhd: Ignore signal_pending() while waiting in IOCTLDmitry Shmidt2012-05-161-4/+1
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* net: wireless: bcmdhd: Check return value from dhd_dev_init_ioctl()Dmitry Shmidt2012-05-163-6/+8
| | | | Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>