Linux userland API discussions
 help / color / mirror / Atom feed
* [PATCH] HID: roccat: Removing all modules except Kone
From: Stefan Achatz @ 2015-04-16 16:39 UTC (permalink / raw)
  To: Jiri Kosina, linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-input-u79uwXL29TY76Z2rM5mHXA

This patch removes all roccat hid modules except the one for the first Kone.

Package roccat-tools is the only known user of these modules. Starting with
roccat-tools-2.2.0, released 7 months ago, I'm not using these modules
anymore. All functionality has been moved to userspace using hidraw.

The first Kone is not fully HID-compliant and still needs a module.

Signed-off-by: Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
 .../ABI/obsolete/sysfs-driver-hid-roccat-koneplus  |   48 --
 .../ABI/obsolete/sysfs-driver-hid-roccat-kovaplus  |   66 --
 .../ABI/obsolete/sysfs-driver-hid-roccat-pyra      |   73 ---
 .../ABI/testing/sysfs-driver-hid-roccat-arvo       |   53 --
 .../ABI/testing/sysfs-driver-hid-roccat-isku       |  153 -----
 .../ABI/testing/sysfs-driver-hid-roccat-koneplus   |   96 ---
 .../ABI/testing/sysfs-driver-hid-roccat-konepure   |  105 ---
 .../ABI/testing/sysfs-driver-hid-roccat-kovaplus   |   49 --
 .../ABI/testing/sysfs-driver-hid-roccat-lua        |    7 -
 .../ABI/testing/sysfs-driver-hid-roccat-pyra       |   49 --
 .../ABI/testing/sysfs-driver-hid-roccat-ryos       |  178 ------
 .../ABI/testing/sysfs-driver-hid-roccat-savu       |   76 ---
 drivers/hid/Kconfig                                |    6 +-
 drivers/hid/Makefile                               |    5 +-
 drivers/hid/hid-core.c                             |   15 -
 drivers/hid/hid-ids.h                              |   15 -
 drivers/hid/hid-roccat-arvo.c                      |  460 --------------
 drivers/hid/hid-roccat-arvo.h                      |   85 ---
 drivers/hid/hid-roccat-isku.c                      |  462 --------------
 drivers/hid/hid-roccat-isku.h                      |  100 ---
 drivers/hid/hid-roccat-koneplus.c                  |  578 -----------------
 drivers/hid/hid-roccat-koneplus.h                  |  125 ----
 drivers/hid/hid-roccat-konepure.c                  |  232 -------
 drivers/hid/hid-roccat-kovaplus.c                  |  665 --------------------
 drivers/hid/hid-roccat-kovaplus.h                  |  133 ----
 drivers/hid/hid-roccat-lua.c                       |  215 -------
 drivers/hid/hid-roccat-lua.h                       |   29 -
 drivers/hid/hid-roccat-pyra.c                      |  615 ------------------
 drivers/hid/hid-roccat-pyra.h                      |  152 -----
 drivers/hid/hid-roccat-ryos.c                      |  241 -------
 drivers/hid/hid-roccat-savu.c                      |  229 -------
 drivers/hid/hid-roccat-savu.h                      |   55 --
 32 files changed, 4 insertions(+), 5366 deletions(-)
 delete mode 100644 Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus
 delete mode 100644 Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus
 delete mode 100644 Documentation/ABI/obsolete/sysfs-driver-hid-roccat-pyra
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-arvo
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-isku
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-konepure
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-kovaplus
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-lua
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-ryos
 delete mode 100644 Documentation/ABI/testing/sysfs-driver-hid-roccat-savu
 delete mode 100644 drivers/hid/hid-roccat-arvo.c
 delete mode 100644 drivers/hid/hid-roccat-arvo.h
 delete mode 100644 drivers/hid/hid-roccat-isku.c
 delete mode 100644 drivers/hid/hid-roccat-isku.h
 delete mode 100644 drivers/hid/hid-roccat-koneplus.c
 delete mode 100644 drivers/hid/hid-roccat-koneplus.h
 delete mode 100644 drivers/hid/hid-roccat-konepure.c
 delete mode 100644 drivers/hid/hid-roccat-kovaplus.c
 delete mode 100644 drivers/hid/hid-roccat-kovaplus.h
 delete mode 100644 drivers/hid/hid-roccat-lua.c
 delete mode 100644 drivers/hid/hid-roccat-lua.h
 delete mode 100644 drivers/hid/hid-roccat-pyra.c
 delete mode 100644 drivers/hid/hid-roccat-pyra.h
 delete mode 100644 drivers/hid/hid-roccat-ryos.c
 delete mode 100644 drivers/hid/hid-roccat-savu.c
 delete mode 100644 drivers/hid/hid-roccat-savu.h

diff --git a/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus b/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus
deleted file mode 100644
index 833fd59..0000000
--- a/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-koneplus
+++ /dev/null
@@ -1,48 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/startup_profile
-Date:		October 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 0-4.
-                When read, this attribute returns the number of the actual
-                profile. This value is persistent, so its equivalent to the
-                profile that's active when the mouse is powered on next time.
-		When written, this file sets the number of the startup profile
-		and the mouse activates this profile immediately.
-		Please use actual_profile, it does the same thing.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/firmware_version
-Date:		October 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns the raw integer version number of the
-		firmware reported by the mouse. Using the integer value eases
-		further usage in other programs. To receive the real version
-		number the decimal point has to be shifted 2 positions to the
-		left. E.g. a returned value of 121 means 1.21
-		This file is readonly.
-		Please read binary attribute info which contains firmware version.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile[1-5]_buttons
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_buttons holds information about button layout.
-		When read, these files return the respective profile buttons.
-		The returned data is 77 bytes in size.
-		This file is readonly.
-		Write control to select profile and read profile_buttons instead.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile[1-5]_settings
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_settings holds information like resolution, sensitivity
-		and light effects.
-		When read, these files return the respective profile settings.
-		The returned data is 43 bytes in size.
-		This file is readonly.
-		Write control to select profile and read profile_settings instead.
-Users:		http://roccat.sourceforge.net
\ No newline at end of file
diff --git a/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus b/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus
deleted file mode 100644
index 4a98e02..0000000
--- a/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-kovaplus
+++ /dev/null
@@ -1,66 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/actual_cpi
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 1-4.
-		When read, this attribute returns the number of the active
-		cpi level.
-		This file is readonly.
-		Has never been used. If bookkeeping is done, it's done in userland tools.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/actual_sensitivity_x
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 1-10.
-		When read, this attribute returns the number of the actual
-		sensitivity in x direction.
-		This file is readonly.
-		Has never been used. If bookkeeping is done, it's done in userland tools.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/actual_sensitivity_y
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 1-10.
-		When read, this attribute returns the number of the actual
-		sensitivity in y direction.
-		This file is readonly.
-		Has never been used. If bookkeeping is done, it's done in userland tools.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/firmware_version
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns the raw integer version number of the
-		firmware reported by the mouse. Using the integer value eases
-		further usage in other programs. To receive the real version
-		number the decimal point has to be shifted 2 positions to the
-		left. E.g. a returned value of 121 means 1.21
-		This file is readonly.
-		Obsoleted by binary sysfs attribute "info".
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile[1-5]_buttons
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_buttons holds information about button layout.
-		When read, these files return the respective profile buttons.
-		The returned data is 23 bytes in size.
-		This file is readonly.
-		Write control to select profile and read profile_buttons instead.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile[1-5]_settings
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_settings holds information like resolution, sensitivity
-		and light effects.
-		When read, these files return the respective profile settings.
-		The returned data is 16 bytes in size.
-		This file is readonly.
-		Write control to select profile and read profile_settings instead.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-pyra b/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-pyra
deleted file mode 100644
index 87ac87e..0000000
--- a/Documentation/ABI/obsolete/sysfs-driver-hid-roccat-pyra
+++ /dev/null
@@ -1,73 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/actual_cpi
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	It is possible to switch the cpi setting of the mouse with the
-		press of a button.
-		When read, this file returns the raw number of the actual cpi
-		setting reported by the mouse. This number has to be further
-		processed to receive the real dpi value.
-
-		VALUE DPI
-		1     400
-		2     800
-		4     1600
-
-		This file is readonly.
-		Has never been used. If bookkeeping is done, it's done in userland tools.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/actual_profile
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns the number of the actual profile in
-		range 0-4.
-		This file is readonly.
-		Please use binary attribute "settings" which provides this information.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/firmware_version
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns the raw integer version number of the
-		firmware reported by the mouse. Using the integer value eases
-		further usage in other programs. To receive the real version
-		number the decimal point has to be shifted 2 positions to the
-		left. E.g. a returned value of 138 means 1.38
-		This file is readonly.
-		Please use binary attribute "info" which provides this information.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile[1-5]_buttons
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_buttons holds information about button layout.
-		When read, these files return the respective profile buttons.
-		The returned data is 19 bytes in size.
-		This file is readonly.
-		Write control to select profile and read profile_buttons instead.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile[1-5]_settings
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_settings holds information like resolution, sensitivity
-		and light effects.
-		When read, these files return the respective profile settings.
-		The returned data is 13 bytes in size.
-		This file is readonly.
-		Write control to select profile and read profile_settings instead.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/startup_profile
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 0-4.
-                When read, this attribute returns the number of the profile
-                that's active when the mouse is powered on.
-		This file is readonly.
-		Please use binary attribute "settings" which provides this information.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-arvo b/Documentation/ABI/testing/sysfs-driver-hid-roccat-arvo
deleted file mode 100644
index 55e281b..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-arvo
+++ /dev/null
@@ -1,53 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/actual_profile
-Date:		Januar 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 1-5.
-		When read, this attribute returns the number of the actual
-		profile which is also the profile that's active on device startup.
-		When written this attribute activates the selected profile
-		immediately.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/button
-Date:		Januar 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The keyboard can store short macros with consist of 1 button with
-		several modifier keys internally.
-		When written, this file lets one set the sequence for a specific
-		button for a specific profile. Button and profile numbers are
-		included in written data. The data has to be 24 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/info
-Date:		Januar 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns some info about the device like the
-		installed firmware version.
-		The size of the data is 8 bytes in size.
-		This file is readonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/key_mask
-Date:		Januar 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The keyboard lets the user deactivate 5 certain keys like the
-		windows and application keys, to protect the user from the outcome
-		of accidentally pressing them.
-		The integer value of this attribute has bits 0-4 set depending
-		on the state of the corresponding key.
-		When read, this file returns the current state of the buttons.
-		When written, the given buttons are activated/deactivated
-		immediately.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/arvo/roccatarvo<minor>/mode_key
-Date:		Januar 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The keyboard has a condensed layout without num-lock key.
-		Instead it uses a mode-key which activates a gaming mode where
-		the assignment of the number block changes.
-		The integer value of this attribute ranges from 0 (OFF) to 1 (ON).
-		When read, this file returns the actual state of the key.
-		When written, the key is activated/deactivated immediately.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku b/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku
deleted file mode 100644
index c601d0f..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-isku
+++ /dev/null
@@ -1,153 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/actual_profile
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 0-4.
-		When read, this attribute returns the number of the actual
-		profile. This value is persistent, so its equivalent to the
-		profile that's active when the device is powered on next time.
-		When written, this file sets the number of the startup profile
-		and the device activates this profile immediately.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/info
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns general data like firmware version.
-		The data is 6 bytes long.
-		This file is readonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/key_mask
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one deactivate certain keys like
-		windows and application keys, to prevent accidental presses.
-		Profile number for which this settings occur is included in
-		written data. The data has to be 6 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_capslock
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the
-		capslock key for a specific profile. Profile number is included
-		in written data. The data has to be 6 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_easyzone
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the
-		easyzone keys for a specific profile. Profile number is included
-		in written data. The data has to be 65 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_function
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the
-		function keys for a specific profile. Profile number is included
-		in written data. The data has to be 41 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_macro
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the macro
-		keys for a specific profile. Profile number is included in
-		written data. The data has to be 35 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_media
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the media
-		keys for a specific profile. Profile number is included in
-		written data. The data has to be 29 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/keys_thumbster
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the
-		thumbster keys for a specific profile. Profile number is included
-		in written data. The data has to be 23 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/last_set
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the time in secs since
-		epoch in which the last configuration took place.
-		The data has to be 20 bytes long.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/light
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the backlight intensity for
-		a specific profile. Profile number is included in written data.
-		The data has to be 10 bytes long for Isku, IskuFX needs	16 bytes
-		of data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/macro
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one store macros with max 500
-		keystrokes for a specific button for a specific profile.
-		Button and profile numbers are included in written data.
-		The data has to be 2083 bytes long.
-		Before reading this file, control has to be written to select
-		which profile and key to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/reset
-Date:		November 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one reset the device.
-		The data has to be 3 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/control
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one select which data from which
-		profile will be	read next. The data has to be 3 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/talk
-Date:		June 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one trigger easyshift functionality
-		from the host.
-		The data has to be 16 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/isku/roccatisku<minor>/talkfx
-Date:		February 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one trigger temporary color schemes
-		from the host.
-		The data has to be 16 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus b/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus
deleted file mode 100644
index 7bd776f..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-koneplus
+++ /dev/null
@@ -1,96 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/actual_profile
-Date:		October 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 0-4.
-                When read, this attribute returns the number of the actual
-                profile. This value is persistent, so its equivalent to the
-                profile that's active when the mouse is powered on next time.
-		When written, this file sets the number of the startup profile
-		and the mouse activates this profile immediately.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/info
-Date:		November 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns general data like firmware version.
-		When written, the device can be reset.
-		The data is 8 bytes long.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/macro
-Date:		October 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store a macro with max 500 key/button strokes
-		internally.
-		When written, this file lets one set the sequence for a specific
-		button for a specific profile. Button and profile numbers are
-		included in written data. The data has to be 2082 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile_buttons
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_buttons holds information about button layout.
-		When written, this file lets one write the respective profile
-		buttons back to the mouse. The data has to be 77 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/profile_settings
-Date:		October 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_settings holds information like resolution, sensitivity
-		and light effects.
-		When written, this file lets one write the respective profile
-		settings back to the mouse. The data has to be 43 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/sensor
-Date:		October 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse has a tracking- and a distance-control-unit. These
-		can be activated/deactivated and the lift-off distance can be
-		set. The data has to be 6 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/talk
-Date:		May 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	Used to active some easy* functions of the mouse from outside.
-		The data has to be 16 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu
-Date:		October 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written a calibration process for the tracking control unit
-		can be initiated/cancelled. Also lets one read/write sensor
-		registers.
-		The data has to be 4 bytes long.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/koneplus/roccatkoneplus<minor>/tcu_image
-Date:		October 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read the mouse returns a 30x30 pixel image of the
-		sampled underground. This works only in the course of a
-		calibration process initiated with tcu.
-		The returned data is 1028 bytes in size.
-		This file is readonly.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-konepure b/Documentation/ABI/testing/sysfs-driver-hid-roccat-konepure
deleted file mode 100644
index 41a9b7f..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-konepure
+++ /dev/null
@@ -1,105 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/actual_profile
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. actual_profile holds number of actual profile.
-		This value is persistent, so its value determines the profile
-		that's active when the mouse is powered on next time.
-		When written, the mouse activates the set profile immediately.
-		The data has to be 3 bytes long.
-		The mouse will reject invalid data.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/control
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one select which data from which
-		profile will be	read next. The data has to be 3 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/info
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns general data like firmware version.
-		When written, the device can be reset.
-		The data is 6 bytes long.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/macro
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store a macro with max 500 key/button strokes
-		internally.
-		When written, this file lets one set the sequence for a specific
-		button for a specific profile. Button and profile numbers are
-		included in written data. The data has to be 2082 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/profile_buttons
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_buttons holds information about button layout.
-		When written, this file lets one write the respective profile
-		buttons back to the mouse. The data has to be 59 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/profile_settings
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_settings holds information like resolution, sensitivity
-		and light effects.
-		When written, this file lets one write the respective profile
-		settings back to the mouse. The data has to be 31 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/sensor
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse has a tracking- and a distance-control-unit. These
-		can be activated/deactivated and the lift-off distance can be
-		set. The data has to be 6 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/talk
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	Used to active some easy* functions of the mouse from outside.
-		The data has to be 16 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/tcu
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written a calibration process for the tracking control unit
-		can be initiated/cancelled. Also lets one read/write sensor
-		registers.
-		The data has to be 4 bytes long.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/konepure/roccatkonepure<minor>/tcu_image
-Date:		December 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read the mouse returns a 30x30 pixel image of the
-		sampled underground. This works only in the course of a
-		calibration process initiated with tcu.
-		The returned data is 1028 bytes in size.
-		This file is readonly.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-kovaplus b/Documentation/ABI/testing/sysfs-driver-hid-roccat-kovaplus
deleted file mode 100644
index a10404f..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-kovaplus
+++ /dev/null
@@ -1,49 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/actual_profile
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The integer value of this attribute ranges from 0-4.
-		When read, this attribute returns the number of the active
-		profile.
-		When written, the mouse activates this profile immediately.
-		The profile that's active when powered down is the same that's
-		active when the mouse is powered on.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/info
-Date:		November 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns general data like firmware version.
-		When written, the device can be reset.
-		The data is 6 bytes long.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile_buttons
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_buttons holds information about button layout.
-		When written, this file lets one write the respective profile
-		buttons back to the mouse. The data has to be 23 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/kovaplus/roccatkovaplus<minor>/profile_settings
-Date:		January 2011
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_settings holds information like resolution, sensitivity
-		and light effects.
-		When written, this file lets one write the respective profile
-		settings back to the mouse. The data has to be 16 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-lua b/Documentation/ABI/testing/sysfs-driver-hid-roccat-lua
deleted file mode 100644
index 31c6c4c..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-lua
+++ /dev/null
@@ -1,7 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/control
-Date:		October 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, cpi, button and light settings can be configured.
-		When read, actual cpi setting and sensor data are returned.
-		The data has to be 8 bytes long.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra b/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra
deleted file mode 100644
index 9fa9de3..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-pyra
+++ /dev/null
@@ -1,49 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/info
-Date:		November 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns general data like firmware version.
-		When written, the device can be reset.
-		The data is 6 bytes long.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile_settings
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_settings holds information like resolution, sensitivity
-		and light effects.
-		When written, this file lets one write the respective profile
-		settings back to the mouse. The data has to be 13 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/profile_buttons
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split in settings and buttons.
-		profile_buttons holds information about button layout.
-		When written, this file lets one write the respective profile
-		buttons back to the mouse. The data has to be 19 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/pyra/roccatpyra<minor>/settings
-Date:		August 2010
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns the settings stored in the mouse.
-		The size of the data is 3 bytes and holds information on the
-		startup_profile.
-		When written, this file lets write settings back to the mouse.
-		The data has to be 3 bytes long. The mouse will reject invalid
-		data.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-ryos b/Documentation/ABI/testing/sysfs-driver-hid-roccat-ryos
deleted file mode 100644
index 1d6a8cf..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-ryos
+++ /dev/null
@@ -1,178 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/control
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one select which data from which
-		profile will be	read next. The data has to be 3 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/profile
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. profile holds index of actual profile.
-		This value is persistent, so its value determines the profile
-		that's active when the device is powered on next time.
-		When written, the device activates the set profile immediately.
-		The data has to be 3 bytes long.
-		The device will reject invalid data.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_primary
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the default of all keys for
-		a specific profile. Profile index is included in written data.
-		The data has to be 125 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_function
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the
-		function keys for a specific profile. Profile index is included
-		in written data. The data has to be 95 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_macro
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the macro
-		keys for a specific profile. Profile index is included in
-		written data. The data has to be 35 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_thumbster
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the
-		thumbster keys for a specific profile. Profile index is included
-		in written data. The data has to be 23 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_extra
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the
-		capslock and function keys for a specific profile. Profile index
-		is included in written data. The data has to be 8 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/keys_easyzone
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the function of the
-		easyzone keys for a specific profile. Profile index is included
-		in written data. The data has to be 294 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/key_mask
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one deactivate certain keys like
-		windows and application keys, to prevent accidental presses.
-		Profile index for which this settings occur is included in
-		written data. The data has to be 6 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/light
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the backlight intensity for
-		a specific profile. Profile index is included in written data.
-		This attribute is only valid for the glow and pro variant.
-		The data has to be 16 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/macro
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one store macros with max 480
-		keystrokes for a specific button for a specific profile.
-		Button and profile indexes are included in written data.
-		The data has to be 2002 bytes long.
-		Before reading this file, control has to be written to select
-		which profile and key to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/info
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns general data like firmware version.
-		The data is 8 bytes long.
-		This file is readonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/reset
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one reset the device.
-		The data has to be 3 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/talk
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one trigger easyshift functionality
-		from the host.
-		The data has to be 16 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/light_control
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one switch between stored and custom
-		light settings.
-		This attribute is only valid for the pro variant.
-		The data has to be 8 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/stored_lights
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set per-key lighting for different
-		layers.
-		This attribute is only valid for the pro variant.
-		The data has to be 1382 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/custom_lights
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set the actual per-key lighting.
-		This attribute is only valid for the pro variant.
-		The data has to be 20 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/ryos/roccatryos<minor>/light_macro
-Date:		October 2013
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one set a light macro that is looped
-		whenever the device gets in dimness mode.
-		This attribute is only valid for the pro variant.
-		The data has to be 2002 bytes long.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-roccat-savu b/Documentation/ABI/testing/sysfs-driver-hid-roccat-savu
deleted file mode 100644
index f1e02a9..0000000
--- a/Documentation/ABI/testing/sysfs-driver-hid-roccat-savu
+++ /dev/null
@@ -1,76 +0,0 @@
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/savu/roccatsavu<minor>/buttons
-Date:		Mai 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split into general settings and
-		button settings. buttons holds informations about button layout.
-		When written, this file lets one write the respective profile
-		buttons to the mouse. The data has to be 47 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		Before reading this file, control has to be written to select
-		which profile to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/savu/roccatsavu<minor>/control
-Date:		Mai 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one select which data from which
-		profile will be	read next. The data has to be 3 bytes long.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/savu/roccatsavu<minor>/general
-Date:		Mai 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. A profile is split into general settings and
-		button settings. profile holds informations like resolution, sensitivity
-		and light effects.
-		When written, this file lets one write the respective profile
-		settings back to the mouse. The data has to be 43 bytes long.
-		The mouse will reject invalid data.
-		Which profile to write is determined by the profile number
-		contained in the data.
-		This file is writeonly.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/savu/roccatsavu<minor>/info
-Date:		Mai 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When read, this file returns general data like firmware version.
-		When written, the device can be reset.
-		The data is 8 bytes long.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/savu/roccatsavu<minor>/macro
-Date:		Mai 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	When written, this file lets one store macros with max 500
-		keystrokes for a specific button for a specific profile.
-		Button and profile numbers are included in written data.
-		The data has to be 2083 bytes long.
-		Before reading this file, control has to be written to select
-		which profile and key to read.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/savu/roccatsavu<minor>/profile
-Date:		Mai 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse can store 5 profiles which can be switched by the
-		press of a button. profile holds number of actual profile.
-		This value is persistent, so its value determines the profile
-		that's active when the mouse is powered on next time.
-		When written, the mouse activates the set profile immediately.
-		The data has to be 3 bytes long.
-		The mouse will reject invalid data.
-Users:		http://roccat.sourceforge.net
-
-What:		/sys/bus/usb/devices/<busnum>-<devnum>:<config num>.<interface num>/<hid-bus>:<vendor-id>:<product-id>.<num>/savu/roccatsavu<minor>/sensor
-Date:		July 2012
-Contact:	Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
-Description:	The mouse has a Avago ADNS-3090 sensor.
-		This file allows reading and writing of the mouse sensors registers.
-		The data has to be 4 bytes long.
-Users:		http://roccat.sourceforge.net
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 152b006..57802a3 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -651,11 +651,11 @@ config HID_PRIMAX
 	HID standard.
 
 config HID_ROCCAT
-	tristate "Roccat device support"
+	tristate "Roccat Kone support"
 	depends on USB_HID
 	---help---
-	Support for Roccat devices.
-	Say Y here if you have a Roccat mouse or keyboard and want
+	Support for Roccat Kone mouse.
+	Say Y here if you have a Roccat Kone mouse and want
 	support for its special functionalities.
 
 config HID_SAITEK
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 6f19958..caf4872 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -73,10 +73,7 @@ hid-picolcd-$(CONFIG_DEBUG_FS)		+= hid-picolcd_debugfs.o
 
 obj-$(CONFIG_HID_PLANTRONICS)	+= hid-plantronics.o
 obj-$(CONFIG_HID_PRIMAX)	+= hid-primax.o
-obj-$(CONFIG_HID_ROCCAT)	+= hid-roccat.o hid-roccat-common.o \
-	hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \
-	hid-roccat-koneplus.o hid-roccat-konepure.o hid-roccat-kovaplus.o \
-	hid-roccat-lua.o hid-roccat-pyra.o hid-roccat-ryos.o hid-roccat-savu.o
+obj-$(CONFIG_HID_ROCCAT)	+= hid-roccat.o hid-roccat-common.o hid-roccat-kone.o
 obj-$(CONFIG_HID_RMI)		+= hid-rmi.o
 obj-$(CONFIG_HID_SAITEK)	+= hid-saitek.o
 obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 56ce8c2..e7f400f 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1908,22 +1908,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
 #if IS_ENABLED(CONFIG_HID_ROCCAT)
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKUFX) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONE) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPLUS) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEXTD) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_LUA) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_RYOS_MK) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_RYOS_MK_GLOW) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_RYOS_MK_PRO) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_SAVU) },
 #endif
 #if IS_ENABLED(CONFIG_HID_SAITEK)
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 9c47867..5c9a7bb 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -784,22 +784,7 @@
 #define USB_DEVICE_ID_REALTEK_READER	0x0152
 
 #define USB_VENDOR_ID_ROCCAT		0x1e7d
-#define USB_DEVICE_ID_ROCCAT_ARVO	0x30d4
-#define USB_DEVICE_ID_ROCCAT_ISKU	0x319c
-#define USB_DEVICE_ID_ROCCAT_ISKUFX	0x3264
 #define USB_DEVICE_ID_ROCCAT_KONE	0x2ced
-#define USB_DEVICE_ID_ROCCAT_KONEPLUS	0x2d51
-#define USB_DEVICE_ID_ROCCAT_KONEPURE	0x2dbe
-#define USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL	0x2db4
-#define USB_DEVICE_ID_ROCCAT_KONEXTD	0x2e22
-#define USB_DEVICE_ID_ROCCAT_KOVAPLUS	0x2d50
-#define USB_DEVICE_ID_ROCCAT_LUA	0x2c2e
-#define USB_DEVICE_ID_ROCCAT_PYRA_WIRED	0x2c24
-#define USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS	0x2cf6
-#define USB_DEVICE_ID_ROCCAT_RYOS_MK	0x3138
-#define USB_DEVICE_ID_ROCCAT_RYOS_MK_GLOW	0x31ce
-#define USB_DEVICE_ID_ROCCAT_RYOS_MK_PRO	0x3232
-#define USB_DEVICE_ID_ROCCAT_SAVU	0x2d5a
 
 #define USB_VENDOR_ID_SAITEK		0x06a3
 #define USB_DEVICE_ID_SAITEK_RUMBLEPAD	0xff17
diff --git a/drivers/hid/hid-roccat-arvo.c b/drivers/hid/hid-roccat-arvo.c
deleted file mode 100644
index 1948208..0000000
--- a/drivers/hid/hid-roccat-arvo.c
+++ /dev/null
@@ -1,460 +0,0 @@
-/*
- * Roccat Arvo driver for Linux
- *
- * Copyright (c) 2011 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-/*
- * Roccat Arvo is a gamer keyboard with 5 macro keys that can be configured in
- * 5 profiles.
- */
-
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-#include "hid-roccat-arvo.h"
-
-static struct class *arvo_class;
-
-static ssize_t arvo_sysfs_show_mode_key(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct arvo_device *arvo =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	struct usb_device *usb_dev =
-			interface_to_usbdev(to_usb_interface(dev->parent->parent));
-	struct arvo_mode_key temp_buf;
-	int retval;
-
-	mutex_lock(&arvo->arvo_lock);
-	retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_MODE_KEY,
-			&temp_buf, sizeof(struct arvo_mode_key));
-	mutex_unlock(&arvo->arvo_lock);
-	if (retval)
-		return retval;
-
-	return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.state);
-}
-
-static ssize_t arvo_sysfs_set_mode_key(struct device *dev,
-		struct device_attribute *attr, char const *buf, size_t size)
-{
-	struct arvo_device *arvo =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	struct usb_device *usb_dev =
-			interface_to_usbdev(to_usb_interface(dev->parent->parent));
-	struct arvo_mode_key temp_buf;
-	unsigned long state;
-	int retval;
-
-	retval = kstrtoul(buf, 10, &state);
-	if (retval)
-		return retval;
-
-	temp_buf.command = ARVO_COMMAND_MODE_KEY;
-	temp_buf.state = state;
-
-	mutex_lock(&arvo->arvo_lock);
-	retval = roccat_common2_send(usb_dev, ARVO_COMMAND_MODE_KEY,
-			&temp_buf, sizeof(struct arvo_mode_key));
-	mutex_unlock(&arvo->arvo_lock);
-	if (retval)
-		return retval;
-
-	return size;
-}
-static DEVICE_ATTR(mode_key, 0660,
-		   arvo_sysfs_show_mode_key, arvo_sysfs_set_mode_key);
-
-static ssize_t arvo_sysfs_show_key_mask(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct arvo_device *arvo =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	struct usb_device *usb_dev =
-			interface_to_usbdev(to_usb_interface(dev->parent->parent));
-	struct arvo_key_mask temp_buf;
-	int retval;
-
-	mutex_lock(&arvo->arvo_lock);
-	retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_KEY_MASK,
-			&temp_buf, sizeof(struct arvo_key_mask));
-	mutex_unlock(&arvo->arvo_lock);
-	if (retval)
-		return retval;
-
-	return snprintf(buf, PAGE_SIZE, "%d\n", temp_buf.key_mask);
-}
-
-static ssize_t arvo_sysfs_set_key_mask(struct device *dev,
-		struct device_attribute *attr, char const *buf, size_t size)
-{
-	struct arvo_device *arvo =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	struct usb_device *usb_dev =
-			interface_to_usbdev(to_usb_interface(dev->parent->parent));
-	struct arvo_key_mask temp_buf;
-	unsigned long key_mask;
-	int retval;
-
-	retval = kstrtoul(buf, 10, &key_mask);
-	if (retval)
-		return retval;
-
-	temp_buf.command = ARVO_COMMAND_KEY_MASK;
-	temp_buf.key_mask = key_mask;
-
-	mutex_lock(&arvo->arvo_lock);
-	retval = roccat_common2_send(usb_dev, ARVO_COMMAND_KEY_MASK,
-			&temp_buf, sizeof(struct arvo_key_mask));
-	mutex_unlock(&arvo->arvo_lock);
-	if (retval)
-		return retval;
-
-	return size;
-}
-static DEVICE_ATTR(key_mask, 0660,
-		   arvo_sysfs_show_key_mask, arvo_sysfs_set_key_mask);
-
-/* retval is 1-5 on success, < 0 on error */
-static int arvo_get_actual_profile(struct usb_device *usb_dev)
-{
-	struct arvo_actual_profile temp_buf;
-	int retval;
-
-	retval = roccat_common2_receive(usb_dev, ARVO_COMMAND_ACTUAL_PROFILE,
-			&temp_buf, sizeof(struct arvo_actual_profile));
-
-	if (retval)
-		return retval;
-
-	return temp_buf.actual_profile;
-}
-
-static ssize_t arvo_sysfs_show_actual_profile(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct arvo_device *arvo =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-
-	return snprintf(buf, PAGE_SIZE, "%d\n", arvo->actual_profile);
-}
-
-static ssize_t arvo_sysfs_set_actual_profile(struct device *dev,
-		struct device_attribute *attr, char const *buf, size_t size)
-{
-	struct arvo_device *arvo =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	struct usb_device *usb_dev =
-			interface_to_usbdev(to_usb_interface(dev->parent->parent));
-	struct arvo_actual_profile temp_buf;
-	unsigned long profile;
-	int retval;
-
-	retval = kstrtoul(buf, 10, &profile);
-	if (retval)
-		return retval;
-
-	if (profile < 1 || profile > 5)
-		return -EINVAL;
-
-	temp_buf.command = ARVO_COMMAND_ACTUAL_PROFILE;
-	temp_buf.actual_profile = profile;
-
-	mutex_lock(&arvo->arvo_lock);
-	retval = roccat_common2_send(usb_dev, ARVO_COMMAND_ACTUAL_PROFILE,
-			&temp_buf, sizeof(struct arvo_actual_profile));
-	if (!retval) {
-		arvo->actual_profile = profile;
-		retval = size;
-	}
-	mutex_unlock(&arvo->arvo_lock);
-	return retval;
-}
-static DEVICE_ATTR(actual_profile, 0660,
-		   arvo_sysfs_show_actual_profile,
-		   arvo_sysfs_set_actual_profile);
-
-static ssize_t arvo_sysfs_write(struct file *fp,
-		struct kobject *kobj, void const *buf,
-		loff_t off, size_t count, size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct arvo_device *arvo = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&arvo->arvo_lock);
-	retval = roccat_common2_send(usb_dev, command, buf, real_size);
-	mutex_unlock(&arvo->arvo_lock);
-
-	return (retval ? retval : real_size);
-}
-
-static ssize_t arvo_sysfs_read(struct file *fp,
-		struct kobject *kobj, void *buf, loff_t off,
-		size_t count, size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct arvo_device *arvo = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off >= real_size)
-		return 0;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&arvo->arvo_lock);
-	retval = roccat_common2_receive(usb_dev, command, buf, real_size);
-	mutex_unlock(&arvo->arvo_lock);
-
-	return (retval ? retval : real_size);
-}
-
-static ssize_t arvo_sysfs_write_button(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	return arvo_sysfs_write(fp, kobj, buf, off, count,
-			sizeof(struct arvo_button), ARVO_COMMAND_BUTTON);
-}
-static BIN_ATTR(button, 0220, NULL, arvo_sysfs_write_button,
-		sizeof(struct arvo_button));
-
-static ssize_t arvo_sysfs_read_info(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	return arvo_sysfs_read(fp, kobj, buf, off, count,
-			sizeof(struct arvo_info), ARVO_COMMAND_INFO);
-}
-static BIN_ATTR(info, 0440, arvo_sysfs_read_info, NULL,
-		sizeof(struct arvo_info));
-
-static struct attribute *arvo_attrs[] = {
-	&dev_attr_mode_key.attr,
-	&dev_attr_key_mask.attr,
-	&dev_attr_actual_profile.attr,
-	NULL,
-};
-
-static struct bin_attribute *arvo_bin_attributes[] = {
-	&bin_attr_button,
-	&bin_attr_info,
-	NULL,
-};
-
-static const struct attribute_group arvo_group = {
-	.attrs = arvo_attrs,
-	.bin_attrs = arvo_bin_attributes,
-};
-
-static const struct attribute_group *arvo_groups[] = {
-	&arvo_group,
-	NULL,
-};
-
-static int arvo_init_arvo_device_struct(struct usb_device *usb_dev,
-		struct arvo_device *arvo)
-{
-	int retval;
-
-	mutex_init(&arvo->arvo_lock);
-
-	retval = arvo_get_actual_profile(usb_dev);
-	if (retval < 0)
-		return retval;
-	arvo->actual_profile = retval;
-
-	return 0;
-}
-
-static int arvo_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct arvo_device *arvo;
-	int retval;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			== USB_INTERFACE_PROTOCOL_KEYBOARD) {
-		hid_set_drvdata(hdev, NULL);
-		return 0;
-	}
-
-	arvo = kzalloc(sizeof(*arvo), GFP_KERNEL);
-	if (!arvo) {
-		hid_err(hdev, "can't alloc device descriptor\n");
-		return -ENOMEM;
-	}
-	hid_set_drvdata(hdev, arvo);
-
-	retval = arvo_init_arvo_device_struct(usb_dev, arvo);
-	if (retval) {
-		hid_err(hdev, "couldn't init struct arvo_device\n");
-		goto exit_free;
-	}
-
-	retval = roccat_connect(arvo_class, hdev,
-			sizeof(struct arvo_roccat_report));
-	if (retval < 0) {
-		hid_err(hdev, "couldn't init char dev\n");
-	} else {
-		arvo->chrdev_minor = retval;
-		arvo->roccat_claimed = 1;
-	}
-
-	return 0;
-exit_free:
-	kfree(arvo);
-	return retval;
-}
-
-static void arvo_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct arvo_device *arvo;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			== USB_INTERFACE_PROTOCOL_KEYBOARD)
-		return;
-
-	arvo = hid_get_drvdata(hdev);
-	if (arvo->roccat_claimed)
-		roccat_disconnect(arvo->chrdev_minor);
-	kfree(arvo);
-}
-
-static int arvo_probe(struct hid_device *hdev,
-		const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = arvo_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install keyboard\n");
-		goto exit_stop;
-	}
-
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void arvo_remove(struct hid_device *hdev)
-{
-	arvo_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static void arvo_report_to_chrdev(struct arvo_device const *arvo,
-		u8 const *data)
-{
-	struct arvo_special_report const *special_report;
-	struct arvo_roccat_report roccat_report;
-
-	special_report = (struct arvo_special_report const *)data;
-
-	roccat_report.profile = arvo->actual_profile;
-	roccat_report.button = special_report->event &
-			ARVO_SPECIAL_REPORT_EVENT_MASK_BUTTON;
-	if ((special_report->event & ARVO_SPECIAL_REPORT_EVENT_MASK_ACTION) ==
-			ARVO_SPECIAL_REPORT_EVENT_ACTION_PRESS)
-		roccat_report.action = ARVO_ROCCAT_REPORT_ACTION_PRESS;
-	else
-		roccat_report.action = ARVO_ROCCAT_REPORT_ACTION_RELEASE;
-
-	roccat_report_event(arvo->chrdev_minor,
-			(uint8_t const *)&roccat_report);
-}
-
-static int arvo_raw_event(struct hid_device *hdev,
-		struct hid_report *report, u8 *data, int size)
-{
-	struct arvo_device *arvo = hid_get_drvdata(hdev);
-
-	if (size != 3)
-		return 0;
-
-	if (arvo && arvo->roccat_claimed)
-		arvo_report_to_chrdev(arvo, data);
-
-	return 0;
-}
-
-static const struct hid_device_id arvo_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, arvo_devices);
-
-static struct hid_driver arvo_driver = {
-	.name = "arvo",
-	.id_table = arvo_devices,
-	.probe = arvo_probe,
-	.remove = arvo_remove,
-	.raw_event = arvo_raw_event
-};
-
-static int __init arvo_init(void)
-{
-	int retval;
-
-	arvo_class = class_create(THIS_MODULE, "arvo");
-	if (IS_ERR(arvo_class))
-		return PTR_ERR(arvo_class);
-	arvo_class->dev_groups = arvo_groups;
-
-	retval = hid_register_driver(&arvo_driver);
-	if (retval)
-		class_destroy(arvo_class);
-	return retval;
-}
-
-static void __exit arvo_exit(void)
-{
-	hid_unregister_driver(&arvo_driver);
-	class_destroy(arvo_class);
-}
-
-module_init(arvo_init);
-module_exit(arvo_exit);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat Arvo driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-arvo.h b/drivers/hid/hid-roccat-arvo.h
deleted file mode 100644
index ce8415e..0000000
--- a/drivers/hid/hid-roccat-arvo.h
+++ /dev/null
@@ -1,85 +0,0 @@
-#ifndef __HID_ROCCAT_ARVO_H
-#define __HID_ROCCAT_ARVO_H
-
-/*
- * Copyright (c) 2011 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-#include <linux/types.h>
-
-struct arvo_mode_key { /* 2 bytes */
-	uint8_t command; /* ARVO_COMMAND_MODE_KEY */
-	uint8_t state;
-} __packed;
-
-struct arvo_button {
-	uint8_t unknown[24];
-} __packed;
-
-struct arvo_info {
-	uint8_t unknown[8];
-} __packed;
-
-struct arvo_key_mask { /* 2 bytes */
-	uint8_t command; /* ARVO_COMMAND_KEY_MASK */
-	uint8_t key_mask;
-} __packed;
-
-/* selected profile is persistent */
-struct arvo_actual_profile { /* 2 bytes */
-	uint8_t command; /* ARVO_COMMAND_ACTUAL_PROFILE */
-	uint8_t actual_profile;
-} __packed;
-
-enum arvo_commands {
-	ARVO_COMMAND_MODE_KEY = 0x3,
-	ARVO_COMMAND_BUTTON = 0x4,
-	ARVO_COMMAND_INFO = 0x5,
-	ARVO_COMMAND_KEY_MASK = 0x6,
-	ARVO_COMMAND_ACTUAL_PROFILE = 0x7,
-};
-
-struct arvo_special_report {
-	uint8_t unknown1; /* always 0x01 */
-	uint8_t event;
-	uint8_t unknown2; /* always 0x70 */
-} __packed;
-
-enum arvo_special_report_events {
-	ARVO_SPECIAL_REPORT_EVENT_ACTION_PRESS = 0x10,
-	ARVO_SPECIAL_REPORT_EVENT_ACTION_RELEASE = 0x0,
-};
-
-enum arvo_special_report_event_masks {
-	ARVO_SPECIAL_REPORT_EVENT_MASK_ACTION = 0xf0,
-	ARVO_SPECIAL_REPORT_EVENT_MASK_BUTTON = 0x0f,
-};
-
-struct arvo_roccat_report {
-	uint8_t profile;
-	uint8_t button;
-	uint8_t action;
-} __packed;
-
-enum arvo_roccat_report_action {
-	ARVO_ROCCAT_REPORT_ACTION_RELEASE = 0,
-	ARVO_ROCCAT_REPORT_ACTION_PRESS = 1,
-};
-
-struct arvo_device {
-	int roccat_claimed;
-	int chrdev_minor;
-
-	struct mutex arvo_lock;
-
-	int actual_profile;
-};
-
-#endif
diff --git a/drivers/hid/hid-roccat-isku.c b/drivers/hid/hid-roccat-isku.c
deleted file mode 100644
index bc62ed9..0000000
--- a/drivers/hid/hid-roccat-isku.c
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- * Roccat Isku driver for Linux
- *
- * Copyright (c) 2011 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-/*
- * Roccat Isku is a gamer keyboard with macro keys that can be configured in
- * 5 profiles.
- */
-
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-#include "hid-roccat-isku.h"
-
-static struct class *isku_class;
-
-static void isku_profile_activated(struct isku_device *isku, uint new_profile)
-{
-	isku->actual_profile = new_profile;
-}
-
-static int isku_receive(struct usb_device *usb_dev, uint command,
-		void *buf, uint size)
-{
-	return roccat_common2_receive(usb_dev, command, buf, size);
-}
-
-static int isku_get_actual_profile(struct usb_device *usb_dev)
-{
-	struct isku_actual_profile buf;
-	int retval;
-
-	retval = isku_receive(usb_dev, ISKU_COMMAND_ACTUAL_PROFILE,
-			&buf, sizeof(struct isku_actual_profile));
-	return retval ? retval : buf.actual_profile;
-}
-
-static int isku_set_actual_profile(struct usb_device *usb_dev, int new_profile)
-{
-	struct isku_actual_profile buf;
-
-	buf.command = ISKU_COMMAND_ACTUAL_PROFILE;
-	buf.size = sizeof(struct isku_actual_profile);
-	buf.actual_profile = new_profile;
-	return roccat_common2_send_with_status(usb_dev,
-			ISKU_COMMAND_ACTUAL_PROFILE, &buf,
-			sizeof(struct isku_actual_profile));
-}
-
-static ssize_t isku_sysfs_show_actual_profile(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct isku_device *isku =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", isku->actual_profile);
-}
-
-static ssize_t isku_sysfs_set_actual_profile(struct device *dev,
-		struct device_attribute *attr, char const *buf, size_t size)
-{
-	struct isku_device *isku;
-	struct usb_device *usb_dev;
-	unsigned long profile;
-	int retval;
-	struct isku_roccat_report roccat_report;
-
-	dev = dev->parent->parent;
-	isku = hid_get_drvdata(dev_get_drvdata(dev));
-	usb_dev = interface_to_usbdev(to_usb_interface(dev));
-
-	retval = kstrtoul(buf, 10, &profile);
-	if (retval)
-		return retval;
-
-	if (profile > 4)
-		return -EINVAL;
-
-	mutex_lock(&isku->isku_lock);
-
-	retval = isku_set_actual_profile(usb_dev, profile);
-	if (retval) {
-		mutex_unlock(&isku->isku_lock);
-		return retval;
-	}
-
-	isku_profile_activated(isku, profile);
-
-	roccat_report.event = ISKU_REPORT_BUTTON_EVENT_PROFILE;
-	roccat_report.data1 = profile + 1;
-	roccat_report.data2 = 0;
-	roccat_report.profile = profile + 1;
-	roccat_report_event(isku->chrdev_minor, (uint8_t const *)&roccat_report);
-
-	mutex_unlock(&isku->isku_lock);
-
-	return size;
-}
-static DEVICE_ATTR(actual_profile, 0660, isku_sysfs_show_actual_profile,
-		   isku_sysfs_set_actual_profile);
-
-static struct attribute *isku_attrs[] = {
-	&dev_attr_actual_profile.attr,
-	NULL,
-};
-
-static ssize_t isku_sysfs_read(struct file *fp, struct kobject *kobj,
-		char *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct isku_device *isku = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off >= real_size)
-		return 0;
-
-	if (off != 0 || count > real_size)
-		return -EINVAL;
-
-	mutex_lock(&isku->isku_lock);
-	retval = isku_receive(usb_dev, command, buf, count);
-	mutex_unlock(&isku->isku_lock);
-
-	return retval ? retval : count;
-}
-
-static ssize_t isku_sysfs_write(struct file *fp, struct kobject *kobj,
-		void const *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct isku_device *isku = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off != 0 || count > real_size)
-		return -EINVAL;
-
-	mutex_lock(&isku->isku_lock);
-	retval = roccat_common2_send_with_status(usb_dev, command,
-			(void *)buf, count);
-	mutex_unlock(&isku->isku_lock);
-
-	return retval ? retval : count;
-}
-
-#define ISKU_SYSFS_W(thingy, THINGY) \
-static ssize_t isku_sysfs_write_ ## thingy(struct file *fp, struct kobject *kobj, \
-		struct bin_attribute *attr, char *buf, \
-		loff_t off, size_t count) \
-{ \
-	return isku_sysfs_write(fp, kobj, buf, off, count, \
-			ISKU_SIZE_ ## THINGY, ISKU_COMMAND_ ## THINGY); \
-}
-
-#define ISKU_SYSFS_R(thingy, THINGY) \
-static ssize_t isku_sysfs_read_ ## thingy(struct file *fp, struct kobject *kobj, \
-		struct bin_attribute *attr, char *buf, \
-		loff_t off, size_t count) \
-{ \
-	return isku_sysfs_read(fp, kobj, buf, off, count, \
-			ISKU_SIZE_ ## THINGY, ISKU_COMMAND_ ## THINGY); \
-}
-
-#define ISKU_SYSFS_RW(thingy, THINGY) \
-ISKU_SYSFS_R(thingy, THINGY) \
-ISKU_SYSFS_W(thingy, THINGY)
-
-#define ISKU_BIN_ATTR_RW(thingy, THINGY) \
-ISKU_SYSFS_RW(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0660 }, \
-	.size = ISKU_SIZE_ ## THINGY, \
-	.read = isku_sysfs_read_ ## thingy, \
-	.write = isku_sysfs_write_ ## thingy \
-}
-
-#define ISKU_BIN_ATTR_R(thingy, THINGY) \
-ISKU_SYSFS_R(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0440 }, \
-	.size = ISKU_SIZE_ ## THINGY, \
-	.read = isku_sysfs_read_ ## thingy, \
-}
-
-#define ISKU_BIN_ATTR_W(thingy, THINGY) \
-ISKU_SYSFS_W(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0220 }, \
-	.size = ISKU_SIZE_ ## THINGY, \
-	.write = isku_sysfs_write_ ## thingy \
-}
-
-ISKU_BIN_ATTR_RW(macro, MACRO);
-ISKU_BIN_ATTR_RW(keys_function, KEYS_FUNCTION);
-ISKU_BIN_ATTR_RW(keys_easyzone, KEYS_EASYZONE);
-ISKU_BIN_ATTR_RW(keys_media, KEYS_MEDIA);
-ISKU_BIN_ATTR_RW(keys_thumbster, KEYS_THUMBSTER);
-ISKU_BIN_ATTR_RW(keys_macro, KEYS_MACRO);
-ISKU_BIN_ATTR_RW(keys_capslock, KEYS_CAPSLOCK);
-ISKU_BIN_ATTR_RW(light, LIGHT);
-ISKU_BIN_ATTR_RW(key_mask, KEY_MASK);
-ISKU_BIN_ATTR_RW(last_set, LAST_SET);
-ISKU_BIN_ATTR_W(talk, TALK);
-ISKU_BIN_ATTR_W(talkfx, TALKFX);
-ISKU_BIN_ATTR_W(control, CONTROL);
-ISKU_BIN_ATTR_W(reset, RESET);
-ISKU_BIN_ATTR_R(info, INFO);
-
-static struct bin_attribute *isku_bin_attributes[] = {
-	&bin_attr_macro,
-	&bin_attr_keys_function,
-	&bin_attr_keys_easyzone,
-	&bin_attr_keys_media,
-	&bin_attr_keys_thumbster,
-	&bin_attr_keys_macro,
-	&bin_attr_keys_capslock,
-	&bin_attr_light,
-	&bin_attr_key_mask,
-	&bin_attr_last_set,
-	&bin_attr_talk,
-	&bin_attr_talkfx,
-	&bin_attr_control,
-	&bin_attr_reset,
-	&bin_attr_info,
-	NULL,
-};
-
-static const struct attribute_group isku_group = {
-	.attrs = isku_attrs,
-	.bin_attrs = isku_bin_attributes,
-};
-
-static const struct attribute_group *isku_groups[] = {
-	&isku_group,
-	NULL,
-};
-
-static int isku_init_isku_device_struct(struct usb_device *usb_dev,
-		struct isku_device *isku)
-{
-	int retval;
-
-	mutex_init(&isku->isku_lock);
-
-	retval = isku_get_actual_profile(usb_dev);
-	if (retval < 0)
-		return retval;
-	isku_profile_activated(isku, retval);
-
-	return 0;
-}
-
-static int isku_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct isku_device *isku;
-	int retval;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= ISKU_USB_INTERFACE_PROTOCOL) {
-		hid_set_drvdata(hdev, NULL);
-		return 0;
-	}
-
-	isku = kzalloc(sizeof(*isku), GFP_KERNEL);
-	if (!isku) {
-		hid_err(hdev, "can't alloc device descriptor\n");
-		return -ENOMEM;
-	}
-	hid_set_drvdata(hdev, isku);
-
-	retval = isku_init_isku_device_struct(usb_dev, isku);
-	if (retval) {
-		hid_err(hdev, "couldn't init struct isku_device\n");
-		goto exit_free;
-	}
-
-	retval = roccat_connect(isku_class, hdev,
-			sizeof(struct isku_roccat_report));
-	if (retval < 0) {
-		hid_err(hdev, "couldn't init char dev\n");
-	} else {
-		isku->chrdev_minor = retval;
-		isku->roccat_claimed = 1;
-	}
-
-	return 0;
-exit_free:
-	kfree(isku);
-	return retval;
-}
-
-static void isku_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct isku_device *isku;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= ISKU_USB_INTERFACE_PROTOCOL)
-		return;
-
-	isku = hid_get_drvdata(hdev);
-	if (isku->roccat_claimed)
-		roccat_disconnect(isku->chrdev_minor);
-	kfree(isku);
-}
-
-static int isku_probe(struct hid_device *hdev,
-		const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = isku_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install keyboard\n");
-		goto exit_stop;
-	}
-
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void isku_remove(struct hid_device *hdev)
-{
-	isku_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static void isku_keep_values_up_to_date(struct isku_device *isku,
-		u8 const *data)
-{
-	struct isku_report_button const *button_report;
-
-	switch (data[0]) {
-	case ISKU_REPORT_NUMBER_BUTTON:
-		button_report = (struct isku_report_button const *)data;
-		switch (button_report->event) {
-		case ISKU_REPORT_BUTTON_EVENT_PROFILE:
-			isku_profile_activated(isku, button_report->data1 - 1);
-			break;
-		}
-		break;
-	}
-}
-
-static void isku_report_to_chrdev(struct isku_device const *isku,
-		u8 const *data)
-{
-	struct isku_roccat_report roccat_report;
-	struct isku_report_button const *button_report;
-
-	if (data[0] != ISKU_REPORT_NUMBER_BUTTON)
-		return;
-
-	button_report = (struct isku_report_button const *)data;
-
-	roccat_report.event = button_report->event;
-	roccat_report.data1 = button_report->data1;
-	roccat_report.data2 = button_report->data2;
-	roccat_report.profile = isku->actual_profile + 1;
-	roccat_report_event(isku->chrdev_minor,
-			(uint8_t const *)&roccat_report);
-}
-
-static int isku_raw_event(struct hid_device *hdev,
-		struct hid_report *report, u8 *data, int size)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct isku_device *isku = hid_get_drvdata(hdev);
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= ISKU_USB_INTERFACE_PROTOCOL)
-		return 0;
-
-	if (isku == NULL)
-		return 0;
-
-	isku_keep_values_up_to_date(isku, data);
-
-	if (isku->roccat_claimed)
-		isku_report_to_chrdev(isku, data);
-
-	return 0;
-}
-
-static const struct hid_device_id isku_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKUFX) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, isku_devices);
-
-static struct hid_driver isku_driver = {
-		.name = "isku",
-		.id_table = isku_devices,
-		.probe = isku_probe,
-		.remove = isku_remove,
-		.raw_event = isku_raw_event
-};
-
-static int __init isku_init(void)
-{
-	int retval;
-	isku_class = class_create(THIS_MODULE, "isku");
-	if (IS_ERR(isku_class))
-		return PTR_ERR(isku_class);
-	isku_class->dev_groups = isku_groups;
-
-	retval = hid_register_driver(&isku_driver);
-	if (retval)
-		class_destroy(isku_class);
-	return retval;
-}
-
-static void __exit isku_exit(void)
-{
-	hid_unregister_driver(&isku_driver);
-	class_destroy(isku_class);
-}
-
-module_init(isku_init);
-module_exit(isku_exit);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat Isku/FX driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-isku.h b/drivers/hid/hid-roccat-isku.h
deleted file mode 100644
index 5305686..0000000
--- a/drivers/hid/hid-roccat-isku.h
+++ /dev/null
@@ -1,100 +0,0 @@
-#ifndef __HID_ROCCAT_ISKU_H
-#define __HID_ROCCAT_ISKU_H
-
-/*
- * Copyright (c) 2011 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-#include <linux/types.h>
-
-enum {
-	ISKU_SIZE_CONTROL = 0x03,
-	ISKU_SIZE_INFO = 0x06,
-	ISKU_SIZE_KEY_MASK = 0x06,
-	ISKU_SIZE_KEYS_FUNCTION = 0x29,
-	ISKU_SIZE_KEYS_EASYZONE = 0x41,
-	ISKU_SIZE_KEYS_MEDIA = 0x1d,
-	ISKU_SIZE_KEYS_THUMBSTER = 0x17,
-	ISKU_SIZE_KEYS_MACRO = 0x23,
-	ISKU_SIZE_KEYS_CAPSLOCK = 0x06,
-	ISKU_SIZE_LAST_SET = 0x14,
-	ISKU_SIZE_LIGHT = 0x10,
-	ISKU_SIZE_MACRO = 0x823,
-	ISKU_SIZE_RESET = 0x03,
-	ISKU_SIZE_TALK = 0x10,
-	ISKU_SIZE_TALKFX = 0x10,
-};
-
-enum {
-	ISKU_PROFILE_NUM = 5,
-	ISKU_USB_INTERFACE_PROTOCOL = 0,
-};
-
-struct isku_actual_profile {
-	uint8_t command; /* ISKU_COMMAND_ACTUAL_PROFILE */
-	uint8_t size; /* always 3 */
-	uint8_t actual_profile;
-} __packed;
-
-enum isku_commands {
-	ISKU_COMMAND_CONTROL = 0x4,
-	ISKU_COMMAND_ACTUAL_PROFILE = 0x5,
-	ISKU_COMMAND_KEY_MASK = 0x7,
-	ISKU_COMMAND_KEYS_FUNCTION = 0x8,
-	ISKU_COMMAND_KEYS_EASYZONE = 0x9,
-	ISKU_COMMAND_KEYS_MEDIA = 0xa,
-	ISKU_COMMAND_KEYS_THUMBSTER = 0xb,
-	ISKU_COMMAND_KEYS_MACRO = 0xd,
-	ISKU_COMMAND_MACRO = 0xe,
-	ISKU_COMMAND_INFO = 0xf,
-	ISKU_COMMAND_LIGHT = 0x10,
-	ISKU_COMMAND_RESET = 0x11,
-	ISKU_COMMAND_KEYS_CAPSLOCK = 0x13,
-	ISKU_COMMAND_LAST_SET = 0x14,
-	ISKU_COMMAND_15 = 0x15,
-	ISKU_COMMAND_TALK = 0x16,
-	ISKU_COMMAND_TALKFX = 0x17,
-	ISKU_COMMAND_FIRMWARE_WRITE = 0x1b,
-	ISKU_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
-};
-
-struct isku_report_button {
-	uint8_t number; /* ISKU_REPORT_NUMBER_BUTTON */
-	uint8_t zero;
-	uint8_t event;
-	uint8_t data1;
-	uint8_t data2;
-};
-
-enum isku_report_numbers {
-	ISKU_REPORT_NUMBER_BUTTON = 3,
-};
-
-enum isku_report_button_events {
-	ISKU_REPORT_BUTTON_EVENT_PROFILE = 0x2,
-};
-
-struct isku_roccat_report {
-	uint8_t event;
-	uint8_t data1;
-	uint8_t data2;
-	uint8_t profile;
-} __packed;
-
-struct isku_device {
-	int roccat_claimed;
-	int chrdev_minor;
-
-	struct mutex isku_lock;
-
-	int actual_profile;
-};
-
-#endif
diff --git a/drivers/hid/hid-roccat-koneplus.c b/drivers/hid/hid-roccat-koneplus.c
deleted file mode 100644
index 5e99fcd..0000000
--- a/drivers/hid/hid-roccat-koneplus.c
+++ /dev/null
@@ -1,578 +0,0 @@
-/*
- * Roccat Kone[+] driver for Linux
- *
- * Copyright (c) 2010 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-/*
- * Roccat Kone[+] is an updated/improved version of the Kone with more memory
- * and functionality and without the non-standard behaviours the Kone had.
- * KoneXTD has same capabilities but updated sensor.
- */
-
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-#include "hid-roccat-koneplus.h"
-
-static uint profile_numbers[5] = {0, 1, 2, 3, 4};
-
-static struct class *koneplus_class;
-
-static void koneplus_profile_activated(struct koneplus_device *koneplus,
-		uint new_profile)
-{
-	koneplus->actual_profile = new_profile;
-}
-
-static int koneplus_send_control(struct usb_device *usb_dev, uint value,
-		enum koneplus_control_requests request)
-{
-	struct roccat_common2_control control;
-
-	if ((request == KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS ||
-			request == KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS) &&
-			value > 4)
-		return -EINVAL;
-
-	control.command = ROCCAT_COMMON_COMMAND_CONTROL;
-	control.value = value;
-	control.request = request;
-
-	return roccat_common2_send_with_status(usb_dev,
-			ROCCAT_COMMON_COMMAND_CONTROL,
-			&control, sizeof(struct roccat_common2_control));
-}
-
-
-/* retval is 0-4 on success, < 0 on error */
-static int koneplus_get_actual_profile(struct usb_device *usb_dev)
-{
-	struct koneplus_actual_profile buf;
-	int retval;
-
-	retval = roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_ACTUAL_PROFILE,
-			&buf, KONEPLUS_SIZE_ACTUAL_PROFILE);
-
-	return retval ? retval : buf.actual_profile;
-}
-
-static int koneplus_set_actual_profile(struct usb_device *usb_dev,
-		int new_profile)
-{
-	struct koneplus_actual_profile buf;
-
-	buf.command = KONEPLUS_COMMAND_ACTUAL_PROFILE;
-	buf.size = KONEPLUS_SIZE_ACTUAL_PROFILE;
-	buf.actual_profile = new_profile;
-
-	return roccat_common2_send_with_status(usb_dev,
-			KONEPLUS_COMMAND_ACTUAL_PROFILE,
-			&buf, KONEPLUS_SIZE_ACTUAL_PROFILE);
-}
-
-static ssize_t koneplus_sysfs_read(struct file *fp, struct kobject *kobj,
-		char *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off >= real_size)
-		return 0;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&koneplus->koneplus_lock);
-	retval = roccat_common2_receive(usb_dev, command, buf, real_size);
-	mutex_unlock(&koneplus->koneplus_lock);
-
-	if (retval)
-		return retval;
-
-	return real_size;
-}
-
-static ssize_t koneplus_sysfs_write(struct file *fp, struct kobject *kobj,
-		void const *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct koneplus_device *koneplus = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&koneplus->koneplus_lock);
-	retval = roccat_common2_send_with_status(usb_dev, command,
-			buf, real_size);
-	mutex_unlock(&koneplus->koneplus_lock);
-
-	if (retval)
-		return retval;
-
-	return real_size;
-}
-
-#define KONEPLUS_SYSFS_W(thingy, THINGY) \
-static ssize_t koneplus_sysfs_write_ ## thingy(struct file *fp, \
-		struct kobject *kobj, struct bin_attribute *attr, char *buf, \
-		loff_t off, size_t count) \
-{ \
-	return koneplus_sysfs_write(fp, kobj, buf, off, count, \
-			KONEPLUS_SIZE_ ## THINGY, KONEPLUS_COMMAND_ ## THINGY); \
-}
-
-#define KONEPLUS_SYSFS_R(thingy, THINGY) \
-static ssize_t koneplus_sysfs_read_ ## thingy(struct file *fp, \
-		struct kobject *kobj, struct bin_attribute *attr, char *buf, \
-		loff_t off, size_t count) \
-{ \
-	return koneplus_sysfs_read(fp, kobj, buf, off, count, \
-			KONEPLUS_SIZE_ ## THINGY, KONEPLUS_COMMAND_ ## THINGY); \
-}
-
-#define KONEPLUS_SYSFS_RW(thingy, THINGY) \
-KONEPLUS_SYSFS_W(thingy, THINGY) \
-KONEPLUS_SYSFS_R(thingy, THINGY)
-
-#define KONEPLUS_BIN_ATTRIBUTE_RW(thingy, THINGY) \
-KONEPLUS_SYSFS_RW(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0660 }, \
-	.size = KONEPLUS_SIZE_ ## THINGY, \
-	.read = koneplus_sysfs_read_ ## thingy, \
-	.write = koneplus_sysfs_write_ ## thingy \
-}
-
-#define KONEPLUS_BIN_ATTRIBUTE_R(thingy, THINGY) \
-KONEPLUS_SYSFS_R(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0440 }, \
-	.size = KONEPLUS_SIZE_ ## THINGY, \
-	.read = koneplus_sysfs_read_ ## thingy, \
-}
-
-#define KONEPLUS_BIN_ATTRIBUTE_W(thingy, THINGY) \
-KONEPLUS_SYSFS_W(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0220 }, \
-	.size = KONEPLUS_SIZE_ ## THINGY, \
-	.write = koneplus_sysfs_write_ ## thingy \
-}
-KONEPLUS_BIN_ATTRIBUTE_W(control, CONTROL);
-KONEPLUS_BIN_ATTRIBUTE_W(talk, TALK);
-KONEPLUS_BIN_ATTRIBUTE_W(macro, MACRO);
-KONEPLUS_BIN_ATTRIBUTE_R(tcu_image, TCU_IMAGE);
-KONEPLUS_BIN_ATTRIBUTE_RW(info, INFO);
-KONEPLUS_BIN_ATTRIBUTE_RW(sensor, SENSOR);
-KONEPLUS_BIN_ATTRIBUTE_RW(tcu, TCU);
-KONEPLUS_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS);
-KONEPLUS_BIN_ATTRIBUTE_RW(profile_buttons, PROFILE_BUTTONS);
-
-static ssize_t koneplus_sysfs_read_profilex_settings(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	ssize_t retval;
-
-	retval = koneplus_send_control(usb_dev, *(uint *)(attr->private),
-			KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS);
-	if (retval)
-		return retval;
-
-	return koneplus_sysfs_read(fp, kobj, buf, off, count,
-			KONEPLUS_SIZE_PROFILE_SETTINGS,
-			KONEPLUS_COMMAND_PROFILE_SETTINGS);
-}
-
-static ssize_t koneplus_sysfs_read_profilex_buttons(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	ssize_t retval;
-
-	retval = koneplus_send_control(usb_dev, *(uint *)(attr->private),
-			KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS);
-	if (retval)
-		return retval;
-
-	return koneplus_sysfs_read(fp, kobj, buf, off, count,
-			KONEPLUS_SIZE_PROFILE_BUTTONS,
-			KONEPLUS_COMMAND_PROFILE_BUTTONS);
-}
-
-#define PROFILE_ATTR(number)						\
-static struct bin_attribute bin_attr_profile##number##_settings = {	\
-	.attr = { .name = "profile" #number "_settings", .mode = 0440 },	\
-	.size = KONEPLUS_SIZE_PROFILE_SETTINGS,				\
-	.read = koneplus_sysfs_read_profilex_settings,			\
-	.private = &profile_numbers[number-1],				\
-};									\
-static struct bin_attribute bin_attr_profile##number##_buttons = {	\
-	.attr = { .name = "profile" #number "_buttons", .mode = 0440 },	\
-	.size = KONEPLUS_SIZE_PROFILE_BUTTONS,				\
-	.read = koneplus_sysfs_read_profilex_buttons,			\
-	.private = &profile_numbers[number-1],				\
-};
-PROFILE_ATTR(1);
-PROFILE_ATTR(2);
-PROFILE_ATTR(3);
-PROFILE_ATTR(4);
-PROFILE_ATTR(5);
-
-static ssize_t koneplus_sysfs_show_actual_profile(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct koneplus_device *koneplus =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", koneplus->actual_profile);
-}
-
-static ssize_t koneplus_sysfs_set_actual_profile(struct device *dev,
-		struct device_attribute *attr, char const *buf, size_t size)
-{
-	struct koneplus_device *koneplus;
-	struct usb_device *usb_dev;
-	unsigned long profile;
-	int retval;
-	struct koneplus_roccat_report roccat_report;
-
-	dev = dev->parent->parent;
-	koneplus = hid_get_drvdata(dev_get_drvdata(dev));
-	usb_dev = interface_to_usbdev(to_usb_interface(dev));
-
-	retval = kstrtoul(buf, 10, &profile);
-	if (retval)
-		return retval;
-
-	if (profile > 4)
-		return -EINVAL;
-
-	mutex_lock(&koneplus->koneplus_lock);
-
-	retval = koneplus_set_actual_profile(usb_dev, profile);
-	if (retval) {
-		mutex_unlock(&koneplus->koneplus_lock);
-		return retval;
-	}
-
-	koneplus_profile_activated(koneplus, profile);
-
-	roccat_report.type = KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE;
-	roccat_report.data1 = profile + 1;
-	roccat_report.data2 = 0;
-	roccat_report.profile = profile + 1;
-	roccat_report_event(koneplus->chrdev_minor,
-			(uint8_t const *)&roccat_report);
-
-	mutex_unlock(&koneplus->koneplus_lock);
-
-	return size;
-}
-static DEVICE_ATTR(actual_profile, 0660,
-		   koneplus_sysfs_show_actual_profile,
-		   koneplus_sysfs_set_actual_profile);
-static DEVICE_ATTR(startup_profile, 0660,
-		   koneplus_sysfs_show_actual_profile,
-		   koneplus_sysfs_set_actual_profile);
-
-static ssize_t koneplus_sysfs_show_firmware_version(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct koneplus_device *koneplus;
-	struct usb_device *usb_dev;
-	struct koneplus_info info;
-
-	dev = dev->parent->parent;
-	koneplus = hid_get_drvdata(dev_get_drvdata(dev));
-	usb_dev = interface_to_usbdev(to_usb_interface(dev));
-
-	mutex_lock(&koneplus->koneplus_lock);
-	roccat_common2_receive(usb_dev, KONEPLUS_COMMAND_INFO,
-			&info, KONEPLUS_SIZE_INFO);
-	mutex_unlock(&koneplus->koneplus_lock);
-
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
-}
-static DEVICE_ATTR(firmware_version, 0440,
-		   koneplus_sysfs_show_firmware_version, NULL);
-
-static struct attribute *koneplus_attrs[] = {
-	&dev_attr_actual_profile.attr,
-	&dev_attr_startup_profile.attr,
-	&dev_attr_firmware_version.attr,
-	NULL,
-};
-
-static struct bin_attribute *koneplus_bin_attributes[] = {
-	&bin_attr_control,
-	&bin_attr_talk,
-	&bin_attr_macro,
-	&bin_attr_tcu_image,
-	&bin_attr_info,
-	&bin_attr_sensor,
-	&bin_attr_tcu,
-	&bin_attr_profile_settings,
-	&bin_attr_profile_buttons,
-	&bin_attr_profile1_settings,
-	&bin_attr_profile2_settings,
-	&bin_attr_profile3_settings,
-	&bin_attr_profile4_settings,
-	&bin_attr_profile5_settings,
-	&bin_attr_profile1_buttons,
-	&bin_attr_profile2_buttons,
-	&bin_attr_profile3_buttons,
-	&bin_attr_profile4_buttons,
-	&bin_attr_profile5_buttons,
-	NULL,
-};
-
-static const struct attribute_group koneplus_group = {
-	.attrs = koneplus_attrs,
-	.bin_attrs = koneplus_bin_attributes,
-};
-
-static const struct attribute_group *koneplus_groups[] = {
-	&koneplus_group,
-	NULL,
-};
-
-static int koneplus_init_koneplus_device_struct(struct usb_device *usb_dev,
-		struct koneplus_device *koneplus)
-{
-	int retval;
-
-	mutex_init(&koneplus->koneplus_lock);
-
-	retval = koneplus_get_actual_profile(usb_dev);
-	if (retval < 0)
-		return retval;
-	koneplus_profile_activated(koneplus, retval);
-
-	return 0;
-}
-
-static int koneplus_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct koneplus_device *koneplus;
-	int retval;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			== USB_INTERFACE_PROTOCOL_MOUSE) {
-
-		koneplus = kzalloc(sizeof(*koneplus), GFP_KERNEL);
-		if (!koneplus) {
-			hid_err(hdev, "can't alloc device descriptor\n");
-			return -ENOMEM;
-		}
-		hid_set_drvdata(hdev, koneplus);
-
-		retval = koneplus_init_koneplus_device_struct(usb_dev, koneplus);
-		if (retval) {
-			hid_err(hdev, "couldn't init struct koneplus_device\n");
-			goto exit_free;
-		}
-
-		retval = roccat_connect(koneplus_class, hdev,
-				sizeof(struct koneplus_roccat_report));
-		if (retval < 0) {
-			hid_err(hdev, "couldn't init char dev\n");
-		} else {
-			koneplus->chrdev_minor = retval;
-			koneplus->roccat_claimed = 1;
-		}
-	} else {
-		hid_set_drvdata(hdev, NULL);
-	}
-
-	return 0;
-exit_free:
-	kfree(koneplus);
-	return retval;
-}
-
-static void koneplus_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct koneplus_device *koneplus;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			== USB_INTERFACE_PROTOCOL_MOUSE) {
-		koneplus = hid_get_drvdata(hdev);
-		if (koneplus->roccat_claimed)
-			roccat_disconnect(koneplus->chrdev_minor);
-		kfree(koneplus);
-	}
-}
-
-static int koneplus_probe(struct hid_device *hdev,
-		const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = koneplus_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install mouse\n");
-		goto exit_stop;
-	}
-
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void koneplus_remove(struct hid_device *hdev)
-{
-	koneplus_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static void koneplus_keep_values_up_to_date(struct koneplus_device *koneplus,
-		u8 const *data)
-{
-	struct koneplus_mouse_report_button const *button_report;
-
-	switch (data[0]) {
-	case KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON:
-		button_report = (struct koneplus_mouse_report_button const *)data;
-		switch (button_report->type) {
-		case KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE:
-			koneplus_profile_activated(koneplus, button_report->data1 - 1);
-			break;
-		}
-		break;
-	}
-}
-
-static void koneplus_report_to_chrdev(struct koneplus_device const *koneplus,
-		u8 const *data)
-{
-	struct koneplus_roccat_report roccat_report;
-	struct koneplus_mouse_report_button const *button_report;
-
-	if (data[0] != KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON)
-		return;
-
-	button_report = (struct koneplus_mouse_report_button const *)data;
-
-	if ((button_report->type == KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH ||
-			button_report->type == KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER) &&
-			button_report->data2 != KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS)
-		return;
-
-	roccat_report.type = button_report->type;
-	roccat_report.data1 = button_report->data1;
-	roccat_report.data2 = button_report->data2;
-	roccat_report.profile = koneplus->actual_profile + 1;
-	roccat_report_event(koneplus->chrdev_minor,
-			(uint8_t const *)&roccat_report);
-}
-
-static int koneplus_raw_event(struct hid_device *hdev,
-		struct hid_report *report, u8 *data, int size)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct koneplus_device *koneplus = hid_get_drvdata(hdev);
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE)
-		return 0;
-
-	if (koneplus == NULL)
-		return 0;
-
-	koneplus_keep_values_up_to_date(koneplus, data);
-
-	if (koneplus->roccat_claimed)
-		koneplus_report_to_chrdev(koneplus, data);
-
-	return 0;
-}
-
-static const struct hid_device_id koneplus_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPLUS) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEXTD) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, koneplus_devices);
-
-static struct hid_driver koneplus_driver = {
-		.name = "koneplus",
-		.id_table = koneplus_devices,
-		.probe = koneplus_probe,
-		.remove = koneplus_remove,
-		.raw_event = koneplus_raw_event
-};
-
-static int __init koneplus_init(void)
-{
-	int retval;
-
-	/* class name has to be same as driver name */
-	koneplus_class = class_create(THIS_MODULE, "koneplus");
-	if (IS_ERR(koneplus_class))
-		return PTR_ERR(koneplus_class);
-	koneplus_class->dev_groups = koneplus_groups;
-
-	retval = hid_register_driver(&koneplus_driver);
-	if (retval)
-		class_destroy(koneplus_class);
-	return retval;
-}
-
-static void __exit koneplus_exit(void)
-{
-	hid_unregister_driver(&koneplus_driver);
-	class_destroy(koneplus_class);
-}
-
-module_init(koneplus_init);
-module_exit(koneplus_exit);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat Kone[+]/XTD driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-koneplus.h b/drivers/hid/hid-roccat-koneplus.h
deleted file mode 100644
index af7f57e..0000000
--- a/drivers/hid/hid-roccat-koneplus.h
+++ /dev/null
@@ -1,125 +0,0 @@
-#ifndef __HID_ROCCAT_KONEPLUS_H
-#define __HID_ROCCAT_KONEPLUS_H
-
-/*
- * Copyright (c) 2010 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-#include <linux/types.h>
-
-enum {
-	KONEPLUS_SIZE_ACTUAL_PROFILE = 0x03,
-	KONEPLUS_SIZE_CONTROL = 0x03,
-	KONEPLUS_SIZE_FIRMWARE_WRITE = 0x0402,
-	KONEPLUS_SIZE_INFO = 0x06,
-	KONEPLUS_SIZE_MACRO = 0x0822,
-	KONEPLUS_SIZE_PROFILE_SETTINGS = 0x2b,
-	KONEPLUS_SIZE_PROFILE_BUTTONS = 0x4d,
-	KONEPLUS_SIZE_SENSOR = 0x06,
-	KONEPLUS_SIZE_TALK = 0x10,
-	KONEPLUS_SIZE_TCU = 0x04,
-	KONEPLUS_SIZE_TCU_IMAGE = 0x0404,
-};
-
-enum koneplus_control_requests {
-	KONEPLUS_CONTROL_REQUEST_PROFILE_SETTINGS = 0x80,
-	KONEPLUS_CONTROL_REQUEST_PROFILE_BUTTONS = 0x90,
-};
-
-struct koneplus_actual_profile {
-	uint8_t command; /* KONEPLUS_COMMAND_ACTUAL_PROFILE */
-	uint8_t size; /* always 3 */
-	uint8_t actual_profile; /* Range 0-4! */
-} __attribute__ ((__packed__));
-
-struct koneplus_info {
-	uint8_t command; /* KONEPLUS_COMMAND_INFO */
-	uint8_t size; /* always 6 */
-	uint8_t firmware_version;
-	uint8_t unknown[3];
-} __attribute__ ((__packed__));
-
-enum koneplus_commands {
-	KONEPLUS_COMMAND_ACTUAL_PROFILE = 0x5,
-	KONEPLUS_COMMAND_CONTROL = 0x4,
-	KONEPLUS_COMMAND_PROFILE_SETTINGS = 0x6,
-	KONEPLUS_COMMAND_PROFILE_BUTTONS = 0x7,
-	KONEPLUS_COMMAND_MACRO = 0x8,
-	KONEPLUS_COMMAND_INFO = 0x9,
-	KONEPLUS_COMMAND_TCU = 0xc,
-	KONEPLUS_COMMAND_TCU_IMAGE = 0xc,
-	KONEPLUS_COMMAND_E = 0xe,
-	KONEPLUS_COMMAND_SENSOR = 0xf,
-	KONEPLUS_COMMAND_TALK = 0x10,
-	KONEPLUS_COMMAND_FIRMWARE_WRITE = 0x1b,
-	KONEPLUS_COMMAND_FIRMWARE_WRITE_CONTROL = 0x1c,
-};
-
-enum koneplus_mouse_report_numbers {
-	KONEPLUS_MOUSE_REPORT_NUMBER_HID = 1,
-	KONEPLUS_MOUSE_REPORT_NUMBER_AUDIO = 2,
-	KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON = 3,
-};
-
-struct koneplus_mouse_report_button {
-	uint8_t report_number; /* always KONEPLUS_MOUSE_REPORT_NUMBER_BUTTON */
-	uint8_t zero1;
-	uint8_t type;
-	uint8_t data1;
-	uint8_t data2;
-	uint8_t zero2;
-	uint8_t unknown[2];
-} __attribute__ ((__packed__));
-
-enum koneplus_mouse_report_button_types {
-	/* data1 = new profile range 1-5 */
-	KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE = 0x20,
-
-	/* data1 = button number range 1-24; data2 = action */
-	KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
-
-	/* data1 = button number range 1-24; data2 = action */
-	KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER = 0x80,
-
-	/* data1 = setting number range 1-5 */
-	KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI = 0xb0,
-
-	/* data1 and data2 = range 0x1-0xb */
-	KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY = 0xc0,
-
-	/* data1 = 22 = next track...
-	 * data2 = action
-	 */
-	KONEPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
-	KONEPLUS_MOUSE_REPORT_TALK = 0xff,
-};
-
-enum koneplus_mouse_report_button_action {
-	KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS = 0,
-	KONEPLUS_MOUSE_REPORT_BUTTON_ACTION_RELEASE = 1,
-};
-
-struct koneplus_roccat_report {
-	uint8_t type;
-	uint8_t data1;
-	uint8_t data2;
-	uint8_t profile;
-} __attribute__ ((__packed__));
-
-struct koneplus_device {
-	int actual_profile;
-
-	int roccat_claimed;
-	int chrdev_minor;
-
-	struct mutex koneplus_lock;
-};
-
-#endif
diff --git a/drivers/hid/hid-roccat-konepure.c b/drivers/hid/hid-roccat-konepure.c
deleted file mode 100644
index 07de2f9..0000000
--- a/drivers/hid/hid-roccat-konepure.c
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Roccat KonePure driver for Linux
- *
- * Copyright (c) 2012 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-/*
- * Roccat KonePure is a smaller version of KoneXTD with less buttons and lights.
- */
-
-#include <linux/types.h>
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-
-enum {
-	KONEPURE_MOUSE_REPORT_NUMBER_BUTTON = 3,
-};
-
-struct konepure_mouse_report_button {
-	uint8_t report_number; /* always KONEPURE_MOUSE_REPORT_NUMBER_BUTTON */
-	uint8_t zero;
-	uint8_t type;
-	uint8_t data1;
-	uint8_t data2;
-	uint8_t zero2;
-	uint8_t unknown[2];
-} __packed;
-
-static struct class *konepure_class;
-
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(control, 0x04, 0x03);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(actual_profile, 0x05, 0x03);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(profile_settings, 0x06, 0x1f);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(profile_buttons, 0x07, 0x3b);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(macro, 0x08, 0x0822);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(info, 0x09, 0x06);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(tcu, 0x0c, 0x04);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_R(tcu_image, 0x0c, 0x0404);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(sensor, 0x0f, 0x06);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(talk, 0x10, 0x10);
-
-static struct bin_attribute *konepure_bin_attrs[] = {
-	&bin_attr_actual_profile,
-	&bin_attr_control,
-	&bin_attr_info,
-	&bin_attr_talk,
-	&bin_attr_macro,
-	&bin_attr_sensor,
-	&bin_attr_tcu,
-	&bin_attr_tcu_image,
-	&bin_attr_profile_settings,
-	&bin_attr_profile_buttons,
-	NULL,
-};
-
-static const struct attribute_group konepure_group = {
-	.bin_attrs = konepure_bin_attrs,
-};
-
-static const struct attribute_group *konepure_groups[] = {
-	&konepure_group,
-	NULL,
-};
-
-static int konepure_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct roccat_common2_device *konepure;
-	int retval;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE) {
-		hid_set_drvdata(hdev, NULL);
-		return 0;
-	}
-
-	konepure = kzalloc(sizeof(*konepure), GFP_KERNEL);
-	if (!konepure) {
-		hid_err(hdev, "can't alloc device descriptor\n");
-		return -ENOMEM;
-	}
-	hid_set_drvdata(hdev, konepure);
-
-	retval = roccat_common2_device_init_struct(usb_dev, konepure);
-	if (retval) {
-		hid_err(hdev, "couldn't init KonePure device\n");
-		goto exit_free;
-	}
-
-	retval = roccat_connect(konepure_class, hdev,
-			sizeof(struct konepure_mouse_report_button));
-	if (retval < 0) {
-		hid_err(hdev, "couldn't init char dev\n");
-	} else {
-		konepure->chrdev_minor = retval;
-		konepure->roccat_claimed = 1;
-	}
-
-	return 0;
-exit_free:
-	kfree(konepure);
-	return retval;
-}
-
-static void konepure_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct roccat_common2_device *konepure;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE)
-		return;
-
-	konepure = hid_get_drvdata(hdev);
-	if (konepure->roccat_claimed)
-		roccat_disconnect(konepure->chrdev_minor);
-	kfree(konepure);
-}
-
-static int konepure_probe(struct hid_device *hdev,
-		const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = konepure_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install mouse\n");
-		goto exit_stop;
-	}
-
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void konepure_remove(struct hid_device *hdev)
-{
-	konepure_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static int konepure_raw_event(struct hid_device *hdev,
-		struct hid_report *report, u8 *data, int size)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct roccat_common2_device *konepure = hid_get_drvdata(hdev);
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE)
-		return 0;
-
-	if (data[0] != KONEPURE_MOUSE_REPORT_NUMBER_BUTTON)
-		return 0;
-
-	if (konepure != NULL && konepure->roccat_claimed)
-		roccat_report_event(konepure->chrdev_minor, data);
-
-	return 0;
-}
-
-static const struct hid_device_id konepure_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KONEPURE_OPTICAL) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, konepure_devices);
-
-static struct hid_driver konepure_driver = {
-		.name = "konepure",
-		.id_table = konepure_devices,
-		.probe = konepure_probe,
-		.remove = konepure_remove,
-		.raw_event = konepure_raw_event
-};
-
-static int __init konepure_init(void)
-{
-	int retval;
-
-	konepure_class = class_create(THIS_MODULE, "konepure");
-	if (IS_ERR(konepure_class))
-		return PTR_ERR(konepure_class);
-	konepure_class->dev_groups = konepure_groups;
-
-	retval = hid_register_driver(&konepure_driver);
-	if (retval)
-		class_destroy(konepure_class);
-	return retval;
-}
-
-static void __exit konepure_exit(void)
-{
-	hid_unregister_driver(&konepure_driver);
-	class_destroy(konepure_class);
-}
-
-module_init(konepure_init);
-module_exit(konepure_exit);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat KonePure/Optical driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-kovaplus.c b/drivers/hid/hid-roccat-kovaplus.c
deleted file mode 100644
index 9660477..0000000
--- a/drivers/hid/hid-roccat-kovaplus.c
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * Roccat Kova[+] driver for Linux
- *
- * Copyright (c) 2011 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-/*
- * Roccat Kova[+] is a bigger version of the Pyra with two more side buttons.
- */
-
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-#include "hid-roccat-kovaplus.h"
-
-static uint profile_numbers[5] = {0, 1, 2, 3, 4};
-
-static struct class *kovaplus_class;
-
-static uint kovaplus_convert_event_cpi(uint value)
-{
-	return (value == 7 ? 4 : (value == 4 ? 3 : value));
-}
-
-static void kovaplus_profile_activated(struct kovaplus_device *kovaplus,
-		uint new_profile_index)
-{
-	kovaplus->actual_profile = new_profile_index;
-	kovaplus->actual_cpi = kovaplus->profile_settings[new_profile_index].cpi_startup_level;
-	kovaplus->actual_x_sensitivity = kovaplus->profile_settings[new_profile_index].sensitivity_x;
-	kovaplus->actual_y_sensitivity = kovaplus->profile_settings[new_profile_index].sensitivity_y;
-}
-
-static int kovaplus_send_control(struct usb_device *usb_dev, uint value,
-		enum kovaplus_control_requests request)
-{
-	int retval;
-	struct roccat_common2_control control;
-
-	if ((request == KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS ||
-			request == KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS) &&
-			value > 4)
-		return -EINVAL;
-
-	control.command = ROCCAT_COMMON_COMMAND_CONTROL;
-	control.value = value;
-	control.request = request;
-
-	retval = roccat_common2_send(usb_dev, ROCCAT_COMMON_COMMAND_CONTROL,
-			&control, sizeof(struct roccat_common2_control));
-
-	return retval;
-}
-
-static int kovaplus_select_profile(struct usb_device *usb_dev, uint number,
-		enum kovaplus_control_requests request)
-{
-	return kovaplus_send_control(usb_dev, number, request);
-}
-
-static int kovaplus_get_profile_settings(struct usb_device *usb_dev,
-		struct kovaplus_profile_settings *buf, uint number)
-{
-	int retval;
-
-	retval = kovaplus_select_profile(usb_dev, number,
-			KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS);
-	if (retval)
-		return retval;
-
-	return roccat_common2_receive(usb_dev, KOVAPLUS_COMMAND_PROFILE_SETTINGS,
-			buf, KOVAPLUS_SIZE_PROFILE_SETTINGS);
-}
-
-static int kovaplus_get_profile_buttons(struct usb_device *usb_dev,
-		struct kovaplus_profile_buttons *buf, int number)
-{
-	int retval;
-
-	retval = kovaplus_select_profile(usb_dev, number,
-			KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS);
-	if (retval)
-		return retval;
-
-	return roccat_common2_receive(usb_dev, KOVAPLUS_COMMAND_PROFILE_BUTTONS,
-			buf, KOVAPLUS_SIZE_PROFILE_BUTTONS);
-}
-
-/* retval is 0-4 on success, < 0 on error */
-static int kovaplus_get_actual_profile(struct usb_device *usb_dev)
-{
-	struct kovaplus_actual_profile buf;
-	int retval;
-
-	retval = roccat_common2_receive(usb_dev, KOVAPLUS_COMMAND_ACTUAL_PROFILE,
-			&buf, sizeof(struct kovaplus_actual_profile));
-
-	return retval ? retval : buf.actual_profile;
-}
-
-static int kovaplus_set_actual_profile(struct usb_device *usb_dev,
-		int new_profile)
-{
-	struct kovaplus_actual_profile buf;
-
-	buf.command = KOVAPLUS_COMMAND_ACTUAL_PROFILE;
-	buf.size = sizeof(struct kovaplus_actual_profile);
-	buf.actual_profile = new_profile;
-
-	return roccat_common2_send_with_status(usb_dev,
-			KOVAPLUS_COMMAND_ACTUAL_PROFILE,
-			&buf, sizeof(struct kovaplus_actual_profile));
-}
-
-static ssize_t kovaplus_sysfs_read(struct file *fp, struct kobject *kobj,
-		char *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct kovaplus_device *kovaplus = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off >= real_size)
-		return 0;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&kovaplus->kovaplus_lock);
-	retval = roccat_common2_receive(usb_dev, command, buf, real_size);
-	mutex_unlock(&kovaplus->kovaplus_lock);
-
-	if (retval)
-		return retval;
-
-	return real_size;
-}
-
-static ssize_t kovaplus_sysfs_write(struct file *fp, struct kobject *kobj,
-		void const *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct kovaplus_device *kovaplus = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&kovaplus->kovaplus_lock);
-	retval = roccat_common2_send_with_status(usb_dev, command,
-			buf, real_size);
-	mutex_unlock(&kovaplus->kovaplus_lock);
-
-	if (retval)
-		return retval;
-
-	return real_size;
-}
-
-#define KOVAPLUS_SYSFS_W(thingy, THINGY) \
-static ssize_t kovaplus_sysfs_write_ ## thingy(struct file *fp, \
-		struct kobject *kobj, struct bin_attribute *attr, char *buf, \
-		loff_t off, size_t count) \
-{ \
-	return kovaplus_sysfs_write(fp, kobj, buf, off, count, \
-			KOVAPLUS_SIZE_ ## THINGY, KOVAPLUS_COMMAND_ ## THINGY); \
-}
-
-#define KOVAPLUS_SYSFS_R(thingy, THINGY) \
-static ssize_t kovaplus_sysfs_read_ ## thingy(struct file *fp, \
-		struct kobject *kobj, struct bin_attribute *attr, char *buf, \
-		loff_t off, size_t count) \
-{ \
-	return kovaplus_sysfs_read(fp, kobj, buf, off, count, \
-			KOVAPLUS_SIZE_ ## THINGY, KOVAPLUS_COMMAND_ ## THINGY); \
-}
-
-#define KOVAPLUS_SYSFS_RW(thingy, THINGY) \
-KOVAPLUS_SYSFS_W(thingy, THINGY) \
-KOVAPLUS_SYSFS_R(thingy, THINGY)
-
-#define KOVAPLUS_BIN_ATTRIBUTE_RW(thingy, THINGY) \
-KOVAPLUS_SYSFS_RW(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0660 }, \
-	.size = KOVAPLUS_SIZE_ ## THINGY, \
-	.read = kovaplus_sysfs_read_ ## thingy, \
-	.write = kovaplus_sysfs_write_ ## thingy \
-}
-
-#define KOVAPLUS_BIN_ATTRIBUTE_W(thingy, THINGY) \
-KOVAPLUS_SYSFS_W(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0220 }, \
-	.size = KOVAPLUS_SIZE_ ## THINGY, \
-	.write = kovaplus_sysfs_write_ ## thingy \
-}
-KOVAPLUS_BIN_ATTRIBUTE_W(control, CONTROL);
-KOVAPLUS_BIN_ATTRIBUTE_RW(info, INFO);
-KOVAPLUS_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS);
-KOVAPLUS_BIN_ATTRIBUTE_RW(profile_buttons, PROFILE_BUTTONS);
-
-static ssize_t kovaplus_sysfs_read_profilex_settings(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	ssize_t retval;
-
-	retval = kovaplus_select_profile(usb_dev, *(uint *)(attr->private),
-			KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS);
-	if (retval)
-		return retval;
-
-	return kovaplus_sysfs_read(fp, kobj, buf, off, count,
-			KOVAPLUS_SIZE_PROFILE_SETTINGS,
-			KOVAPLUS_COMMAND_PROFILE_SETTINGS);
-}
-
-static ssize_t kovaplus_sysfs_read_profilex_buttons(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	ssize_t retval;
-
-	retval = kovaplus_select_profile(usb_dev, *(uint *)(attr->private),
-			KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS);
-	if (retval)
-		return retval;
-
-	return kovaplus_sysfs_read(fp, kobj, buf, off, count,
-			KOVAPLUS_SIZE_PROFILE_BUTTONS,
-			KOVAPLUS_COMMAND_PROFILE_BUTTONS);
-}
-
-#define PROFILE_ATTR(number)						\
-static struct bin_attribute bin_attr_profile##number##_settings = {	\
-	.attr = { .name = "profile" #number "_settings", .mode = 0440 },	\
-	.size = KOVAPLUS_SIZE_PROFILE_SETTINGS,				\
-	.read = kovaplus_sysfs_read_profilex_settings,			\
-	.private = &profile_numbers[number-1],				\
-};									\
-static struct bin_attribute bin_attr_profile##number##_buttons = {	\
-	.attr = { .name = "profile" #number "_buttons", .mode = 0440 },	\
-	.size = KOVAPLUS_SIZE_PROFILE_BUTTONS,				\
-	.read = kovaplus_sysfs_read_profilex_buttons,			\
-	.private = &profile_numbers[number-1],				\
-};
-PROFILE_ATTR(1);
-PROFILE_ATTR(2);
-PROFILE_ATTR(3);
-PROFILE_ATTR(4);
-PROFILE_ATTR(5);
-
-static ssize_t kovaplus_sysfs_show_actual_profile(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct kovaplus_device *kovaplus =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile);
-}
-
-static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev,
-		struct device_attribute *attr, char const *buf, size_t size)
-{
-	struct kovaplus_device *kovaplus;
-	struct usb_device *usb_dev;
-	unsigned long profile;
-	int retval;
-	struct kovaplus_roccat_report roccat_report;
-
-	dev = dev->parent->parent;
-	kovaplus = hid_get_drvdata(dev_get_drvdata(dev));
-	usb_dev = interface_to_usbdev(to_usb_interface(dev));
-
-	retval = kstrtoul(buf, 10, &profile);
-	if (retval)
-		return retval;
-
-	if (profile >= 5)
-		return -EINVAL;
-
-	mutex_lock(&kovaplus->kovaplus_lock);
-	retval = kovaplus_set_actual_profile(usb_dev, profile);
-	if (retval) {
-		mutex_unlock(&kovaplus->kovaplus_lock);
-		return retval;
-	}
-
-	kovaplus_profile_activated(kovaplus, profile);
-
-	roccat_report.type = KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_1;
-	roccat_report.profile = profile + 1;
-	roccat_report.button = 0;
-	roccat_report.data1 = profile + 1;
-	roccat_report.data2 = 0;
-	roccat_report_event(kovaplus->chrdev_minor,
-			(uint8_t const *)&roccat_report);
-
-	mutex_unlock(&kovaplus->kovaplus_lock);
-
-	return size;
-}
-static DEVICE_ATTR(actual_profile, 0660,
-		   kovaplus_sysfs_show_actual_profile,
-		   kovaplus_sysfs_set_actual_profile);
-
-static ssize_t kovaplus_sysfs_show_actual_cpi(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct kovaplus_device *kovaplus =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi);
-}
-static DEVICE_ATTR(actual_cpi, 0440, kovaplus_sysfs_show_actual_cpi, NULL);
-
-static ssize_t kovaplus_sysfs_show_actual_sensitivity_x(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct kovaplus_device *kovaplus =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_x_sensitivity);
-}
-static DEVICE_ATTR(actual_sensitivity_x, 0440,
-		   kovaplus_sysfs_show_actual_sensitivity_x, NULL);
-
-static ssize_t kovaplus_sysfs_show_actual_sensitivity_y(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct kovaplus_device *kovaplus =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_y_sensitivity);
-}
-static DEVICE_ATTR(actual_sensitivity_y, 0440,
-		   kovaplus_sysfs_show_actual_sensitivity_y, NULL);
-
-static ssize_t kovaplus_sysfs_show_firmware_version(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct kovaplus_device *kovaplus;
-	struct usb_device *usb_dev;
-	struct kovaplus_info info;
-
-	dev = dev->parent->parent;
-	kovaplus = hid_get_drvdata(dev_get_drvdata(dev));
-	usb_dev = interface_to_usbdev(to_usb_interface(dev));
-
-	mutex_lock(&kovaplus->kovaplus_lock);
-	roccat_common2_receive(usb_dev, KOVAPLUS_COMMAND_INFO,
-			&info, KOVAPLUS_SIZE_INFO);
-	mutex_unlock(&kovaplus->kovaplus_lock);
-
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
-}
-static DEVICE_ATTR(firmware_version, 0440,
-		   kovaplus_sysfs_show_firmware_version, NULL);
-
-static struct attribute *kovaplus_attrs[] = {
-	&dev_attr_actual_cpi.attr,
-	&dev_attr_firmware_version.attr,
-	&dev_attr_actual_profile.attr,
-	&dev_attr_actual_sensitivity_x.attr,
-	&dev_attr_actual_sensitivity_y.attr,
-	NULL,
-};
-
-static struct bin_attribute *kovaplus_bin_attributes[] = {
-	&bin_attr_control,
-	&bin_attr_info,
-	&bin_attr_profile_settings,
-	&bin_attr_profile_buttons,
-	&bin_attr_profile1_settings,
-	&bin_attr_profile2_settings,
-	&bin_attr_profile3_settings,
-	&bin_attr_profile4_settings,
-	&bin_attr_profile5_settings,
-	&bin_attr_profile1_buttons,
-	&bin_attr_profile2_buttons,
-	&bin_attr_profile3_buttons,
-	&bin_attr_profile4_buttons,
-	&bin_attr_profile5_buttons,
-	NULL,
-};
-
-static const struct attribute_group kovaplus_group = {
-	.attrs = kovaplus_attrs,
-	.bin_attrs = kovaplus_bin_attributes,
-};
-
-static const struct attribute_group *kovaplus_groups[] = {
-	&kovaplus_group,
-	NULL,
-};
-
-static int kovaplus_init_kovaplus_device_struct(struct usb_device *usb_dev,
-		struct kovaplus_device *kovaplus)
-{
-	int retval, i;
-	static uint wait = 70; /* device will freeze with just 60 */
-
-	mutex_init(&kovaplus->kovaplus_lock);
-
-	for (i = 0; i < 5; ++i) {
-		msleep(wait);
-		retval = kovaplus_get_profile_settings(usb_dev,
-				&kovaplus->profile_settings[i], i);
-		if (retval)
-			return retval;
-
-		msleep(wait);
-		retval = kovaplus_get_profile_buttons(usb_dev,
-				&kovaplus->profile_buttons[i], i);
-		if (retval)
-			return retval;
-	}
-
-	msleep(wait);
-	retval = kovaplus_get_actual_profile(usb_dev);
-	if (retval < 0)
-		return retval;
-	kovaplus_profile_activated(kovaplus, retval);
-
-	return 0;
-}
-
-static int kovaplus_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct kovaplus_device *kovaplus;
-	int retval;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			== USB_INTERFACE_PROTOCOL_MOUSE) {
-
-		kovaplus = kzalloc(sizeof(*kovaplus), GFP_KERNEL);
-		if (!kovaplus) {
-			hid_err(hdev, "can't alloc device descriptor\n");
-			return -ENOMEM;
-		}
-		hid_set_drvdata(hdev, kovaplus);
-
-		retval = kovaplus_init_kovaplus_device_struct(usb_dev, kovaplus);
-		if (retval) {
-			hid_err(hdev, "couldn't init struct kovaplus_device\n");
-			goto exit_free;
-		}
-
-		retval = roccat_connect(kovaplus_class, hdev,
-				sizeof(struct kovaplus_roccat_report));
-		if (retval < 0) {
-			hid_err(hdev, "couldn't init char dev\n");
-		} else {
-			kovaplus->chrdev_minor = retval;
-			kovaplus->roccat_claimed = 1;
-		}
-
-	} else {
-		hid_set_drvdata(hdev, NULL);
-	}
-
-	return 0;
-exit_free:
-	kfree(kovaplus);
-	return retval;
-}
-
-static void kovaplus_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct kovaplus_device *kovaplus;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			== USB_INTERFACE_PROTOCOL_MOUSE) {
-		kovaplus = hid_get_drvdata(hdev);
-		if (kovaplus->roccat_claimed)
-			roccat_disconnect(kovaplus->chrdev_minor);
-		kfree(kovaplus);
-	}
-}
-
-static int kovaplus_probe(struct hid_device *hdev,
-		const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = kovaplus_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install mouse\n");
-		goto exit_stop;
-	}
-
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void kovaplus_remove(struct hid_device *hdev)
-{
-	kovaplus_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static void kovaplus_keep_values_up_to_date(struct kovaplus_device *kovaplus,
-		u8 const *data)
-{
-	struct kovaplus_mouse_report_button const *button_report;
-
-	if (data[0] != KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON)
-		return;
-
-	button_report = (struct kovaplus_mouse_report_button const *)data;
-
-	switch (button_report->type) {
-	case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_1:
-		kovaplus_profile_activated(kovaplus, button_report->data1 - 1);
-		break;
-	case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI:
-		kovaplus->actual_cpi = kovaplus_convert_event_cpi(button_report->data1);
-		break;
-	case KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY:
-		kovaplus->actual_x_sensitivity = button_report->data1;
-		kovaplus->actual_y_sensitivity = button_report->data2;
-		break;
-	default:
-		break;
-	}
-}
-
-static void kovaplus_report_to_chrdev(struct kovaplus_device const *kovaplus,
-		u8 const *data)
-{
-	struct kovaplus_roccat_report roccat_report;
-	struct kovaplus_mouse_report_button const *button_report;
-
-	if (data[0] != KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON)
-		return;
-
-	button_report = (struct kovaplus_mouse_report_button const *)data;
-
-	if (button_report->type == KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_2)
-		return;
-
-	roccat_report.type = button_report->type;
-	roccat_report.profile = kovaplus->actual_profile + 1;
-
-	if (roccat_report.type == KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MACRO ||
-			roccat_report.type == KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SHORTCUT ||
-			roccat_report.type == KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH ||
-			roccat_report.type == KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER)
-		roccat_report.button = button_report->data1;
-	else
-		roccat_report.button = 0;
-
-	if (roccat_report.type == KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI)
-		roccat_report.data1 = kovaplus_convert_event_cpi(button_report->data1);
-	else
-		roccat_report.data1 = button_report->data1;
-
-	roccat_report.data2 = button_report->data2;
-
-	roccat_report_event(kovaplus->chrdev_minor,
-			(uint8_t const *)&roccat_report);
-}
-
-static int kovaplus_raw_event(struct hid_device *hdev,
-		struct hid_report *report, u8 *data, int size)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct kovaplus_device *kovaplus = hid_get_drvdata(hdev);
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE)
-		return 0;
-
-	if (kovaplus == NULL)
-		return 0;
-
-	kovaplus_keep_values_up_to_date(kovaplus, data);
-
-	if (kovaplus->roccat_claimed)
-		kovaplus_report_to_chrdev(kovaplus, data);
-
-	return 0;
-}
-
-static const struct hid_device_id kovaplus_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, kovaplus_devices);
-
-static struct hid_driver kovaplus_driver = {
-		.name = "kovaplus",
-		.id_table = kovaplus_devices,
-		.probe = kovaplus_probe,
-		.remove = kovaplus_remove,
-		.raw_event = kovaplus_raw_event
-};
-
-static int __init kovaplus_init(void)
-{
-	int retval;
-
-	kovaplus_class = class_create(THIS_MODULE, "kovaplus");
-	if (IS_ERR(kovaplus_class))
-		return PTR_ERR(kovaplus_class);
-	kovaplus_class->dev_groups = kovaplus_groups;
-
-	retval = hid_register_driver(&kovaplus_driver);
-	if (retval)
-		class_destroy(kovaplus_class);
-	return retval;
-}
-
-static void __exit kovaplus_exit(void)
-{
-	hid_unregister_driver(&kovaplus_driver);
-	class_destroy(kovaplus_class);
-}
-
-module_init(kovaplus_init);
-module_exit(kovaplus_exit);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat Kova[+] driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-kovaplus.h b/drivers/hid/hid-roccat-kovaplus.h
deleted file mode 100644
index fbb7a16..0000000
--- a/drivers/hid/hid-roccat-kovaplus.h
+++ /dev/null
@@ -1,133 +0,0 @@
-#ifndef __HID_ROCCAT_KOVAPLUS_H
-#define __HID_ROCCAT_KOVAPLUS_H
-
-/*
- * Copyright (c) 2010 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-#include <linux/types.h>
-
-enum {
-	KOVAPLUS_SIZE_CONTROL = 0x03,
-	KOVAPLUS_SIZE_INFO = 0x06,
-	KOVAPLUS_SIZE_PROFILE_SETTINGS = 0x10,
-	KOVAPLUS_SIZE_PROFILE_BUTTONS = 0x17,
-};
-
-enum kovaplus_control_requests {
-	/* write; value = profile number range 0-4 */
-	KOVAPLUS_CONTROL_REQUEST_PROFILE_SETTINGS = 0x10,
-	/* write; value = profile number range 0-4 */
-	KOVAPLUS_CONTROL_REQUEST_PROFILE_BUTTONS = 0x20,
-};
-
-struct kovaplus_actual_profile {
-	uint8_t command; /* KOVAPLUS_COMMAND_ACTUAL_PROFILE */
-	uint8_t size; /* always 3 */
-	uint8_t actual_profile; /* Range 0-4! */
-} __packed;
-
-struct kovaplus_profile_settings {
-	uint8_t command; /* KOVAPLUS_COMMAND_PROFILE_SETTINGS */
-	uint8_t size; /* 16 */
-	uint8_t profile_index; /* range 0-4 */
-	uint8_t unknown1;
-	uint8_t sensitivity_x; /* range 1-10 */
-	uint8_t sensitivity_y; /* range 1-10 */
-	uint8_t cpi_levels_enabled;
-	uint8_t cpi_startup_level; /* range 1-4 */
-	uint8_t data[8];
-} __packed;
-
-struct kovaplus_profile_buttons {
-	uint8_t command; /* KOVAPLUS_COMMAND_PROFILE_BUTTONS */
-	uint8_t size; /* 23 */
-	uint8_t profile_index; /* range 0-4 */
-	uint8_t data[20];
-} __packed;
-
-struct kovaplus_info {
-	uint8_t command; /* KOVAPLUS_COMMAND_INFO */
-	uint8_t size; /* 6 */
-	uint8_t firmware_version;
-	uint8_t unknown[3];
-} __packed;
-
-enum kovaplus_commands {
-	KOVAPLUS_COMMAND_ACTUAL_PROFILE = 0x5,
-	KOVAPLUS_COMMAND_CONTROL = 0x4,
-	KOVAPLUS_COMMAND_PROFILE_SETTINGS = 0x6,
-	KOVAPLUS_COMMAND_PROFILE_BUTTONS = 0x7,
-	KOVAPLUS_COMMAND_INFO = 0x9,
-	KOVAPLUS_COMMAND_A = 0xa,
-};
-
-enum kovaplus_mouse_report_numbers {
-	KOVAPLUS_MOUSE_REPORT_NUMBER_MOUSE = 1,
-	KOVAPLUS_MOUSE_REPORT_NUMBER_AUDIO = 2,
-	KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON = 3,
-	KOVAPLUS_MOUSE_REPORT_NUMBER_KBD = 4,
-};
-
-struct kovaplus_mouse_report_button {
-	uint8_t report_number; /* KOVAPLUS_MOUSE_REPORT_NUMBER_BUTTON */
-	uint8_t unknown1;
-	uint8_t type;
-	uint8_t data1;
-	uint8_t data2;
-} __packed;
-
-enum kovaplus_mouse_report_button_types {
-	/* data1 = profile_number range 1-5; no release event */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_1 = 0x20,
-	/* data1 = profile_number range 1-5; no release event */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_PROFILE_2 = 0x30,
-	/* data1 = button_number range 1-18; data2 = action */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MACRO = 0x40,
-	/* data1 = button_number range 1-18; data2 = action */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SHORTCUT = 0x50,
-	/* data1 = button_number range 1-18; data2 = action */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
-	/* data1 = button_number range 1-18; data2 = action */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_TIMER = 0x80,
-	/* data1 = 1 = 400, 2 = 800, 4 = 1600, 7 = 3200; no release event */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_CPI = 0xb0,
-	/* data1 + data2 = sense range 1-10; no release event */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY = 0xc0,
-	/* data1 = type as in profile_buttons; data2 = action */
-	KOVAPLUS_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
-};
-
-enum kovaplus_mouse_report_button_actions {
-	KOVAPLUS_MOUSE_REPORT_BUTTON_ACTION_PRESS = 0,
-	KOVAPLUS_MOUSE_REPORT_BUTTON_ACTION_RELEASE = 1,
-};
-
-struct kovaplus_roccat_report {
-	uint8_t type;
-	uint8_t profile;
-	uint8_t button;
-	uint8_t data1;
-	uint8_t data2;
-} __packed;
-
-struct kovaplus_device {
-	int actual_profile;
-	int actual_cpi;
-	int actual_x_sensitivity;
-	int actual_y_sensitivity;
-	int roccat_claimed;
-	int chrdev_minor;
-	struct mutex kovaplus_lock;
-	struct kovaplus_profile_settings profile_settings[5];
-	struct kovaplus_profile_buttons profile_buttons[5];
-};
-
-#endif
diff --git a/drivers/hid/hid-roccat-lua.c b/drivers/hid/hid-roccat-lua.c
deleted file mode 100644
index 65e2e76..0000000
--- a/drivers/hid/hid-roccat-lua.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Roccat Lua driver for Linux
- *
- * Copyright (c) 2012 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-/*
- * Roccat Lua is a gamer mouse which cpi, button and light settings can be
- * configured.
- */
-
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-#include "hid-roccat-lua.h"
-
-static ssize_t lua_sysfs_read(struct file *fp, struct kobject *kobj,
-		char *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev = container_of(kobj, struct device, kobj);
-	struct lua_device *lua = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off >= real_size)
-		return 0;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&lua->lua_lock);
-	retval = roccat_common2_receive(usb_dev, command, buf, real_size);
-	mutex_unlock(&lua->lua_lock);
-
-	return retval ? retval : real_size;
-}
-
-static ssize_t lua_sysfs_write(struct file *fp, struct kobject *kobj,
-		void const *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev = container_of(kobj, struct device, kobj);
-	struct lua_device *lua = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&lua->lua_lock);
-	retval = roccat_common2_send(usb_dev, command, buf, real_size);
-	mutex_unlock(&lua->lua_lock);
-
-	return retval ? retval : real_size;
-}
-
-#define LUA_SYSFS_W(thingy, THINGY) \
-static ssize_t lua_sysfs_write_ ## thingy(struct file *fp, \
-		struct kobject *kobj, struct bin_attribute *attr, \
-		char *buf, loff_t off, size_t count) \
-{ \
-	return lua_sysfs_write(fp, kobj, buf, off, count, \
-			LUA_SIZE_ ## THINGY, LUA_COMMAND_ ## THINGY); \
-}
-
-#define LUA_SYSFS_R(thingy, THINGY) \
-static ssize_t lua_sysfs_read_ ## thingy(struct file *fp, \
-		struct kobject *kobj, struct bin_attribute *attr, \
-		char *buf, loff_t off, size_t count) \
-{ \
-	return lua_sysfs_read(fp, kobj, buf, off, count, \
-			LUA_SIZE_ ## THINGY, LUA_COMMAND_ ## THINGY); \
-}
-
-#define LUA_BIN_ATTRIBUTE_RW(thingy, THINGY) \
-LUA_SYSFS_W(thingy, THINGY) \
-LUA_SYSFS_R(thingy, THINGY) \
-static struct bin_attribute lua_ ## thingy ## _attr = { \
-	.attr = { .name = #thingy, .mode = 0660 }, \
-	.size = LUA_SIZE_ ## THINGY, \
-	.read = lua_sysfs_read_ ## thingy, \
-	.write = lua_sysfs_write_ ## thingy \
-};
-
-LUA_BIN_ATTRIBUTE_RW(control, CONTROL)
-
-static int lua_create_sysfs_attributes(struct usb_interface *intf)
-{
-	return sysfs_create_bin_file(&intf->dev.kobj, &lua_control_attr);
-}
-
-static void lua_remove_sysfs_attributes(struct usb_interface *intf)
-{
-	sysfs_remove_bin_file(&intf->dev.kobj, &lua_control_attr);
-}
-
-static int lua_init_lua_device_struct(struct usb_device *usb_dev,
-		struct lua_device *lua)
-{
-	mutex_init(&lua->lua_lock);
-
-	return 0;
-}
-
-static int lua_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct lua_device *lua;
-	int retval;
-
-	lua = kzalloc(sizeof(*lua), GFP_KERNEL);
-	if (!lua) {
-		hid_err(hdev, "can't alloc device descriptor\n");
-		return -ENOMEM;
-	}
-	hid_set_drvdata(hdev, lua);
-
-	retval = lua_init_lua_device_struct(usb_dev, lua);
-	if (retval) {
-		hid_err(hdev, "couldn't init struct lua_device\n");
-		goto exit;
-	}
-
-	retval = lua_create_sysfs_attributes(intf);
-	if (retval) {
-		hid_err(hdev, "cannot create sysfs files\n");
-		goto exit;
-	}
-
-	return 0;
-exit:
-	kfree(lua);
-	return retval;
-}
-
-static void lua_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct lua_device *lua;
-
-	lua_remove_sysfs_attributes(intf);
-
-	lua = hid_get_drvdata(hdev);
-	kfree(lua);
-}
-
-static int lua_probe(struct hid_device *hdev,
-		const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = lua_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install mouse\n");
-		goto exit_stop;
-	}
-
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void lua_remove(struct hid_device *hdev)
-{
-	lua_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static const struct hid_device_id lua_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_LUA) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, lua_devices);
-
-static struct hid_driver lua_driver = {
-		.name = "lua",
-		.id_table = lua_devices,
-		.probe = lua_probe,
-		.remove = lua_remove
-};
-module_hid_driver(lua_driver);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat Lua driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-lua.h b/drivers/hid/hid-roccat-lua.h
deleted file mode 100644
index 547d77a..0000000
--- a/drivers/hid/hid-roccat-lua.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __HID_ROCCAT_LUA_H
-#define __HID_ROCCAT_LUA_H
-
-/*
- * Copyright (c) 2012 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-#include <linux/types.h>
-
-enum {
-	LUA_SIZE_CONTROL = 8,
-};
-
-enum lua_commands {
-	LUA_COMMAND_CONTROL = 3,
-};
-
-struct lua_device {
-	struct mutex lua_lock;
-};
-
-#endif
diff --git a/drivers/hid/hid-roccat-pyra.c b/drivers/hid/hid-roccat-pyra.c
deleted file mode 100644
index 47d7e74..0000000
--- a/drivers/hid/hid-roccat-pyra.c
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- * Roccat Pyra driver for Linux
- *
- * Copyright (c) 2010 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-/*
- * Roccat Pyra is a mobile gamer mouse which comes in wired and wireless
- * variant. Wireless variant is not tested.
- * Userland tools can be found at http://sourceforge.net/projects/roccat
- */
-
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-#include "hid-roccat-pyra.h"
-
-static uint profile_numbers[5] = {0, 1, 2, 3, 4};
-
-/* pyra_class is used for creating sysfs attributes via roccat char device */
-static struct class *pyra_class;
-
-static void profile_activated(struct pyra_device *pyra,
-		unsigned int new_profile)
-{
-	if (new_profile >= ARRAY_SIZE(pyra->profile_settings))
-		return;
-	pyra->actual_profile = new_profile;
-	pyra->actual_cpi = pyra->profile_settings[pyra->actual_profile].y_cpi;
-}
-
-static int pyra_send_control(struct usb_device *usb_dev, int value,
-		enum pyra_control_requests request)
-{
-	struct roccat_common2_control control;
-
-	if ((request == PYRA_CONTROL_REQUEST_PROFILE_SETTINGS ||
-			request == PYRA_CONTROL_REQUEST_PROFILE_BUTTONS) &&
-			(value < 0 || value > 4))
-		return -EINVAL;
-
-	control.command = ROCCAT_COMMON_COMMAND_CONTROL;
-	control.value = value;
-	control.request = request;
-
-	return roccat_common2_send(usb_dev, ROCCAT_COMMON_COMMAND_CONTROL,
-			&control, sizeof(struct roccat_common2_control));
-}
-
-static int pyra_get_profile_settings(struct usb_device *usb_dev,
-		struct pyra_profile_settings *buf, int number)
-{
-	int retval;
-	retval = pyra_send_control(usb_dev, number,
-			PYRA_CONTROL_REQUEST_PROFILE_SETTINGS);
-	if (retval)
-		return retval;
-	return roccat_common2_receive(usb_dev, PYRA_COMMAND_PROFILE_SETTINGS,
-			buf, PYRA_SIZE_PROFILE_SETTINGS);
-}
-
-static int pyra_get_settings(struct usb_device *usb_dev,
-		struct pyra_settings *buf)
-{
-	return roccat_common2_receive(usb_dev, PYRA_COMMAND_SETTINGS,
-			buf, PYRA_SIZE_SETTINGS);
-}
-
-static int pyra_set_settings(struct usb_device *usb_dev,
-		struct pyra_settings const *settings)
-{
-	return roccat_common2_send_with_status(usb_dev,
-			PYRA_COMMAND_SETTINGS, settings,
-			PYRA_SIZE_SETTINGS);
-}
-
-static ssize_t pyra_sysfs_read(struct file *fp, struct kobject *kobj,
-		char *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off >= real_size)
-		return 0;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&pyra->pyra_lock);
-	retval = roccat_common2_receive(usb_dev, command, buf, real_size);
-	mutex_unlock(&pyra->pyra_lock);
-
-	if (retval)
-		return retval;
-
-	return real_size;
-}
-
-static ssize_t pyra_sysfs_write(struct file *fp, struct kobject *kobj,
-		void const *buf, loff_t off, size_t count,
-		size_t real_size, uint command)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval;
-
-	if (off != 0 || count != real_size)
-		return -EINVAL;
-
-	mutex_lock(&pyra->pyra_lock);
-	retval = roccat_common2_send_with_status(usb_dev, command, (void *)buf, real_size);
-	mutex_unlock(&pyra->pyra_lock);
-
-	if (retval)
-		return retval;
-
-	return real_size;
-}
-
-#define PYRA_SYSFS_W(thingy, THINGY) \
-static ssize_t pyra_sysfs_write_ ## thingy(struct file *fp, \
-		struct kobject *kobj, struct bin_attribute *attr, char *buf, \
-		loff_t off, size_t count) \
-{ \
-	return pyra_sysfs_write(fp, kobj, buf, off, count, \
-			PYRA_SIZE_ ## THINGY, PYRA_COMMAND_ ## THINGY); \
-}
-
-#define PYRA_SYSFS_R(thingy, THINGY) \
-static ssize_t pyra_sysfs_read_ ## thingy(struct file *fp, \
-		struct kobject *kobj, struct bin_attribute *attr, char *buf, \
-		loff_t off, size_t count) \
-{ \
-	return pyra_sysfs_read(fp, kobj, buf, off, count, \
-			PYRA_SIZE_ ## THINGY, PYRA_COMMAND_ ## THINGY); \
-}
-
-#define PYRA_SYSFS_RW(thingy, THINGY) \
-PYRA_SYSFS_W(thingy, THINGY) \
-PYRA_SYSFS_R(thingy, THINGY)
-
-#define PYRA_BIN_ATTRIBUTE_RW(thingy, THINGY) \
-PYRA_SYSFS_RW(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0660 }, \
-	.size = PYRA_SIZE_ ## THINGY, \
-	.read = pyra_sysfs_read_ ## thingy, \
-	.write = pyra_sysfs_write_ ## thingy \
-}
-
-#define PYRA_BIN_ATTRIBUTE_R(thingy, THINGY) \
-PYRA_SYSFS_R(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0440 }, \
-	.size = PYRA_SIZE_ ## THINGY, \
-	.read = pyra_sysfs_read_ ## thingy, \
-}
-
-#define PYRA_BIN_ATTRIBUTE_W(thingy, THINGY) \
-PYRA_SYSFS_W(thingy, THINGY); \
-static struct bin_attribute bin_attr_##thingy = { \
-	.attr = { .name = #thingy, .mode = 0220 }, \
-	.size = PYRA_SIZE_ ## THINGY, \
-	.write = pyra_sysfs_write_ ## thingy \
-}
-
-PYRA_BIN_ATTRIBUTE_W(control, CONTROL);
-PYRA_BIN_ATTRIBUTE_RW(info, INFO);
-PYRA_BIN_ATTRIBUTE_RW(profile_settings, PROFILE_SETTINGS);
-PYRA_BIN_ATTRIBUTE_RW(profile_buttons, PROFILE_BUTTONS);
-
-static ssize_t pyra_sysfs_read_profilex_settings(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	ssize_t retval;
-
-	retval = pyra_send_control(usb_dev, *(uint *)(attr->private),
-			PYRA_CONTROL_REQUEST_PROFILE_SETTINGS);
-	if (retval)
-		return retval;
-
-	return pyra_sysfs_read(fp, kobj, buf, off, count,
-			PYRA_SIZE_PROFILE_SETTINGS,
-			PYRA_COMMAND_PROFILE_SETTINGS);
-}
-
-static ssize_t pyra_sysfs_read_profilex_buttons(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	ssize_t retval;
-
-	retval = pyra_send_control(usb_dev, *(uint *)(attr->private),
-			PYRA_CONTROL_REQUEST_PROFILE_BUTTONS);
-	if (retval)
-		return retval;
-
-	return pyra_sysfs_read(fp, kobj, buf, off, count,
-			PYRA_SIZE_PROFILE_BUTTONS,
-			PYRA_COMMAND_PROFILE_BUTTONS);
-}
-
-#define PROFILE_ATTR(number)						\
-static struct bin_attribute bin_attr_profile##number##_settings = {	\
-	.attr = { .name = "profile" #number "_settings", .mode = 0440 },	\
-	.size = PYRA_SIZE_PROFILE_SETTINGS,				\
-	.read = pyra_sysfs_read_profilex_settings,			\
-	.private = &profile_numbers[number-1],				\
-};									\
-static struct bin_attribute bin_attr_profile##number##_buttons = {	\
-	.attr = { .name = "profile" #number "_buttons", .mode = 0440 },	\
-	.size = PYRA_SIZE_PROFILE_BUTTONS,				\
-	.read = pyra_sysfs_read_profilex_buttons,			\
-	.private = &profile_numbers[number-1],				\
-};
-PROFILE_ATTR(1);
-PROFILE_ATTR(2);
-PROFILE_ATTR(3);
-PROFILE_ATTR(4);
-PROFILE_ATTR(5);
-
-static ssize_t pyra_sysfs_write_settings(struct file *fp,
-		struct kobject *kobj, struct bin_attribute *attr, char *buf,
-		loff_t off, size_t count)
-{
-	struct device *dev =
-			container_of(kobj, struct device, kobj)->parent->parent;
-	struct pyra_device *pyra = hid_get_drvdata(dev_get_drvdata(dev));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	int retval = 0;
-	struct pyra_roccat_report roccat_report;
-	struct pyra_settings const *settings;
-
-	if (off != 0 || count != PYRA_SIZE_SETTINGS)
-		return -EINVAL;
-
-	settings = (struct pyra_settings const *)buf;
-	if (settings->startup_profile >= ARRAY_SIZE(pyra->profile_settings))
-		return -EINVAL;
-
-	mutex_lock(&pyra->pyra_lock);
-
-	retval = pyra_set_settings(usb_dev, settings);
-	if (retval) {
-		mutex_unlock(&pyra->pyra_lock);
-		return retval;
-	}
-
-	profile_activated(pyra, settings->startup_profile);
-
-	roccat_report.type = PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2;
-	roccat_report.value = settings->startup_profile + 1;
-	roccat_report.key = 0;
-	roccat_report_event(pyra->chrdev_minor,
-			(uint8_t const *)&roccat_report);
-
-	mutex_unlock(&pyra->pyra_lock);
-	return PYRA_SIZE_SETTINGS;
-}
-
-PYRA_SYSFS_R(settings, SETTINGS);
-static struct bin_attribute bin_attr_settings =
-	__BIN_ATTR(settings, (S_IWUSR | S_IRUGO),
-		   pyra_sysfs_read_settings, pyra_sysfs_write_settings,
-		   PYRA_SIZE_SETTINGS);
-
-static ssize_t pyra_sysfs_show_actual_cpi(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct pyra_device *pyra =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	return snprintf(buf, PAGE_SIZE, "%d\n", pyra->actual_cpi);
-}
-static DEVICE_ATTR(actual_cpi, 0440, pyra_sysfs_show_actual_cpi, NULL);
-
-static ssize_t pyra_sysfs_show_actual_profile(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct pyra_device *pyra =
-			hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-	struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
-	struct pyra_settings settings;
-
-	mutex_lock(&pyra->pyra_lock);
-	roccat_common2_receive(usb_dev, PYRA_COMMAND_SETTINGS,
-			&settings, PYRA_SIZE_SETTINGS);
-	mutex_unlock(&pyra->pyra_lock);
-
-	return snprintf(buf, PAGE_SIZE, "%d\n", settings.startup_profile);
-}
-static DEVICE_ATTR(actual_profile, 0440, pyra_sysfs_show_actual_profile, NULL);
-static DEVICE_ATTR(startup_profile, 0440, pyra_sysfs_show_actual_profile, NULL);
-
-static ssize_t pyra_sysfs_show_firmware_version(struct device *dev,
-		struct device_attribute *attr, char *buf)
-{
-	struct pyra_device *pyra;
-	struct usb_device *usb_dev;
-	struct pyra_info info;
-
-	dev = dev->parent->parent;
-	pyra = hid_get_drvdata(dev_get_drvdata(dev));
-	usb_dev = interface_to_usbdev(to_usb_interface(dev));
-
-	mutex_lock(&pyra->pyra_lock);
-	roccat_common2_receive(usb_dev, PYRA_COMMAND_INFO,
-			&info, PYRA_SIZE_INFO);
-	mutex_unlock(&pyra->pyra_lock);
-
-	return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
-}
-static DEVICE_ATTR(firmware_version, 0440, pyra_sysfs_show_firmware_version,
-		   NULL);
-
-static struct attribute *pyra_attrs[] = {
-	&dev_attr_actual_cpi.attr,
-	&dev_attr_actual_profile.attr,
-	&dev_attr_firmware_version.attr,
-	&dev_attr_startup_profile.attr,
-	NULL,
-};
-
-static struct bin_attribute *pyra_bin_attributes[] = {
-	&bin_attr_control,
-	&bin_attr_info,
-	&bin_attr_profile_settings,
-	&bin_attr_profile_buttons,
-	&bin_attr_settings,
-	&bin_attr_profile1_settings,
-	&bin_attr_profile2_settings,
-	&bin_attr_profile3_settings,
-	&bin_attr_profile4_settings,
-	&bin_attr_profile5_settings,
-	&bin_attr_profile1_buttons,
-	&bin_attr_profile2_buttons,
-	&bin_attr_profile3_buttons,
-	&bin_attr_profile4_buttons,
-	&bin_attr_profile5_buttons,
-	NULL,
-};
-
-static const struct attribute_group pyra_group = {
-	.attrs = pyra_attrs,
-	.bin_attrs = pyra_bin_attributes,
-};
-
-static const struct attribute_group *pyra_groups[] = {
-	&pyra_group,
-	NULL,
-};
-
-static int pyra_init_pyra_device_struct(struct usb_device *usb_dev,
-		struct pyra_device *pyra)
-{
-	struct pyra_settings settings;
-	int retval, i;
-
-	mutex_init(&pyra->pyra_lock);
-
-	retval = pyra_get_settings(usb_dev, &settings);
-	if (retval)
-		return retval;
-
-	for (i = 0; i < 5; ++i) {
-		retval = pyra_get_profile_settings(usb_dev,
-				&pyra->profile_settings[i], i);
-		if (retval)
-			return retval;
-	}
-
-	profile_activated(pyra, settings.startup_profile);
-
-	return 0;
-}
-
-static int pyra_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct pyra_device *pyra;
-	int retval;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			== USB_INTERFACE_PROTOCOL_MOUSE) {
-
-		pyra = kzalloc(sizeof(*pyra), GFP_KERNEL);
-		if (!pyra) {
-			hid_err(hdev, "can't alloc device descriptor\n");
-			return -ENOMEM;
-		}
-		hid_set_drvdata(hdev, pyra);
-
-		retval = pyra_init_pyra_device_struct(usb_dev, pyra);
-		if (retval) {
-			hid_err(hdev, "couldn't init struct pyra_device\n");
-			goto exit_free;
-		}
-
-		retval = roccat_connect(pyra_class, hdev,
-				sizeof(struct pyra_roccat_report));
-		if (retval < 0) {
-			hid_err(hdev, "couldn't init char dev\n");
-		} else {
-			pyra->chrdev_minor = retval;
-			pyra->roccat_claimed = 1;
-		}
-	} else {
-		hid_set_drvdata(hdev, NULL);
-	}
-
-	return 0;
-exit_free:
-	kfree(pyra);
-	return retval;
-}
-
-static void pyra_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct pyra_device *pyra;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			== USB_INTERFACE_PROTOCOL_MOUSE) {
-		pyra = hid_get_drvdata(hdev);
-		if (pyra->roccat_claimed)
-			roccat_disconnect(pyra->chrdev_minor);
-		kfree(hid_get_drvdata(hdev));
-	}
-}
-
-static int pyra_probe(struct hid_device *hdev, const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = pyra_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install mouse\n");
-		goto exit_stop;
-	}
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void pyra_remove(struct hid_device *hdev)
-{
-	pyra_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static void pyra_keep_values_up_to_date(struct pyra_device *pyra,
-		u8 const *data)
-{
-	struct pyra_mouse_event_button const *button_event;
-
-	switch (data[0]) {
-	case PYRA_MOUSE_REPORT_NUMBER_BUTTON:
-		button_event = (struct pyra_mouse_event_button const *)data;
-		switch (button_event->type) {
-		case PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2:
-			profile_activated(pyra, button_event->data1 - 1);
-			break;
-		case PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI:
-			pyra->actual_cpi = button_event->data1;
-			break;
-		}
-		break;
-	}
-}
-
-static void pyra_report_to_chrdev(struct pyra_device const *pyra,
-		u8 const *data)
-{
-	struct pyra_roccat_report roccat_report;
-	struct pyra_mouse_event_button const *button_event;
-
-	if (data[0] != PYRA_MOUSE_REPORT_NUMBER_BUTTON)
-		return;
-
-	button_event = (struct pyra_mouse_event_button const *)data;
-
-	switch (button_event->type) {
-	case PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2:
-	case PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI:
-		roccat_report.type = button_event->type;
-		roccat_report.value = button_event->data1;
-		roccat_report.key = 0;
-		roccat_report_event(pyra->chrdev_minor,
-				(uint8_t const *)&roccat_report);
-		break;
-	case PYRA_MOUSE_EVENT_BUTTON_TYPE_MACRO:
-	case PYRA_MOUSE_EVENT_BUTTON_TYPE_SHORTCUT:
-	case PYRA_MOUSE_EVENT_BUTTON_TYPE_QUICKLAUNCH:
-		if (button_event->data2 == PYRA_MOUSE_EVENT_BUTTON_PRESS) {
-			roccat_report.type = button_event->type;
-			roccat_report.key = button_event->data1;
-			/*
-			 * pyra reports profile numbers with range 1-5.
-			 * Keeping this behaviour.
-			 */
-			roccat_report.value = pyra->actual_profile + 1;
-			roccat_report_event(pyra->chrdev_minor,
-					(uint8_t const *)&roccat_report);
-		}
-		break;
-	}
-}
-
-static int pyra_raw_event(struct hid_device *hdev, struct hid_report *report,
-		u8 *data, int size)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct pyra_device *pyra = hid_get_drvdata(hdev);
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE)
-		return 0;
-
-	if (pyra == NULL)
-		return 0;
-
-	pyra_keep_values_up_to_date(pyra, data);
-
-	if (pyra->roccat_claimed)
-		pyra_report_to_chrdev(pyra, data);
-
-	return 0;
-}
-
-static const struct hid_device_id pyra_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT,
-			USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT,
-			USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, pyra_devices);
-
-static struct hid_driver pyra_driver = {
-		.name = "pyra",
-		.id_table = pyra_devices,
-		.probe = pyra_probe,
-		.remove = pyra_remove,
-		.raw_event = pyra_raw_event
-};
-
-static int __init pyra_init(void)
-{
-	int retval;
-
-	/* class name has to be same as driver name */
-	pyra_class = class_create(THIS_MODULE, "pyra");
-	if (IS_ERR(pyra_class))
-		return PTR_ERR(pyra_class);
-	pyra_class->dev_groups = pyra_groups;
-
-	retval = hid_register_driver(&pyra_driver);
-	if (retval)
-		class_destroy(pyra_class);
-	return retval;
-}
-
-static void __exit pyra_exit(void)
-{
-	hid_unregister_driver(&pyra_driver);
-	class_destroy(pyra_class);
-}
-
-module_init(pyra_init);
-module_exit(pyra_exit);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat Pyra driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-pyra.h b/drivers/hid/hid-roccat-pyra.h
deleted file mode 100644
index beedcf0..0000000
--- a/drivers/hid/hid-roccat-pyra.h
+++ /dev/null
@@ -1,152 +0,0 @@
-#ifndef __HID_ROCCAT_PYRA_H
-#define __HID_ROCCAT_PYRA_H
-
-/*
- * Copyright (c) 2010 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-#include <linux/types.h>
-
-enum {
-	PYRA_SIZE_CONTROL = 0x03,
-	PYRA_SIZE_INFO = 0x06,
-	PYRA_SIZE_PROFILE_SETTINGS = 0x0d,
-	PYRA_SIZE_PROFILE_BUTTONS = 0x13,
-	PYRA_SIZE_SETTINGS = 0x03,
-};
-
-enum pyra_control_requests {
-	PYRA_CONTROL_REQUEST_PROFILE_SETTINGS = 0x10,
-	PYRA_CONTROL_REQUEST_PROFILE_BUTTONS = 0x20
-};
-
-struct pyra_settings {
-	uint8_t command; /* PYRA_COMMAND_SETTINGS */
-	uint8_t size; /* always 3 */
-	uint8_t startup_profile; /* Range 0-4! */
-} __attribute__ ((__packed__));
-
-struct pyra_profile_settings {
-	uint8_t command; /* PYRA_COMMAND_PROFILE_SETTINGS */
-	uint8_t size; /* always 0xd */
-	uint8_t number; /* Range 0-4 */
-	uint8_t xysync;
-	uint8_t x_sensitivity; /* 0x1-0xa */
-	uint8_t y_sensitivity;
-	uint8_t x_cpi; /* unused */
-	uint8_t y_cpi; /* this value is for x and y */
-	uint8_t lightswitch; /* 0 = off, 1 = on */
-	uint8_t light_effect;
-	uint8_t handedness;
-	uint16_t checksum; /* byte sum */
-} __attribute__ ((__packed__));
-
-struct pyra_info {
-	uint8_t command; /* PYRA_COMMAND_INFO */
-	uint8_t size; /* always 6 */
-	uint8_t firmware_version;
-	uint8_t unknown1; /* always 0 */
-	uint8_t unknown2; /* always 1 */
-	uint8_t unknown3; /* always 0 */
-} __attribute__ ((__packed__));
-
-enum pyra_commands {
-	PYRA_COMMAND_CONTROL = 0x4,
-	PYRA_COMMAND_SETTINGS = 0x5,
-	PYRA_COMMAND_PROFILE_SETTINGS = 0x6,
-	PYRA_COMMAND_PROFILE_BUTTONS = 0x7,
-	PYRA_COMMAND_INFO = 0x9,
-	PYRA_COMMAND_B = 0xb
-};
-
-enum pyra_mouse_report_numbers {
-	PYRA_MOUSE_REPORT_NUMBER_HID = 1,
-	PYRA_MOUSE_REPORT_NUMBER_AUDIO = 2,
-	PYRA_MOUSE_REPORT_NUMBER_BUTTON = 3,
-};
-
-struct pyra_mouse_event_button {
-	uint8_t report_number; /* always 3 */
-	uint8_t unknown; /* always 0 */
-	uint8_t type;
-	uint8_t data1;
-	uint8_t data2;
-} __attribute__ ((__packed__));
-
-struct pyra_mouse_event_audio {
-	uint8_t report_number; /* always 2 */
-	uint8_t type;
-	uint8_t unused; /* always 0 */
-} __attribute__ ((__packed__));
-
-/* hid audio controls */
-enum pyra_mouse_event_audio_types {
-	PYRA_MOUSE_EVENT_AUDIO_TYPE_MUTE = 0xe2,
-	PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_UP = 0xe9,
-	PYRA_MOUSE_EVENT_AUDIO_TYPE_VOLUME_DOWN = 0xea,
-};
-
-enum pyra_mouse_event_button_types {
-	/*
-	 * Mouse sends tilt events on report_number 1 and 3
-	 * Tilt events are sent repeatedly with 0.94s between first and second
-	 * event and 0.22s on subsequent
-	 */
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_TILT = 0x10,
-
-	/*
-	 * These are sent sequentially
-	 * data1 contains new profile number in range 1-5
-	 */
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_1 = 0x20,
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_PROFILE_2 = 0x30,
-
-	/*
-	 * data1 = button_number (rmp index)
-	 * data2 = pressed/released
-	 */
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_MACRO = 0x40,
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_SHORTCUT = 0x50,
-
-	/*
-	 * data1 = button_number (rmp index)
-	 */
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
-
-	/* data1 = new cpi */
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_CPI = 0xb0,
-
-	/* data1 and data2 = new sensitivity */
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_SENSITIVITY = 0xc0,
-
-	PYRA_MOUSE_EVENT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
-};
-
-enum {
-	PYRA_MOUSE_EVENT_BUTTON_PRESS = 0,
-	PYRA_MOUSE_EVENT_BUTTON_RELEASE = 1,
-};
-
-struct pyra_roccat_report {
-	uint8_t type;
-	uint8_t value;
-	uint8_t key;
-} __attribute__ ((__packed__));
-
-struct pyra_device {
-	int actual_profile;
-	int actual_cpi;
-	int roccat_claimed;
-	int chrdev_minor;
-	struct mutex pyra_lock;
-	struct pyra_profile_settings profile_settings[5];
-};
-
-#endif
diff --git a/drivers/hid/hid-roccat-ryos.c b/drivers/hid/hid-roccat-ryos.c
deleted file mode 100644
index 47cc8f3..0000000
--- a/drivers/hid/hid-roccat-ryos.c
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Roccat Ryos driver for Linux
- *
- * Copyright (c) 2013 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-#include <linux/types.h>
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-
-enum {
-	RYOS_REPORT_NUMBER_SPECIAL = 3,
-	RYOS_USB_INTERFACE_PROTOCOL = 0,
-};
-
-struct ryos_report_special {
-	uint8_t number; /* RYOS_REPORT_NUMBER_SPECIAL */
-	uint8_t data[4];
-} __packed;
-
-static struct class *ryos_class;
-
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(control, 0x04, 0x03);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(profile, 0x05, 0x03);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(keys_primary, 0x06, 0x7d);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(keys_function, 0x07, 0x5f);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(keys_macro, 0x08, 0x23);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(keys_thumbster, 0x09, 0x17);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(keys_extra, 0x0a, 0x08);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(keys_easyzone, 0x0b, 0x126);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(key_mask, 0x0c, 0x06);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(light, 0x0d, 0x10);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(macro, 0x0e, 0x7d2);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_R(info, 0x0f, 0x08);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(reset, 0x11, 0x03);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(light_control, 0x13, 0x08);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(talk, 0x16, 0x10);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(stored_lights, 0x17, 0x0566);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(custom_lights, 0x18, 0x14);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(light_macro, 0x19, 0x07d2);
-
-static struct bin_attribute *ryos_bin_attrs[] = {
-	&bin_attr_control,
-	&bin_attr_profile,
-	&bin_attr_keys_primary,
-	&bin_attr_keys_function,
-	&bin_attr_keys_macro,
-	&bin_attr_keys_thumbster,
-	&bin_attr_keys_extra,
-	&bin_attr_keys_easyzone,
-	&bin_attr_key_mask,
-	&bin_attr_light,
-	&bin_attr_macro,
-	&bin_attr_info,
-	&bin_attr_reset,
-	&bin_attr_light_control,
-	&bin_attr_talk,
-	&bin_attr_stored_lights,
-	&bin_attr_custom_lights,
-	&bin_attr_light_macro,
-	NULL,
-};
-
-static const struct attribute_group ryos_group = {
-	.bin_attrs = ryos_bin_attrs,
-};
-
-static const struct attribute_group *ryos_groups[] = {
-	&ryos_group,
-	NULL,
-};
-
-static int ryos_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct roccat_common2_device *ryos;
-	int retval;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= RYOS_USB_INTERFACE_PROTOCOL) {
-		hid_set_drvdata(hdev, NULL);
-		return 0;
-	}
-
-	ryos = kzalloc(sizeof(*ryos), GFP_KERNEL);
-	if (!ryos) {
-		hid_err(hdev, "can't alloc device descriptor\n");
-		return -ENOMEM;
-	}
-	hid_set_drvdata(hdev, ryos);
-
-	retval = roccat_common2_device_init_struct(usb_dev, ryos);
-	if (retval) {
-		hid_err(hdev, "couldn't init Ryos device\n");
-		goto exit_free;
-	}
-
-	retval = roccat_connect(ryos_class, hdev,
-			sizeof(struct ryos_report_special));
-	if (retval < 0) {
-		hid_err(hdev, "couldn't init char dev\n");
-	} else {
-		ryos->chrdev_minor = retval;
-		ryos->roccat_claimed = 1;
-	}
-
-	return 0;
-exit_free:
-	kfree(ryos);
-	return retval;
-}
-
-static void ryos_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct roccat_common2_device *ryos;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= RYOS_USB_INTERFACE_PROTOCOL)
-		return;
-
-	ryos = hid_get_drvdata(hdev);
-	if (ryos->roccat_claimed)
-		roccat_disconnect(ryos->chrdev_minor);
-	kfree(ryos);
-}
-
-static int ryos_probe(struct hid_device *hdev,
-		const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = ryos_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install mouse\n");
-		goto exit_stop;
-	}
-
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void ryos_remove(struct hid_device *hdev)
-{
-	ryos_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static int ryos_raw_event(struct hid_device *hdev,
-		struct hid_report *report, u8 *data, int size)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct roccat_common2_device *ryos = hid_get_drvdata(hdev);
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= RYOS_USB_INTERFACE_PROTOCOL)
-		return 0;
-
-	if (data[0] != RYOS_REPORT_NUMBER_SPECIAL)
-		return 0;
-
-	if (ryos != NULL && ryos->roccat_claimed)
-		roccat_report_event(ryos->chrdev_minor, data);
-
-	return 0;
-}
-
-static const struct hid_device_id ryos_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_RYOS_MK) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_RYOS_MK_GLOW) },
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_RYOS_MK_PRO) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, ryos_devices);
-
-static struct hid_driver ryos_driver = {
-		.name = "ryos",
-		.id_table = ryos_devices,
-		.probe = ryos_probe,
-		.remove = ryos_remove,
-		.raw_event = ryos_raw_event
-};
-
-static int __init ryos_init(void)
-{
-	int retval;
-
-	ryos_class = class_create(THIS_MODULE, "ryos");
-	if (IS_ERR(ryos_class))
-		return PTR_ERR(ryos_class);
-	ryos_class->dev_groups = ryos_groups;
-
-	retval = hid_register_driver(&ryos_driver);
-	if (retval)
-		class_destroy(ryos_class);
-	return retval;
-}
-
-static void __exit ryos_exit(void)
-{
-	hid_unregister_driver(&ryos_driver);
-	class_destroy(ryos_class);
-}
-
-module_init(ryos_init);
-module_exit(ryos_exit);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat Ryos MK/Glow/Pro driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-savu.c b/drivers/hid/hid-roccat-savu.c
deleted file mode 100644
index 6dbf6e0..0000000
--- a/drivers/hid/hid-roccat-savu.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Roccat Savu driver for Linux
- *
- * Copyright (c) 2012 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-/* Roccat Savu is a gamer mouse with macro keys that can be configured in
- * 5 profiles.
- */
-
-#include <linux/device.h>
-#include <linux/input.h>
-#include <linux/hid.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/hid-roccat.h>
-#include "hid-ids.h"
-#include "hid-roccat-common.h"
-#include "hid-roccat-savu.h"
-
-static struct class *savu_class;
-
-ROCCAT_COMMON2_BIN_ATTRIBUTE_W(control, 0x4, 0x03);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(profile, 0x5, 0x03);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(general, 0x6, 0x10);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(buttons, 0x7, 0x2f);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(macro, 0x8, 0x0823);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(info, 0x9, 0x08);
-ROCCAT_COMMON2_BIN_ATTRIBUTE_RW(sensor, 0xc, 0x04);
-
-static struct bin_attribute *savu_bin_attrs[] = {
-	&bin_attr_control,
-	&bin_attr_profile,
-	&bin_attr_general,
-	&bin_attr_buttons,
-	&bin_attr_macro,
-	&bin_attr_info,
-	&bin_attr_sensor,
-	NULL,
-};
-
-static const struct attribute_group savu_group = {
-	.bin_attrs = savu_bin_attrs,
-};
-
-static const struct attribute_group *savu_groups[] = {
-	&savu_group,
-	NULL,
-};
-
-static int savu_init_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct usb_device *usb_dev = interface_to_usbdev(intf);
-	struct roccat_common2_device *savu;
-	int retval;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE) {
-		hid_set_drvdata(hdev, NULL);
-		return 0;
-	}
-
-	savu = kzalloc(sizeof(*savu), GFP_KERNEL);
-	if (!savu) {
-		hid_err(hdev, "can't alloc device descriptor\n");
-		return -ENOMEM;
-	}
-	hid_set_drvdata(hdev, savu);
-
-	retval = roccat_common2_device_init_struct(usb_dev, savu);
-	if (retval) {
-		hid_err(hdev, "couldn't init Savu device\n");
-		goto exit_free;
-	}
-
-	retval = roccat_connect(savu_class, hdev,
-			sizeof(struct savu_roccat_report));
-	if (retval < 0) {
-		hid_err(hdev, "couldn't init char dev\n");
-	} else {
-		savu->chrdev_minor = retval;
-		savu->roccat_claimed = 1;
-	}
-
-	return 0;
-exit_free:
-	kfree(savu);
-	return retval;
-}
-
-static void savu_remove_specials(struct hid_device *hdev)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct roccat_common2_device *savu;
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE)
-		return;
-
-	savu = hid_get_drvdata(hdev);
-	if (savu->roccat_claimed)
-		roccat_disconnect(savu->chrdev_minor);
-	kfree(savu);
-}
-
-static int savu_probe(struct hid_device *hdev,
-		const struct hid_device_id *id)
-{
-	int retval;
-
-	retval = hid_parse(hdev);
-	if (retval) {
-		hid_err(hdev, "parse failed\n");
-		goto exit;
-	}
-
-	retval = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
-	if (retval) {
-		hid_err(hdev, "hw start failed\n");
-		goto exit;
-	}
-
-	retval = savu_init_specials(hdev);
-	if (retval) {
-		hid_err(hdev, "couldn't install mouse\n");
-		goto exit_stop;
-	}
-
-	return 0;
-
-exit_stop:
-	hid_hw_stop(hdev);
-exit:
-	return retval;
-}
-
-static void savu_remove(struct hid_device *hdev)
-{
-	savu_remove_specials(hdev);
-	hid_hw_stop(hdev);
-}
-
-static void savu_report_to_chrdev(struct roccat_common2_device const *savu,
-		u8 const *data)
-{
-	struct savu_roccat_report roccat_report;
-	struct savu_mouse_report_special const *special_report;
-
-	if (data[0] != SAVU_MOUSE_REPORT_NUMBER_SPECIAL)
-		return;
-
-	special_report = (struct savu_mouse_report_special const *)data;
-
-	roccat_report.type = special_report->type;
-	roccat_report.data[0] = special_report->data[0];
-	roccat_report.data[1] = special_report->data[1];
-	roccat_report_event(savu->chrdev_minor,
-			(uint8_t const *)&roccat_report);
-}
-
-static int savu_raw_event(struct hid_device *hdev,
-		struct hid_report *report, u8 *data, int size)
-{
-	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
-	struct roccat_common2_device *savu = hid_get_drvdata(hdev);
-
-	if (intf->cur_altsetting->desc.bInterfaceProtocol
-			!= USB_INTERFACE_PROTOCOL_MOUSE)
-		return 0;
-
-	if (savu == NULL)
-		return 0;
-
-	if (savu->roccat_claimed)
-		savu_report_to_chrdev(savu, data);
-
-	return 0;
-}
-
-static const struct hid_device_id savu_devices[] = {
-	{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_SAVU) },
-	{ }
-};
-
-MODULE_DEVICE_TABLE(hid, savu_devices);
-
-static struct hid_driver savu_driver = {
-		.name = "savu",
-		.id_table = savu_devices,
-		.probe = savu_probe,
-		.remove = savu_remove,
-		.raw_event = savu_raw_event
-};
-
-static int __init savu_init(void)
-{
-	int retval;
-
-	savu_class = class_create(THIS_MODULE, "savu");
-	if (IS_ERR(savu_class))
-		return PTR_ERR(savu_class);
-	savu_class->dev_groups = savu_groups;
-
-	retval = hid_register_driver(&savu_driver);
-	if (retval)
-		class_destroy(savu_class);
-	return retval;
-}
-
-static void __exit savu_exit(void)
-{
-	hid_unregister_driver(&savu_driver);
-	class_destroy(savu_class);
-}
-
-module_init(savu_init);
-module_exit(savu_exit);
-
-MODULE_AUTHOR("Stefan Achatz");
-MODULE_DESCRIPTION("USB Roccat Savu driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/hid/hid-roccat-savu.h b/drivers/hid/hid-roccat-savu.h
deleted file mode 100644
index d23217b..0000000
--- a/drivers/hid/hid-roccat-savu.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef __HID_ROCCAT_SAVU_H
-#define __HID_ROCCAT_SAVU_H
-
-/*
- * Copyright (c) 2012 Stefan Achatz <erazor_de-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
- */
-
-/*
- * 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.
- */
-
-#include <linux/types.h>
-
-struct savu_mouse_report_special {
-	uint8_t report_number; /* always 3 */
-	uint8_t zero;
-	uint8_t type;
-	uint8_t data[2];
-} __packed;
-
-enum {
-	SAVU_MOUSE_REPORT_NUMBER_SPECIAL = 3,
-};
-
-enum savu_mouse_report_button_types {
-	/* data1 = new profile range 1-5 */
-	SAVU_MOUSE_REPORT_BUTTON_TYPE_PROFILE = 0x20,
-
-	/* data1 = button number range 1-24; data2 = action */
-	SAVU_MOUSE_REPORT_BUTTON_TYPE_QUICKLAUNCH = 0x60,
-
-	/* data1 = button number range 1-24; data2 = action */
-	SAVU_MOUSE_REPORT_BUTTON_TYPE_TIMER = 0x80,
-
-	/* data1 = setting number range 1-5 */
-	SAVU_MOUSE_REPORT_BUTTON_TYPE_CPI = 0xb0,
-
-	/* data1 and data2 = range 0x1-0xb */
-	SAVU_MOUSE_REPORT_BUTTON_TYPE_SENSITIVITY = 0xc0,
-
-	/* data1 = 22 = next track...
-	 * data2 = action
-	 */
-	SAVU_MOUSE_REPORT_BUTTON_TYPE_MULTIMEDIA = 0xf0,
-};
-
-struct savu_roccat_report {
-	uint8_t type;
-	uint8_t data[2];
-} __packed;
-
-#endif
-- 
1.7.3.4

^ permalink raw reply related

* Re: [Patch 2/3] firmware: dmi_scan: add SBMIOS entry and DMI tables
From: Roy Franz @ 2015-04-16 17:08 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Ivan.khoronzhuk, Linux Kernel Mailing List, Matt Fleming,
	Ard Biesheuvel, Grant Likely, linux-api, linux-doc,
	Mike Waychison, dmidecode-devel, Leif Lindholm, Mark Salter
In-Reply-To: <20150416084808.424385e0@endymion.delvare>

On Wed, Apr 15, 2015 at 11:48 PM, Jean Delvare <jdelvare@suse.de> wrote:
> Hi Roy,
>
> On Wed, 15 Apr 2015 17:54:51 -0700, Roy Franz wrote:
>> On Tue, Apr 14, 2015 at 9:19 PM, Roy Franz <roy.franz@linaro.org> wrote:
>> > I have made modifications to dmidecode to support this interface, and it
>> > works quite nicely for dmidecode. (changes posted to dmidecode-devel list)
>> > The only open issue I am aware of is how the SMBIOS v3 entry point
>> > will be handled,
>> > especially in cases where there is a v2 and a v3 entry point.
>> > In principal I think this a good change - are there any other open issues?
>>
>> I looked at the SMBIOS spec again, and the platform can provide either or
>> both of the 32-bit and 64-bit entry points.  The spec says that an
>> implementation
>> "should" provide a 32-bit entry point for compatibility.
>>
>> These 2 entry point structures can both point to the same SMBIOS
>> structure table,
>> or two distinct ones.  If distinct, the one referenced by the 32-bit
>> entry point must be
>> a consistent subset of the 64-bit one.
>> There does not seem to be any prohibition from using new SMBIOS v3 structures
>> in a table referenced by a 32-bit entry point, so backwards
>> compatibility is completely
>> up to the implementation.
>
> What do you mean with "new SMBIOS v3 structures"? I took a brief look
> at the change log at the end of the SMBIOS 3.0.0 specification, and all
> I can see are new enumerated values for existing fields, as well as 3
> new fields in the type 4 structure. I can't see any new structure type.
> Either way this is all backwards compatible, which is why both entry
> points can point to the same table.
Sorry, I used that imprecisely - I was referring to the new things defined
in the 3.0 specification in addition to the new entry point.  It sounds like
there is not much.
>
>> Since the point of this patchset (and related changes to dmidecode) is
>> to provide the
>> SMBIOS information without using /dev/mem, I think the interface we
>> define should
>> support all the cases outlined in the specification.  I would like to
>> avoid a case where
>> we're back to using /dev/mem to deal with the dual entry/dual table
>> case if that becomes
>> important down the road.
>>
>> Here's a proposal for files in /sys/firmware/dmi/tables:
>>
>> smbios_entry_point32   -  32 bit (existing entry point type), if it exists.
>> smbios_entry_point64   -  64 bit entry, new in SMBIOS v3.0
>> DMI32                         -  smbios structure tables referenced by
>> 32 bit entry point, if it exists
>> DMI64                         -  smbios structure tables referenced by
>> 64 bit entry point, if it exists.
>>                                      symlink to DMI32 if identical
>> smbios_entry_point    - symlink to smbios_entry_point64 if it exists,
>> otherwise symlink to smbios_entry_point64
>> DMI                           - symlink to DMI64 if it exists,
>> otherwise symlink to DMI32
>>
>> These last two would provide names to the 'preferred' tables, and
>> names that would always exist on all systems, which
>> I think is a nice property to have.
>>
>> Thoughts?
>
> The idea was discussed before, and discarded. The question is, what use
> cases do you envision from a user-space application perspective? As you
> found out, the table pointed to by the _SM3_ entry point must be a
> super-set of the one pointed to by the _SM_ entry point, so for a
> compliant implementation there is no reason to follow the _SM_ entry
> point when both exist. And if only one entry point exists, there is
> nothing to choose from.
>
> The kernel itself will have to choose one of the entry points when it
> comes to dmi_scan and dmi-id. It can't provide two sets of DMI strings.
> So it seems reasonable to only expose though sysfs that one entry point
> and table that the kernel itself used.
>
> The only case where it would make some sense to expose everything to
> user-space is for BIOS debugging purpose: if both entry points exist
> and point to different tables, and if the _SM3_ table is broken and
> the _SM_ table is correct, then you may want to be able to temporarily
> read the _SM_ table instead of the _SM3_ table, to check what needs to
> be fixed in the latter. But I would argue that this is beyond the scope
> of our code: neither the kernel nor dmidecode are DMI table or BIOS
> authoring tools.
>
> If there really ever is a need to ignore the _SM3_ entry point, I'd
> rather have a kernel boot parameter for this. This would guarantee that
> the kernel and user-space applications always operate on the same data.
>
> So I would keep the sysfs interface simple, as Ivan implemented it.

Apologies for missing that previous discussion - I was intentionally
bringing an old topic up.
I don't feel strongly, and I think the main use case is debugging
something in the future,
as it doesn't address any current problems. My main motivation for
proposing this was to
avoid a future case where the answer is "just map /dev/mem".  This is
acceptable if the only
people doing it are developers debugging a BIOS/UEFI problem, but I
don't think this is the
right answer for general use case.  If a general use case emerges in
the future that requires
both tables exposed, we can extend the sysfs interface then (and this
may well never happen.)

Thanks,
Roy


>
> --
> Jean Delvare
> SUSE L3 Support

^ permalink raw reply

* Re: [Patch 2/3] firmware: dmi_scan: add SBMIOS entry and DMI tables
From: subscivan @ 2015-04-16 17:27 UTC (permalink / raw)
  To: Jean Delvare, Ivan.khoronzhuk
  Cc: linux-kernel, matt.fleming, ard.biesheuvel, grant.likely,
	linux-api, linux-doc, mikew, dmidecode-devel, leif.lindholm,
	msalter, roy.franz
In-Reply-To: <1429199064.4386.93.camel@chaos.site>

Jean,

On 16.04.15 18:44, Jean Delvare wrote:
> Hi Ivan,
>
> Le Thursday 16 April 2015 à 15:56 +0300, Ivan.khoronzhuk a écrit :
>> On 16.04.15 12:52, Jean Delvare wrote:
>>> On Thu,  2 Apr 2015 15:57:02 +0300, Ivan Khoronzhuk wrote:
>>>> +static BIN_ATTR(smbios_entry_point, S_IRUSR, raw_table_read, NULL, 0);
>>> This one could be world-readable as it contains no sensitive
>>> information.
>> It contains the address of DMI table containing sensitive information.
>> Who knows which ways can be used to take it. Anyway, no see reasons in this
>> w/o DMI table. But if you insist I can do it "world-readable".
> OK, you convinced me.
>
>>>> +struct bin_attribute bin_attr_dmi_table =
>>>> +			__BIN_ATTR(DMI, S_IRUSR, raw_table_read, NULL, 0);
>>> I do not understand why you don't use BIN_ATTR here too? I tried naming
>>> the attribute bin_attr_DMI and it seems to work just fine, checkpatch
>>> doesn't even complain!
>> I dislike upper case in names, at least in such simple names.
>> It makes me using bin_attr_DMI lower in the code. That's why.
>> But if you like it, I will name it "bin_attr_DMI"
> I don't like upper case in names either, but in this specific case, I'd
> do it for consistency. As you wish though, I really only wanted to know
> the reason.
>
>>>> +
>>>> +static int __init dmi_init(void)
>>>> +{
>>>> +	int ret = -ENOMEM;
>>>> +	struct kobject *tables_kobj = NULL;
>>>> +
>>>> +	if (!dmi_available) {
>>>> +		ret = -ENOSYS;
>>>> +		goto err;
>>>> +	}
>>> This is weird. Can this actually happen?
>>>
>>> We currently have two ways to enter this module: dmi_scan_machine(),
>>> which is called by the architecture code, and dmi_init(), which is
>>> called at subsys_initcall time. As far as I can see,
>>> core/arch_initcalls are guaranteed to be always called before
>>> subsys_initcalls. If we can rely on that, the test above is not needed.
>>> If for any reason we can't, that means that dmi_init() should not be a
>>> subsys_initcall, but should instead be called explicitly at the end of
>>> dmi_scan_machine().
>> We cannot be sure that firmware_kobj created at time of dmi_init().
>> The sources don't oblige you to call it at core level,
>> for instance like it was done for arm64. For x86, dmi_init() can be called
>> before firmware_kobj is created.
> Looking at the code, it seems that firmware_kobj is created very, very
> early in the boot process. In do_basic_setup(), you can see that
> driver_init() (which in turn calls firmware_init(), creating
> firmware_kobj) is called before do_initcalls(). So firmware_kobj must be
> defined before dmi_scan_machine() or dmi_init() is called.

No. Not must, rather should. See below.

>
> Oh, and this wasn't even my point ;-) I'm fine with you checking if
> firmware_kobj is defined. My question was about the dmi_available check
> above. But that question was silly anyway, sorry. I confused
> dmi_available with dmi_initialized. Checking for dmi_available is
> perfectly reasonable, please scratch my objection.
>
>> And if I call it from dmi_init() I suppose
>> I would face an error. As I can't call it in dmi_init I can't be sure that
>> DMI is available at all. So, no, we have to check dmi_available here and
>> call it at subsys layer, where it's supposed to be.
> I can't parse that, I suspect you wrote dmi_init where you actually
> meant dmi_scan_machine? Given how early firmware_kobj is created, I
> think the code currently in dmi_init could in fact go at the end of
> dmi_scan_machine.

Actually, dmi_scan_machine can be called even earlier.
As I've sad, for x86, it's called before firmware_kobj is created.

kernel_start()
     setup_arch()
         dmi_scan_machine()

And for firmware_init(), as you noticed already:

start_kernel()
     rest_init()
         kernel_init()
             kernel_init_freeable()
                 do_basic_setup()
                     driver_init()
                         firmware_init()

Pay attentions that setup_arch() is called much earlier than rest_init().
So dmi_init couldn't in fact go at the end of dmi_scan_machine.

> But it's not important for the time being, this can be
> attempted later.
>
>>>> (...)
>>>> +	kobject_del(dmi_kobj);
>>>> +	kobject_put(dmi_kobj);
>>>> +	dmi_kobj = NULL;
>>> I'm wondering, wouldn't it make sense to keep dmi_kobj alive (with an
>>> appropriate comment), so that dmi-sysfs has a chance to load? As it is
>>> now, a bug or some unexpected behavior in this new code could cause a
>>> regression for dmi-sysfs users. Just because I don't like dmi_sysfs
>>> doesn't mean we can break it ;-)
>> As I remember it was not so critical for you last time.
>> "I don't care which way you choose". And I've explained my position.
>> But it's not very hard to me to change it. Anyway patch requires re-push.
> You're right, I did not remember we had discussed this already,
> sorry :-(
>
> Well, I still agree that it doesn't really matter, but of two acceptable
> solutions for an event which will most likely never happen, why not go
> for the ones with the fewer lines of code? ;-)

Ok.

^ permalink raw reply

* Re: [Patch 2/3] firmware: dmi_scan: add SBMIOS entry and DMI tables
From: Ivan.khoronzhuk @ 2015-04-16 17:32 UTC (permalink / raw)
  To: subscivan, Jean Delvare
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	matt.fleming-ral2JQCrhuEAvxtiuMwx3w,
	ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA, mikew-hpIqsD4AKlfQT0dZR+AlfA,
	dmidecode-devel-qX2TKyscuCcdnm+yROfE0A,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A,
	msalter-H+wXaHxf7aLQT0dZR+AlfA, roy.franz-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <552FF0E4.709-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Sorry, sent it from not original mail.

On 16.04.15 20:27, subscivan wrote:
> Jean,
>
> On 16.04.15 18:44, Jean Delvare wrote:
>> Hi Ivan,
>>
>> Le Thursday 16 April 2015 à 15:56 +0300, Ivan.khoronzhuk a écrit :
>>> On 16.04.15 12:52, Jean Delvare wrote:
>>>> On Thu,  2 Apr 2015 15:57:02 +0300, Ivan Khoronzhuk wrote:
>>>>> +static BIN_ATTR(smbios_entry_point, S_IRUSR, raw_table_read, 
>>>>> NULL, 0);
>>>> This one could be world-readable as it contains no sensitive
>>>> information.
>>> It contains the address of DMI table containing sensitive information.
>>> Who knows which ways can be used to take it. Anyway, no see reasons 
>>> in this
>>> w/o DMI table. But if you insist I can do it "world-readable".
>> OK, you convinced me.
>>
>>>>> +struct bin_attribute bin_attr_dmi_table =
>>>>> +            __BIN_ATTR(DMI, S_IRUSR, raw_table_read, NULL, 0);
>>>> I do not understand why you don't use BIN_ATTR here too? I tried 
>>>> naming
>>>> the attribute bin_attr_DMI and it seems to work just fine, checkpatch
>>>> doesn't even complain!
>>> I dislike upper case in names, at least in such simple names.
>>> It makes me using bin_attr_DMI lower in the code. That's why.
>>> But if you like it, I will name it "bin_attr_DMI"
>> I don't like upper case in names either, but in this specific case, I'd
>> do it for consistency. As you wish though, I really only wanted to know
>> the reason.
>>
>>>>> +
>>>>> +static int __init dmi_init(void)
>>>>> +{
>>>>> +    int ret = -ENOMEM;
>>>>> +    struct kobject *tables_kobj = NULL;
>>>>> +
>>>>> +    if (!dmi_available) {
>>>>> +        ret = -ENOSYS;
>>>>> +        goto err;
>>>>> +    }
>>>> This is weird. Can this actually happen?
>>>>
>>>> We currently have two ways to enter this module: dmi_scan_machine(),
>>>> which is called by the architecture code, and dmi_init(), which is
>>>> called at subsys_initcall time. As far as I can see,
>>>> core/arch_initcalls are guaranteed to be always called before
>>>> subsys_initcalls. If we can rely on that, the test above is not 
>>>> needed.
>>>> If for any reason we can't, that means that dmi_init() should not be a
>>>> subsys_initcall, but should instead be called explicitly at the end of
>>>> dmi_scan_machine().
>>> We cannot be sure that firmware_kobj created at time of dmi_init().
>>> The sources don't oblige you to call it at core level,
>>> for instance like it was done for arm64. For x86, dmi_init() can be 
>>> called
>>> before firmware_kobj is created.
>> Looking at the code, it seems that firmware_kobj is created very, very
>> early in the boot process. In do_basic_setup(), you can see that
>> driver_init() (which in turn calls firmware_init(), creating
>> firmware_kobj) is called before do_initcalls(). So firmware_kobj must be
>> defined before dmi_scan_machine() or dmi_init() is called.
>
> No. Not must, rather should. See below.
>
>>
>> Oh, and this wasn't even my point ;-) I'm fine with you checking if
>> firmware_kobj is defined. My question was about the dmi_available check
>> above. But that question was silly anyway, sorry. I confused
>> dmi_available with dmi_initialized. Checking for dmi_available is
>> perfectly reasonable, please scratch my objection.
>>
>>> And if I call it from dmi_init() I suppose
>>> I would face an error. As I can't call it in dmi_init I can't be 
>>> sure that
>>> DMI is available at all. So, no, we have to check dmi_available here 
>>> and
>>> call it at subsys layer, where it's supposed to be.
>> I can't parse that, I suspect you wrote dmi_init where you actually
>> meant dmi_scan_machine? Given how early firmware_kobj is created, I
>> think the code currently in dmi_init could in fact go at the end of
>> dmi_scan_machine.
>
> Actually, dmi_scan_machine can be called even earlier.
> As I've sad, for x86, it's called before firmware_kobj is created.
>
> kernel_start()
>     setup_arch()
>         dmi_scan_machine()
>
> And for firmware_init(), as you noticed already:
>
> start_kernel()
>     rest_init()
>         kernel_init()
>             kernel_init_freeable()
>                 do_basic_setup()
>                     driver_init()
>                         firmware_init()
>
> Pay attentions that setup_arch() is called much earlier than rest_init().
> So dmi_init couldn't in fact go at the end of dmi_scan_machine.
>
>> But it's not important for the time being, this can be
>> attempted later.
>>
>>>>> (...)
>>>>> +    kobject_del(dmi_kobj);
>>>>> +    kobject_put(dmi_kobj);
>>>>> +    dmi_kobj = NULL;
>>>> I'm wondering, wouldn't it make sense to keep dmi_kobj alive (with an
>>>> appropriate comment), so that dmi-sysfs has a chance to load? As it is
>>>> now, a bug or some unexpected behavior in this new code could cause a
>>>> regression for dmi-sysfs users. Just because I don't like dmi_sysfs
>>>> doesn't mean we can break it ;-)
>>> As I remember it was not so critical for you last time.
>>> "I don't care which way you choose". And I've explained my position.
>>> But it's not very hard to me to change it. Anyway patch requires 
>>> re-push.
>> You're right, I did not remember we had discussed this already,
>> sorry :-(
>>
>> Well, I still agree that it doesn't really matter, but of two acceptable
>> solutions for an event which will most likely never happen, why not go
>> for the ones with the fewer lines of code? ;-)
>
> Ok.

-- 
Regards,
Ivan Khoronzhuk

^ permalink raw reply

* Re: [Patch 1/3] firmware: dmi_scan: rename dmi_table to dmi_decode_table
From: Ivan.khoronzhuk @ 2015-04-16 20:16 UTC (permalink / raw)
  To: Jean Delvare, Matt Fleming
  Cc: linux-kernel, matt.fleming, ard.biesheuvel, grant.likely,
	linux-api, linux-doc, mikew, dmidecode-devel, leif.lindholm,
	msalter, roy.franz
In-Reply-To: <20150416103511.55927ccc@endymion.delvare>

Hi Jean,

On 16.04.15 11:35, Jean Delvare wrote:
> Hi Matt,
>
> On Wed, 15 Apr 2015 15:35:30 +0100, Matt Fleming wrote:
>> On Thu, 02 Apr, at 03:57:01PM, Ivan Khoronzhuk wrote:
>>> The "dmi_table" function looks like data instance, but it does DMI
>>> table decode. This patch renames it to "dmi_decode_table" name as
>>> more appropriate. That allows us to use "dmi_table" name for correct
>>> purposes.
>>>
>>> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@globallogic.com>
>>> ---
>>>   drivers/firmware/dmi_scan.c | 10 +++++-----
>>>   1 file changed, 5 insertions(+), 5 deletions(-)
>> Looks good to me.
>>
>> Jean, do you want me to pick this patch up or are you going to?
> Good question, we need to agree on a strategy.
>
> There are 3 patch sets to consider here.
>
> 1* My patch fixing the UUID ordering bug. It must go in first and
>     immediately, as it fixes a regression and will have to be backported
>     to stable branches.

||
V

>
> 2* 2 older patches from Ivan which are currently in your efi-next tree
>     if I'm not mistaken. Both were based on an old tree so they do not
>     apply cleanly on kernel v4.0, I had to fix them up manually. I have

They are in master tree already.

>     no idea if git would be able to merge them properly, as the fix
>     above changed the context even more.

Current efi-next already merged, so you should base your patches on
top of last changes.

>
> 3* The 3 new patches from Ivan which I am reviewing now, which are not
>     applied in any public tree AFAIK.

It shouldn't happen,
I've been verifying just now once again.
They are applied on top of linux_next cleanly.
Equal as on efi/next.

>
> I don't really care who picks these patches up and sends them to Linus,
> but I think they should all follow the same route so that Linus has as
> little merge work to do as possible. So either you pick them all, or I
> do. If I do, you'll have to drop the 2 patches you have in efi-next.
> Again I'm fine either way, so please let me know what makes your life
> easier and let's do that.
>
> Thanks,

Jean,
I'm going to base my series
"firmware: dmi_scan: add SBMIOS entry point and DMI tables"
on top of linux next unless you have already your tree to pick up changes.
Please let me know, if you have one.


-- 
Regards,
Ivan Khoronzhuk


^ permalink raw reply

* [PATCH V6 03/10] audit: log namespace ID numbers
From: Richard Guy Briggs @ 2015-04-17  7:35 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-audit-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, pmoore-H+wXaHxf7aLQT0dZR+AlfA,
	linux-security-module-u79uwXL29TY76Z2rM5mHXA,
	linux-ima-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	eparis-FjpueFixGhCM4zKIHC2jIg, sgrubb-H+wXaHxf7aLQT0dZR+AlfA,
	zohar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w
In-Reply-To: <cover.1429252659.git.rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Log the namespace identifiers (device ID and proc inode minus base offset) of a
task in a new record type (1329) (usually accompanies audit_log_task_info()
type=SYSCALL record) which is used by syscall audits, among others..

Idea first presented:
	https://www.redhat.com/archives/linux-audit/2013-March/msg00020.html

Typical output format would look something like:
	type=NS_INFO msg=audit(1408577535.306:82): pid=374 dev=00:03 netns=116 utsns=-2 ipcns=-1 pidns=-4 userns=-3 mntns=0

The namespace identifier values are printed relative to PROC_DYNAMIC_FIRST
(0xF000000) (so the first 4 are negative).

Suggested-by: Aristeu Rozanski <arozansk-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Richard Guy Briggs <rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Acked-by: Serge Hallyn <serge.hallyn-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
 include/linux/audit.h            |    8 ++++++++
 include/uapi/linux/audit.h       |    1 +
 kernel/audit.c                   |   35 +++++++++++++++++++++++++++++++++++
 kernel/auditsc.c                 |    2 ++
 security/integrity/ima/ima_api.c |    2 ++
 5 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/include/linux/audit.h b/include/linux/audit.h
index b481779..71698ec 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -478,6 +478,12 @@ static inline void	    audit_log_secctx(struct audit_buffer *ab, u32 secid)
 extern int audit_log_task_context(struct audit_buffer *ab);
 extern void audit_log_task_info(struct audit_buffer *ab,
 				struct task_struct *tsk);
+#ifdef CONFIG_NAMESPACES
+extern void		    audit_log_ns_info(struct task_struct *tsk);
+#else
+static inline void	    audit_log_ns_info(struct task_struct *tsk)
+{ }
+#endif
 
 extern int		    audit_update_lsm_rules(void);
 
@@ -534,6 +540,8 @@ static inline int audit_log_task_context(struct audit_buffer *ab)
 static inline void audit_log_task_info(struct audit_buffer *ab,
 				       struct task_struct *tsk)
 { }
+static inline void audit_log_ns_info(struct task_struct *tsk)
+{ }
 #define audit_enabled 0
 #endif /* CONFIG_AUDIT */
 static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 2ccf19e..1ffb151 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -110,6 +110,7 @@
 #define AUDIT_SECCOMP		1326	/* Secure Computing event */
 #define AUDIT_PROCTITLE		1327	/* Proctitle emit event */
 #define AUDIT_FEATURE_CHANGE	1328	/* audit log listing feature changes */
+#define AUDIT_NS_INFO		1329	/* Record process namespace IDs */
 
 #define AUDIT_AVC		1400	/* SE Linux avc denial or grant */
 #define AUDIT_SELINUX_ERR	1401	/* Internal SE Linux Errors */
diff --git a/kernel/audit.c b/kernel/audit.c
index d5a1220..68200ce 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -66,7 +66,9 @@
 #include <linux/freezer.h>
 #include <linux/tty.h>
 #include <linux/pid_namespace.h>
+#include <linux/proc_ns.h>
 #include <net/netns/generic.h>
+#include <linux/mount.h> /* struct vfsmount */
 
 #include "audit.h"
 
@@ -745,6 +747,8 @@ static void audit_log_feature_change(int which, u32 old_feature, u32 new_feature
 			 audit_feature_names[which], !!old_feature, !!new_feature,
 			 !!old_lock, !!new_lock, res);
 	audit_log_end(ab);
+
+	audit_log_ns_info(current);
 }
 
 static int audit_set_feature(struct sk_buff *skb)
@@ -1653,6 +1657,35 @@ void audit_log_session_info(struct audit_buffer *ab)
 	audit_log_format(ab, " auid=%u ses=%u", auid, sessionid);
 }
 
+#ifdef CONFIG_NAMESPACES
+void audit_log_ns_info(struct task_struct *tsk)
+{
+	const struct proc_ns_operations **entry;
+	bool end = false;
+	struct audit_buffer *ab;
+	struct vfsmount *mnt = task_active_pid_ns(tsk)->proc_mnt;
+	struct super_block *sb = mnt->mnt_sb;
+
+	if (!tsk)
+		return;
+	ab = audit_log_start(tsk->audit_context, GFP_KERNEL,
+			     AUDIT_NS_INFO);
+	if (!ab)
+		return;
+	audit_log_format(ab, "pid=%d", task_pid_nr(tsk));
+	audit_log_format(ab, " dev=%02x:%02x", MAJOR(sb->s_dev), MINOR(sb->s_dev));
+	for (entry = ns_entries; !end; entry++) {
+		void *ns = (*entry)->get(tsk);
+
+		audit_log_format(ab, " %sns=%d", (*entry)->name,
+				 (*entry)->inum(ns) - PROC_DYNAMIC_FIRST);
+		(*entry)->put(ns);
+		end = (*entry)->type == CLONE_NEWNS;
+	}
+	audit_log_end(ab);
+}
+#endif /* CONFIG_NAMESPACES */
+
 void audit_log_key(struct audit_buffer *ab, char *key)
 {
 	audit_log_format(ab, " key=");
@@ -1935,6 +1968,8 @@ void audit_log_link_denied(const char *operation, struct path *link)
 	audit_log_format(ab, " res=0");
 	audit_log_end(ab);
 
+	audit_log_ns_info(current);
+
 	/* Generate AUDIT_PATH record with object. */
 	name->type = AUDIT_TYPE_NORMAL;
 	audit_copy_inode(name, link->dentry, link->dentry->d_inode);
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 4b89f7f..3ca3416 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1378,6 +1378,8 @@ static void audit_log_exit(struct audit_context *context, struct task_struct *ts
 	audit_log_key(ab, context->filterkey);
 	audit_log_end(ab);
 
+	audit_log_ns_info(tsk);
+
 	for (aux = context->aux; aux; aux = aux->next) {
 
 		ab = audit_log_start(context, GFP_KERNEL, aux->type);
diff --git a/security/integrity/ima/ima_api.c b/security/integrity/ima/ima_api.c
index d9cd5ce..58ac695 100644
--- a/security/integrity/ima/ima_api.c
+++ b/security/integrity/ima/ima_api.c
@@ -323,6 +323,8 @@ void ima_audit_measurement(struct integrity_iint_cache *iint,
 	audit_log_task_info(ab, current);
 	audit_log_end(ab);
 
+	audit_log_ns_info(current);
+
 	iint->flags |= IMA_AUDITED;
 }
 
-- 
1.7.1

^ permalink raw reply related

* [PATCH V6 05/10] audit: log creation and deletion of namespace instances
From: Richard Guy Briggs @ 2015-04-17  7:35 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-audit-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
	pmoore-H+wXaHxf7aLQT0dZR+AlfA, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
	eparis-FjpueFixGhCM4zKIHC2jIg, sgrubb-H+wXaHxf7aLQT0dZR+AlfA,
	zohar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w
In-Reply-To: <cover.1429252659.git.rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Log the creation and deletion of namespace instances in all 6 types of
namespaces.

Twelve new audit message types have been introduced:
AUDIT_NS_INIT_MNT       1330    /* Record mount namespace instance creation */
AUDIT_NS_INIT_UTS       1331    /* Record UTS namespace instance creation */
AUDIT_NS_INIT_IPC       1332    /* Record IPC namespace instance creation */
AUDIT_NS_INIT_USER      1333    /* Record USER namespace instance creation */
AUDIT_NS_INIT_PID       1334    /* Record PID namespace instance creation */
AUDIT_NS_INIT_NET       1335    /* Record NET namespace instance creation */
AUDIT_NS_DEL_MNT        1336    /* Record mount namespace instance deletion */
AUDIT_NS_DEL_UTS        1337    /* Record UTS namespace instance deletion */
AUDIT_NS_DEL_IPC        1338    /* Record IPC namespace instance deletion */
AUDIT_NS_DEL_USER       1339    /* Record USER namespace instance deletion */
AUDIT_NS_DEL_PID        1340    /* Record PID namespace instance deletion */
AUDIT_NS_DEL_NET        1341    /* Record NET namespace instance deletion */

As suggested by Eric Paris, there are 12 message types, one for each of
creation and deletion, one for each type of namespace so that text searches are
easier in conjunction with the AUDIT_NS_INFO message type, being able to search
for all records such as "netns=4 " and to avoid fields disappearing per message
type to make ausearch more efficient.

A typical startup would look roughly like:

	type=AUDIT_NS_INIT_UTS msg=audit(1408577534.868:5): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel dev=00:03 old_utsns=(none) utsns=-2 res=1
	type=AUDIT_NS_INIT_USER msg=audit(1408577534.868:6): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel dev=00:03 old_userns=(none) userns=-3 res=1
	type=AUDIT_NS_INIT_PID msg=audit(1408577534.868:7): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel dev=00:03 old_pidns=(none) pidns=-4 res=1
	type=AUDIT_NS_INIT_MNT msg=audit(1408577534.868:8): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel dev=00:03 old_mntns=(none) mntns=0 res=1
	type=AUDIT_NS_INIT_IPC msg=audit(1408577534.868:9): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel dev=00:03 old_ipcns=(none) ipcns=-1 res=1
	type=AUDIT_NS_INIT_NET msg=audit(1408577533.500:10): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel dev=00:03 old_netns=(none) netns=2 res=1

And a CLONE action would result in:
	type=type=AUDIT_NS_INIT_NET msg=audit(1408577535.306:81): pid=481 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 dev=00:03 old_netns=2 netns=3 res=1

While deleting a namespace would result in:
	type=type=AUDIT_NS_DEL_MNT msg=audit(1408577552.221:85): pid=481 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 dev=00:03 mntns=4 res=1

If not "(none)", old_XXXns lists the namespace from which it was cloned.

Signed-off-by: Richard Guy Briggs <rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fs/namespace.c             |   13 +++++++++
 include/linux/audit.h      |    8 +++++
 include/uapi/linux/audit.h |   12 ++++++++
 ipc/namespace.c            |   12 ++++++++
 kernel/audit.c             |   64 ++++++++++++++++++++++++++++++++++++++++++++
 kernel/pid_namespace.c     |   13 +++++++++
 kernel/user_namespace.c    |   13 +++++++++
 kernel/utsname.c           |   12 ++++++++
 net/core/net_namespace.c   |   12 ++++++++
 9 files changed, 159 insertions(+), 0 deletions(-)

diff --git a/fs/namespace.c b/fs/namespace.c
index 182bc41..7b62543 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -24,6 +24,7 @@
 #include <linux/proc_ns.h>
 #include <linux/magic.h>
 #include <linux/bootmem.h>
+#include <linux/audit.h>
 #include "pnode.h"
 #include "internal.h"
 
@@ -2459,6 +2460,7 @@ dput_out:
 
 static void free_mnt_ns(struct mnt_namespace *ns)
 {
+	audit_log_ns_del(AUDIT_NS_DEL_MNT, ns->proc_inum);
 	proc_free_inum(ns->proc_inum);
 	put_user_ns(ns->user_ns);
 	kfree(ns);
@@ -2518,6 +2520,7 @@ struct mnt_namespace *copy_mnt_ns(unsigned long flags, struct mnt_namespace *ns,
 	new_ns = alloc_mnt_ns(user_ns);
 	if (IS_ERR(new_ns))
 		return new_ns;
+	audit_log_ns_init(AUDIT_NS_INIT_MNT, ns->proc_inum, new_ns->proc_inum);
 
 	namespace_lock();
 	/* First pass: copy the tree topology */
@@ -2830,6 +2833,16 @@ static void __init init_mount_tree(void)
 	set_fs_root(current->fs, &root);
 }
 
+/* log the ID of init mnt namespace after audit service starts */
+static int __init mnt_ns_init_log(void)
+{
+	struct mnt_namespace *init_mnt_ns = init_task.nsproxy->mnt_ns;
+
+	audit_log_ns_init(AUDIT_NS_INIT_MNT, 0, init_mnt_ns->proc_inum);
+	return 0;
+}
+late_initcall(mnt_ns_init_log);
+
 void __init mnt_init(void)
 {
 	unsigned u;
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 71698ec..b28dfb0 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -484,6 +484,9 @@ extern void		    audit_log_ns_info(struct task_struct *tsk);
 static inline void	    audit_log_ns_info(struct task_struct *tsk)
 { }
 #endif
+extern void		    audit_log_ns_init(int type, unsigned int old_inum,
+					      unsigned int inum);
+extern void		    audit_log_ns_del(int type, unsigned int inum);
 
 extern int		    audit_update_lsm_rules(void);
 
@@ -542,6 +545,11 @@ static inline void audit_log_task_info(struct audit_buffer *ab,
 { }
 static inline void audit_log_ns_info(struct task_struct *tsk)
 { }
+static inline int audit_log_ns_init(int type, unsigned int old_inum,
+				    unsigned int inum)
+{ }
+static inline int audit_log_ns_del(int type, unsigned int inum)
+{ }
 #define audit_enabled 0
 #endif /* CONFIG_AUDIT */
 static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 1ffb151..487cad6 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -111,6 +111,18 @@
 #define AUDIT_PROCTITLE		1327	/* Proctitle emit event */
 #define AUDIT_FEATURE_CHANGE	1328	/* audit log listing feature changes */
 #define AUDIT_NS_INFO		1329	/* Record process namespace IDs */
+#define AUDIT_NS_INIT_MNT	1330	/* Record mount namespace instance creation */
+#define AUDIT_NS_INIT_UTS	1331	/* Record UTS namespace instance creation */
+#define AUDIT_NS_INIT_IPC	1332	/* Record IPC namespace instance creation */
+#define AUDIT_NS_INIT_USER	1333	/* Record USER namespace instance creation */
+#define AUDIT_NS_INIT_PID	1334	/* Record PID namespace instance creation */
+#define AUDIT_NS_INIT_NET	1335	/* Record NET namespace instance creation */
+#define AUDIT_NS_DEL_MNT	1336	/* Record mount namespace instance deletion */
+#define AUDIT_NS_DEL_UTS	1337	/* Record UTS namespace instance deletion */
+#define AUDIT_NS_DEL_IPC	1338	/* Record IPC namespace instance deletion */
+#define AUDIT_NS_DEL_USER	1339	/* Record USER namespace instance deletion */
+#define AUDIT_NS_DEL_PID	1340	/* Record PID namespace instance deletion */
+#define AUDIT_NS_DEL_NET	1341	/* Record NET namespace instance deletion */
 
 #define AUDIT_AVC		1400	/* SE Linux avc denial or grant */
 #define AUDIT_SELINUX_ERR	1401	/* Internal SE Linux Errors */
diff --git a/ipc/namespace.c b/ipc/namespace.c
index 59451c1..73727ce 100644
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -13,6 +13,7 @@
 #include <linux/mount.h>
 #include <linux/user_namespace.h>
 #include <linux/proc_ns.h>
+#include <linux/audit.h>
 
 #include "util.h"
 
@@ -41,6 +42,8 @@ static struct ipc_namespace *create_ipc_ns(struct user_namespace *user_ns,
 	}
 	atomic_inc(&nr_ipc_ns);
 
+	audit_log_ns_init(AUDIT_NS_INIT_IPC, old_ns->proc_inum, ns->proc_inum);
+
 	sem_init_ns(ns);
 	msg_init_ns(ns);
 	shm_init_ns(ns);
@@ -119,6 +122,7 @@ static void free_ipc_ns(struct ipc_namespace *ns)
 	 */
 	ipcns_notify(IPCNS_REMOVED);
 	put_user_ns(ns->user_ns);
+	audit_log_ns_del(AUDIT_NS_DEL_IPC, ns->proc_inum);
 	proc_free_inum(ns->proc_inum);
 	kfree(ns);
 }
@@ -197,3 +201,11 @@ const struct proc_ns_operations ipcns_operations = {
 	.install	= ipcns_install,
 	.inum		= ipcns_inum,
 };
+
+/* log the ID of init IPC namespace after audit service starts */
+static int __init ipc_namespaces_init(void)
+{
+	audit_log_ns_init(AUDIT_NS_INIT_IPC, 0, init_ipc_ns.proc_inum);
+	return 0;
+}
+late_initcall(ipc_namespaces_init);
diff --git a/kernel/audit.c b/kernel/audit.c
index 63f32f4..e6230c4 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1978,6 +1978,70 @@ out:
 	kfree(name);
 }
 
+#ifdef CONFIG_NAMESPACES
+static char *ns_name[] = {
+	"mnt",
+	"uts",
+	"ipc",
+	"user",
+	"pid",
+	"net",
+};
+
+/**
+ * audit_log_ns_init - report a namespace instance creation
+ * @type: type of audit namespace instance created message
+ * @old_inum: the ID number of the cloned namespace instance
+ * @inum: the ID number of the new namespace instance
+ */
+void  audit_log_ns_init(int type, unsigned int old_inum, unsigned int inum)
+{
+	struct audit_buffer *ab;
+	char *audit_ns_name = ns_name[type - AUDIT_NS_INIT_MNT];
+	struct vfsmount *mnt = task_active_pid_ns(current)->proc_mnt;
+	struct super_block *sb = mnt->mnt_sb;
+	char old_ns[16];
+
+	if (type < AUDIT_NS_INIT_MNT || type > AUDIT_NS_INIT_NET) {
+		WARN(1, "audit_log_ns_init: type:%d out of range", type);
+		return;
+	}
+	if (!old_inum)
+		sprintf(old_ns, "(none)");
+	else
+		sprintf(old_ns, "%d", old_inum - PROC_DYNAMIC_FIRST);
+	audit_log_common_recv_msg(&ab, type);
+	audit_log_format(ab, " dev=%02x:%02x old_%sns=%s %sns=%d res=1",
+			 MAJOR(sb->s_dev), MINOR(sb->s_dev),
+			 audit_ns_name, old_ns,
+			 audit_ns_name, inum - PROC_DYNAMIC_FIRST);
+	audit_log_end(ab);
+}
+
+/**
+ * audit_log_ns_del - report a namespace instance deleted
+ * @type: type of audit namespace instance deleted message
+ * @inum: the ID number of the namespace instance
+ */
+void audit_log_ns_del(int type, unsigned int inum)
+{
+	struct audit_buffer *ab;
+	char *audit_ns_name = ns_name[type - AUDIT_NS_DEL_MNT];
+	struct vfsmount *mnt = task_active_pid_ns(current)->proc_mnt;
+	struct super_block *sb = mnt->mnt_sb;
+
+	if (type < AUDIT_NS_DEL_MNT || type > AUDIT_NS_DEL_NET) {
+		WARN(1, "audit_log_ns_del: type:%d out of range", type);
+		return;
+	}
+	audit_log_common_recv_msg(&ab, type);
+	audit_log_format(ab, " dev=%02x:%02x %sns=%d res=1",
+			 MAJOR(sb->s_dev), MINOR(sb->s_dev), audit_ns_name,
+			 inum - PROC_DYNAMIC_FIRST);
+	audit_log_end(ab);
+}
+#endif /* CONFIG_NAMESPACES */
+
 /**
  * audit_log_end - end one audit record
  * @ab: the audit_buffer
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c
index db95d8e..d28fd14 100644
--- a/kernel/pid_namespace.c
+++ b/kernel/pid_namespace.c
@@ -18,6 +18,7 @@
 #include <linux/proc_ns.h>
 #include <linux/reboot.h>
 #include <linux/export.h>
+#include <linux/audit.h>
 
 struct pid_cache {
 	int nr_ids;
@@ -109,6 +110,9 @@ static struct pid_namespace *create_pid_namespace(struct user_namespace *user_ns
 	if (err)
 		goto out_free_map;
 
+	audit_log_ns_init(AUDIT_NS_INIT_PID, parent_pid_ns->proc_inum,
+			  ns->proc_inum);
+
 	kref_init(&ns->kref);
 	ns->level = level;
 	ns->parent = get_pid_ns(parent_pid_ns);
@@ -142,6 +146,7 @@ static void destroy_pid_namespace(struct pid_namespace *ns)
 {
 	int i;
 
+	audit_log_ns_del(AUDIT_NS_DEL_PID, ns->proc_inum);
 	proc_free_inum(ns->proc_inum);
 	for (i = 0; i < PIDMAP_ENTRIES; i++)
 		kfree(ns->pidmap[i].page);
@@ -388,3 +393,11 @@ static __init int pid_namespaces_init(void)
 }
 
 __initcall(pid_namespaces_init);
+
+/* log the ID of init PID namespace after audit service starts */
+static __init int pid_namespaces_late_init(void)
+{
+	audit_log_ns_init(AUDIT_NS_INIT_PID, 0, init_pid_ns.proc_inum);
+	return 0;
+}
+late_initcall(pid_namespaces_late_init);
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index fcc0256..89c2517 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -22,6 +22,7 @@
 #include <linux/ctype.h>
 #include <linux/projid.h>
 #include <linux/fs_struct.h>
+#include <linux/audit.h>
 
 static struct kmem_cache *user_ns_cachep __read_mostly;
 
@@ -92,6 +93,9 @@ int create_user_ns(struct cred *new)
 		return ret;
 	}
 
+	audit_log_ns_init(AUDIT_NS_INIT_USER, parent_ns->proc_inum,
+			  ns->proc_inum);
+
 	atomic_set(&ns->count, 1);
 	/* Leave the new->user_ns reference with the new user namespace. */
 	ns->parent = parent_ns;
@@ -136,6 +140,7 @@ void free_user_ns(struct user_namespace *ns)
 #ifdef CONFIG_PERSISTENT_KEYRINGS
 		key_put(ns->persistent_keyring_register);
 #endif
+		audit_log_ns_del(AUDIT_NS_DEL_USER, ns->proc_inum);
 		proc_free_inum(ns->proc_inum);
 		kmem_cache_free(user_ns_cachep, ns);
 		ns = parent;
@@ -909,3 +914,11 @@ static __init int user_namespaces_init(void)
 	return 0;
 }
 subsys_initcall(user_namespaces_init);
+
+/* log the ID of init user namespace after audit service starts */
+static __init int user_namespaces_late_init(void)
+{
+	audit_log_ns_init(AUDIT_NS_INIT_USER, 0, init_user_ns.proc_inum);
+	return 0;
+}
+late_initcall(user_namespaces_late_init);
diff --git a/kernel/utsname.c b/kernel/utsname.c
index fd39312..fa21e8d 100644
--- a/kernel/utsname.c
+++ b/kernel/utsname.c
@@ -16,6 +16,7 @@
 #include <linux/slab.h>
 #include <linux/user_namespace.h>
 #include <linux/proc_ns.h>
+#include <linux/audit.h>
 
 static struct uts_namespace *create_uts_ns(void)
 {
@@ -48,6 +49,8 @@ static struct uts_namespace *clone_uts_ns(struct user_namespace *user_ns,
 		return ERR_PTR(err);
 	}
 
+	audit_log_ns_init(AUDIT_NS_INIT_UTS, old_ns->proc_inum, ns->proc_inum);
+
 	down_read(&uts_sem);
 	memcpy(&ns->name, &old_ns->name, sizeof(ns->name));
 	ns->user_ns = get_user_ns(user_ns);
@@ -84,6 +87,7 @@ void free_uts_ns(struct kref *kref)
 
 	ns = container_of(kref, struct uts_namespace, kref);
 	put_user_ns(ns->user_ns);
+	audit_log_ns_del(AUDIT_NS_DEL_UTS, ns->proc_inum);
 	proc_free_inum(ns->proc_inum);
 	kfree(ns);
 }
@@ -138,3 +142,11 @@ const struct proc_ns_operations utsns_operations = {
 	.install	= utsns_install,
 	.inum		= utsns_inum,
 };
+
+/* log the ID of init UTS namespace after audit service starts */
+static int __init uts_namespaces_init(void)
+{
+	audit_log_ns_init(AUDIT_NS_INIT_UTS, 0, init_uts_ns.proc_inum);
+	return 0;
+}
+late_initcall(uts_namespaces_init);
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 85b6269..562eb85 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -17,6 +17,7 @@
 #include <linux/user_namespace.h>
 #include <net/net_namespace.h>
 #include <net/netns/generic.h>
+#include <linux/audit.h>
 
 /*
  *	Our network namespace constructor/destructor lists
@@ -253,6 +254,8 @@ struct net *copy_net_ns(unsigned long flags,
 	mutex_lock(&net_mutex);
 	rv = setup_net(net, user_ns);
 	if (rv == 0) {
+		audit_log_ns_init(AUDIT_NS_INIT_NET, old_net->proc_inum,
+				  net->proc_inum);
 		rtnl_lock();
 		list_add_tail_rcu(&net->list, &net_namespace_list);
 		rtnl_unlock();
@@ -389,6 +392,7 @@ static __net_init int net_ns_net_init(struct net *net)
 
 static __net_exit void net_ns_net_exit(struct net *net)
 {
+	audit_log_ns_del(AUDIT_NS_DEL_NET, net->proc_inum);
 	proc_free_inum(net->proc_inum);
 }
 
@@ -435,6 +439,14 @@ static int __init net_ns_init(void)
 
 pure_initcall(net_ns_init);
 
+/* log the ID of init_net namespace after audit service starts */
+static int __init net_ns_init_log(void)
+{
+	audit_log_ns_init(AUDIT_NS_INIT_NET, 0, init_net.proc_inum);
+	return 0;
+}
+late_initcall(net_ns_init_log);
+
 #ifdef CONFIG_NET_NS
 static int __register_pernet_operations(struct list_head *list,
 					struct pernet_operations *ops)
-- 
1.7.1

^ permalink raw reply related

* [PATCH V6 07/10] sched: add a macro to ref all CLONE_NEW* flags
From: Richard Guy Briggs @ 2015-04-17  7:35 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-audit-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, pmoore-H+wXaHxf7aLQT0dZR+AlfA,
	mingo-H+wXaHxf7aLQT0dZR+AlfA, eparis-FjpueFixGhCM4zKIHC2jIg,
	sgrubb-H+wXaHxf7aLQT0dZR+AlfA,
	zohar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w
In-Reply-To: <cover.1429252659.git.rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Added the macro CLONE_NEW_MASK_ALL to refer to all CLONE_NEW* flags.

Signed-off-by: Richard Guy Briggs <rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 include/uapi/linux/sched.h |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h
index 34f9d73..21ed8f4 100644
--- a/include/uapi/linux/sched.h
+++ b/include/uapi/linux/sched.h
@@ -28,6 +28,12 @@
 #define CLONE_NEWUSER		0x10000000	/* New user namespace */
 #define CLONE_NEWPID		0x20000000	/* New pid namespace */
 #define CLONE_NEWNET		0x40000000	/* New network namespace */
+#define CLONE_NEW_MASK_ALL	 (CLONE_NEWNS \
+				| CLONE_NEWUTS \
+				| CLONE_NEWIPC \
+				| CLONE_NEWUSER \
+				| CLONE_NEWPID \
+				| CLONE_NEWNET)	/* mask of all namespace type flags */
 #define CLONE_IO		0x80000000	/* Clone io context */
 
 /*
-- 
1.7.1

^ permalink raw reply related

* [PATCH V6 09/10] audit: log on switching namespace (setns)
From: Richard Guy Briggs @ 2015-04-17  7:35 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-audit-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, pmoore-H+wXaHxf7aLQT0dZR+AlfA,
	eparis-FjpueFixGhCM4zKIHC2jIg, sgrubb-H+wXaHxf7aLQT0dZR+AlfA,
	zohar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w
In-Reply-To: <cover.1429252659.git.rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Added six new audit message types, AUDIT_NS_SET_* and function
audit_log_ns_set() to log a switch of namespace.

Signed-off-by: Richard Guy Briggs <rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 include/linux/audit.h      |    4 +++
 include/uapi/linux/audit.h |    6 +++++
 kernel/audit.c             |   52 ++++++++++++++++++++++++++++++++++++++++++++
 kernel/nsproxy.c           |    3 ++
 4 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/include/linux/audit.h b/include/linux/audit.h
index b28dfb0..c71c819 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -26,6 +26,7 @@
 #include <linux/sched.h>
 #include <linux/ptrace.h>
 #include <uapi/linux/audit.h>
+#include <linux/proc_ns.h>
 
 struct audit_sig_info {
 	uid_t		uid;
@@ -487,6 +488,7 @@ static inline void	    audit_log_ns_info(struct task_struct *tsk)
 extern void		    audit_log_ns_init(int type, unsigned int old_inum,
 					      unsigned int inum);
 extern void		    audit_log_ns_del(int type, unsigned int inum);
+extern void		    audit_log_ns_set(const struct proc_ns_operations *ops, void *ns);
 
 extern int		    audit_update_lsm_rules(void);
 
@@ -550,6 +552,8 @@ static inline int audit_log_ns_init(int type, unsigned int old_inum,
 { }
 static inline int audit_log_ns_del(int type, unsigned int inum)
 { }
+static inline void audit_log_ns_set(const struct proc_ns_operations *ops, void *ns)
+{ }
 #define audit_enabled 0
 #endif /* CONFIG_AUDIT */
 static inline void audit_log_string(struct audit_buffer *ab, const char *buf)
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 487cad6..567b45f 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -123,6 +123,12 @@
 #define AUDIT_NS_DEL_USER	1339	/* Record USER namespace instance deletion */
 #define AUDIT_NS_DEL_PID	1340	/* Record PID namespace instance deletion */
 #define AUDIT_NS_DEL_NET	1341	/* Record NET namespace instance deletion */
+#define AUDIT_NS_SET_MNT	1342	/* Record mount namespace instance deletion */
+#define AUDIT_NS_SET_UTS	1343	/* Record UTS namespace instance deletion */
+#define AUDIT_NS_SET_IPC	1344	/* Record IPC namespace instance deletion */
+#define AUDIT_NS_SET_USER	1345	/* Record USER namespace instance deletion */
+#define AUDIT_NS_SET_PID	1346	/* Record PID namespace instance deletion */
+#define AUDIT_NS_SET_NET	1347	/* Record NET namespace instance deletion */
 
 #define AUDIT_AVC		1400	/* SE Linux avc denial or grant */
 #define AUDIT_SELINUX_ERR	1401	/* Internal SE Linux Errors */
diff --git a/kernel/audit.c b/kernel/audit.c
index b7f10e9..a7b1b61 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -2054,6 +2054,58 @@ void audit_log_ns_del(int type, unsigned int inum)
 			 inum - PROC_DYNAMIC_FIRST);
 	audit_log_end(ab);
 }
+
+/**
+ * audit_log_ns_set - report a namespace set change
+ * @ops: the ops structure for the namespace to be changed
+ * @ns: the new namespace
+ */
+void audit_log_ns_set(const struct proc_ns_operations *ops, void *ns)
+{
+	struct audit_buffer *ab;
+	void *old_ns;
+	int msg_type;
+	struct vfsmount *mnt = task_active_pid_ns(current)->proc_mnt;
+	struct super_block *sb = mnt->mnt_sb;
+	char old_ns_s[16];
+
+	switch (ops->type) {
+	case CLONE_NEWNS:
+		msg_type = AUDIT_NS_SET_MNT;
+		break;
+	case CLONE_NEWUTS:
+		msg_type = AUDIT_NS_SET_UTS;
+		break;
+	case CLONE_NEWIPC:
+		msg_type = AUDIT_NS_SET_IPC;
+		break;
+	case CLONE_NEWUSER:
+		msg_type = AUDIT_NS_SET_USER;
+		break;
+	case CLONE_NEWPID:
+		msg_type = AUDIT_NS_SET_PID;
+		break;
+	case CLONE_NEWNET:
+		msg_type = AUDIT_NS_SET_NET;
+		break;
+	default:
+		return;
+	}
+	audit_log_common_recv_msg(&ab, ops->type);
+	if (!ab)
+		return;
+	old_ns = ops->get(current);
+	if (!ops->inum(old_ns))
+		sprintf(old_ns_s, "(none)");
+	else
+		sprintf(old_ns_s, "%d", ops->inum(old_ns) - PROC_DYNAMIC_FIRST);
+	audit_log_format(ab, " dev=%02x:%02x old_%sns=%s %sns=%d res=1",
+			 MAJOR(sb->s_dev), MINOR(sb->s_dev),
+			 ops->name, old_ns_s,
+			 ops->name, ops->inum(ns));
+	ops->put(old_ns);
+	audit_log_end(ab);
+}
 #endif /* CONFIG_NAMESPACES */
 
 /**
diff --git a/kernel/nsproxy.c b/kernel/nsproxy.c
index d5353c2..2ca86cf 100644
--- a/kernel/nsproxy.c
+++ b/kernel/nsproxy.c
@@ -257,6 +257,9 @@ SYSCALL_DEFINE2(setns, int, fd, int, nstype)
 		goto out;
 	}
 	switch_task_namespaces(tsk, new_nsproxy);
+
+	audit_log_ns_set(ops, ei->ns);
+
 out:
 	fput(file);
 	return err;
-- 
1.7.1

^ permalink raw reply related

* [PATCH V6 10/10] audit: emit AUDIT_NS_INFO record with AUDIT_VIRT_CONTROL record
From: Richard Guy Briggs @ 2015-04-17  7:35 UTC (permalink / raw)
  To: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-audit-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA, pmoore-H+wXaHxf7aLQT0dZR+AlfA,
	eparis-FjpueFixGhCM4zKIHC2jIg, sgrubb-H+wXaHxf7aLQT0dZR+AlfA,
	zohar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w
In-Reply-To: <cover.1429252659.git.rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Signed-off-by: Richard Guy Briggs <rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 include/uapi/linux/audit.h |    2 ++
 kernel/audit.c             |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 567b45f..b6a55fe 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -163,6 +163,8 @@
 
 #define AUDIT_KERNEL		2000	/* Asynchronous audit record. NOT A REQUEST. */
 
+#define AUDIT_VIRT_CONTROL	2500	/* Start, Pause, Stop VM */
+
 /* Rule flags */
 #define AUDIT_FILTER_USER	0x00	/* Apply rule to user-generated messages */
 #define AUDIT_FILTER_TASK	0x01	/* Apply rule at task creation (not syscall) */
diff --git a/kernel/audit.c b/kernel/audit.c
index a7b1b61..8a01d88 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -943,6 +943,8 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 			}
 			audit_set_portid(ab, NETLINK_CB(skb).portid);
 			audit_log_end(ab);
+			if (msg_type == AUDIT_VIRT_CONTROL)
+				audit_log_ns_info(NULL);
 			mutex_lock(&audit_cmd_mutex);
 		}
 		break;
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH V6 07/10] sched: add a macro to ref all CLONE_NEW* flags
From: Peter Zijlstra @ 2015-04-17  8:18 UTC (permalink / raw)
  To: Richard Guy Briggs
  Cc: linux-api-u79uwXL29TY76Z2rM5mHXA,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	pmoore-H+wXaHxf7aLQT0dZR+AlfA, linux-audit-H+wXaHxf7aLQT0dZR+AlfA,
	eparis-FjpueFixGhCM4zKIHC2jIg, sgrubb-H+wXaHxf7aLQT0dZR+AlfA,
	zohar-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8,
	mingo-H+wXaHxf7aLQT0dZR+AlfA, ebiederm-aS9lmoZGLiVWk0Htik3J/w
In-Reply-To: <cf1ed24f71743ea7f85682f26f3185202a1f8a32.1429252659.git.rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Fri, Apr 17, 2015 at 03:35:54AM -0400, Richard Guy Briggs wrote:
> Added the macro CLONE_NEW_MASK_ALL to refer to all CLONE_NEW* flags.

A wee bit about why might be nice..

^ permalink raw reply

* Re: [Patch 1/3] firmware: dmi_scan: rename dmi_table to dmi_decode_table
From: Jean Delvare @ 2015-04-17  8:54 UTC (permalink / raw)
  To: Ivan.khoronzhuk
  Cc: Matt Fleming, linux-kernel, matt.fleming, ard.biesheuvel,
	grant.likely, linux-api, linux-doc, mikew, dmidecode-devel,
	leif.lindholm, msalter, roy.franz
In-Reply-To: <553018BB.1080903@globallogic.com>

Hi Ivan,

On Thu, 16 Apr 2015 23:16:59 +0300, Ivan.khoronzhuk wrote:
> On 16.04.15 11:35, Jean Delvare wrote:
> > On Wed, 15 Apr 2015 15:35:30 +0100, Matt Fleming wrote:
> >> Jean, do you want me to pick this patch up or are you going to?
> > Good question, we need to agree on a strategy.
> >
> > There are 3 patch sets to consider here.
> >
> > 1* My patch fixing the UUID ordering bug. It must go in first and
> >     immediately, as it fixes a regression and will have to be backported
> >     to stable branches.
> 
> ||
> V
> 
> >
> > 2* 2 older patches from Ivan which are currently in your efi-next tree
> >     if I'm not mistaken. Both were based on an old tree so they do not
> >     apply cleanly on kernel v4.0, I had to fix them up manually. I have
> 
> They are in master tree already.
> 
> >     no idea if git would be able to merge them properly, as the fix
> >     above changed the context even more.
> 
> Current efi-next already merged, so you should base your patches on
> top of last changes.

Correct. I looked at the result and the merge looks correct. I'll turn
my objections into fixup patches to apply on top, where still worth it.
In particular I'll start with the ".x" revert, as it will make
backporting the bug fix easier.

> >
> > 3* The 3 new patches from Ivan which I am reviewing now, which are not
> >     applied in any public tree AFAIK.
> 
> It shouldn't happen,
> I've been verifying just now once again.
> They are applied on top of linux_next cleanly.
> Equal as on efi/next.

I can't see them at
http://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/log/?h=next

To clarify: I do not claim that they can't be applied, I'm only saying
they're not there yet (which is OK as they were still pending my
review.) They do apply just fine, no problem with this.

> > I don't really care who picks these patches up and sends them to Linus,
> > but I think they should all follow the same route so that Linus has as
> > little merge work to do as possible. So either you pick them all, or I
> > do. If I do, you'll have to drop the 2 patches you have in efi-next.
> > Again I'm fine either way, so please let me know what makes your life
> > easier and let's do that.
> 
> I'm going to base my series
> "firmware: dmi_scan: add SBMIOS entry point and DMI tables"
> on top of linux next unless you have already your tree to pick up changes.
> Please let me know, if you have one.

I have no formal tree yet, but my current patch set can be seen at:
http://jdelvare.nerim.net/devel/linux-3/jdelvare-dmi/

First 2 patches from you are already upstream. You should rebase your
updated patch series on top of upstream + patches 03 and 04, as they
will go in first.

Thanks,
-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply

* Re: [RFC 0/4] Generic file system events interface
From: Beata Michalska @ 2015-04-17  9:10 UTC (permalink / raw)
  To: Jan Kara
  Cc: linux-kernel, tytso, adilger.kernel, hughd, lczerner, hch,
	linux-ext4, linux-mm, kyungmin.park, kmpark,
	Linux Filesystem Mailing List, linux-api
In-Reply-To: <20150417081727.GB3116@quack.suse.cz>


Hi,

On 04/17/2015 10:17 AM, Jan Kara wrote:
>   Hello,
> 
> On Wed 15-04-15 09:15:43, Beata Michalska wrote:
>> The following patchset is a result of previous discussions regarding
>> file system threshold notifiactions. It introduces support for file
>> system event notifications, sent through generic netlinik interface
>> whenever an fs-related event occurs. Included are also some shmem
>> and ext4 changes showing how the new interface might actually be used.
>>
>> The vary idea of using the generic netlink interface has been previoulsy
>> suggested here:  https://lkml.org/lkml/2011/8/18/169
>>
>> The basic description of the new functionality can be found in
>> the first patch from this set - both in the commit message and
>> in the doc file.
>>
>> Some very basic tests have been performed though still this is
>> a PoC version. Below though is a sample user space application
>> which subscribes to the new multicast group and listens for
>> potential fs-related events. The code has been based on libnl 3.4
>> and its test application for the generic netlink.
>   Thanks for the patches! As a general note for the next posting, please CC
> also linux-fsdevel@vger.kernel.org (since this has implications for other
> filesystems as well, specifically I know about XFS guys thinking about some
> notification system as well) and linux-api@vger.kernel.org (since this is a
> new kernel interface to userspace).
> 
> 								Honza

My bad  - with the CC list. Apologies for that.

BR
Beata

>>
>> ---
>>
>> Beata Michalska (4):
>>   fs: Add generic file system event notifications
>>   ext4: Add helper function to mark group as corrupted
>>   ext4: Add support for generic FS events
>>   shmem: Add support for generic FS events
>>
>>  Documentation/filesystems/events.txt |  254 +++++++++++
>>  fs/Makefile                          |    1 +
>>  fs/events/Makefile                   |    6 +
>>  fs/events/fs_event.c                 |  775 ++++++++++++++++++++++++++++++++++
>>  fs/events/fs_event.h                 |   27 ++
>>  fs/events/fs_event_netlink.c         |   94 +++++
>>  fs/ext4/balloc.c                     |   26 +-
>>  fs/ext4/ext4.h                       |   10 +
>>  fs/ext4/ialloc.c                     |    5 +-
>>  fs/ext4/inode.c                      |    2 +-
>>  fs/ext4/mballoc.c                    |   17 +-
>>  fs/ext4/resize.c                     |    1 +
>>  fs/ext4/super.c                      |   43 ++
>>  fs/namespace.c                       |    1 +
>>  include/linux/fs.h                   |    6 +-
>>  include/linux/fs_event.h             |   69 +++
>>  include/uapi/linux/fs_event.h        |   62 +++
>>  include/uapi/linux/genetlink.h       |    1 +
>>  mm/shmem.c                           |   39 +-
>>  net/netlink/genetlink.c              |    7 +-
>>  20 files changed, 1412 insertions(+), 34 deletions(-)
>>  create mode 100644 Documentation/filesystems/events.txt
>>  create mode 100644 fs/events/Makefile
>>  create mode 100644 fs/events/fs_event.c
>>  create mode 100644 fs/events/fs_event.h
>>  create mode 100644 fs/events/fs_event_netlink.c
>>  create mode 100644 include/linux/fs_event.h
>>  create mode 100644 include/uapi/linux/fs_event.h
>>
>> ---
>> Sample application:
>>
>> #include <netlink/cli/utils.h>
>> #include <fs_event.h>
>>
>> #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
>> #define LOG(args...) fprintf(stderr, args)
>>
>> static int parse_info(struct nl_cache_ops *unused, struct genl_cmd *cmd,
>> 		struct genl_info *info, void *arg)
>> {
>> 	LOG("New trace %d:\n",
>> 		info->attrs[FS_EVENT_ATR_FS_ID]
>> 		?  nla_get_u32(info->attrs[FS_EVENT_ATR_FS_ID])
>> 		: -1);
>> 	LOG("Mout point: %s\n", info->attrs[FS_EVENT_ATR_MOUNT]
>> 		? nla_get_string(info->attrs[FS_EVENT_ATR_MOUNT])
>> 		: "unknown");
>> 	return 0;
>> }
>>
>> static int parse_thres(struct nl_cache_ops *unused, struct genl_cmd *cmd,
>> 		struct genl_info *info, void *arg)
>> {
>>
>> 	LOG("Threshold notification received for trace %d:\n",
>> 		info->attrs[FS_EVENT_ATR_FS_ID]
>> 		?  nla_get_u32(info->attrs[FS_EVENT_ATR_FS_ID])
>> 		: -1);
>>
>> 	if (info->attrs[FS_EVENT_ATR_DEV_MAJOR])
>> 		LOG("Backing dev major: %u\n",
>> 			nla_get_u32(info->attrs[FS_EVENT_ATR_DEV_MAJOR]));
>> 	if (info->attrs[FS_EVENT_ATR_DEV_MINOR])
>> 		LOG("Backing dev minor: %u\n",
>> 			nla_get_u32(info->attrs[FS_EVENT_ATR_DEV_MINOR]));
>> 	LOG("Proc:              %u\n", info->attrs[FS_EVENT_ATR_CAUSED_ID] ?
>> 			nla_get_u32(info->attrs[FS_EVENT_ATR_CAUSED_ID]) : -1);
>> 	LOG("Threshold data:    %llu\n", info->attrs[FS_EVENT_ATR_DATA]
>> 		? nla_get_u64(info->attrs[FS_EVENT_ATR_DATA])
>> 		: 0);
>>
>> 	return 0;
>> }
>>
>> static int parse_warning(struct nl_cache_ops *unused, struct genl_cmd *cmd,
>> 			 struct genl_info *info, void *arg)
>> {
>>
>> 	LOG("Warning recieved for trace %d\n", info->attrs[FS_EVENT_ATR_FS_ID] ?
>> 		nla_get_u32(info->attrs[FS_EVENT_ATR_FS_ID]) : -1);
>> 	if (info->attrs[FS_EVENT_ATR_DEV_MAJOR])
>> 		LOG("Backing dev major: %u\n",
>> 			nla_get_u32(info->attrs[FS_EVENT_ATR_DEV_MAJOR]));
>> 	if (info->attrs[FS_EVENT_ATR_DEV_MINOR])
>> 		LOG("Backing dev minor: %u\n",
>> 			nla_get_u32(info->attrs[FS_EVENT_ATR_DEV_MINOR]));
>> 	LOG("Proc:              %u\n", info->attrs[FS_EVENT_ATR_CAUSED_ID] ?
>> 		nla_get_u32(info->attrs[FS_EVENT_ATR_CAUSED_ID]) : -1);
>> 	LOG("Warning:           %u\n", info->attrs[FS_EVENT_ATR_ID] ?
>> 		nla_get_u32(info->attrs[FS_EVENT_ATR_ID]) : -1);
>>
>> 	return 0;
>> }
>>
>> static struct genl_cmd cmd[] = {
>> 	{
>> 		.c_id = FS_EVENT_TYPE_NEW_TRACE,
>> 		.c_name = "info",
>> 		.c_maxattr = 2,
>> 		.c_msg_parser = parse_info,
>> 	}, {
>> 		.c_id = FS_EVENT_TYPE_THRESH,
>> 		.c_name = "thres",
>> 		.c_maxattr = 6,
>> 		.c_msg_parser = parse_thres,
>> 	}, {
>> 		.c_id = FS_EVENT_TYPE_WARN,
>> 		.c_name = "warn",
>> 		.c_maxattr = 5,
>> 		.c_msg_parser = parse_warning,
>> 	},
>> };
>>
>> static struct genl_ops ops = {
>> 	.o_id = GENL_ID_FS_EVENT,
>> 	.o_name = "FS_EVENT",
>> 	.o_hdrsize = 0,
>> 	.o_cmds = cmd,
>> 	.o_ncmds = ARRAY_SIZE(cmd),
>> };
>>
>>
>> int events_cb(struct nl_msg *msg, void *arg)
>> {
>> 	 return  genl_handle_msg(msg, arg);
>> }
>>
>> int main(int argc, char **argv)
>> {
>> 	struct nl_sock *sock;
>> 	int ret;
>>
>> 	sock = nl_cli_alloc_socket();
>> 	nl_socket_set_local_port(sock, 0);
>> 	nl_socket_disable_seq_check(sock);
>>
>> 	nl_socket_modify_cb(sock, NL_CB_VALID, NL_CB_CUSTOM, events_cb, NULL);
>>
>> 	nl_cli_connect(sock, NETLINK_GENERIC);
>>
>> 	if ((ret = nl_socket_add_membership(sock, GENL_ID_FS_EVENT))) {
>> 		LOG("Failed to add membership\n");
>> 		goto leave;
>> 	}
>>
>> 	if((ret = genl_register_family(&ops))) {
>> 		LOG("Failed to register protocol family\n");
>> 		goto leave;
>> 	}
>>
>> 	if ((ret = genl_ops_resolve(sock, &ops) < 0)) {
>> 		LOG("Unable to resolve the family name\n");
>> 		goto leave;
>> 	}
>>
>> 	if (genl_ctrl_resolve(sock, "FS_EVENT") < 0) {
>> 		LOG("Failed to resolve  the family name\n");
>> 		goto leave;
>> 	}
>>
>> 	while (1) {
>> 		if ((ret = nl_recvmsgs_default(sock)) < 0)
>> 			LOG("Unable to receive message: %s\n", nl_geterror(ret));
>> 	}
>>
>> leave:
>> 	nl_close(sock);
>> 	nl_socket_free(sock);
>> 	return 0;
>> }
>>
>> -- 
>> 1.7.9.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [RFC 1/4] fs: Add generic file system event notifications
From: Beata Michalska @ 2015-04-17  9:10 UTC (permalink / raw)
  To: Hugh Dickins
  Cc: Eric Sandeen, Tim Chen, linux-kernel, tytso, adilger.kernel,
	lczerner, hch, linux-ext4, linux-mm, kyungmin.park, kmpark,
	Linux Filesystem Mailing List, linux-api
In-Reply-To: <alpine.LSU.2.11.1504161229450.17935@eggly.anvils>

Hi,

On 04/16/2015 10:10 PM, Hugh Dickins wrote:
> On Thu, 16 Apr 2015, Beata Michalska wrote:
>> On 04/16/2015 05:46 AM, Eric Sandeen wrote:
>>> On 4/15/15 2:15 AM, Beata Michalska wrote:
>>>> Introduce configurable generic interface for file
>>>> system-wide event notifications to provide file
>>>> systems with a common way of reporting any potential
>>>> issues as they emerge.
>>>>
>>>> The notifications are to be issued through generic
>>>> netlink interface, by a dedicated, for file system
>>>> events, multicast group. The file systems might as
>>>> well use this group to send their own custom messages.
>>>
>>> ...
>>>
>>>> + 4.3 Threshold notifications:
>>>> +
>>>> + #include <linux/fs_event.h>
>>>> + void fs_event_alloc_space(struct super_block *sb, u64 ncount);
>>>> + void fs_event_free_space(struct super_block *sb, u64 ncount);
>>>> +
>>>> + Each filesystme supporting the treshold notifiactions should call
>>>> + fs_event_alloc_space/fs_event_free_space repsectively whenever the
>>>> + ammount of availbale blocks changes.
>>>> + - sb:     the filesystem's super block
>>>> + - ncount: number of blocks being acquired/released
>>>
>>> so:
>>>
>>>> +void fs_event_alloc_space(struct super_block *sb, u64 ncount)
>>>> +{
>>>> +	struct fs_trace_entry *en;
>>>> +	s64 count;
>>>> +
>>>> +	spin_lock(&fs_trace_lock);
>>>
>>> Every allocation/free for every supported filesystem system-wide will be
>>> serialized on this global spinlock?  That sounds like a non-starter...
>>>
>>> -Eric
>>>
>> I guess there is a plenty room for improvements as this is an early version.
>> I do agree that this might be a performance bottleneck event though I've tried
>> to keep this to minimum - it's being taken only for hashtable look-up. But still...
>> I was considering placing the trace object within the super_block to skip
>> this look-up part but I'd like to gather more comments, especially on the concept
>> itself.
> 
> Sorry, I have no opinion on the netlink fs notifications concept
> itself, not my area of expertise at all.
> 
> No doubt you Cc'ed me for tmpfs: I am very glad you're now trying the
> generic filesystem route, and yes, I'd be happy to have the support
> in tmpfs, thank you - if it is generally agreed to be suitable for
> filesystems; but wouldn't want this as a special for tmpfs.
> 
> However, I must echo Eric's point: please take a look at 7e496299d4d2
> "tmpfs: make tmpfs scalable with percpu_counter for used blocks":
> Tim would be unhappy if you added overhead back into that path.
> 
> (And please Cc linux-fsdevel@vger.kernel.org next time you post these.)
> 
> Hugh
> 

Well, the concept of using netlink interface here is just a part of the overall
idea - so any comments are really welcomed here. The more of them the better solution
can be worked out, as I believe.

As for the possible overhead: this is the last thing I would want, so I'll
definitely do may best to not to introduce any. I will definitely rework this.

Thanks for Your comments,

BR
Beata


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [PATCH v4 0/8] vhost: support for cross endian guests
From: Greg Kurz @ 2015-04-17  9:18 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: linux-api, linux-kernel, kvm, virtualization
In-Reply-To: <20150410101500.31843.61248.stgit@bahia.local>

On Fri, 10 Apr 2015 12:15:00 +0200
Greg Kurz <gkurz@linux.vnet.ibm.com> wrote:

> Hi,
> 
> This patchset allows vhost to be used with legacy virtio when guest and host
> have a different endianness.
> 
> Patch 7 got rewritten according to Cornelia's and Michael's comments. I have
> also introduced patch 8 that brings BE vnet headers support to tun/macvtap.
> 
> This series is enough to have vhost_net working flawlessly. I could
> succesfully reboot guests from ppc64 to ppc64le and vice-versa on ppc64
> and ppc64le hosts.
> 

Michael,

I am ready to post v5 with the changes suggested by Cornelia... Do you have any
extra comments on this v4 ? 

--
Greg

> ---
> 
> Greg Kurz (8):
>       virtio: introduce virtio_is_little_endian() helper
>       tun: add tun_is_little_endian() helper
>       macvtap: introduce macvtap_is_little_endian() helper
>       vringh: introduce vringh_is_little_endian() helper
>       vhost: introduce vhost_is_little_endian() helper
>       virtio: add explicit big-endian support to memory accessors
>       vhost: feature to set the vring endianness
>       macvtap/tun: add VNET_BE flag
> 
> 
>  drivers/net/Kconfig              |   12 ++++++
>  drivers/net/macvtap.c            |   69 ++++++++++++++++++++++++++++++++++-
>  drivers/net/tun.c                |   71 +++++++++++++++++++++++++++++++++++-
>  drivers/vhost/Kconfig            |   10 +++++
>  drivers/vhost/vhost.c            |   76 ++++++++++++++++++++++++++++++++++++++
>  drivers/vhost/vhost.h            |   25 ++++++++++---
>  include/linux/virtio_byteorder.h |   24 +++++++-----
>  include/linux/virtio_config.h    |   19 +++++++---
>  include/linux/vringh.h           |   19 +++++++---
>  include/uapi/linux/if_tun.h      |    2 +
>  include/uapi/linux/vhost.h       |    9 +++++
>  11 files changed, 303 insertions(+), 33 deletions(-)
> 
> --
> Greg
> 
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
> 

^ permalink raw reply

* Re: [RFC 1/4] fs: Add generic file system event notifications
From: Beata Michalska @ 2015-04-17  9:46 UTC (permalink / raw)
  To: Heinrich Schuchardt
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, tytso-3s7WtUTddSA,
	adilger.kernel-m1MBpc4rdrD3fQ9qLvQP4Q,
	hughd-hpIqsD4AKlfQT0dZR+AlfA, lczerner-H+wXaHxf7aLQT0dZR+AlfA,
	hch-wEGCiKHe2LqWVfeAwA7xHQ, linux-ext4-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	kyungmin.park-Sze3O3UU22JBDgjK7y7TUQ,
	kmpark-wEGCiKHe2LqWVfeAwA7xHQ, Jan Kara,
	Linux Filesystem Mailing List, linux-api-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <55302FFB.4010108-Mmb7MZpHnFY@public.gmane.org>


Hi,

On 04/16/2015 11:56 PM, Heinrich Schuchardt wrote:
> On 15.04.2015 09:15, Beata Michalska wrote:
>> Introduce configurable generic interface for file
>> system-wide event notifications to provide file
>> systems with a common way of reporting any potential
>> issues as they emerge.
>>
>> The notifications are to be issued through generic
>> netlink interface, by a dedicated, for file system
>> events, multicast group. The file systems might as
>> well use this group to send their own custom messages.
>>
>> The events have been split into four base categories:
>> information, warnings, errors and threshold notifications,
>> with some very basic event types like running out of space
>> or file system being remounted as read-only.
>>
>> Threshold notifications have been included to allow
>> triggering an event whenever the amount of free space
>> drops below a certain level - or levels to be more precise
>> as two of them are being supported: the lower and the upper
>> range. The notifications work both ways: once the threshold
>> level has been reached, an event shall be generated whenever
>> the number of available blocks goes up again re-activating
>> the threshold.
>>
>> The interface has been exposed through a vfs. Once mounted,
>> it serves as an entry point for the set-up where one can
>> register for particular file system events.
> 
> Having a framework for notification for file systems is a great idea.
> Your solution covers an important part of the possible application scope.
> 
> Before moving forward I suggest we should analyze if this scope should
> be enlarged.
> 
> Many filesystems are remote (e.g. CIFS/Samba) or distributed over many
> network nodes (e.g. Lustre). How should file system notification work here?
> 
> How will fuse file systems be served?
> 
> The current point of reference is a single mount point.
> Every time I insert an USB stick several file system may be automounted.
> I would like to receive events for these automounted file systems.
> 
> A similar case arises when starting new virtual machines. How will I
> receive events on the host system for the file systems of the virtual
> machines?

> In your implementation events are received via Netlink.
> Using Netlink for marking mounts for notification would create a much
> more homogenous interface. So why should we use a virtual file system here?
> 
> Best regards
> 
> Heinrich Schuchardt
> 
> 

I'd be more than happy to extend the scope of suggested changes.
I hope I'll be able to collect more comments - in this way there 
is a chance we might get here smth that is really useful, for everyone.

I've tried to make the interface rather flexible, so that new cases
can be easily added - so the notification whenever a file system
is being mounted is definitely doable.

The vfs here merely serves the purpose to configure which type of events
and for which filesystems are to be issued. Having this done through
netlink is also an option, though it needs some more thoughts. The way
notifications are being sent might be extended: so there could be more
than one option for this. We might also want to consider if we want to
have this widely available - everything for everyone. (?)

As for the rest, I must admit I'm not really an fs person, so I assume
there will be more comments and questions like yours. This is also why
any comments/hints/remarks/doubts/issues etc would me more than just
welcomed. I'll try to answer them all, though this will require some
time on my side, thus apologies if I have some delays.


I'll get beck to this asap.

BR
Beata

^ permalink raw reply

* Re: [Patch 1/3] firmware: dmi_scan: rename dmi_table to dmi_decode_table
From: Ivan.khoronzhuk @ 2015-04-17 10:11 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Matt Fleming, linux-kernel, matt.fleming, ard.biesheuvel,
	grant.likely, linux-api, linux-doc, mikew, dmidecode-devel,
	leif.lindholm, msalter, roy.franz
In-Reply-To: <20150417105454.1c52f430@endymion.delvare>



On 17.04.15 11:54, Jean Delvare wrote:
> Hi Ivan,
>
> On Thu, 16 Apr 2015 23:16:59 +0300, Ivan.khoronzhuk wrote:
>> On 16.04.15 11:35, Jean Delvare wrote:
>>> On Wed, 15 Apr 2015 15:35:30 +0100, Matt Fleming wrote:
>>>> Jean, do you want me to pick this patch up or are you going to?
>>> Good question, we need to agree on a strategy.
>>>
>>> There are 3 patch sets to consider here.
>>>
>>> 1* My patch fixing the UUID ordering bug. It must go in first and
>>>      immediately, as it fixes a regression and will have to be backported
>>>      to stable branches.
>> ||
>> V
>>
>>> 2* 2 older patches from Ivan which are currently in your efi-next tree
>>>      if I'm not mistaken. Both were based on an old tree so they do not
>>>      apply cleanly on kernel v4.0, I had to fix them up manually. I have
>> They are in master tree already.
>>
>>>      no idea if git would be able to merge them properly, as the fix
>>>      above changed the context even more.
>> Current efi-next already merged, so you should base your patches on
>> top of last changes.
> Correct. I looked at the result and the merge looks correct. I'll turn
> my objections into fixup patches to apply on top, where still worth it.
> In particular I'll start with the ".x" revert, as it will make
> backporting the bug fix easier.
>
>>> 3* The 3 new patches from Ivan which I am reviewing now, which are not
>>>      applied in any public tree AFAIK.
>> It shouldn't happen,
>> I've been verifying just now once again.
>> They are applied on top of linux_next cleanly.
>> Equal as on efi/next.
> I can't see them at
> http://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/log/?h=next
>
> To clarify: I do not claim that they can't be applied, I'm only saying
> they're not there yet (which is OK as they were still pending my
> review.) They do apply just fine, no problem with this.
>
>>> I don't really care who picks these patches up and sends them to Linus,
>>> but I think they should all follow the same route so that Linus has as
>>> little merge work to do as possible. So either you pick them all, or I
>>> do. If I do, you'll have to drop the 2 patches you have in efi-next.
>>> Again I'm fine either way, so please let me know what makes your life
>>> easier and let's do that.
>> I'm going to base my series
>> "firmware: dmi_scan: add SBMIOS entry point and DMI tables"
>> on top of linux next unless you have already your tree to pick up changes.
>> Please let me know, if you have one.
> I have no formal tree yet, but my current patch set can be seen at:
> http://jdelvare.nerim.net/devel/linux-3/jdelvare-dmi/
>
> First 2 patches from you are already upstream. You should rebase your
> updated patch series on top of upstream + patches 03 and 04, as they
> will go in first.
>
> Thanks,

Not sure that's a good idea to base on patches that doesn't path any 
review and
no one cannot apply. At least it be good you send them that I can point 
on them in
commit message.

-- 
Regards,
Ivan Khoronzhuk


^ permalink raw reply

* Re: [PATCH/RFC 0/2] Repurpose the v4l2_plane data_offset field
From: Hans Verkuil @ 2015-04-17 10:27 UTC (permalink / raw)
  To: Laurent Pinchart, linux-media
  Cc: linux-api, Sakari Ailus, Pawel Osciak, Marek Szyprowski,
	Mauro Carvalho Chehab
In-Reply-To: <1429040689-23808-1-git-send-email-laurent.pinchart@ideasonboard.com>

Hi Laurent,

On 04/14/2015 09:44 PM, Laurent Pinchart wrote:
> Hello,
> 
> The v4l2_plane data_offset field has been introduced at the same time as the
> the multiplane API to convey header size information between kernelspace and
> userspace.
> 
> The API then became slightly controversial, both because different developers
> understood the purpose of the field differently (resulting for instance in an
> out-of-tree driver abusing the field for a different purpose), and because of
> competing proposals (see for instance "[RFC] Multi format stream support" at
> http://www.spinics.net/lists/linux-media/msg69130.html).
> 
> Furthermore, the data_offset field isn't used by any mainline driver except
> vivid (for testing purpose).
> 
> I need a different data offset in planes to allow data capture to or data
> output from a userspace-selected offset within a buffer (mainly for the
> DMABUF and MMAP memory types). As the data_offset field already has the
> right name, is unused, and ill-defined, I propose repurposing it. This is what
> this RFC is about.
> 
> If the proposal is accepted I'll add another patch to update data_offset usage
> in the vivid driver.

I am skeptical about all this for a variety of reasons:

1) The data_offset field is well-defined in the spec. There really is no doubt
about the meaning of the field.

2) We really don't know who else might be using it, or which applications might
be using it (a lot of work was done in gstreamer recently, I wonder if data_offset
support was implemented there).

3) You offer no alternative to this feature. Basically this is my main objection.
It is not at all unusual to have headers in front of the frame data. We (Cisco)
use it in one of our product series for example. And I suspect it is something that
happens especially in systems with an FPGA that does custom processing, and those
systems are exactly the ones that are generally not upstreamed and so are not
visible to us.

IMHO the functionality it provides is very much relevant, and I would like to see
an alternative in place before it is repurposed.

But frankly, I really don't see why you would want to repurpose it. Adding a new
field (buf_offset) would do exactly what you want it to do without causing an ABI
change.

Should we ever implement a better alternative for data_offset, then that field can
be renamed to 'reserved2' or whatever at some point.

Frankly, I don't think data_offset is all that bad. What is missing is info about
the format (so add a 'data_format' field) and possible similar info about a footer
(footer_size, footer_format). Yes, the name could have been better (header_size),
but nobody is perfect...

Regards,

	Hans

^ permalink raw reply

* Re: [Patch 1/3] firmware: dmi_scan: rename dmi_table to dmi_decode_table
From: Ivan.khoronzhuk @ 2015-04-17 12:04 UTC (permalink / raw)
  To: Jean Delvare
  Cc: Matt Fleming, linux-kernel, matt.fleming, ard.biesheuvel,
	grant.likely, linux-api, linux-doc, mikew, dmidecode-devel,
	leif.lindholm, msalter, roy.franz
In-Reply-To: <5530DC41.3050700@globallogic.com>

Hi Jean,

On 17.04.15 13:11, Ivan.khoronzhuk wrote:
>
>
> On 17.04.15 11:54, Jean Delvare wrote:
>> Hi Ivan,
>>
>> On Thu, 16 Apr 2015 23:16:59 +0300, Ivan.khoronzhuk wrote:
>>> On 16.04.15 11:35, Jean Delvare wrote:
>>>> On Wed, 15 Apr 2015 15:35:30 +0100, Matt Fleming wrote:
>>>>> Jean, do you want me to pick this patch up or are you going to?
>>>> Good question, we need to agree on a strategy.
>>>>
>>>> There are 3 patch sets to consider here.
>>>>
>>>> 1* My patch fixing the UUID ordering bug. It must go in first and
>>>>      immediately, as it fixes a regression and will have to be 
>>>> backported
>>>>      to stable branches.
>>> ||
>>> V
>>>
>>>> 2* 2 older patches from Ivan which are currently in your efi-next tree
>>>>      if I'm not mistaken. Both were based on an old tree so they do 
>>>> not
>>>>      apply cleanly on kernel v4.0, I had to fix them up manually. I 
>>>> have
>>> They are in master tree already.
>>>
>>>>      no idea if git would be able to merge them properly, as the fix
>>>>      above changed the context even more.
>>> Current efi-next already merged, so you should base your patches on
>>> top of last changes.
>> Correct. I looked at the result and the merge looks correct. I'll turn
>> my objections into fixup patches to apply on top, where still worth it.
>> In particular I'll start with the ".x" revert, as it will make
>> backporting the bug fix easier.
>>
>>>> 3* The 3 new patches from Ivan which I am reviewing now, which are not
>>>>      applied in any public tree AFAIK.
>>> It shouldn't happen,
>>> I've been verifying just now once again.
>>> They are applied on top of linux_next cleanly.
>>> Equal as on efi/next.
>> I can't see them at
>> http://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/log/?h=next
>>
>> To clarify: I do not claim that they can't be applied, I'm only saying
>> they're not there yet (which is OK as they were still pending my
>> review.) They do apply just fine, no problem with this.
>>
>>>> I don't really care who picks these patches up and sends them to 
>>>> Linus,
>>>> but I think they should all follow the same route so that Linus has as
>>>> little merge work to do as possible. So either you pick them all, or I
>>>> do. If I do, you'll have to drop the 2 patches you have in efi-next.
>>>> Again I'm fine either way, so please let me know what makes your life
>>>> easier and let's do that.
>>> I'm going to base my series
>>> "firmware: dmi_scan: add SBMIOS entry point and DMI tables"
>>> on top of linux next unless you have already your tree to pick up 
>>> changes.
>>> Please let me know, if you have one.
>> I have no formal tree yet, but my current patch set can be seen at:
>> http://jdelvare.nerim.net/devel/linux-3/jdelvare-dmi/
>>
>> First 2 patches from you are already upstream. You should rebase your
>> updated patch series on top of upstream + patches 03 and 04, as they
>> will go in first.
>>
>> Thanks,
>
> Not sure that's a good idea to base on patches that doesn't path any 
> review and
> no one cannot apply. At least it be good you send them that I can 
> point on them in
> commit message.
>

Don't know why your patches don't apply on top of linux next.
They looks w/o conflicts. I've applied them by hand. To avoid mess, 
could you
please send them in order I can refer on them in my commit message.

-- 
Regards,
Ivan Khoronzhuk


^ permalink raw reply

* [PATCH] mm: fix mprotect() behaviour on VM_LOCKED VMAs
From: Kirill A. Shutemov @ 2015-04-17 12:20 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Kirill A. Shutemov

On mlock(2) we trigger COW on private writable VMA to avoid faults in
future.

mm/gup.c:
 840 long populate_vma_page_range(struct vm_area_struct *vma,
 841                 unsigned long start, unsigned long end, int *nonblocking)
 842 {
 ...
 855          * We want to touch writable mappings with a write fault in order
 856          * to break COW, except for shared mappings because these don't COW
 857          * and we would not want to dirty them for nothing.
 858          */
 859         if ((vma->vm_flags & (VM_WRITE | VM_SHARED)) == VM_WRITE)
 860                 gup_flags |= FOLL_WRITE;

But we miss this case when we make VM_LOCKED VMA writeable via
mprotect(2). The test case:

	#define _GNU_SOURCE
	#include <fcntl.h>
	#include <stdio.h>
	#include <stdlib.h>
	#include <unistd.h>
	#include <sys/mman.h>
	#include <sys/resource.h>
	#include <sys/stat.h>
	#include <sys/time.h>
	#include <sys/types.h>

	#define PAGE_SIZE 4096

	int main(int argc, char **argv)
	{
		struct rusage usage;
		long before;
		char *p;
		int fd;

		/* Create a file and populate first page of page cache */
		fd = open("/tmp", O_TMPFILE | O_RDWR, S_IRUSR | S_IWUSR);
		write(fd, "1", 1);

		/* Create a *read-only* *private* mapping of the file */
		p = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_PRIVATE, fd, 0);

		/*
		 * Since the mapping is read-only, mlock() will populate the mapping
		 * with PTEs pointing to page cache without triggering COW.
		 */
		mlock(p, PAGE_SIZE);

		/*
		 * Mapping became read-write, but it's still populated with PTEs
		 * pointing to page cache.
		 */
		mprotect(p, PAGE_SIZE, PROT_READ | PROT_WRITE);

		getrusage(RUSAGE_SELF, &usage);
		before = usage.ru_minflt;

		/* Trigger COW: fault in mlock()ed VMA. */
		*p = 1;

		getrusage(RUSAGE_SELF, &usage);
		printf("faults: %ld\n", usage.ru_minflt - before);

		return 0;
	}

	$ ./test
	faults: 1

Let's fix it by triggering populating of VMA in mprotect_fixup() on this
condition. We don't care about population error as we don't in other
similar cases i.e. mremap.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 mm/mprotect.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/mm/mprotect.c b/mm/mprotect.c
index 88584838e704..911fb9070b2b 100644
--- a/mm/mprotect.c
+++ b/mm/mprotect.c
@@ -29,6 +29,8 @@
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 
+#include "internal.h"
+
 /*
  * For a prot_numa update we only hold mmap_sem for read so there is a
  * potential race with faulting where a pmd was temporarily none. This
@@ -322,6 +324,15 @@ success:
 	change_protection(vma, start, end, vma->vm_page_prot,
 			  dirty_accountable, 0);
 
+	/*
+	 * Private VM_LOCKED VMA become writable: trigger COW to avoid major
+	 * fault on access.
+	 */
+	if ((oldflags & (VM_WRITE | VM_SHARED | VM_LOCKED)) == VM_LOCKED &&
+			(newflags & VM_WRITE)) {
+		populate_vma_page_range(vma, start, end, NULL);
+	}
+
 	vm_stat_account(mm, oldflags, vma->vm_file, -nrpages);
 	vm_stat_account(mm, newflags, vma->vm_file, nrpages);
 	perf_event_mmap(vma);
-- 
2.1.4

^ permalink raw reply related

* Re: [Patch 1/3] firmware: dmi_scan: rename dmi_table to dmi_decode_table
From: Jean Delvare @ 2015-04-17 12:50 UTC (permalink / raw)
  To: Ivan.khoronzhuk
  Cc: Matt Fleming, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	matt.fleming-ral2JQCrhuEAvxtiuMwx3w,
	ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA, mikew-hpIqsD4AKlfQT0dZR+AlfA,
	dmidecode-devel-qX2TKyscuCcdnm+yROfE0A,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A,
	msalter-H+wXaHxf7aLQT0dZR+AlfA, roy.franz-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <5530F6C7.6060306-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org>

On Fri, 17 Apr 2015 15:04:23 +0300, Ivan.khoronzhuk wrote:
> On 17.04.15 13:11, Ivan.khoronzhuk wrote:
> > On 17.04.15 11:54, Jean Delvare wrote:
> >> I have no formal tree yet, but my current patch set can be seen at:
> >> http://jdelvare.nerim.net/devel/linux-3/jdelvare-dmi/
> >>
> >> First 2 patches from you are already upstream. You should rebase your
> >> updated patch series on top of upstream + patches 03 and 04, as they
> >> will go in first.
> >
> > Not sure that's a good idea to base on patches that doesn't path any 
> > review and
> > no one cannot apply. At least it be good you send them that I can 
> > point on them in
> > commit message.
> 
> Don't know why your patches don't apply on top of linux next.
> They looks w/o conflicts. I've applied them by hand. To avoid mess, 
> could you
> please send them in order I can refer on them in my commit message.

Sorry, I had the the whitespace wrong when backporting one of your two
old patches, so I ended up with a code base different from what upstream
has. It's all fixed now, you can download the patches again and they
should apply fine (starting from 01 if working with kernel v4.0,
starting from 03 if working with linux-next.) Sorry for the trouble.

The reason why my patch series is based on v4.0 and not linux-next is
that I'm going to test it on a remote development system which
implements SMBIOS 3.0 and is currently running kernel v4.0, so I don't
want to use an unstable code base which could cause problems by itself.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply

* Re: [PATCH/RFC 0/2] Repurpose the v4l2_plane data_offset field
From: Laurent Pinchart @ 2015-04-17 12:53 UTC (permalink / raw)
  To: Hans Verkuil
  Cc: linux-media-u79uwXL29TY76Z2rM5mHXA,
	linux-api-u79uwXL29TY76Z2rM5mHXA, Sakari Ailus, Pawel Osciak,
	Marek Szyprowski, Mauro Carvalho Chehab, Nicolas Dufresne
In-Reply-To: <5530E01D.3050105-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>

Hi Hans,

On Friday 17 April 2015 12:27:41 Hans Verkuil wrote:
> On 04/14/2015 09:44 PM, Laurent Pinchart wrote:
> > Hello,
> > 
> > The v4l2_plane data_offset field has been introduced at the same time as
> > the the multiplane API to convey header size information between
> > kernelspace and userspace.
> > 
> > The API then became slightly controversial, both because different
> > developers understood the purpose of the field differently (resulting for
> > instance in an out-of-tree driver abusing the field for a different
> > purpose), and because of competing proposals (see for instance "[RFC]
> > Multi format stream support" at
> > http://www.spinics.net/lists/linux-media/msg69130.html).
> > 
> > Furthermore, the data_offset field isn't used by any mainline driver
> > except vivid (for testing purpose).
> > 
> > I need a different data offset in planes to allow data capture to or data
> > output from a userspace-selected offset within a buffer (mainly for the
> > DMABUF and MMAP memory types). As the data_offset field already has the
> > right name, is unused, and ill-defined, I propose repurposing it. This is
> > what this RFC is about.
> > 
> > If the proposal is accepted I'll add another patch to update data_offset
> > usage in the vivid driver.
> 
> I am skeptical about all this for a variety of reasons:

That's all good, it's an RFC :-)

> 1) The data_offset field is well-defined in the spec. There really is no
> doubt about the meaning of the field.

I only partly agree. I believe the purpose of the data_offset field to be 
clear among the core V4L2 developers, but the documentation isn't precise 
enough. I've seen out-of-tree drivers using the data_offset field for other 
purposes than specifying the header size. The situation is a bit better now 
that videobuf2 handles the field properly (and avoids copying it from user to 
kernel for capture devices for instance), but there are still many users of 
older kernels.

This being said, the problem wouldn't be difficult to fix, it just requires a 
documentation patch.

> 2) We really don't know who else might be using it, or which applications
> might be using it (a lot of work was done in gstreamer recently, I wonder
> if data_offset support was implemented there).

It's funny you mention that. I cloned the gstreamer repositories and tried to 
investigate. The gstreamer v4l2 elements started using data_offset a year ago 
in

commit 92bdd596f2b07dbf4ccc9b8bf3d17620d44f131a
Author: Nicolas Dufresne <nicolas.dufresne-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Date:   Fri Apr 11 17:10:11 2014 -0400

    v4l2: Add DMABUF and USERPTR importation

(I've CC'ed Nicolas to this e-mail)

I'm not too familiar with the latest gstreamer code, but after a first 
investigation it seems that gstreamer uses the data_offset field for the 
purpose introduced by this patch, not to convey the header size. One more 
argument in favour of repurposing the field ;-)

> 3) You offer no alternative to this feature. Basically this is my main
> objection. It is not at all unusual to have headers in front of the frame
> data. We (Cisco) use it in one of our product series for example. And I
> suspect it is something that happens especially in systems with an FPGA
> that does custom processing, and those systems are exactly the ones that
> are generally not upstreamed and so are not visible to us.
> 
> IMHO the functionality it provides is very much relevant, and I would like
> to see an alternative in place before it is repurposed.
>
> But frankly, I really don't see why you would want to repurpose it. Adding a
> new field (buf_offset) would do exactly what you want it to do without
> causing an ABI change.
> 
> Should we ever implement a better alternative for data_offset, then that
> field can be renamed to 'reserved2' or whatever at some point.
> 
> Frankly, I don't think data_offset is all that bad. What is missing is info
> about the format (so add a 'data_format' field) and possible similar info
> about a footer (footer_size, footer_format). Yes, the name could have been
> better (header_size), but nobody is perfect...

I totally agree that the functionality is relevant, and we certainly need an 
API for that.

My point, however, was twofold : I believe we need a better (as in more 
powerful) API than data_offset to specify plane content, and the current usage 
of data_offset in out-of-tree drivers, and it seems in gstreamer too, is 
different than what we had intended the field to be used for.

For those two reasons, I believe it would make sense to repurpose the field 
and introduce a new API to specify information about the plane content. Let's 
kickstart the discussion :-)

The following information comes to my mind as being useful to specify:

- format
- header size
- footer size

There is, however, another point I'd like to raise. I'm working on an H.264 
encoder that produces slices without headers. Userspace is thus responsible 
for filling the headers, based on information produced by the encoder.

When a capture buffer at the output of the encoder contains a single slice, 
that's pretty easy to handle. Userspace can use data_offset (in its new 
purpose, or buf_offset if we decide to introduce a new field instead) to 
reserve space for a header if the header size is known in advance by the 
application, or the driver (or possibly the device) can reserve space for the 
header and report the header size.

However, a capture buffer can contain multiple slices, with gaps between the 
slices for the headers. The position and size of the gaps need to be known by 
the application. I'm not sure yet if userspace can compute them, or if they're 
dynamic and need to be passed from the driver to the application on a per-
frame basis. In the latter case I would need more than a header size and 
footer size per plane.

-- 
Regards,

Laurent Pinchart

^ permalink raw reply

* Re: [Patch 2/3] firmware: dmi_scan: add SBMIOS entry and DMI tables
From: Jean Delvare @ 2015-04-17 13:02 UTC (permalink / raw)
  To: Ivan.khoronzhuk
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	matt.fleming-ral2JQCrhuEAvxtiuMwx3w,
	ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A,
	linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-doc-u79uwXL29TY76Z2rM5mHXA, mikew-hpIqsD4AKlfQT0dZR+AlfA,
	dmidecode-devel-qX2TKyscuCcdnm+yROfE0A,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A,
	msalter-H+wXaHxf7aLQT0dZR+AlfA, roy.franz-QSEj5FYQhm4dnm+yROfE0A
In-Reply-To: <552FF0E4.709-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Thu, 16 Apr 2015 20:27:00 +0300, subscivan wrote:
> On 16.04.15 18:44, Jean Delvare wrote:
> > Le Thursday 16 April 2015 à 15:56 +0300, Ivan.khoronzhuk a écrit :
> >> We cannot be sure that firmware_kobj created at time of dmi_init().
> >> The sources don't oblige you to call it at core level,
> >> for instance like it was done for arm64. For x86, dmi_init() can be called
> >> before firmware_kobj is created.
> > Looking at the code, it seems that firmware_kobj is created very, very
> > early in the boot process. In do_basic_setup(), you can see that
> > driver_init() (which in turn calls firmware_init(), creating
> > firmware_kobj) is called before do_initcalls(). So firmware_kobj must be
> > defined before dmi_scan_machine() or dmi_init() is called.
> 
> No. Not must, rather should. See below.
> 
> > Oh, and this wasn't even my point ;-) I'm fine with you checking if
> > firmware_kobj is defined. My question was about the dmi_available check
> > above. But that question was silly anyway, sorry. I confused
> > dmi_available with dmi_initialized. Checking for dmi_available is
> > perfectly reasonable, please scratch my objection.
> >
> >> And if I call it from dmi_init() I suppose
> >> I would face an error. As I can't call it in dmi_init I can't be sure that
> >> DMI is available at all. So, no, we have to check dmi_available here and
> >> call it at subsys layer, where it's supposed to be.
> > I can't parse that, I suspect you wrote dmi_init where you actually
> > meant dmi_scan_machine? Given how early firmware_kobj is created, I
> > think the code currently in dmi_init could in fact go at the end of
> > dmi_scan_machine.
> 
> Actually, dmi_scan_machine can be called even earlier.
> As I've sad, for x86, it's called before firmware_kobj is created.
> 
> kernel_start()
>      setup_arch()
>          dmi_scan_machine()
> 
> And for firmware_init(), as you noticed already:
> 
> start_kernel()
>      rest_init()
>          kernel_init()
>              kernel_init_freeable()
>                  do_basic_setup()
>                      driver_init()
>                          firmware_init()
> 
> Pay attentions that setup_arch() is called much earlier than rest_init().
> So dmi_init couldn't in fact go at the end of dmi_scan_machine.

Yeah, you're right, sorry. Somehow I thought that setup_arch was an
arch_initcall, but it is not, so I got the order all wrong.

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply

* Re: [RFC 1/4] fs: Add generic file system event notifications
From: Beata Michalska @ 2015-04-17 13:04 UTC (permalink / raw)
  To: Jan Kara
  Cc: linux-kernel, tytso, adilger.kernel, hughd, lczerner, hch,
	linux-ext4, linux-mm, kyungmin.park, kmpark,
	Linux Filesystem Mailing List, linux-api
In-Reply-To: <20150417113110.GD3116@quack.suse.cz>

On 04/17/2015 01:31 PM, Jan Kara wrote:
> On Wed 15-04-15 09:15:44, Beata Michalska wrote:
>> Introduce configurable generic interface for file
>> system-wide event notifications to provide file
>> systems with a common way of reporting any potential
>> issues as they emerge.
>>
>> The notifications are to be issued through generic
>> netlink interface, by a dedicated, for file system
>> events, multicast group. The file systems might as
>> well use this group to send their own custom messages.
>>
>> The events have been split into four base categories:
>> information, warnings, errors and threshold notifications,
>> with some very basic event types like running out of space
>> or file system being remounted as read-only.
>>
>> Threshold notifications have been included to allow
>> triggering an event whenever the amount of free space
>> drops below a certain level - or levels to be more precise
>> as two of them are being supported: the lower and the upper
>> range. The notifications work both ways: once the threshold
>> level has been reached, an event shall be generated whenever
>> the number of available blocks goes up again re-activating
>> the threshold.
>>
>> The interface has been exposed through a vfs. Once mounted,
>> it serves as an entry point for the set-up where one can
>> register for particular file system events.
>>
>> Signed-off-by: Beata Michalska <b.michalska@samsung.com>
>   Thanks for the patches! Some comments are below.
> 
>> ---
>>  Documentation/filesystems/events.txt |  254 +++++++++++
>>  fs/Makefile                          |    1 +
>>  fs/events/Makefile                   |    6 +
>>  fs/events/fs_event.c                 |  775 ++++++++++++++++++++++++++++++++++
>>  fs/events/fs_event.h                 |   27 ++
>>  fs/events/fs_event_netlink.c         |   94 +++++
>>  fs/namespace.c                       |    1 +
>>  include/linux/fs.h                   |    6 +-
>>  include/linux/fs_event.h             |   69 +++
>>  include/uapi/linux/fs_event.h        |   62 +++
>>  include/uapi/linux/genetlink.h       |    1 +
>>  net/netlink/genetlink.c              |    7 +-
>>  12 files changed, 1301 insertions(+), 2 deletions(-)
>>  create mode 100644 Documentation/filesystems/events.txt
>>  create mode 100644 fs/events/Makefile
>>  create mode 100644 fs/events/fs_event.c
>>  create mode 100644 fs/events/fs_event.h
>>  create mode 100644 fs/events/fs_event_netlink.c
>>  create mode 100644 include/linux/fs_event.h
>>  create mode 100644 include/uapi/linux/fs_event.h
>>
>> diff --git a/Documentation/filesystems/events.txt b/Documentation/filesystems/events.txt
>> new file mode 100644
>> index 0000000..c85dd88
>> --- /dev/null
>> +++ b/Documentation/filesystems/events.txt
>> @@ -0,0 +1,254 @@
>> +
>> +	Generic file system event notification interface
>> +
>> +Document created 09 April 2015 by Beata Michalska <b.michalska@samsung.com>
>> +
>> +1. The reason behind:
>> +=====================
>> +
>> +There are many corner cases when things might get messy with the filesystems.
>> +And it is not always obvious what and when went wrong. Sometimes you might
>> +get some subtle hints that there is something going on - but by the time
>> +you realise it, it might be too late as you are already out-of-space
>> +or the filesystem has been remounted as read-only (i.e.). The generic
>> +interface for the filesystem events fills the gap by providing a rather
>> +easy way of real-time notifications triggered whenever something intreseting
>> +happens, allowing filesystems to report events in a common way, as they occur.
>> +
>> +2. How does it work:
>> +====================
>> +
>> +The interface itself has been exposed as fstrace-type Virtual File System,
>> +primarily to ease the process of setting up the configuration for the file
>> +system notifications. So for starters it needs to get mounted (obviously):
>> +
>> +	mount -t fstrace none /sys/fs/events
>> +
>> +This will unveil the single fstrace filesystem entry - the 'config' file,
>> +through which the notification are being set-up.
>> +
>> +Activating notifications for particular filesystem is as straightforward
>> +as writing into the 'config' file. Note that by default all events despite
>> +the actual filesystem type are being disregarded.
>   Is there a reason to have a special filesystem for this? Do you expect
> extending it by (many) more files? Why not just creating a file in sysfs or
> something like that?

No particular reason here - just for possible future extension if needed.
I'm totally fine with having a single sysfs entry.

> 
>> +Synopsis of config:
>> +------------------
>> +
>> +	MOUNT EVENT_TYPE [L1] [L2]
>> +
>> + MOUNT      : the filesystem's mount point
>   I'm not quite decided but is mountpoint really the right thing to pass
> via the interface? They aren't unique (filesystem can be mounted in
> multiple places) and more importantly can change over time. So won't it be
> better to pass major:minor over the interface? These are stable, unique to
> the filesystem, and userspace can easily get them by calling stat(2) on the
> desired path (or directly from /proc/self/mountinfo). That could be also
> used as an fs identifier instead of assigned ID (and thus we won't need
> those events about creation of new trace which look somewhat strange to
> me).
> 
Even if a given filesystem is being mounted in many places this will come
down to single super_block - the interface will add trace for the first mount
point. This is just to ease the usage: internally a particular trace is 
associated with a super_block. 

> OTOH using major:minor may have issues in container world where processes
> could watch events from filesystems inaccessible to the container if they
> guess the device number. So maybe we could use 'path' when creating new
> trace but I'd still like to use the device number internally and for all
> outgoing communication because of above mentioned problems with
> mountpoints.

Alright then, so dropping the idea of announcing new trace (with assigned id)
and switching to using the major:minor numbers. Sounds OK to me.

> 
>> + EVENT_TYPE : type of events to be enabled: info,warn,err,thr;
>> +              at least one type needs to be specified;
>> +              note the comma delimiter and lack of spaces between
>> +	      those options
>> + L1         : the threshold limit - lower range
>> + L2         : the threshold limit - upper range
>> + 	      case enabling threshold notifications the lower level is
>> +	      mandatory, whereas the upper one remains optional;
>> +	      note though, that as those refer to the number of available
>> +	      blocks, the lower level needs to be higher than the upper one
>> +
>> +Sample request could look like the follwoing:
>> +
>> + echo /sample/mount/point warn,err,thr 710000 500000 > /sys/fs/events/config
>> +
>> +Multiple request might be specified provided they are separated with semicolon.
>   Is this necessary? It somewhat complicates syntax and parsing in kernel
> and I don't see a need for that. I'd prefer to keep the interface as simple
> as possible.
> 

This is not necessary but could ease the usage - i.e. through scripting: to specify
multiple traces and register them in one go. 

> Also I think that we should make it clear that each event type has
> different set of arguments. For threshold events they'll be L1 & L2, for
> other events there may be no arguments, for other events maybe something
> else...
> 

Currently only the threshold events use arguments -  not sure what arguments
could be used for the remaining notifications. But any suggestions are welcomed.

> ...
>> +static const match_table_t fs_etypes = {
>> +	{ FS_EVENT_INFO,    "info"  },
>> +	{ FS_EVENT_WARN,    "warn"  },
>> +	{ FS_EVENT_THRESH,  "thr"   },
>> +	{ FS_EVENT_ERR,     "err"   },
>> +	{ 0, NULL },
>> +};
>   Why are there these generic message types? Threshold messages make good
> sense to me. But not so much the rest. If they don't have a clear meaning,
> it will be a mess. So I also agree with a message like - "filesystem has
> trouble, you should probably unmount and run fsck" - that's fine. But
> generic "info" or "warning" doesn't really carry any meaning on its own and
> thus seems pretty useless to me. To explain a bit more, AFAIU this
> shouldn't be a generic logging interface where something like severity
> makes sense but rather a relatively specific interface notifying about
> events in filesystem userspace should know about so I expect relatively low
> number of types of events, not tens or even hundreds...
> 
> 								Honza

Getting rid of those would simplify the configuration part, indeed.
So we would be left with 'generic' and threshold events.
I guess I've overdone this part.

Thanks for Your comments so far.

BR
Beata





--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [RFC 1/4] fs: Add generic file system event notifications
From: Beata Michalska @ 2015-04-17 13:15 UTC (permalink / raw)
  To: Jan Kara
  Cc: linux-kernel, tytso, adilger.kernel, hughd, lczerner, hch,
	linux-ext4, linux-mm, kyungmin.park, kmpark,
	Linux Filesystem Mailing List, linux-api
In-Reply-To: <553104E5.2040704@samsung.com>

On 04/17/2015 03:04 PM, Beata Michalska wrote:
> On 04/17/2015 01:31 PM, Jan Kara wrote:
>> On Wed 15-04-15 09:15:44, Beata Michalska wrote:
>>> Introduce configurable generic interface for file
>>> system-wide event notifications to provide file
>>> systems with a common way of reporting any potential
>>> issues as they emerge.
>>>
>>> The notifications are to be issued through generic
>>> netlink interface, by a dedicated, for file system
>>> events, multicast group. The file systems might as
>>> well use this group to send their own custom messages.
>>>
>>> The events have been split into four base categories:
>>> information, warnings, errors and threshold notifications,
>>> with some very basic event types like running out of space
>>> or file system being remounted as read-only.
>>>
>>> Threshold notifications have been included to allow
>>> triggering an event whenever the amount of free space
>>> drops below a certain level - or levels to be more precise
>>> as two of them are being supported: the lower and the upper
>>> range. The notifications work both ways: once the threshold
>>> level has been reached, an event shall be generated whenever
>>> the number of available blocks goes up again re-activating
>>> the threshold.
>>>
>>> The interface has been exposed through a vfs. Once mounted,
>>> it serves as an entry point for the set-up where one can
>>> register for particular file system events.
>>>
>>> Signed-off-by: Beata Michalska <b.michalska@samsung.com>
>>   Thanks for the patches! Some comments are below.
>>
>>> ---
>>>  Documentation/filesystems/events.txt |  254 +++++++++++
>>>  fs/Makefile                          |    1 +
>>>  fs/events/Makefile                   |    6 +
>>>  fs/events/fs_event.c                 |  775 ++++++++++++++++++++++++++++++++++
>>>  fs/events/fs_event.h                 |   27 ++
>>>  fs/events/fs_event_netlink.c         |   94 +++++
>>>  fs/namespace.c                       |    1 +
>>>  include/linux/fs.h                   |    6 +-
>>>  include/linux/fs_event.h             |   69 +++
>>>  include/uapi/linux/fs_event.h        |   62 +++
>>>  include/uapi/linux/genetlink.h       |    1 +
>>>  net/netlink/genetlink.c              |    7 +-
>>>  12 files changed, 1301 insertions(+), 2 deletions(-)
>>>  create mode 100644 Documentation/filesystems/events.txt
>>>  create mode 100644 fs/events/Makefile
>>>  create mode 100644 fs/events/fs_event.c
>>>  create mode 100644 fs/events/fs_event.h
>>>  create mode 100644 fs/events/fs_event_netlink.c
>>>  create mode 100644 include/linux/fs_event.h
>>>  create mode 100644 include/uapi/linux/fs_event.h
>>>
>>> diff --git a/Documentation/filesystems/events.txt b/Documentation/filesystems/events.txt
>>> new file mode 100644
>>> index 0000000..c85dd88
>>> --- /dev/null
>>> +++ b/Documentation/filesystems/events.txt
>>> @@ -0,0 +1,254 @@
>>> +
>>> +	Generic file system event notification interface
>>> +
>>> +Document created 09 April 2015 by Beata Michalska <b.michalska@samsung.com>
>>> +
>>> +1. The reason behind:
>>> +=====================
>>> +
>>> +There are many corner cases when things might get messy with the filesystems.
>>> +And it is not always obvious what and when went wrong. Sometimes you might
>>> +get some subtle hints that there is something going on - but by the time
>>> +you realise it, it might be too late as you are already out-of-space
>>> +or the filesystem has been remounted as read-only (i.e.). The generic
>>> +interface for the filesystem events fills the gap by providing a rather
>>> +easy way of real-time notifications triggered whenever something intreseting
>>> +happens, allowing filesystems to report events in a common way, as they occur.
>>> +
>>> +2. How does it work:
>>> +====================
>>> +
>>> +The interface itself has been exposed as fstrace-type Virtual File System,
>>> +primarily to ease the process of setting up the configuration for the file
>>> +system notifications. So for starters it needs to get mounted (obviously):
>>> +
>>> +	mount -t fstrace none /sys/fs/events
>>> +
>>> +This will unveil the single fstrace filesystem entry - the 'config' file,
>>> +through which the notification are being set-up.
>>> +
>>> +Activating notifications for particular filesystem is as straightforward
>>> +as writing into the 'config' file. Note that by default all events despite
>>> +the actual filesystem type are being disregarded.
>>   Is there a reason to have a special filesystem for this? Do you expect
>> extending it by (many) more files? Why not just creating a file in sysfs or
>> something like that?
> 
> No particular reason here - just for possible future extension if needed.
> I'm totally fine with having a single sysfs entry.
> 

On the other hand .... sysfs entries are mostly single-valued or are sets
of values of a single type, so not sure if we would fit in here -
with the current configuration for the interface.

>>
>>> +Synopsis of config:
>>> +------------------
>>> +
>>> +	MOUNT EVENT_TYPE [L1] [L2]
>>> +
>>> + MOUNT      : the filesystem's mount point
>>   I'm not quite decided but is mountpoint really the right thing to pass
>> via the interface? They aren't unique (filesystem can be mounted in
>> multiple places) and more importantly can change over time. So won't it be
>> better to pass major:minor over the interface? These are stable, unique to
>> the filesystem, and userspace can easily get them by calling stat(2) on the
>> desired path (or directly from /proc/self/mountinfo). That could be also
>> used as an fs identifier instead of assigned ID (and thus we won't need
>> those events about creation of new trace which look somewhat strange to
>> me).
>>
> Even if a given filesystem is being mounted in many places this will come
> down to single super_block - the interface will add trace for the first mount
> point. This is just to ease the usage: internally a particular trace is 
> associated with a super_block. 
> 
>> OTOH using major:minor may have issues in container world where processes
>> could watch events from filesystems inaccessible to the container if they
>> guess the device number. So maybe we could use 'path' when creating new
>> trace but I'd still like to use the device number internally and for all
>> outgoing communication because of above mentioned problems with
>> mountpoints.
> 
> Alright then, so dropping the idea of announcing new trace (with assigned id)
> and switching to using the major:minor numbers. Sounds OK to me.
> 
>>
>>> + EVENT_TYPE : type of events to be enabled: info,warn,err,thr;
>>> +              at least one type needs to be specified;
>>> +              note the comma delimiter and lack of spaces between
>>> +	      those options
>>> + L1         : the threshold limit - lower range
>>> + L2         : the threshold limit - upper range
>>> + 	      case enabling threshold notifications the lower level is
>>> +	      mandatory, whereas the upper one remains optional;
>>> +	      note though, that as those refer to the number of available
>>> +	      blocks, the lower level needs to be higher than the upper one
>>> +
>>> +Sample request could look like the follwoing:
>>> +
>>> + echo /sample/mount/point warn,err,thr 710000 500000 > /sys/fs/events/config
>>> +
>>> +Multiple request might be specified provided they are separated with semicolon.
>>   Is this necessary? It somewhat complicates syntax and parsing in kernel
>> and I don't see a need for that. I'd prefer to keep the interface as simple
>> as possible.
>>
> 
> This is not necessary but could ease the usage - i.e. through scripting: to specify
> multiple traces and register them in one go. 
> 
>> Also I think that we should make it clear that each event type has
>> different set of arguments. For threshold events they'll be L1 & L2, for
>> other events there may be no arguments, for other events maybe something
>> else...
>>
> 
> Currently only the threshold events use arguments -  not sure what arguments
> could be used for the remaining notifications. But any suggestions are welcomed.
> 
>> ...
>>> +static const match_table_t fs_etypes = {
>>> +	{ FS_EVENT_INFO,    "info"  },
>>> +	{ FS_EVENT_WARN,    "warn"  },
>>> +	{ FS_EVENT_THRESH,  "thr"   },
>>> +	{ FS_EVENT_ERR,     "err"   },
>>> +	{ 0, NULL },
>>> +};
>>   Why are there these generic message types? Threshold messages make good
>> sense to me. But not so much the rest. If they don't have a clear meaning,
>> it will be a mess. So I also agree with a message like - "filesystem has
>> trouble, you should probably unmount and run fsck" - that's fine. But
>> generic "info" or "warning" doesn't really carry any meaning on its own and
>> thus seems pretty useless to me. To explain a bit more, AFAIU this
>> shouldn't be a generic logging interface where something like severity
>> makes sense but rather a relatively specific interface notifying about
>> events in filesystem userspace should know about so I expect relatively low
>> number of types of events, not tens or even hundreds...
>>
>> 								Honza
> 
> Getting rid of those would simplify the configuration part, indeed.
> So we would be left with 'generic' and threshold events.
> I guess I've overdone this part.
> 
> Thanks for Your comments so far.
> 
> BR
> Beata
> 
> 
> 
> 
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox