History log of /linux-master/drivers/input/joystick/iforce/iforce-packets.c
Revision Date Author Comments
# 6d45d3e0 14-Jul-2019 Tim Schumacher <timschumi@gmx.de>

Input: iforce - remove empty multiline comments

Those are remnants of the SPDX identifier migration, which haven't been
removed properly.

Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 21ae38f8 10-Aug-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - use unaligned accessors, where appropriate

Instead of open-coding conversion from/to little-endian, let's
use proper accessors.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 633354d1 10-Aug-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - only call iforce_process_packet() if initialized

It is excessive to check if device is fully initialized in
iforce_process_packet(), as for USB-conected devices we do not start
collecting reports until the device is fully initialized.

Let's change serio transport code to not call iforce_process_packet()
until device initialization is done.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 2880dcf9 10-Aug-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - signal command completion from transport code

Signalling command completion from iforce_process_packet() does
not make sense, as not all transport use the same data path for
both commands and motion data form the device, that is why USB
code already has to signal command completion iforce_usb_out().

Let's move signalling completion into individual transport
modules.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# d3cc1000 09-Aug-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - do not combine arguments for iforce_process_packet()

Current code combines packet type and data length into single argument to
iforce_process_packet() and then has to untangle it. It is much clearer to
simply use separate arguments.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 8a25e058 09-Aug-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - factor out hat handling when parsing packets

This makes code clearer a bit.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 43e61fc7 09-Aug-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - update formatting of switch statements

According to our coding style case labels in switch statements should
be aligned with the switch keyword.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 4f99de6d 24-Jul-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - split into core and transport modules

Now that we have moved enough transport details into separate source files
we can change them into transport modules so that they are only loaded when
needed.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 93817584 03-Aug-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - move command completion handling to serio code

Continue teasing apart protocol-specific bits from core into transport
modules. This time move RS232-specific command completion handling
from core to iforce-serio module.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 2a1433ff 26-Jul-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - move get_id to the transport operations

To avoid #ifdef-ing out parts of the code and having conditionals in normal
control flow, let's define "get_id" transport method and move
implementation into respective transport modules.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 38d10769 26-Jul-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - introduce transport ops

In order to tease apart the driver into core and transport modules, let's
introduce transport operations and make "xmit" the very first one such
operation.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# f7f3651e 24-Jul-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: iforce - remove "being used" silliness

The kernel is supposed to handle multiple devices, static flags
in packet handling code will never work.

Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 1a59d1b8 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version this program is distributed in the
hope that it will be useful but without any warranty without even
the implied warranty of merchantability or fitness for a particular
purpose see the gnu general public license for more details you
should have received a copy of the gnu general public license along
with this program if not write to the free software foundation inc
59 temple place suite 330 boston ma 02111 1307 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 1334 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Reviewed-by: Richard Fontana <rfontana@redhat.com>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 305180bc 24-Jul-2018 Tim Schumacher <timschumi@gmx.de>

Input: iforce - reformat the packet dump output

Previously, packets that have been dumped are shown in the
kernel log like this:

drivers/input/joystick/iforce/iforce-packets.c: info cmd = ff04, data =
56
02
04
00

Use dev_dbg to dump the packages only when requested and to list
the parent device as well. Use printf logic to generate the hexdump
instead of looping through every char that needs to be printed (which
in turn fixes the unnecessary newlines and looks more clean in general).

The resulting package dump output does now look like this:

usb 2-8: iforce_dump_packet info cmd = ff04, data = 56 02 04 00

Signed-off-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 179909ec 24-Jul-2018 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: stop telling users to snail-mail Vojtech

I do not think Vojtech wants snail mail these days (and he mentioned that
nobody has ever sent him snail mail), and the address is not even valid
anymore, so let's remove snail-mail instructions from the sources.

Acked-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 381a2c6f 04-Jul-2018 Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Input: iforce - use GFP_KERNEL in iforce_get_id_packet()

iforce_get_id_packet() invokes wait_event_interruptible_timeout() which
means it has to be in non-atomic context at that point, thus we can use
GFP_KERNEL instead of GFP_ATOMIC.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# a852d78e 04-May-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: input: iforce: fix up dev_* messages

Previously I had made the struct device point to the input device, but
after talking with Dmitry, he said that the USB device would make more
sense for this driver to point to. So converted it to use that instead.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# f576125d 01-May-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: iforce: remove dbg() usage

dbg() was a very old USB-specific macro that should no longer
be used. This patch removes it from being used in the driver
and uses dev_dbg() instead.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# d331efdd 01-May-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: input: joystick: iforce: fix up dev_err() usages

We should always reference the input device for dev_err(), not the USB
device. Fix up the places where I got this wrong.

Reported-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 7b22a885 25-Apr-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

USB: iforce: remove err() usage

err() was a very old USB-specific macro that I thought had gone away.
This patch removes it from being used in the driver and uses dev_err()
instead.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 1817b169 14-Aug-2008 Greg Kroah-Hartman <gregkh@suse.de>

USB: remove warn() macro from usb input drivers

USB should not be having it's own printk macros, so remove warn() and
use the system-wide standard of dev_warn() wherever possible. In the
few places that will not work out, use a basic printk().

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# d1659fcc 19-May-2008 Adrian Bunk <bunk@kernel.org>

Input: remove CVS keywords

This patch removes CVS keywords that weren't updated for a long time
from comments.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# d9f03831 29-Aug-2007 Andrew Morton <akpm@linux-foundation.org>

Input: iforce - fix 'unused variable' warning

drivers/input/joystick/iforce/iforce-packets.c: In function `iforce_get_id_packet':
drivers/input/joystick/iforce/iforce-packets.c:249: warning: unused variable `status'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# c0338c15 13-May-2007 Johann Deneux <johann.deneux@gmail.com>

Input: iforce - minor clean-ups

Signed-off-by: Johann Deneux <johann.deneux@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 598972d4 11-Apr-2007 Johann Deneux <johann.deneux@gmail.com>

Input: iforce - use usb_kill_urb instead of usb_unlink_urb

Using usb_unlink_urb can cause iforce_open to fail when called
soon after iforce_release. Also updated my email address and
replaced calls to printk() by dbg(), warn(), info(), err()...

Signed-off-by: Johann Deneux <johann.deneux@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 7d12e780 05-Oct-2006 David Howells <dhowells@redhat.com>

IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)


# f6a01c85 18-Jul-2006 Anssi Hannula <anssi.hannula@gmail.com>

Input: iforce - switch to the new FF interface

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 97d4ebfe 30-Jan-2006 Dmitry Torokhov <dtor_core@ameritech.net>

Input: iforce - fix detection of USB devices

Recent conversion to wait_event_interruptible_timeout() caused
USB detection routine erroneously report timeouts for perfectly
working devices.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 17dd3f0f 15-Sep-2005 Dmitry Torokhov <dtor_core@ameritech.net>

[PATCH] drivers/input/joystick: convert to dynamic input_dev allocation

Input: convert drivers/input/joystick to dynamic input_dev allocation

This is required for input_dev sysfs integration

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# fb76b099 04-Sep-2005 Vojtech Pavlik <vojtech@suse.cz>

Input: iforce - use wait_event_interruptible_timeout

The timeout while() loops in iforce-packets.c lack a
set_current_state(TASK_INTERRUPTIBLE); call. The right solution is
to replace them with wait_event_interruptible_timeout().

Reported-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!