diff -Nru openrazer-2.7.0~ubuntu19.10.1/.builds/alpine.yml openrazer-2.8.0~ubuntu19.10.1/.builds/alpine.yml --- openrazer-2.7.0~ubuntu19.10.1/.builds/alpine.yml 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/.builds/alpine.yml 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,62 @@ +image: alpine/edge +packages: + - astyle + - dbus-x11 + - gtk+3.0 + - linux-lts-dev + - py3-autopep8 + - py3-daemonize + - py3-dbus + - py3-gobject3 + - py3-numpy + - py3-pylint + - py3-setproctitle + - py3-udev +sources: + - https://github.com/openrazer/openrazer +tasks: + - check-formatting: | + cd openrazer + + # Check the formatting of the driver and the python code + ./scripts/ci/check-astyle-formatting.sh + ./scripts/ci/check-autopep8-formatting.sh + + - check-misc: | + cd openrazer + + # Check with pylint for errors + ./scripts/ci/check-pylint.sh + # Check for duplicate fake driver serials + ./scripts/ci/test-duplicate-fake-driver-serials.sh + + - compile-driver: | + cd openrazer + + # Compile the kernel driver + echo "ccflags-y := -Wall -Werror" >> driver/Makefile + kerneldir=(/lib/modules/*/build) + make KERNELDIR="${kerneldir[0]}" + + - functional-test-setup: | + # The daemon wants the user to be in the plugdev group + sudo addgroup -S plugdev + sudo addgroup -S $USER plugdev + + - functional-test: | + cd openrazer + + # Launch dbus + eval $(dbus-launch --sh-syntax) + + # Setup the fake driver + ./scripts/ci/setup-fakedriver.sh + + # Launch the daemon + ./scripts/ci/launch-daemon.sh + + # Wait for the daemon to be ready + sleep 2 + + # Run a simple check to see if the daemon is alive + ./scripts/ci/test-daemon.sh diff -Nru openrazer-2.7.0~ubuntu19.10.1/.bumpversion.cfg openrazer-2.8.0~ubuntu19.10.1/.bumpversion.cfg --- openrazer-2.7.0~ubuntu19.10.1/.bumpversion.cfg 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/.bumpversion.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -1,5 +1,5 @@ [bumpversion] -current_version = 2.7.0 +current_version = 2.8.0 [bumpversion:file:pylib/openrazer/client/__init__.py] diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/daemon.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/daemon.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/daemon.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/daemon.py 2020-05-02 11:24:51.000000000 +0000 @@ -3,7 +3,7 @@ This class is the main core of the daemon, this serves a basic dbus module to control the main bit of the daemon """ -__version__ = '2.7.0' +__version__ = '2.8.0' import configparser import logging @@ -83,6 +83,7 @@ # Check for plugdev group if not self._check_plugdev_group(): self.logger.critical("User is not a member of the plugdev group") + self.logger.critical("Please run the command 'sudo gpasswd -a $USER plugdev' and then reboot!") sys.exit(1) # Setup DBus to use gobject main loop @@ -162,7 +163,7 @@ if log_dir is not None: log_file = os.path.join(log_dir, 'razer.log') - file_logger = logging.handlers.RotatingFileHandler(log_file, maxBytes=16777216, backupCount=10) # 16MiB + file_logger = logging.handlers.RotatingFileHandler(log_file, maxBytes=1048576, backupCount=1) # 1 MiB file_logger.setLevel(log_level) file_logger.setFormatter(formatter) logger.addHandler(file_logger) @@ -254,7 +255,7 @@ self._config[section] = {} self._config['DEFAULT'] = { - 'verbose_logging': True, + 'verbose_logging': False, 'sync_effects_enabled': True, 'devices_off_on_screensaver': True, 'key_statistics': False, diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/accessory.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/accessory.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/accessory.py 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/accessory.py 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,20 @@ +""" +Module for accessory methods +""" +from openrazer_daemon.dbus_services import endpoint + + +@endpoint('razer.device.misc.mug', 'isMugPresent', out_sig='b') +def is_mug_present(self): + """ + Get if the mug is present + + :return: True if there's a mug + :rtype: bool + """ + self.logger.debug("DBus call is_mug_present") + + driver_path = self.get_driver_path('is_mug_present') + + with open(driver_path, 'r') as driver_file: + return int(driver_file.read().strip()) == 1 diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/all.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/all.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/all.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/all.py 2020-05-02 11:24:51.000000000 +0000 @@ -13,6 +13,7 @@ "05": "ru_RU", "06": "en_GB", "07": "Nordic", + "0A": "tr_TR", "0C": "ja_JP", "10": "es_ES", "11": "it_IT", @@ -172,15 +173,15 @@ @endpoint('razer.device.misc', 'getDeviceType', out_sig='s') -def get_device_type_mug(self): +def get_device_type_accessory(self): """ Get the device's type - :return:'mug' + :return:'accessory' :rtype: str """ self.logger.debug("DBus call get_device_type") - return 'mug' + return 'accessory' @endpoint('razer.device.misc', 'hasMatrix', out_sig='b') diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/deathadder_chroma.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/deathadder_chroma.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/deathadder_chroma.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/deathadder_chroma.py 2020-05-02 11:24:51.000000000 +0000 @@ -40,7 +40,7 @@ @endpoint('razer.device.lighting.logo', 'getLogoActive', out_sig='b') def get_logo_active(self): """ - Get if the logo is light up + Get if the logo is lit up :return: Active :rtype: bool @@ -57,7 +57,7 @@ @endpoint('razer.device.lighting.logo', 'setLogoActive', in_sig='b') def set_logo_active(self, active): """ - Get if the logo is light up + Set if the logo is lit up :param active: Is active :type active: bool diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/__init__.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/__init__.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/__init__.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/__init__.py 2020-05-02 11:24:51.000000000 +0000 @@ -14,4 +14,4 @@ from openrazer_daemon.dbus_services.dbus_methods.nagahex import * from openrazer_daemon.dbus_services.dbus_methods.lanceheadte import * from openrazer_daemon.dbus_services.dbus_methods.kraken import * -from openrazer_daemon.dbus_services.dbus_methods.mug import * +from openrazer_daemon.dbus_services.dbus_methods.accessory import * diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/mug.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/mug.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/mug.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/dbus_services/dbus_methods/mug.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -""" -Module for mug methods -""" -from openrazer_daemon.dbus_services import endpoint - - -@endpoint('razer.device.misc.mug', 'isMugPresent', out_sig='b') -def is_mug_present(self): - """ - Get if the mug is present - - :return: True if there's a mug - :rtype: bool - """ - self.logger.debug("DBus call is_mug_present") - - driver_path = self.get_driver_path('is_mug_present') - - with open(driver_path, 'r') as driver_file: - return int(driver_file.read().strip()) == 1 diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/accessory.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/accessory.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/accessory.py 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/accessory.py 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,110 @@ +""" +Mug class +""" +import re + +from openrazer_daemon.hardware.device_base import RazerDeviceBrightnessSuspend as _RazerDeviceBrightnessSuspend + + +class RazerChromaMugHolder(_RazerDeviceBrightnessSuspend): + """ + Class for the Razer Chroma Mug Holder + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Chroma_Mug_Holder-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0F07 + HAS_MATRIX = True + MATRIX_DIMS = [1, 15] + METHODS = ['get_device_type_accessory', + 'set_static_effect', 'set_spectrum_effect', 'set_wave_effect', 'set_none_effect', 'set_breath_single_effect', 'set_breath_dual_effect', 'set_breath_random_effect', 'set_blinking_effect', + 'is_mug_present', + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://assets2.razerzone.com/images/mug-holder/e64e507b73e61c44789d996065fd9645-1500x1000mug_01.jpg" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets2.razerzone.com/images/mug-holder/e64e507b73e61c44789d996065fd9645-1500x1000mug_01.jpg", + "perspective_img": "https://assets2.razerzone.com/images/mug-holder/e64e507b73e61c44789d996065fd9645-1500x1000mug_01.jpg" + } + + +class RazerChromaHDK(_RazerDeviceBrightnessSuspend): + """ + Class for the Razer Chroma Hardware Development Kit (HDK) + """ + USB_VID = 0x1532 + USB_PID = 0x0F09 + HAS_MATRIX = True + MATRIX_DIMS = [4, 16] + METHODS = ['get_device_type_accessory', 'set_static_effect', 'set_wave_effect', 'set_spectrum_effect', + 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', 'set_breath_dual_effect', + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://assets2.razerzone.com/images/chromahdk2017/788b689d471fedbc0c5a175592316657-gallery-08.jpg" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets2.razerzone.com/images/chromahdk2017/788b689d471fedbc0c5a175592316657-gallery-08.jpg" + } + + +class RazerBaseStationChroma(_RazerDeviceBrightnessSuspend): + """ + Class for the Razer Base Station Chroma (Headphone Stand) + """ + USB_VID = 0x1532 + USB_PID = 0x0F08 + HAS_MATRIX = True + MATRIX_DIMS = [1, 15] + METHODS = ['get_device_type_accessory', 'set_static_effect', 'set_wave_effect', 'set_spectrum_effect', + 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', 'set_breath_dual_effect', + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://rzrwarranty.s3.amazonaws.com/145dcc47f9f9d33b0bd07b066364704160f45e87b756d690b203decec7d1e87c.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": DEVICE_IMAGE + } + + +class RazerNommoChroma(_RazerDeviceBrightnessSuspend): + """ + Class for the Razer Nommo Chroma (Speakers) + """ + USB_VID = 0x1532 + USB_PID = 0x0517 + HAS_MATRIX = True + MATRIX_DIMS = [2, 24] + METHODS = ['get_device_type_accessory', 'set_static_effect', 'set_wave_effect', 'set_spectrum_effect', + 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', 'set_breath_dual_effect', + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://d4kkpd69xt9l7.cloudfront.net/sys-master/root/he6/h1a/8939927175198/nommo-gallery-1500x1000-11.jpg" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": DEVICE_IMAGE + } + + +class RazerNommoPro(_RazerDeviceBrightnessSuspend): + """ + Class for the Razer Nommo Pro (Speakers) + """ + USB_VID = 0x1532 + USB_PID = 0x0518 + HAS_MATRIX = True + MATRIX_DIMS = [2, 8] + METHODS = ['get_device_type_accessory', 'set_static_effect', 'set_wave_effect', 'set_spectrum_effect', + 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', 'set_breath_dual_effect', + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://d4kkpd69xt9l7.cloudfront.net/sys-master/root/h89/hc4/9003754717214/razer-nommo-pro-audio-04.jpg" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": DEVICE_IMAGE + } diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/keyboards.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/keyboards.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/keyboards.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/keyboards.py 2020-05-02 11:24:51.000000000 +0000 @@ -177,6 +177,54 @@ # self.key_manager.close() +class RazerTartarusV2(_RippleKeyboard): + """ + Class for Razer Tartarus V2 + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Tartarus_V2(-if01)?-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x022B + DEDICATED_MACRO_KEYS = True + MATRIX_DIMS = [4, 6] + + METHODS = ['get_device_type_keypad', + 'set_breath_random_effect', 'set_breath_single_effect', 'set_breath_dual_effect', + 'set_key_row', + 'set_reactive_effect', + 'set_none_effect', + 'set_custom_effect', + 'set_wave_effect', + 'set_static_effect', + 'set_spectrum_effect', + 'set_starlight_random_effect', 'set_starlight_single_effect', 'set_starlight_dual_effect', + 'keypad_get_profile_led_red', 'keypad_set_profile_led_red', + 'keypad_get_profile_led_green', 'keypad_set_profile_led_green', + 'keypad_get_profile_led_blue', 'keypad_set_profile_led_blue', + 'get_macro_effect', 'set_macro_effect', 'get_macros', 'delete_macro', 'add_macro', + 'set_ripple_effect', 'set_ripple_effect_random_colour', + 'get_game_mode', 'set_game_mode', + 'keypad_get_mode_modifier', 'keypad_set_mode_modifier'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1255/1255_tartarus_v2.png" + + RAZER_URLS = { + "top_img": DEVICE_IMAGE + } + + def __init__(self, *args, **kwargs): + super(RazerTartarusV2, self).__init__(*args, **kwargs) + + def _close(self): + """ + Close the key manager + """ + super(RazerTartarusV2, self)._close() + + # TODO look into saving stats in /var/run maybe + # self.key_manager.close() + + class RazerOrbweaver(_RazerDeviceBrightnessSuspend): """ Class for the Razer Orbweaver @@ -217,7 +265,7 @@ # self.key_manager.close() -class RazerOrbweaverChroma(_RazerDeviceBrightnessSuspend): +class RazerOrbweaverChroma(_RippleKeyboard): """ Class for the Razer Orbweaver Chroma """ @@ -227,9 +275,18 @@ USB_VID = 0x1532 USB_PID = 0x0207 DEDICATED_MACRO_KEYS = True - METHODS = ['get_device_type_keypad', 'set_breath_random_effect', 'set_breath_single_effect', - 'set_breath_dual_effect', 'set_static_effect', 'set_spectrum_effect', 'set_wave_effect', 'keypad_get_profile_led_red', 'keypad_set_profile_led_red', 'keypad_get_profile_led_green', - 'keypad_set_profile_led_green', 'keypad_get_profile_led_blue', 'keypad_set_profile_led_blue', 'get_macros', 'delete_macro', 'add_macro', 'keypad_get_mode_modifier', 'keypad_set_mode_modifier'] + HAS_MATRIX = True + MATRIX_DIMS = [5, 22] + METHODS = ['get_device_type_keypad', + 'set_key_row', + 'set_breath_random_effect', 'set_breath_single_effect', 'set_breath_dual_effect', + 'set_static_effect', 'set_spectrum_effect', 'set_wave_effect', 'set_custom_effect', + 'keypad_get_profile_led_red', 'keypad_set_profile_led_red', + 'keypad_get_profile_led_green', 'keypad_set_profile_led_green', + 'keypad_get_profile_led_blue', 'keypad_set_profile_led_blue', + 'get_macros', 'delete_macro', 'add_macro', + 'keypad_get_mode_modifier', 'keypad_set_mode_modifier', + 'set_ripple_effect', 'set_ripple_effect_random_colour'] DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/607/607_orbweaver_chroma.png" @@ -721,6 +778,32 @@ } +class RazerHuntsmanTournamentEdition(_RippleKeyboard): + """ + Class for the Razer Huntsman Tournament Edition + """ + EVENT_FILE_REGEX = re.compile(r'.*Huntsman_Tournament_Edition_00000000001A(-if01)?-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0243 + HAS_MATRIX = True + WAVE_DIRS = (0, 1) + MATRIX_DIMS = [6, 16] + METHODS = ['get_device_type_keyboard', 'set_wave_effect', 'set_static_effect', 'set_spectrum_effect', + 'set_reactive_effect', 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', 'set_breath_dual_effect', + 'set_custom_effect', 'set_key_row', 'get_game_mode', 'set_game_mode', 'get_macro_mode', 'set_macro_mode', + 'get_macro_effect', 'set_macro_effect', 'get_macros', 'delete_macro', 'add_macro', + 'set_starlight_random_effect', 'set_starlight_single_effect', 'set_starlight_dual_effect', + 'set_ripple_effect', 'set_ripple_effect_random_colour'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1537/1537_huntsman_te.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/1537/1537_huntsman_te.png" + } + + class RazerBlackWidowElite(_RippleKeyboard): """ Class for the Razer BlackWidow Elite @@ -822,7 +905,7 @@ """ Class for the Razer BlackWidow 2019 """ - EVENT_FILE_REGEX = re.compile(r'.*BlackWidow_2019(-if01)?-event-kbd') + EVENT_FILE_REGEX = re.compile(r'.*BlackWidow(-if01)?-event-kbd') USB_VID = 0x1532 USB_PID = 0x0241 @@ -838,6 +921,24 @@ DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1501/1501-blackwidow2019.png" +class RazerBlackWidowEssential(_RippleKeyboard): + """ + Class for the Razer BlackWidow Essential + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_BlackWidow_Essential(-if01)?-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0237 + HAS_MATRIX = True + MATRIX_DIMS = [6, 22] + METHODS = ['get_device_type_keyboard', 'set_static_effect', 'set_none_effect', + 'set_breath_single_effect', 'set_key_row', 'get_game_mode', + 'set_game_mode', 'get_macro_mode', 'set_macro_mode', 'get_macro_effect', + 'set_macro_effect', 'get_macros', 'delete_macro', 'add_macro'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1501/1501-blackwidow2019.png" + + class RazerOrnata(_RippleKeyboard): """ Class for the Razer Ornata @@ -1219,7 +1320,7 @@ USB_PID = 0x0245 HAS_MATRIX = True MATRIX_DIMS = [6, 16] - METHODS = ['get_device_type_keyboard', 'set_wave_effect', 'set_static_effect', 'set_spectrum_effect', + METHODS = ['get_device_type_keyboard', 'get_logo_active', 'set_logo_active', 'set_wave_effect', 'set_static_effect', 'set_spectrum_effect', 'set_reactive_effect', 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', 'set_breath_dual_effect', 'set_custom_effect', 'set_key_row', 'set_starlight_random_effect', 'set_starlight_single_effect', 'set_starlight_dual_effect', @@ -1240,3 +1341,60 @@ 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect'] DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1518/1518_blade15_mid2019-base.png" + + +class RazerBladeProLate2019(_RippleKeyboard): + """ + Class for the Razer Blade Pro (Late 2019) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Blade(-if01)?-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x024C + HAS_MATRIX = True + MATRIX_DIMS = [6, 16] + METHODS = ['get_device_type_keyboard', 'get_logo_active', 'set_logo_active', 'set_wave_effect', 'set_static_effect', 'set_spectrum_effect', + 'set_reactive_effect', 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', + 'set_breath_dual_effect', 'set_custom_effect', 'set_key_row', + 'set_starlight_random_effect', 'set_starlight_single_effect', 'set_starlight_dual_effect', + 'set_ripple_effect', 'set_ripple_effect_random_colour'] + + DEVICE_IMAGE = "https://assets2.razerzone.com/images/razer-blade-pro-17/razer-blade-pro-17-2019-OGimage-1200x630.jpg" + + +class RazerBlade2019StudioEdition(_RippleKeyboard): + """ + Class for the Razer Blade 15 Studio Edition (2019) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Blade(-if01)?-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x024D + HAS_MATRIX = True + MATRIX_DIMS = [6, 16] + METHODS = ['get_device_type_keyboard', 'set_wave_effect', 'set_static_effect', 'set_spectrum_effect', + 'set_reactive_effect', 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', + 'set_breath_dual_effect', 'set_custom_effect', 'set_key_row', + 'set_starlight_random_effect', 'set_starlight_single_effect', 'set_starlight_dual_effect', + 'set_ripple_effect', 'set_ripple_effect_random_colour'] + + DEVICE_IMAGE = "https://assets2.razerzone.com/images/blade-15/shop/studio-ch41-1.jpg" + + +class RazerBladePro2019(_RippleKeyboard): + """ + Class for the Razer Blade Pro 17 (2019) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Blade(-if01)?-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0234 + HAS_MATRIX = True + MATRIX_DIMS = [6, 16] + METHODS = ['get_device_type_keyboard', 'set_wave_effect', 'set_static_effect', 'set_spectrum_effect', + 'set_reactive_effect', 'set_none_effect', 'set_breath_random_effect', 'set_breath_single_effect', + 'set_breath_dual_effect', 'set_custom_effect', 'set_key_row', + 'set_starlight_random_effect', 'set_starlight_single_effect', 'set_starlight_dual_effect', + 'set_ripple_effect', 'set_ripple_effect_random_colour'] + + DEVICE_IMAGE = "https://assets2.razerzone.com/images/razer-blade-pro-17/razer-blade-pro-17-2019-OGimage-1200x630.jpg" diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mouse_mat.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mouse_mat.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mouse_mat.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mouse_mat.py 2020-05-02 11:24:51.000000000 +0000 @@ -26,9 +26,9 @@ } -class RazerFirefly_Hyperflux(__RazerDeviceBrightnessSuspend): +class RazerFireflyHyperflux(__RazerDeviceBrightnessSuspend): """ - Class for the Razer Firefly_Hyperflux (2018) + Class for the Razer Firefly Hyperflux (2018) """ USB_VID = 0x1532 USB_PID = 0x0068 diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mouse.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mouse.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mouse.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mouse.py 2020-05-02 11:24:51.000000000 +0000 @@ -15,6 +15,337 @@ set_left_brightness as _set_left_brightness, set_right_brightness as _set_right_brightness +class RazerLanceheadWirelessWired(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Lancehead Wireless (Wired) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Lancehead_Wireless-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0070 + HAS_MATRIX = True + WAVE_DIRS = (1, 2) + MATRIX_DIMS = [1, 16] + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', 'get_poll_rate', 'set_poll_rate', 'get_logo_brightness', 'set_logo_brightness', 'get_scroll_brightness', 'set_scroll_brightness', + 'get_left_brightness', 'set_left_brightness', 'get_right_brightness', 'set_right_brightness', + # Battery + 'get_battery', 'is_charging', 'set_idle_time', 'set_low_battery_threshold', + # Logo + 'set_logo_wave', 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_reactive_naga_hex_v2', 'set_logo_breath_random_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2', + # Scroll wheel + 'set_scroll_wave', 'set_scroll_static_naga_hex_v2', 'set_scroll_spectrum_naga_hex_v2', 'set_scroll_none_naga_hex_v2', 'set_scroll_reactive_naga_hex_v2', 'set_scroll_breath_random_naga_hex_v2', 'set_scroll_breath_single_naga_hex_v2', 'set_scroll_breath_dual_naga_hex_v2', + # Left side + 'set_left_wave', 'set_left_static', 'set_left_spectrum', 'set_left_none', 'set_left_reactive', 'set_left_breath_random', 'set_left_breath_single', 'set_left_breath_dual', + # Right side + 'set_right_wave', 'set_right_static', 'set_right_spectrum', 'set_right_none', 'set_right_reactive', 'set_right_breath_random', 'set_right_breath_single', 'set_right_breath_dual', + # Can set LOGO and Scroll with custom + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1205/1205_lancehead.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/1205/1205_lancehead.png" + } + + DPI_MAX = 16000 + + def _suspend_device(self): + """ + Suspend the device + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = (_da_get_logo_brightness(self), _da_get_scroll_brightness(self), _get_left_brightness(self), _get_right_brightness(self)) + + # Todo make it context? + self.disable_notify = True + _da_set_logo_brightness(self, 0) + _da_set_scroll_brightness(self, 0) + _set_left_brightness(self, 0) + _set_right_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', (100, 100))[0] + scroll_brightness = self.suspend_args.get('brightness', (100, 100))[1] + left_row_brightness = self.suspend_args.get('brightness', (100, 100))[2] + right_row_brightness = self.suspend_args.get('brightness', (100, 100))[3] + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + _da_set_scroll_brightness(self, scroll_brightness) + _set_left_brightness(self, left_row_brightness) + _set_right_brightness(self, right_row_brightness) + self.disable_notify = False + + +class RazerLanceheadWirelessReceiver(RazerLanceheadWirelessWired): + """ + Class for the Razer Lancehead Wireless (Receiver) + """ + USB_PID = 0x006F + METHODS = RazerLanceheadWirelessWired.METHODS + ['set_charge_effect', 'set_charge_colour'] + + def __init__(self, *args, **kwargs): + super(RazerLanceheadWirelessReceiver, self).__init__(*args, **kwargs) + + self._battery_manager = _BatteryManager(self, self._device_number, 'Razer Lancehead Wireless') + self._battery_manager.active = self.config.getboolean('Startup', 'mouse_battery_notifier', fallback=False) + + def _close(self): + """ + Close the key manager + """ + super(RazerLanceheadWirelessReceiver, self)._close() + + self._battery_manager.close() + + +class RazerLanceheadWired(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Lancehead (Wired) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Lancehead-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0059 + HAS_MATRIX = True + WAVE_DIRS = (1, 2) + MATRIX_DIMS = [1, 16] + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', 'get_poll_rate', 'set_poll_rate', 'get_logo_brightness', 'set_logo_brightness', 'get_scroll_brightness', 'set_scroll_brightness', + 'get_left_brightness', 'set_left_brightness', 'get_right_brightness', 'set_right_brightness', + # Battery + 'get_battery', 'is_charging', 'set_idle_time', 'set_low_battery_threshold', + # Logo + 'set_logo_wave', 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_reactive_naga_hex_v2', 'set_logo_breath_random_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2', + # Scroll wheel + 'set_scroll_wave', 'set_scroll_static_naga_hex_v2', 'set_scroll_spectrum_naga_hex_v2', 'set_scroll_none_naga_hex_v2', 'set_scroll_reactive_naga_hex_v2', 'set_scroll_breath_random_naga_hex_v2', 'set_scroll_breath_single_naga_hex_v2', 'set_scroll_breath_dual_naga_hex_v2', + # Left side + 'set_left_wave', 'set_left_static', 'set_left_spectrum', 'set_left_none', 'set_left_reactive', 'set_left_breath_random', 'set_left_breath_single', 'set_left_breath_dual', + # Right side + 'set_right_wave', 'set_right_static', 'set_right_spectrum', 'set_right_none', 'set_right_reactive', 'set_right_breath_random', 'set_right_breath_single', 'set_right_breath_dual', + # Can set LOGO and Scroll with custom + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1205/1205_lancehead.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/1205/1205_lancehead.png" + } + + DPI_MAX = 16000 + + def _suspend_device(self): + """ + Suspend the device + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = (_da_get_logo_brightness(self), _da_get_scroll_brightness(self), _get_left_brightness(self), _get_right_brightness(self)) + + # Todo make it context? + self.disable_notify = True + _da_set_logo_brightness(self, 0) + _da_set_scroll_brightness(self, 0) + _set_left_brightness(self, 0) + _set_right_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', (100, 100))[0] + scroll_brightness = self.suspend_args.get('brightness', (100, 100))[1] + left_row_brightness = self.suspend_args.get('brightness', (100, 100))[2] + right_row_brightness = self.suspend_args.get('brightness', (100, 100))[3] + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + _da_set_scroll_brightness(self, scroll_brightness) + _set_left_brightness(self, left_row_brightness) + _set_right_brightness(self, right_row_brightness) + self.disable_notify = False + + +class RazerLanceheadWireless(RazerLanceheadWired): + """ + Class for the Razer Lancehead (Wireless) + """ + USB_PID = 0x005A + METHODS = RazerLanceheadWired.METHODS + ['set_charge_effect', 'set_charge_colour'] + + def __init__(self, *args, **kwargs): + super(RazerLanceheadWireless, self).__init__(*args, **kwargs) + + self._battery_manager = _BatteryManager(self, self._device_number, 'Razer Lancehead') + self._battery_manager.active = self.config.getboolean('Startup', 'mouse_battery_notifier', fallback=False) + + def _close(self): + """ + Close the key manager + """ + super(RazerLanceheadWireless, self)._close() + + self._battery_manager.close() + + +class RazerDeathAdderEssentialWhiteEdition(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer DeathAdder Essential (White Edition) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Razer_DeathAdder_Essential_White_Edition-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0071 + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', + 'get_poll_rate', 'set_poll_rate', + 'get_logo_brightness', 'set_logo_brightness', + 'get_scroll_brightness', 'set_scroll_brightness', + # Logo + 'set_logo_static_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', + # Scroll wheel + 'set_scroll_static_naga_hex_v2', 'set_scroll_none_naga_hex_v2', 'set_scroll_breath_single_naga_hex_v2'] + + DEVICE_IMAGE = "https://assets2.razerzone.com/images/da10m/carousel/razer-death-adder-gallery-25.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets2.razerzone.com/images/da10m/carousel/razer-death-adder-gallery-25.png" + } + + DPI_MAX = 6400 + + def _suspend_device(self): + """ + Suspend the device + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = (_da_get_logo_brightness(self), _da_get_scroll_brightness(self)) + + # Todo make it context? + self.disable_notify = True + _da_set_logo_brightness(self, 0) + _da_set_scroll_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', (100, 100))[0] + scroll_brightness = self.suspend_args.get('brightness', (100, 100))[1] + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + _da_set_scroll_brightness(self, scroll_brightness) + self.disable_notify = False + + +class RazerAbyssusEliteDVaEdition(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Abyssus Elite (D.Va Edition) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_D.Va_Razer_Abyssus_Elite-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x006A + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', + 'get_poll_rate', 'set_poll_rate', + 'get_logo_brightness', 'set_logo_brightness', + # Underglow/Logo use LOGO_LED + 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_reactive_naga_hex_v2', + 'set_logo_breath_random_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1288/d.va_abyssus_elite.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/1288/d.va_abyssus_elite.png" + } + + DPI_MAX = 7200 + + def _suspend_device(self): + """ + Suspend the device + + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args['brightness'] = _da_get_logo_brightness(self) + + # Todo make it context? + self.disable_notify = True + _da_set_logo_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', 100) + + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + self.disable_notify = False + + +class RazerAbyssusEssential(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Abyssus Essential + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Razer_Abyssus_Essential-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x006B + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', + 'get_poll_rate', 'set_poll_rate', + 'get_logo_brightness', 'set_logo_brightness', + # Backlight/Logo...same + 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_reactive_naga_hex_v2', + 'set_logo_breath_random_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1290/1290_abyssusessential.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/1290/1290_abyssusessential.png" + } + + DPI_MAX = 7200 + + def _suspend_device(self): + """ + Suspend the device + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args['brightness'] = _da_get_logo_brightness(self) + + # Todo make it context? + self.disable_notify = True + _da_set_logo_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', 100) + + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + self.disable_notify = False + + class RazerLanceheadTE(__RazerDeviceSpecialBrightnessSuspend): """ Class for the Razer Lancehead Tournament Edition @@ -176,7 +507,7 @@ """ USB_VID = 0x1532 USB_PID = 0x0042 - METHODS = ['get_device_type_mouse', 'set_logo_active', 'get_logo_active'] + METHODS = ['get_device_type_mouse', 'set_logo_active', 'get_logo_active', 'get_poll_rate', 'set_poll_rate'] DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/274/abyssus2014_500x500.png" @@ -262,7 +593,7 @@ Get the last known brightness and then set the brightness """ - scroll_brightness = self.suspend_args.get('brightness', 100)[0] + scroll_brightness = self.suspend_args.get('brightness', 100) self.disable_notify = True _da_set_scroll_brightness(self, scroll_brightness) @@ -1007,14 +1338,92 @@ DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/192/192_mamba_2012.png" - # Deprecated - RAZER_URLS be removed in future. - RAZER_URLS = { - "top_img": "https://assets.razerzone.com/eeimages/support/products/192/192_mamba_2012.png", - "side_img": None, - "perspective_img": "https://assets.razerzone.com/eeimages/support/products/18/mamba1.jpg" - } + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/192/192_mamba_2012.png", + "side_img": None, + "perspective_img": "https://assets.razerzone.com/eeimages/support/products/18/mamba1.jpg" + } + + DPI_MAX = 6400 + + +class RazerMambaWirelessWired(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Mamba Wireless (Wired) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Mamba_Wireless_000000000000-if0(1|2)-event-kbd') + USB_VID = 0x1532 + USB_PID = 0x0073 + HAS_MATRIX = True + MATRIX_DIMS = [1, 16] + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', 'get_poll_rate', 'set_poll_rate', 'get_logo_brightness', 'set_logo_brightness', 'get_scroll_brightness', 'set_scroll_brightness', + # Battery + 'get_battery', 'is_charging', 'set_idle_time', 'set_low_battery_threshold', + # Logo + 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_reactive_naga_hex_v2', 'set_logo_breath_random_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2', + # Scroll wheel + 'set_scroll_static_naga_hex_v2', 'set_scroll_spectrum_naga_hex_v2', 'set_scroll_none_naga_hex_v2', 'set_scroll_reactive_naga_hex_v2', 'set_scroll_breath_random_naga_hex_v2', 'set_scroll_breath_single_naga_hex_v2', 'set_scroll_breath_dual_naga_hex_v2', + # Can set LOGO and Scroll with custom + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1404/1404_mamba_wireless.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/1404/1404_mamba_wireless.png" + } + + DPI_MAX = 16000 + + def _suspend_device(self): + """ + Suspend the device + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = (_da_get_logo_brightness(self), _da_get_scroll_brightness(self)) + + # Todo make it context? + self.disable_notify = True + _da_set_logo_brightness(self, 0) + _da_set_scroll_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', (100, 100))[0] + scroll_brightness = self.suspend_args.get('brightness', (100, 100))[1] + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + _da_set_scroll_brightness(self, scroll_brightness) + self.disable_notify = False + + +class RazerMambaWirelessReceiver(RazerMambaWirelessWired): + """ + Class for the Razer Mamba Wireless (Receiver) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Mamba_Wireless_Receiver-if0(1|2)-event-kbd') + USB_PID = 0x0072 + METHODS = RazerMambaWirelessWired.METHODS + ['set_charge_effect', 'set_charge_colour'] + + def __init__(self, *args, **kwargs): + super(RazerMambaWirelessReceiver, self).__init__(*args, **kwargs) + + self._battery_manager = _BatteryManager(self, self._device_number, 'Razer Mamba Wireless') + self._battery_manager.active = self.config.getboolean('Startup', 'mouse_battery_notifier', fallback=False) + + def _close(self): + """ + Close the key manager + """ + super(RazerMambaWirelessReceiver, self)._close() - DPI_MAX = 6400 + self._battery_manager.close() class RazerNaga2014(__RazerDevice): @@ -1287,6 +1696,122 @@ self.disable_notify = False +class RazerViperUltimateWired(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Viper Ultimate (Wired) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Razer_Viper_Ultimate_000000000000-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x007A + HAS_MATRIX = True + WAVE_DIRS = (1, 2) + MATRIX_DIMS = [1, 20] + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', 'get_poll_rate', 'set_poll_rate', + # Logo + 'get_logo_brightness', 'set_logo_brightness', 'set_logo_wave', + 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', + 'set_logo_reactive_naga_hex_v2', 'set_logo_breath_random_naga_hex_v2', + 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1577/ee_photo.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": DEVICE_IMAGE + } + + DPI_MAX = 20000 + + def _suspend_device(self): + """ + Suspend the device + + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = _da_get_logo_brightness(self) + + self.disable_notify = True + _da_set_logo_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', 100) + + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + self.disable_notify = False + + +class RazerViperUltimateWireless(RazerViperUltimateWired): + """ + Class for the Razer Viper Ultimate (Wireless) + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Razer_Viper_Ultimate_Dongle-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x007B + + +class RazerViper(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Viper + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Razer_Viper-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0078 + HAS_MATRIX = True + WAVE_DIRS = (1, 2) + MATRIX_DIMS = [1, 16] + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', 'get_poll_rate', 'set_poll_rate', + # Logo + 'get_logo_brightness', 'set_logo_brightness', 'set_logo_wave', + 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', + 'set_logo_reactive_naga_hex_v2', 'set_logo_breath_random_naga_hex_v2', + 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1539/1539_viper.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/1539/1539_viper.png" + } + + DPI_MAX = 16000 + + def _suspend_device(self): + """ + Suspend the device + + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = _da_get_logo_brightness(self) + + self.disable_notify = True + _da_set_logo_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', 100) + + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + self.disable_notify = False + + class RazerDeathAdderEssential(__RazerDeviceSpecialBrightnessSuspend): """ Class for the Razer DeathAdder Essential @@ -1339,6 +1864,80 @@ self.disable_notify = False +class RazerMambaElite(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Mamba Elite + """ + USB_VID = 0x1532 + USB_PID = 0x006C + HAS_MATRIX = True + WAVE_DIRS = (1, 2) + MATRIX_DIMS = [1, 20] + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', + 'get_poll_rate', 'set_poll_rate', + # Logo logo_led_brightness/logo_matrix_effect_breath/... + 'get_logo_brightness', 'set_logo_brightness', + 'set_logo_wave', 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_reactive_naga_hex_v2', 'set_logo_breath_random_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2', + # Scroll wheel scroll_led_brightness/scroll_matrix_effect_breath/... + 'get_scroll_brightness', 'set_scroll_brightness', + 'set_scroll_wave', 'set_scroll_static_naga_hex_v2', 'set_scroll_spectrum_naga_hex_v2', 'set_scroll_none_naga_hex_v2', 'set_scroll_reactive_naga_hex_v2', 'set_scroll_breath_random_naga_hex_v2', 'set_scroll_breath_single_naga_hex_v2', 'set_scroll_breath_dual_naga_hex_v2', + # Left side left_led_brightness/left_matrix_effect_breath/... + 'get_left_brightness', 'set_left_brightness', + 'set_left_wave', 'set_left_static', 'set_left_spectrum', 'set_left_none', 'set_left_reactive', 'set_left_breath_random', 'set_left_breath_single', 'set_left_breath_dual', + # Right side right_led_brightness/right_matrix_effect_breath/... + 'get_right_brightness', 'set_right_brightness', + 'set_right_wave', 'set_right_static', 'set_right_spectrum', 'set_right_none', 'set_right_reactive', 'set_right_breath_random', 'set_right_breath_single', 'set_right_breath_dual', + # Custom frame + 'set_custom_effect', 'set_key_row'] + + DPI_MAX = 16000 + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1390/1390_mamba_elite.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": DEVICE_IMAGE + } + + def _suspend_device(self): + """ + Suspend the device + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = ( + _da_get_logo_brightness(self), + _da_get_scroll_brightness(self), + _get_left_brightness(self), + _get_right_brightness(self)) + + # Todo make it context? + self.disable_notify = True + _set_backlight_brightness(self, 0) + _da_set_logo_brightness(self, 0) + _da_set_scroll_brightness(self, 0) + _set_left_brightness(self, 0) + _set_right_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', (100, 100))[0] + scroll_brightness = self.suspend_args.get('brightness', (100, 100))[1] + left_row_brightness = self.suspend_args.get('brightness', (100, 100))[2] + right_row_brightness = self.suspend_args.get('brightness', (100, 100))[3] + + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + _da_set_scroll_brightness(self, scroll_brightness) + _set_left_brightness(self, left_row_brightness) + _set_right_brightness(self, right_row_brightness) + self.disable_notify = False + + class RazerDeathAdder1800(__RazerDevice): """ Class for the Razer DeathAdder 1800 @@ -1355,3 +1954,116 @@ RAZER_URLS = { "top_img": DEVICE_IMAGE } + + +class RazerBasilisk(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer Basilisk + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_Basilisk-if0(1|2)-event-kbd') + + USB_VID = 0x1532 + USB_PID = 0x0064 + HAS_MATRIX = True + MATRIX_DIMS = [1, 2] + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', 'get_poll_rate', 'set_poll_rate', + 'get_logo_brightness', 'set_logo_brightness', 'get_scroll_brightness', 'set_scroll_brightness', + # Logo + 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_reactive_naga_hex_v2', 'set_logo_breath_random_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2', + # Scroll wheel + 'set_scroll_static_naga_hex_v2', 'set_scroll_spectrum_naga_hex_v2', 'set_scroll_none_naga_hex_v2', 'set_scroll_reactive_naga_hex_v2', 'set_scroll_breath_random_naga_hex_v2', 'set_scroll_breath_single_naga_hex_v2', 'set_scroll_breath_dual_naga_hex_v2', + # Can set LOGO and Scroll with custom + 'set_custom_effect', 'set_key_row'] + + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1241/1241_basilisk.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": DEVICE_IMAGE + } + + DPI_MAX = 16000 + + def _suspend_device(self): + """ + Suspend the device + + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = (_da_get_logo_brightness(self), _da_get_scroll_brightness(self)) + + # Todo make it context? + self.disable_notify = True + _da_set_logo_brightness(self, 0) + _da_set_scroll_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', (100, 100))[0] + scroll_brightness = self.suspend_args.get('brightness', (100, 100))[1] + + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + _da_set_scroll_brightness(self, scroll_brightness) + self.disable_notify = False + + +class RazerDeathAdderV2(__RazerDeviceSpecialBrightnessSuspend): + """ + Class for the Razer DeathAdder V2 + """ + EVENT_FILE_REGEX = re.compile(r'.*Razer_DeathAdder_V2-if0(1|2)-event-kbd') + METHODS = ['get_device_type_mouse', 'max_dpi', 'get_dpi_xy', 'set_dpi_xy', 'get_poll_rate', 'set_poll_rate', + 'get_logo_brightness', 'set_logo_brightness', 'get_scroll_brightness', 'set_scroll_brightness', + # Logo + 'set_logo_static_naga_hex_v2', 'set_logo_spectrum_naga_hex_v2', 'set_logo_none_naga_hex_v2', 'set_logo_reactive_naga_hex_v2', 'set_logo_breath_random_naga_hex_v2', 'set_logo_breath_single_naga_hex_v2', 'set_logo_breath_dual_naga_hex_v2', + # Scroll wheel + 'set_scroll_static_naga_hex_v2', 'set_scroll_spectrum_naga_hex_v2', 'set_scroll_none_naga_hex_v2', 'set_scroll_reactive_naga_hex_v2', 'set_scroll_breath_random_naga_hex_v2', 'set_scroll_breath_single_naga_hex_v2', 'set_scroll_breath_dual_naga_hex_v2', + # Can set LOGO and Scroll with custom + 'set_custom_effect', 'set_key_row'] + + USB_VID = 0x1532 + USB_PID = 0x0084 + DEVICE_IMAGE = "https://assets.razerzone.com/eeimages/support/products/1612/1612_razerdeathadderv2.png" + + # Deprecated - RAZER_URLS be removed in future. + RAZER_URLS = { + "top_img": "https://assets.razerzone.com/eeimages/support/products/1612/1612_razerdeathadderv2.png" + } + + DPI_MAX = 20000 + + def _suspend_device(self): + """ + Suspend the device + + Get the current brightness level, store it for later and then set the brightness to 0 + """ + self.suspend_args.clear() + self.suspend_args['brightness'] = (_da_get_logo_brightness(self), _da_get_scroll_brightness(self)) + + # Todo make it context? + self.disable_notify = True + _da_set_logo_brightness(self, 0) + _da_set_scroll_brightness(self, 0) + self.disable_notify = False + + def _resume_device(self): + """ + Resume the device + + Get the last known brightness and then set the brightness + """ + logo_brightness = self.suspend_args.get('brightness', (100, 100))[0] + scroll_brightness = self.suspend_args.get('brightness', (100, 100))[1] + + self.disable_notify = True + _da_set_logo_brightness(self, logo_brightness) + _da_set_scroll_brightness(self, scroll_brightness) + self.disable_notify = False diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mug.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mug.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mug.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/hardware/mug.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -""" -Mug class -""" -import re - -from openrazer_daemon.hardware.device_base import RazerDeviceBrightnessSuspend as _RazerDeviceBrightnessSuspend - - -class RazerChromaMugHolder(_RazerDeviceBrightnessSuspend): - """ - Class for the Razer Chroma Mug Holder - """ - EVENT_FILE_REGEX = re.compile(r'.*Razer_Chroma_Mug_Holder-if0(1|2)-event-kbd') - - USB_VID = 0x1532 - USB_PID = 0x0F07 - HAS_MATRIX = True - MATRIX_DIMS = [1, 15] - METHODS = ['get_device_type_mug', - 'set_static_effect', 'set_spectrum_effect', 'set_wave_effect', 'set_none_effect', 'set_breath_single_effect', 'set_breath_dual_effect', 'set_breath_random_effect', 'set_blinking_effect', - 'is_mug_present', - 'set_custom_effect', 'set_key_row'] - - DEVICE_IMAGE = "https://assets2.razerzone.com/images/mug-holder/e64e507b73e61c44789d996065fd9645-1500x1000mug_01.jpg" - - # Deprecated - RAZER_URLS be removed in future. - RAZER_URLS = { - "top_img": "https://assets2.razerzone.com/images/mug-holder/e64e507b73e61c44789d996065fd9645-1500x1000mug_01.jpg", - "side_img": None, - "perspective_img": "https://assets2.razerzone.com/images/mug-holder/e64e507b73e61c44789d996065fd9645-1500x1000mug_01.jpg" - } diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/misc/screensaver_monitor.py openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/misc/screensaver_monitor.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/openrazer_daemon/misc/screensaver_monitor.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/openrazer_daemon/misc/screensaver_monitor.py 2020-05-02 11:24:51.000000000 +0000 @@ -5,7 +5,12 @@ import dbus import dbus.exceptions -DBUS_SCREENSAVER_INTERFACES = ('org.freedesktop.ScreenSaver', 'org.gnome.ScreenSaver', 'org.mate.ScreenSaver') +DBUS_SCREENSAVER_INTERFACES = ( + 'org.freedesktop.ScreenSaver', + 'org.gnome.ScreenSaver', + 'org.mate.ScreenSaver', + 'org.cinnamon.ScreenSaver', +) class ScreensaverMonitor(object): diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/resources/openrazer-daemon.systemd.service.in openrazer-2.8.0~ubuntu19.10.1/daemon/resources/openrazer-daemon.systemd.service.in --- openrazer-2.7.0~ubuntu19.10.1/daemon/resources/openrazer-daemon.systemd.service.in 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/resources/openrazer-daemon.systemd.service.in 2020-05-02 11:24:51.000000000 +0000 @@ -5,7 +5,7 @@ [Service] Type=dbus BusName=org.razer -ExecStart=##PREFIX##/bin/openrazer-daemon -Fv +ExecStart=##PREFIX##/bin/openrazer-daemon -F [Install] WantedBy=default.target diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/resources/razer.conf openrazer-2.8.0~ubuntu19.10.1/daemon/resources/razer.conf --- openrazer-2.7.0~ubuntu19.10.1/daemon/resources/razer.conf 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/resources/razer.conf 2020-05-02 11:24:51.000000000 +0000 @@ -1,6 +1,6 @@ [General] # Verbose logging (logs debug messages - lotsa spam) -verbose_logging = True +verbose_logging = False [Startup] diff -Nru openrazer-2.7.0~ubuntu19.10.1/daemon/setup.py openrazer-2.8.0~ubuntu19.10.1/daemon/setup.py --- openrazer-2.7.0~ubuntu19.10.1/daemon/setup.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/daemon/setup.py 2020-05-02 11:24:51.000000000 +0000 @@ -4,6 +4,6 @@ setup( name="openrazer_daemon", - version="2.7.0", + version="2.8.0", packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]) ) diff -Nru openrazer-2.7.0~ubuntu19.10.1/debian/changelog openrazer-2.8.0~ubuntu19.10.1/debian/changelog --- openrazer-2.7.0~ubuntu19.10.1/debian/changelog 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/debian/changelog 2020-05-02 11:24:51.000000000 +0000 @@ -1,8 +1,14 @@ -openrazer (2.7.0~ubuntu19.10.1) eoan; urgency=low +openrazer (2.8.0~ubuntu19.10.1) eoan; urgency=low * Auto build. - -- Luca Weiss Sat, 11 Jan 2020 10:33:51 +0000 + -- Luca Weiss Sat, 02 May 2020 11:24:51 +0000 + +openrazer (2.8.0) bionic; urgency=high + + * Changelog available at https://github.com/openrazer/openrazer/releases/tag/v2.8.0 + + -- Luca Weiss Sat, 02 May 2020 13:20:33 +0200 openrazer (2.7.0) bionic; urgency=high diff -Nru openrazer-2.7.0~ubuntu19.10.1/debian/git-build-recipe.manifest openrazer-2.8.0~ubuntu19.10.1/debian/git-build-recipe.manifest --- openrazer-2.7.0~ubuntu19.10.1/debian/git-build-recipe.manifest 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/debian/git-build-recipe.manifest 2020-05-02 11:24:51.000000000 +0000 @@ -1,2 +1,2 @@ # git-build-recipe format 0.4 deb-version {debversion} -lp:openrazer git-commit:3592f8197dc2bd143f02a5f996ba8f6feb9b7f80 +lp:openrazer git-commit:95e7307d432cb0be62dc2d733949590f9464f9c2 diff -Nru openrazer-2.7.0~ubuntu19.10.1/debian/openrazer-driver-dkms.postinst openrazer-2.8.0~ubuntu19.10.1/debian/openrazer-driver-dkms.postinst --- openrazer-2.7.0~ubuntu19.10.1/debian/openrazer-driver-dkms.postinst 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/debian/openrazer-driver-dkms.postinst 2020-05-02 11:24:51.000000000 +0000 @@ -3,4 +3,4 @@ #DEBHELPER# -printf "\n\033[1;36mADD YOUR USER TO THE PLUGDEV GROUP '\033[1;35msudo gpasswd -a plugdev\033[1;36m'\033[0m\n" +printf "\n\033[1;36mADD YOUR USER TO THE PLUGDEV GROUP: '\033[1;35msudo gpasswd -a \$USER plugdev\033[1;36m'\033[0m\n" diff -Nru openrazer-2.7.0~ubuntu19.10.1/debian/openrazer-driver-dkms.README.Debian openrazer-2.8.0~ubuntu19.10.1/debian/openrazer-driver-dkms.README.Debian --- openrazer-2.7.0~ubuntu19.10.1/debian/openrazer-driver-dkms.README.Debian 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/debian/openrazer-driver-dkms.README.Debian 2020-05-02 11:24:51.000000000 +0000 @@ -23,7 +23,7 @@ ##### plugdev The daemon requires the current user to be in the user group `plugdev`. You will get an error message while running `openrazer-daemon -Fv` to indicate that. -To fix it, please run `sudo gpasswd -a plugdev`. +To fix it, please run `sudo gpasswd -a $USER plugdev`. ##### Secure Boot diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razeraccessory_driver.c openrazer-2.8.0~ubuntu19.10.1/driver/razeraccessory_driver.c --- openrazer-2.7.0~ubuntu19.10.1/driver/razeraccessory_driver.c 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razeraccessory_driver.c 2020-05-02 11:24:51.000000000 +0000 @@ -43,7 +43,7 @@ /** * Send report to the mouse */ -int razer_get_report(struct usb_device *usb_dev, struct razer_report *request_report, struct razer_report *response_report) +static int razer_get_report(struct usb_device *usb_dev, struct razer_report *request_report, struct razer_report *response_report) { return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, 600, 800); } @@ -51,7 +51,7 @@ /** * Function to send to device, get response, and actually check the response */ -struct razer_report razer_send_payload(struct usb_device *usb_dev, struct razer_report *request_report) +static struct razer_report razer_send_payload(struct usb_device *usb_dev, struct razer_report *request_report) { int retval = -1; struct razer_report response_report = {0}; @@ -85,7 +85,7 @@ /** * Device mode function */ -void razer_set_device_mode(struct usb_device *usb_dev, unsigned char mode, unsigned char param) +static void razer_set_device_mode(struct usb_device *usb_dev, unsigned char mode, unsigned char param) { struct razer_report report = razer_chroma_standard_set_device_mode(mode, param); report.transaction_id.id = 0x3F; @@ -120,8 +120,25 @@ device_type = "Razer Chroma Mug Holder\n"; break; + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + device_type = "Razer Chroma HDK\n"; + break; + + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + device_type = "Razer Base Station Chroma\n"; + break; + + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + device_type = "Razer Nommo Pro\n"; + break; + + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + device_type = "Razer Nommo Chroma\n"; + break; + default: device_type = "Unknown Device\n"; + break; } return sprintf(buf, device_type); @@ -155,7 +172,25 @@ static ssize_t razer_attr_write_mode_spectrum(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct razer_accessory_device *device = dev_get_drvdata(dev); - struct razer_report report = razer_chroma_standard_matrix_effect_spectrum(VARSTORE, BACKLIGHT_LED); + struct razer_report report = { 0 }; + + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_matrix_effect_spectrum(VARSTORE, BACKLIGHT_LED); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, ZERO_LED); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } + report.transaction_id.id = 0x3F; mutex_lock(&device->lock); @@ -173,7 +208,25 @@ static ssize_t razer_attr_write_mode_none(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct razer_accessory_device *device = dev_get_drvdata(dev); - struct razer_report report = razer_chroma_standard_matrix_effect_none(VARSTORE, BACKLIGHT_LED); + struct razer_report report = { 0 }; + + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_matrix_effect_none(VARSTORE, BACKLIGHT_LED); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_effect_none(VARSTORE, ZERO_LED); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } + report.transaction_id.id = 0x3F; mutex_lock(&device->lock); @@ -220,7 +273,24 @@ static ssize_t razer_attr_write_mode_custom(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct razer_accessory_device *device = dev_get_drvdata(dev); - struct razer_report report = razer_chroma_standard_matrix_effect_custom_frame(NOSTORE); + struct razer_report report = { 0 }; + + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_matrix_effect_custom_frame(NOSTORE); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_effect_custom_frame(); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } mutex_lock(&device->lock); razer_send_payload(device->usb_dev, &report); @@ -240,7 +310,23 @@ struct razer_report report = {0}; if(count == 3) { - report = razer_chroma_standard_matrix_effect_static(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0]); + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_matrix_effect_static(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*) & buf[0]); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_effect_static(VARSTORE, ZERO_LED, (struct razer_rgb*) & buf[0]); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } + report.transaction_id.id = 0x3F; mutex_lock(&device->lock); @@ -263,7 +349,25 @@ { struct razer_accessory_device *device = dev_get_drvdata(dev); unsigned char direction = (unsigned char)simple_strtoul(buf, NULL, 10); - struct razer_report report = razer_chroma_standard_matrix_effect_wave(VARSTORE, BACKLIGHT_LED, direction); + struct razer_report report = { 0 }; + + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_matrix_effect_wave(VARSTORE, BACKLIGHT_LED, direction); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_effect_wave(VARSTORE, ZERO_LED, direction); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } + report.transaction_id.id = 0x3F; mutex_lock(&device->lock); @@ -285,15 +389,61 @@ switch(count) { case 3: // Single colour mode - report = razer_chroma_standard_matrix_effect_breathing_single(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0]); + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_matrix_effect_breathing_single(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*) & buf[0]); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_effect_breathing_single(VARSTORE, ZERO_LED, (struct razer_rgb*) & buf[0]); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } break; case 6: // Dual colour mode - report = razer_chroma_standard_matrix_effect_breathing_dual(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0], (struct razer_rgb*)&buf[3]); + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_matrix_effect_breathing_dual(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*) & buf[0], (struct razer_rgb*) & buf[3]); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_effect_breathing_dual(VARSTORE, ZERO_LED, (struct razer_rgb*) & buf[0], (struct razer_rgb*) & buf[3]); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } break; default: // "Random" colour mode - report = razer_chroma_standard_matrix_effect_breathing_random(VARSTORE, BACKLIGHT_LED); + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_matrix_effect_breathing_random(VARSTORE, BACKLIGHT_LED); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_effect_breathing_random(VARSTORE, ZERO_LED); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } + break; } // Set device id @@ -343,11 +493,6 @@ // printk(KERN_ALERT "razeraccessory: Row ID: %d, Start: %d, Stop: %d, row length: %d\n", row_id, start_col, stop_col, row_length); - if(row_id != 0) { - printk(KERN_ALERT "razeraccessory: Row ID must be 0\n"); - break; - } - if(start_col > stop_col) { printk(KERN_ALERT "razeraccessory: Start column is greater than end column\n"); break; @@ -358,7 +503,22 @@ break; } - report = razer_chroma_misc_one_row_set_custom_frame(start_col, stop_col, (unsigned char*)&buf[offset]); + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_misc_one_row_set_custom_frame(start_col, stop_col, (unsigned char*)&buf[offset]); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_set_custom_frame(row_id, start_col, stop_col, (unsigned char*)&buf[offset]); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } mutex_lock(&device->lock); razer_send_payload(device->usb_dev, &report); @@ -380,8 +540,30 @@ static ssize_t razer_attr_read_get_serial(struct device *dev, struct device_attribute *attr, char *buf) { struct razer_accessory_device *device = dev_get_drvdata(dev); + struct razer_report report = razer_chroma_standard_get_serial(); + struct razer_report response_report = {0}; + char serial_string[51]; + + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + strncpy(&serial_string[0], &device->serial[0], sizeof(serial_string)); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + response_report = razer_send_payload(device->usb_dev, &report); + strncpy(&serial_string[0], &response_report.arguments[0], 22); + serial_string[22] = '\0'; + break; - return sprintf(buf, "%s\n", &device->serial[0]); + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } + + return sprintf(buf, "%s\n", &serial_string[0]); } /** @@ -483,7 +665,22 @@ printk(KERN_WARNING "razeraccessory: Brightness takes an ascii number\n"); } - report = razer_chroma_standard_set_led_brightness(VARSTORE, BACKLIGHT_LED, brightness); + switch (device->usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + report = razer_chroma_standard_set_led_brightness(VARSTORE, BACKLIGHT_LED, brightness); + break; + + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + report = razer_chroma_extended_matrix_brightness(VARSTORE, ZERO_LED, brightness); + break; + + default: + printk(KERN_WARNING "razeraccessory: Unknown device\n"); + break; + } mutex_lock(&device->lock); razer_send_payload(device->usb_dev, &report); @@ -609,6 +806,7 @@ static int razer_accessory_probe(struct hid_device *hdev, const struct hid_device_id *id) { int retval = 0; + unsigned char expected_protocol = USB_INTERFACE_PROTOCOL_MOUSE; struct usb_interface *intf = to_usb_interface(hdev->dev.parent); struct usb_device *usb_dev = interface_to_usbdev(intf); struct razer_accessory_device *dev = NULL; @@ -625,24 +823,42 @@ // Init data razer_accessory_init(dev, intf, hdev); - if(dev->usb_interface_protocol == USB_INTERFACE_PROTOCOL_MOUSE) { + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + expected_protocol = USB_INTERFACE_PROTOCOL_MOUSE; + break; + + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + expected_protocol = USB_INTERFACE_PROTOCOL_KEYBOARD; + break; + } + + if(dev->usb_interface_protocol == expected_protocol) { CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_version); // Get driver version CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_test); // Test mode CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_device_type); // Get string of device type CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_device_mode); // Get string of device mode CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_device_serial); // Get string of device serial CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_firmware_version); // Get string of device fw version - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_is_mug_present); // Is cup present CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Custom effect frame CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_blinking); // Blinking effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_brightness); // Brightness + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_brightness); // Brightness + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_is_mug_present); // Is cup present + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_blinking); // Blinking effect + break; + } // Needs to be in "Driver" mode just to function razer_set_device_mode(dev->usb_dev, 0x03, 0x00); @@ -676,19 +892,33 @@ */ static void razer_accessory_disconnect(struct hid_device *hdev) { + unsigned char expected_protocol = USB_INTERFACE_PROTOCOL_MOUSE; struct razer_accessory_device *dev; struct usb_interface *intf = to_usb_interface(hdev->dev.parent); + struct usb_device *usb_dev = interface_to_usbdev(intf); dev = hid_get_drvdata(hdev); - if(dev->usb_interface_protocol == USB_INTERFACE_PROTOCOL_MOUSE) { + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + case USB_DEVICE_ID_RAZER_CHROMA_HDK: + case USB_DEVICE_ID_RAZER_CHROMA_BASE: + expected_protocol = USB_INTERFACE_PROTOCOL_MOUSE; + break; + + case USB_DEVICE_ID_RAZER_NOMMO_PRO: + case USB_DEVICE_ID_RAZER_NOMMO_CHROMA: + expected_protocol = USB_INTERFACE_PROTOCOL_KEYBOARD; + break; + } + + if(dev->usb_interface_protocol == expected_protocol) { device_remove_file(&hdev->dev, &dev_attr_version); // Get driver version device_remove_file(&hdev->dev, &dev_attr_test); // Test mode device_remove_file(&hdev->dev, &dev_attr_device_type); // Get string of device type device_remove_file(&hdev->dev, &dev_attr_device_mode); // Get string of device mode device_remove_file(&hdev->dev, &dev_attr_device_serial); // Get string of device serial device_remove_file(&hdev->dev, &dev_attr_firmware_version); // Get string of device fw version - device_remove_file(&hdev->dev, &dev_attr_is_mug_present); // Is cup present device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Custom effect frame device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect @@ -697,9 +927,14 @@ device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_blinking); // Blinking effect - device_remove_file(&hdev->dev, &dev_attr_matrix_brightness); // Brightness + device_remove_file(&hdev->dev, &dev_attr_matrix_brightness); // Brightness + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_CHROMA_MUG: + device_remove_file(&hdev->dev, &dev_attr_is_mug_present); // Is cup present + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_blinking); // Blinking effect + break; + } } hid_hw_stop(hdev); @@ -738,7 +973,11 @@ */ static const struct hid_device_id razer_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_CHROMA_MUG) }, - { } + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_CHROMA_HDK) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_CHROMA_BASE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_NOMMO_PRO) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_NOMMO_CHROMA) }, + { 0 } }; MODULE_DEVICE_TABLE(hid, razer_devices); diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razeraccessory_driver.h openrazer-2.8.0~ubuntu19.10.1/driver/razeraccessory_driver.h --- openrazer-2.7.0~ubuntu19.10.1/driver/razeraccessory_driver.h 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razeraccessory_driver.h 2020-05-02 11:24:51.000000000 +0000 @@ -12,7 +12,11 @@ #ifndef __HID_RAZER_ACCESSORY_H #define __HID_RAZER_ACCESSORY_H -#define USB_DEVICE_ID_RAZER_CHROMA_MUG 0x0f07 +#define USB_DEVICE_ID_RAZER_NOMMO_CHROMA 0x0517 +#define USB_DEVICE_ID_RAZER_NOMMO_PRO 0x0518 +#define USB_DEVICE_ID_RAZER_CHROMA_MUG 0x0F07 +#define USB_DEVICE_ID_RAZER_CHROMA_BASE 0x0F08 +#define USB_DEVICE_ID_RAZER_CHROMA_HDK 0x0F09 struct razer_accessory_device { struct usb_device *usb_dev; diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razerchromacommon.c openrazer-2.8.0~ubuntu19.10.1/driver/razerchromacommon.c --- openrazer-2.7.0~ubuntu19.10.1/driver/razerchromacommon.c 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razerchromacommon.c 2020-05-02 11:24:51.000000000 +0000 @@ -471,7 +471,6 @@ { size_t row_length = (size_t) (((stop_col + 1) - start_col) * 3); struct razer_report report = get_razer_report(0x03, 0x0B, 0x46); // In theory should be able to leave data size at max as we have start/stop - int index = 4 + (start_col * 3); // printk(KERN_ALERT "razerkbd: Row ID: %d, Start: %d, Stop: %d, row length: %d\n", row_index, start_col, stop_col, (unsigned char)row_length); @@ -479,7 +478,7 @@ report.arguments[1] = row_index; report.arguments[2] = start_col; report.arguments[3] = stop_col; - memcpy(&report.arguments[index], rgb_data, row_length); + memcpy(&report.arguments[4], rgb_data, row_length); return report; } @@ -740,9 +739,16 @@ */ struct razer_report razer_chroma_extended_matrix_set_custom_frame(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char *rgb_data) { - struct razer_report report = get_razer_report(0x0F, 0x03, 0x47); - size_t row_length = (size_t) (((stop_col + 1) - start_col) * 3); - int index = 5 + (start_col * 3); + return razer_chroma_extended_matrix_set_custom_frame2(row_index, start_col, stop_col, rgb_data, 0x47); +} + +struct razer_report razer_chroma_extended_matrix_set_custom_frame2(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char *rgb_data, size_t packetLength) +{ + const size_t row_length = (size_t) (((stop_col + 1) - start_col) * 3); + // Some devices need a specific packet length, most devices are happy with 0x47 + // e.g. the Mamba Elite needs a "row_length + 5" packet length + const size_t data_length = (packetLength != 0) ? packetLength : row_length + 5; + struct razer_report report = get_razer_report(0x0F, 0x03, data_length); report.transaction_id.id = 0x3F; @@ -751,7 +757,7 @@ report.arguments[2] = row_index; report.arguments[3] = start_col; report.arguments[4] = stop_col; - memcpy(&report.arguments[index], rgb_data, row_length); + memcpy(&report.arguments[5], rgb_data, row_length); return report; } @@ -936,12 +942,11 @@ { struct razer_report report = get_razer_report(0x03, 0x0C, 0x32); size_t row_length = (size_t) (((stop_col + 1) - start_col) * 3); - int index = 2 + (start_col * 3); report.arguments[0] = start_col; report.arguments[1] = stop_col; - memcpy(&report.arguments[index], rgb_data, row_length); + memcpy(&report.arguments[2], rgb_data, row_length); return report; } @@ -1085,7 +1090,7 @@ { struct razer_report report = get_razer_report(0x04, 0x85, 0x07); - report.arguments[0] = VARSTORE; + report.arguments[0] = variable_storage; return report; } diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razerchromacommon.h openrazer-2.8.0~ubuntu19.10.1/driver/razerchromacommon.h --- openrazer-2.7.0~ubuntu19.10.1/driver/razerchromacommon.h 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razerchromacommon.h 2020-05-02 11:24:51.000000000 +0000 @@ -71,6 +71,7 @@ struct razer_report razer_chroma_extended_matrix_brightness(unsigned char variable_storage, unsigned char led_id, unsigned char brightness); struct razer_report razer_chroma_extended_matrix_get_brightness(unsigned char variable_storage, unsigned char led_id); struct razer_report razer_chroma_extended_matrix_set_custom_frame(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char *rgb_data); +struct razer_report razer_chroma_extended_matrix_set_custom_frame2(unsigned char row_index, unsigned char start_col, unsigned char stop_col, unsigned char *rgb_data, size_t packetLength); /* * Extended Matrix Effects (Mouse) Functions diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razercommon.h openrazer-2.8.0~ubuntu19.10.1/driver/razercommon.h --- openrazer-2.7.0~ubuntu19.10.1/driver/razercommon.h 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razercommon.h 2020-05-02 11:24:51.000000000 +0000 @@ -14,7 +14,7 @@ #include -#define DRIVER_VERSION "2.7.0" +#define DRIVER_VERSION "2.8.0" #define DRIVER_LICENSE "GPL v2" #define DRIVER_AUTHOR "Terry Cain " diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razercore_driver.c openrazer-2.8.0~ubuntu19.10.1/driver/razercore_driver.c --- openrazer-2.7.0~ubuntu19.10.1/driver/razercore_driver.c 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razercore_driver.c 2020-05-02 11:24:51.000000000 +0000 @@ -44,7 +44,7 @@ /** * Send report to the core */ -int razer_get_report(struct usb_device *usb_dev, struct razer_report *request_report, struct razer_report *response_report) +static int razer_get_report(struct usb_device *usb_dev, struct razer_report *request_report, struct razer_report *response_report) { return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, RAZER_CORE_WAIT_MIN_US, RAZER_CORE_WAIT_MAX_US); } @@ -52,7 +52,7 @@ /** * Function to send to device, get response, and actually check the response */ -struct razer_report razer_send_payload(struct usb_device *usb_dev, struct razer_report *request_report) +static struct razer_report razer_send_payload(struct usb_device *usb_dev, struct razer_report *request_report) { int retval = -1; struct razer_report response_report = {0}; @@ -561,7 +561,7 @@ */ static const struct hid_device_id razer_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_CORE) }, - { } + { 0 } }; MODULE_DEVICE_TABLE(hid, razer_devices); diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razerkbd_driver.c openrazer-2.8.0~ubuntu19.10.1/driver/razerkbd_driver.c --- openrazer-2.7.0~ubuntu19.10.1/driver/razerkbd_driver.c 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razerkbd_driver.c 2020-05-02 11:24:51.000000000 +0000 @@ -73,7 +73,7 @@ // Custom bind { KEY_KPENTER, KEY_CALC }, - { } + { 0 } }; static const struct razer_key_translation chroma_keys_2[] = { @@ -90,7 +90,7 @@ { KEY_RIGHTALT, RAZER_MACRO_KEY }, { KEY_PAUSE, KEY_SLEEP }, - { } + { 0 } }; /** @@ -120,6 +120,7 @@ case USB_DEVICE_ID_RAZER_BLADE_2018_BASE: case USB_DEVICE_ID_RAZER_BLADE_2019_ADV: case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY: + case USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019: case USB_DEVICE_ID_RAZER_BLADE_QHD: case USB_DEVICE_ID_RAZER_BLADE_LATE_2016: case USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017: @@ -129,6 +130,8 @@ case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD: case USB_DEVICE_ID_RAZER_BLADE_2019_BASE: case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019: + case USB_DEVICE_ID_RAZER_BLADE_PRO_2019: + case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2019: return true; } return false; @@ -143,6 +146,7 @@ uint response_index; switch (usb_dev->descriptor.idProduct) { case USB_DEVICE_ID_RAZER_ANANSI: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: report_index = 0x02; response_index = 0x02; break; @@ -206,7 +210,7 @@ /** * Device mode function */ -void razer_set_device_mode(struct usb_device *usb_dev, unsigned char mode, unsigned char param) +static void razer_set_device_mode(struct usb_device *usb_dev, unsigned char mode, unsigned char param) { struct razer_report report = razer_chroma_standard_set_device_mode(mode, param); @@ -409,6 +413,10 @@ device_type = "Razer Blade 15 (Mid 2019) Mercury White\n"; break; + case USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019: + device_type = "Razer Blade 15 Studio Edition (2019)\n"; + break; + case USB_DEVICE_ID_RAZER_BLADE_LATE_2016: device_type = "Razer Blade (Late 2016)\n"; break; @@ -420,6 +428,14 @@ device_type = "Razer Blade Pro FullHD (2017)\n"; break; + case USB_DEVICE_ID_RAZER_BLADE_PRO_2019: + device_type = "Razer Blade Pro (2019)\n"; + break; + + case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2019: + device_type = "Razer Blade Pro (Late 2019)"; + break; + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017: device_type = "Razer Blade Stealth (Late 2017)\n"; break; @@ -436,6 +452,10 @@ device_type = "Razer Tartarus Chroma\n"; break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + device_type = "Razer Tartarus V2\n"; + break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_OVERWATCH: device_type = "Razer BlackWidow Chroma (Overwatch)\n"; break; @@ -472,6 +492,10 @@ device_type = "Razer BlackWidow 2019\n"; break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: + device_type = "Razer BlackWidow Essential\n"; + break; + case USB_DEVICE_ID_RAZER_ORNATA: device_type = "Razer Ornata\n"; break; @@ -484,6 +508,10 @@ device_type = "Razer Huntsman Elite\n"; break; + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: + device_type = "Razer Huntsman Tournament Edition\n"; + break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: device_type = "Razer BlackWidow Elite\n"; break; @@ -527,13 +555,16 @@ case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: report = razer_chroma_standard_set_led_effect(NOSTORE, MACRO_LED, enabled); report.transaction_id.id = 0x3F; break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: report = razer_chroma_standard_set_led_effect(NOSTORE, MACRO_LED, enabled); report.transaction_id.id = 0x1F; @@ -621,8 +652,20 @@ { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, RED_PROFILE_LED); - struct razer_report response = razer_send_payload(usb_dev, &report); + struct razer_report report = {0}; + struct razer_report response = {0}; + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: + case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: + report = razer_chroma_standard_get_led_state(VARSTORE, BLUE_PROFILE_LED); + break; + default: + report = razer_chroma_standard_get_led_state(VARSTORE, RED_PROFILE_LED); + break; + } + + response = razer_send_payload(usb_dev, &report); return sprintf(buf, "%d\n", response.arguments[2]); } @@ -636,8 +679,20 @@ { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, GREEN_PROFILE_LED); - struct razer_report response = razer_send_payload(usb_dev, &report); + struct razer_report report = {0}; + struct razer_report response = {0}; + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: + case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: + report = razer_chroma_standard_get_led_state(VARSTORE, RED_PROFILE_LED); + break; + default: + report = razer_chroma_standard_get_led_state(VARSTORE, GREEN_PROFILE_LED); + break; + } + + response = razer_send_payload(usb_dev, &report); return sprintf(buf, "%d\n", response.arguments[2]); } @@ -651,8 +706,20 @@ { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = razer_chroma_standard_get_led_state(VARSTORE, BLUE_PROFILE_LED); - struct razer_report response = razer_send_payload(usb_dev, &report); + struct razer_report report = {0}; + struct razer_report response = {0}; + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: + case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: + report = razer_chroma_standard_get_led_state(VARSTORE, GREEN_PROFILE_LED); + break; + default: + report = razer_chroma_standard_get_led_state(VARSTORE, BLUE_PROFILE_LED); + break; + } + + response = razer_send_payload(usb_dev, &report); return sprintf(buf, "%d\n", response.arguments[2]); } @@ -665,7 +732,17 @@ struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); unsigned char enabled = (unsigned char)simple_strtoul(buf, NULL, 10); - struct razer_report report = razer_chroma_standard_set_led_state(VARSTORE, RED_PROFILE_LED, enabled); + struct razer_report report = {0}; + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: + case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: + report = razer_chroma_standard_set_led_state(VARSTORE, BLUE_PROFILE_LED, enabled); + break; + default: + report = razer_chroma_standard_set_led_state(VARSTORE, RED_PROFILE_LED, enabled); + break; + } razer_send_payload(usb_dev, &report); @@ -680,7 +757,17 @@ struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); unsigned char enabled = (unsigned char)simple_strtoul(buf, NULL, 10); - struct razer_report report = razer_chroma_standard_set_led_state(VARSTORE, GREEN_PROFILE_LED, enabled); + struct razer_report report = {0}; + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: + case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: + report = razer_chroma_standard_set_led_state(VARSTORE, RED_PROFILE_LED, enabled); + break; + default: + report = razer_chroma_standard_set_led_state(VARSTORE, GREEN_PROFILE_LED, enabled); + break; + } razer_send_payload(usb_dev, &report); return count; @@ -694,7 +781,17 @@ struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); unsigned char enabled = (unsigned char)simple_strtoul(buf, NULL, 10); - struct razer_report report = razer_chroma_standard_set_led_state(VARSTORE, BLUE_PROFILE_LED, enabled); + struct razer_report report = {0}; + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: + case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: + report = razer_chroma_standard_set_led_state(VARSTORE, GREEN_PROFILE_LED, enabled); + break; + default: + report = razer_chroma_standard_set_led_state(VARSTORE, BLUE_PROFILE_LED, enabled); + break; + } razer_send_payload(usb_dev, &report); return count; @@ -755,12 +852,15 @@ case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: report = razer_chroma_extended_matrix_effect_none(VARSTORE, BACKLIGHT_LED); break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: report = razer_chroma_extended_matrix_effect_none(VARSTORE, BACKLIGHT_LED); report.transaction_id.id = 0x1F; @@ -804,8 +904,10 @@ case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: report = razer_chroma_extended_matrix_effect_wave(VARSTORE, BACKLIGHT_LED, direction); break; @@ -815,6 +917,7 @@ report.transaction_id.id = 0x3F; // TODO move to a usb_device variable break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: report = razer_chroma_extended_matrix_effect_wave(VARSTORE, BACKLIGHT_LED, direction); report.transaction_id.id = 0x1F; @@ -844,6 +947,7 @@ case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: @@ -860,10 +964,17 @@ razer_send_payload(usb_dev, &report); report = razer_chroma_standard_set_led_effect(VARSTORE, BACKLIGHT_LED, LED_SPECTRUM_CYCLING); break; + + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, BACKLIGHT_LED); + report.transaction_id.id = 0x1F; // TODO move to a usb_device variable + break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: report = razer_chroma_standard_matrix_effect_spectrum(VARSTORE, BACKLIGHT_LED); report.transaction_id.id = 0x3F; // TODO move to a usb_device variable break; + default: report = razer_chroma_standard_matrix_effect_spectrum(VARSTORE, BACKLIGHT_LED); break; @@ -891,12 +1002,14 @@ case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, BACKLIGHT_LED, speed, (struct razer_rgb*)&buf[1]); break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, BACKLIGHT_LED, speed, (struct razer_rgb*)&buf[1]); report.transaction_id.id = 0x1F; @@ -930,6 +1043,13 @@ struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + report = razer_chroma_extended_matrix_effect_static(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0]); + razer_send_payload(usb_dev, &report); + report.transaction_id.id = 0x1F; + break; + case USB_DEVICE_ID_RAZER_ORBWEAVER: case USB_DEVICE_ID_RAZER_DEATHSTALKER_EXPERT: report = razer_chroma_standard_set_led_effect(VARSTORE, BACKLIGHT_LED, 0x00); @@ -966,12 +1086,14 @@ case USB_DEVICE_ID_RAZER_BLADE_2019_ADV: case USB_DEVICE_ID_RAZER_BLADE_2019_BASE: case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY: + case USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019: case USB_DEVICE_ID_RAZER_BLADE_LATE_2016: case USB_DEVICE_ID_RAZER_BLADE_PRO_2017: case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD: + case USB_DEVICE_ID_RAZER_BLADE_PRO_2019: + case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2019: case USB_DEVICE_ID_RAZER_TARTARUS: case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: - case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: if(count == 3) { report = razer_chroma_standard_matrix_effect_static(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0]); razer_send_payload(usb_dev, &report); @@ -981,6 +1103,7 @@ break; case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: if(count == 3) { report = razer_chroma_standard_matrix_effect_static(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0]); report.transaction_id.id = 0x3F; // TODO move to a usb_device variable @@ -994,8 +1117,10 @@ case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: if(count == 3) { report = razer_chroma_extended_matrix_effect_static(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0]); @@ -1066,6 +1191,7 @@ case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: @@ -1098,6 +1224,39 @@ razer_send_payload(usb_dev, &report); break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + if(count == 7) { + report = razer_chroma_extended_matrix_effect_starlight_dual(VARSTORE, BACKLIGHT_LED, buf[0], (struct razer_rgb*)&buf[1], (struct razer_rgb*)&buf[4]); + report.transaction_id.id = 0x1F; // TODO move to a usb_device variable + razer_send_payload(usb_dev, &report); + } else if(count == 4) { + report = razer_chroma_extended_matrix_effect_starlight_single(VARSTORE, BACKLIGHT_LED, buf[0], (struct razer_rgb*)&buf[1]); + report.transaction_id.id = 0x1F; // TODO move to a usb_device variable + razer_send_payload(usb_dev, &report); + } else if(count == 1) { + report = razer_chroma_extended_matrix_effect_starlight_random(VARSTORE, BACKLIGHT_LED, buf[0]); + report.transaction_id.id = 0x1F; // TODO move to a usb_device variable + razer_send_payload(usb_dev, &report); + } else { + printk(KERN_WARNING "razerkbd: Starlight only accepts Speed (1byte). Speed, RGB (4byte). Speed, RGB, RGB (7byte)"); + } + break; + + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017: + if(count == 7) { + report = razer_chroma_standard_matrix_effect_starlight_dual(VARSTORE, BACKLIGHT_LED, buf[0], (struct razer_rgb*)&buf[1], (struct razer_rgb*)&buf[4]); + razer_send_payload(usb_dev, &report); + } else if(count == 4) { + report = razer_chroma_standard_matrix_effect_starlight_single(VARSTORE, BACKLIGHT_LED, buf[0], (struct razer_rgb*)&buf[1]); + razer_send_payload(usb_dev, &report); + } else if(count == 1) { + report = razer_chroma_standard_matrix_effect_starlight_random(VARSTORE, BACKLIGHT_LED, buf[0]); + razer_send_payload(usb_dev, &report); + } else { + printk(KERN_WARNING "razerkbd: Starlight only accepts Speed (1byte). Speed, RGB (4byte). Speed, RGB, RGB (7byte)"); + } + break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: if(count == 7) { report = razer_chroma_standard_matrix_effect_starlight_dual(VARSTORE, BACKLIGHT_LED, buf[0], (struct razer_rgb*)&buf[1], (struct razer_rgb*)&buf[4]); @@ -1150,10 +1309,38 @@ } break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + switch(count) { + case 3: // Single colour mode + report = razer_chroma_extended_matrix_effect_breathing_single(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0]); + razer_send_payload(usb_dev, &report); + report.transaction_id.id = 0x1F; + break; + + case 6: // Dual colour mode + report = razer_chroma_extended_matrix_effect_breathing_dual(VARSTORE, BACKLIGHT_LED, (struct razer_rgb*)&buf[0], (struct razer_rgb*)&buf[3]); + razer_send_payload(usb_dev, &report); + report.transaction_id.id = 0x1F; + break; + + case 1: // "Random" colour mode + report = razer_chroma_extended_matrix_effect_breathing_random(VARSTORE, BACKLIGHT_LED); + razer_send_payload(usb_dev, &report); + report.transaction_id.id = 0x1F; + break; + + default: + printk(KERN_WARNING "razerkbd: Breathing only accepts '1' (1byte). RGB (3byte). RGB, RGB (6byte)"); + break; + } + break; + case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: switch(count) { case 3: // Single colour mode @@ -1325,18 +1512,21 @@ case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: report = razer_chroma_extended_matrix_effect_custom_frame(); break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: report = razer_chroma_extended_matrix_effect_custom_frame(); report.transaction_id.id = 0x1F; break; case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: report = razer_chroma_standard_matrix_effect_custom_frame(VARSTORE); // Possibly could use VARSTORE report.transaction_id.id = 0x3F; // TODO move to a usb_device variable break; @@ -1404,12 +1594,20 @@ struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + report = razer_chroma_extended_matrix_brightness(VARSTORE, ZERO_LED, brightness); + report.transaction_id.id = 0x1F; + break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE: case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: report = razer_chroma_extended_matrix_brightness(VARSTORE, BACKLIGHT_LED, brightness); break; @@ -1454,12 +1652,20 @@ struct razer_report response = {0}; switch(usb_dev->descriptor.idProduct) { + + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + report = razer_chroma_extended_matrix_get_brightness(VARSTORE, ZERO_LED); + report.transaction_id.id = 0x1F; + break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE: case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: report = razer_chroma_extended_matrix_get_brightness(VARSTORE, BACKLIGHT_LED); break; @@ -1586,12 +1792,14 @@ case USB_DEVICE_ID_RAZER_ORNATA: case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: report = razer_chroma_extended_matrix_set_custom_frame(row_id, start_col, stop_col, (unsigned char*)&buf[offset]); break; + case USB_DEVICE_ID_RAZER_TARTARUS_V2: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: report = razer_chroma_extended_matrix_set_custom_frame(row_id, start_col, stop_col, (unsigned char*)&buf[offset]); report.transaction_id.id = 0x1F; @@ -1603,6 +1811,7 @@ case USB_DEVICE_ID_RAZER_BLADE_LATE_2016: case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: report = razer_chroma_standard_matrix_set_custom_frame(row_id, start_col, stop_col, (unsigned char*)&buf[offset]); report.transaction_id.id = 0x3F; // TODO move to a usb_device variable break; @@ -1621,9 +1830,12 @@ case USB_DEVICE_ID_RAZER_BLADE_2018_BASE: case USB_DEVICE_ID_RAZER_BLADE_2019_ADV: case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY: + case USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019: case USB_DEVICE_ID_RAZER_BLADE_PRO_2017: case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD: + case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2019: report.transaction_id.id = 0x80; // Fall into the 2016/blade/blade2016 to set device id + /* fall through */ default: report = razer_chroma_standard_matrix_set_custom_frame(row_id, start_col, stop_col, (unsigned char*)&buf[offset]); break; @@ -1979,20 +2191,96 @@ switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_NOSTROMO: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue + break; + + case USB_DEVICE_ID_RAZER_TARTARUS: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing + break; + + case USB_DEVICE_ID_RAZER_ORBWEAVER: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing + break; + + case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect + break; + + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix + break; + + case USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + break; + + case USB_DEVICE_ID_RAZER_ANANSI: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); + break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH: case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH_EDITION: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2012: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2013: case USB_DEVICE_ID_RAZER_DEATHSTALKER_EXPERT: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) break; + case USB_DEVICE_ID_RAZER_BLADE_2018_BASE: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_2019: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019: + case USB_DEVICE_ID_RAZER_BLADE_2019_BASE: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect + break; + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2016: case USB_DEVICE_ID_RAZER_BLACKWIDOW_X_ULTIMATE: + case USB_DEVICE_ID_RAZER_ORNATA: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect @@ -2006,85 +2294,63 @@ CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) break; - - case USB_DEVICE_ID_RAZER_BLADE_STEALTH: - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2016: - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017: - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017: + case USB_DEVICE_ID_RAZER_DEATHSTALKER_CHROMA: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) break; - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_2019: - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019: + case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: + case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: + case USB_DEVICE_ID_RAZER_HUNTSMAN: + case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - break; - - case USB_DEVICE_ID_RAZER_BLADE_QHD: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) break; - case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2016: - case USB_DEVICE_ID_RAZER_BLADE_2018: - case USB_DEVICE_ID_RAZER_BLADE_PRO_2017: // same config as late 16 - case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo - break; - - case USB_DEVICE_ID_RAZER_BLADE_2018_MERCURY: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - break; - - case USB_DEVICE_ID_RAZER_BLADE_2018_BASE: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue break; + case USB_DEVICE_ID_RAZER_BLADE_2018_MERCURY: case USB_DEVICE_ID_RAZER_BLADE_2019_ADV: - case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY: + case USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect @@ -2096,14 +2362,6 @@ CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix break; - case USB_DEVICE_ID_RAZER_BLADE_2019_BASE: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - break; - case USB_DEVICE_ID_RAZER_BLADE_LATE_2016: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect @@ -2117,117 +2375,31 @@ CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys break; - - case USB_DEVICE_ID_RAZER_TARTARUS: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - break; - - case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - break; - - case USB_DEVICE_ID_RAZER_NOSTROMO: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - break; - - case USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) - break; - - case USB_DEVICE_ID_RAZER_ORNATA: + case USB_DEVICE_ID_RAZER_BLADE_QHD: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2016: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) - break; - - case USB_DEVICE_ID_RAZER_ORBWEAVER: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - break; - - case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - break; - - case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: - case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: - case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: - case USB_DEVICE_ID_RAZER_HUNTSMAN: - case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: - case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) - break; - - case USB_DEVICE_ID_RAZER_ANANSI: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); - break; - - case USB_DEVICE_ID_RAZER_DEATHSTALKER_CHROMA: - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo break; - case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: + case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2016: + case USB_DEVICE_ID_RAZER_BLADE_2018: + case USB_DEVICE_ID_RAZER_BLADE_PRO_2017: + case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD: + case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY: + case USB_DEVICE_ID_RAZER_BLADE_PRO_2019: + case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2019: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect @@ -2237,9 +2409,7 @@ CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo break; default: // BlackWidow Chroma... @@ -2321,179 +2491,131 @@ switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH: - case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH_EDITION: - case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2012: - case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2013: - case USB_DEVICE_ID_RAZER_DEATHSTALKER_EXPERT: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + case USB_DEVICE_ID_RAZER_NOSTROMO: + device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue break; - case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2016: - case USB_DEVICE_ID_RAZER_BLACKWIDOW_X_ULTIMATE: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect + case USB_DEVICE_ID_RAZER_TARTARUS: + device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect - device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing break; - - case USB_DEVICE_ID_RAZER_BLADE_STEALTH: - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2016: - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017: - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + case USB_DEVICE_ID_RAZER_ORBWEAVER: + device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect - device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - device_remove_file(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo - device_remove_file(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing break; - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_2019: - case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: + device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect break; - case USB_DEVICE_ID_RAZER_BLADE_QHD: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: + device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red + device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green + device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - device_remove_file(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo - device_remove_file(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys break; - case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2016: - case USB_DEVICE_ID_RAZER_BLADE_2018: - case USB_DEVICE_ID_RAZER_BLADE_PRO_2017: // same config as late 16 - case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + case USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect + device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + break; + + case USB_DEVICE_ID_RAZER_ANANSI: + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); + device_remove_file(&hdev->dev, &dev_attr_game_led_state); + device_remove_file(&hdev->dev, &dev_attr_macro_led_state); + device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); + break; + + case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_STEALTH_EDITION: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2012: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2013: + case USB_DEVICE_ID_RAZER_DEATHSTALKER_EXPERT: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect - device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - device_remove_file(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing + device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) break; case USB_DEVICE_ID_RAZER_BLADE_2018_BASE: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_2019: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019: + case USB_DEVICE_ID_RAZER_BLADE_2019_BASE: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect break; - case USB_DEVICE_ID_RAZER_BLADE_2019_ADV: - case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2016: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_X_ULTIMATE: + case USB_DEVICE_ID_RAZER_ORNATA: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix + device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) break; - case USB_DEVICE_ID_RAZER_BLADE_2018_MERCURY: + case USB_DEVICE_ID_RAZER_DEATHSTALKER_CHROMA: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix + device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) break; - case USB_DEVICE_ID_RAZER_BLADE_2019_BASE: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - break; - - case USB_DEVICE_ID_RAZER_BLADE_LATE_2016: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + case USB_DEVICE_ID_RAZER_TARTARUS_V2: + device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED + device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - device_remove_file(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys - break; - - case USB_DEVICE_ID_RAZER_NOSTROMO: - device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - break; - - case USB_DEVICE_ID_RAZER_TARTARUS: - device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - break; - - case USB_DEVICE_ID_RAZER_TARTARUS_CHROMA: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - break; - - case USB_DEVICE_ID_RAZER_ORBWEAVER: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_pulsate); // Pulsate effect, like breathing - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect - device_remove_file(&hdev->dev, &dev_attr_profile_led_red); // Profile/Macro LED Red - device_remove_file(&hdev->dev, &dev_attr_profile_led_green); // Profile/Macro LED Green - device_remove_file(&hdev->dev, &dev_attr_profile_led_blue); // Profile/Macro LED Blue - break; - - case USB_DEVICE_ID_RAZER_ORBWEAVER_CHROMA: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect @@ -2505,10 +2627,13 @@ case USB_DEVICE_ID_RAZER_ORNATA_CHROMA: case USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE: + case USB_DEVICE_ID_RAZER_HUNTSMAN_TE: case USB_DEVICE_ID_RAZER_BLACKWIDOW_2019: case USB_DEVICE_ID_RAZER_HUNTSMAN: case USB_DEVICE_ID_RAZER_CYNOSA_CHROMA: case USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL: + case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect @@ -2523,53 +2648,58 @@ device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) break; - case USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE: + case USB_DEVICE_ID_RAZER_BLADE_2018_MERCURY: + case USB_DEVICE_ID_RAZER_BLADE_2019_ADV: + case USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019: + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect - device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect + device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix break; - case USB_DEVICE_ID_RAZER_ORNATA: + case USB_DEVICE_ID_RAZER_BLADE_LATE_2016: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) - break; - - - case USB_DEVICE_ID_RAZER_ANANSI: - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); - device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); - device_remove_file(&hdev->dev, &dev_attr_game_led_state); - device_remove_file(&hdev->dev, &dev_attr_macro_led_state); - device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); + device_remove_file(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys break; - case USB_DEVICE_ID_RAZER_DEATHSTALKER_CHROMA: + case USB_DEVICE_ID_RAZER_BLADE_QHD: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2016: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017: + case USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_none); // No effect + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_reactive); // Reactive effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + device_remove_file(&hdev->dev, &dev_attr_fn_toggle); // Sets whether FN is requires for F-Keys + device_remove_file(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo break; - case USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2: + case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2016: + case USB_DEVICE_ID_RAZER_BLADE_2018: + case USB_DEVICE_ID_RAZER_BLADE_PRO_2017: + case USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD: + case USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY: + case USB_DEVICE_ID_RAZER_BLADE_PRO_2019: + case USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2019: device_remove_file(&hdev->dev, &dev_attr_matrix_effect_wave); // Wave effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_starlight); // Starlight effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_spectrum); // Spectrum effect @@ -2579,9 +2709,7 @@ device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); // Static effect device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); // Custom effect device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); // Set LED matrix - device_remove_file(&hdev->dev, &dev_attr_game_led_state); // Enable game mode & LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_state); // Enable macro LED - device_remove_file(&hdev->dev, &dev_attr_macro_led_effect); // Change macro LED effect (static, flashing) + device_remove_file(&hdev->dev, &dev_attr_logo_led_state); // Enable/Disable the logo break; default: // BlackWidow Chroma... @@ -2632,8 +2760,12 @@ { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_2019_ADV) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_2019_BASE) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2019) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_PRO_2019) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_TARTARUS) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_TARTARUS_CHROMA) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_TARTARUS_V2) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHSTALKER_EXPERT) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLACKWIDOW_OVERWATCH) }, @@ -2645,6 +2777,7 @@ { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_CYNOSA_CHROMA) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLACKWIDOW_2019) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_ORNATA) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_ANANSI) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_V2) }, @@ -2652,6 +2785,7 @@ { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_PRO_2017) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_HUNTSMAN_ELITE) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_HUNTSMAN_TE) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_HUNTSMAN) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD) }, diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razerkbd_driver.h openrazer-2.8.0~ubuntu19.10.1/driver/razerkbd_driver.h --- openrazer-2.7.0~ubuntu19.10.1/driver/razerkbd_driver.h 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razerkbd_driver.h 2020-05-02 11:24:51.000000000 +0000 @@ -31,12 +31,6 @@ #define USB_DEVICE_ID_RAZER_BLACKWIDOW_CHROMA_TE 0x0209 #define USB_DEVICE_ID_RAZER_BLADE_QHD 0x020F #define USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2016 0x0210 -#define USB_DEVICE_ID_RAZER_BLADE_2018 0x0233 -#define USB_DEVICE_ID_RAZER_BLADE_2019_ADV 0x023a -#define USB_DEVICE_ID_RAZER_BLADE_2018_BASE 0x023b -#define USB_DEVICE_ID_RAZER_BLADE_2018_MERCURY 0x0240 -#define USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY 0x0245 -#define USB_DEVICE_ID_RAZER_BLADE_2019_BASE 0x0246 #define USB_DEVICE_ID_RAZER_BLACKWIDOW_OVERWATCH 0x0211 #define USB_DEVICE_ID_RAZER_BLACKWIDOW_ULTIMATE_2016 0x0214 #define USB_DEVICE_ID_RAZER_BLACKWIDOW_X_CHROMA 0x0216 @@ -52,13 +46,25 @@ #define USB_DEVICE_ID_RAZER_HUNTSMAN 0x0227 #define USB_DEVICE_ID_RAZER_BLACKWIDOW_ELITE 0x0228 #define USB_DEVICE_ID_RAZER_CYNOSA_CHROMA 0x022A +#define USB_DEVICE_ID_RAZER_TARTARUS_V2 0x022B #define USB_DEVICE_ID_RAZER_BLADE_STEALTH_MID_2017 0x022D #define USB_DEVICE_ID_RAZER_BLADE_PRO_2017_FULLHD 0x022F #define USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2017 0x0232 +#define USB_DEVICE_ID_RAZER_BLADE_2018 0x0233 +#define USB_DEVICE_ID_RAZER_BLADE_PRO_2019 0x0234 #define USB_DEVICE_ID_RAZER_BLACKWIDOW_LITE 0x0235 +#define USB_DEVICE_ID_RAZER_BLACKWIDOW_ESSENTIAL 0x0237 #define USB_DEVICE_ID_RAZER_BLADE_STEALTH_2019 0x0239 -#define USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019 0x024a +#define USB_DEVICE_ID_RAZER_BLADE_2019_ADV 0x023a +#define USB_DEVICE_ID_RAZER_BLADE_2018_BASE 0x023b +#define USB_DEVICE_ID_RAZER_BLADE_2018_MERCURY 0x0240 #define USB_DEVICE_ID_RAZER_BLACKWIDOW_2019 0x0241 +#define USB_DEVICE_ID_RAZER_HUNTSMAN_TE 0x0243 +#define USB_DEVICE_ID_RAZER_BLADE_MID_2019_MERCURY 0x0245 +#define USB_DEVICE_ID_RAZER_BLADE_2019_BASE 0x0246 +#define USB_DEVICE_ID_RAZER_BLADE_STEALTH_LATE_2019 0x024a +#define USB_DEVICE_ID_RAZER_BLADE_PRO_LATE_2019 0x024C +#define USB_DEVICE_ID_RAZER_BLADE_STUDIO_EDITION_2019 0x024d /* Each keyboard report has 90 bytes*/ #define RAZER_BLACKWIDOW_REPORT_LEN 0x5A diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razerkraken_driver.c openrazer-2.8.0~ubuntu19.10.1/driver/razerkraken_driver.c --- openrazer-2.7.0~ubuntu19.10.1/driver/razerkraken_driver.c 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razerkraken_driver.c 2020-05-02 11:24:51.000000000 +0000 @@ -42,7 +42,8 @@ /** * Print report to syslog */ -void print_erroneous_kraken_request_report(struct razer_kraken_request_report* report, char* driver_name, char* message) +/* +static void print_erroneous_kraken_request_report(struct razer_kraken_request_report* report, char* driver_name, char* message) { printk(KERN_WARNING "%s: %s. Report ID: %02x dest: %02x length: %02x ADDR: %02x%02x Args: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x .\n", driver_name, @@ -56,8 +57,9 @@ report->arguments[6], report->arguments[7], report->arguments[8], report->arguments[9], report->arguments[10], report->arguments[11], report->arguments[12], report->arguments[13], report->arguments[14], report->arguments[15]); } +*/ -int razer_kraken_send_control_msg(struct usb_device *usb_dev,struct razer_kraken_request_report* report, unsigned char skip) +static int razer_kraken_send_control_msg(struct usb_device *usb_dev,struct razer_kraken_request_report* report, unsigned char skip) { uint request = HID_REQ_SET_REPORT; // 0x09 uint request_type = USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT; // 0x21 @@ -101,7 +103,7 @@ * length - amount of data * address - where to write data to */ -struct razer_kraken_request_report get_kraken_request_report(unsigned char report_id, unsigned char destination, unsigned char length, unsigned short address) +static struct razer_kraken_request_report get_kraken_request_report(unsigned char report_id, unsigned char destination, unsigned char length, unsigned short address) { struct razer_kraken_request_report report; memset(&report, 0, sizeof(struct razer_kraken_request_report)); @@ -118,7 +120,7 @@ /** * Get a union containing the effect bitfield */ -union razer_kraken_effect_byte get_kraken_effect_byte(void) +static union razer_kraken_effect_byte get_kraken_effect_byte(void) { union razer_kraken_effect_byte effect_byte; memset(&effect_byte, 0, sizeof(union razer_kraken_effect_byte)); @@ -129,7 +131,7 @@ /** * Get the current effect */ -unsigned char get_current_effect(struct device *dev) +static unsigned char get_current_effect(struct device *dev) { struct razer_kraken_device *device = dev_get_drvdata(dev); struct razer_kraken_request_report report = get_kraken_request_report(0x04, 0x00, 0x01, device->led_mode_address); @@ -160,7 +162,7 @@ return result; } -unsigned int get_rgb_from_addr(struct device *dev, unsigned short address, unsigned char len, char* buf) +static unsigned int get_rgb_from_addr(struct device *dev, unsigned short address, unsigned char len, char* buf) { struct razer_kraken_device *device = dev_get_drvdata(dev); struct razer_kraken_request_report report = get_kraken_request_report(0x04, 0x00, len, address); @@ -526,9 +528,11 @@ static ssize_t razer_attr_read_mode_breath(struct device *dev, struct device_attribute *attr, char *buf) { struct razer_kraken_device *device = dev_get_drvdata(dev); - union razer_kraken_effect_byte effect_byte = (union razer_kraken_effect_byte)get_current_effect(dev); + union razer_kraken_effect_byte effect_byte; unsigned char num_colours = 1; + effect_byte.value = get_current_effect(dev); + if(effect_byte.bits.two_colour_breathing == 1) { num_colours = 2; } else if(effect_byte.bits.three_colour_breathing == 1) { @@ -686,7 +690,7 @@ static DEVICE_ATTR(matrix_effect_custom, 0660, razer_attr_read_mode_custom, razer_attr_write_mode_custom); static DEVICE_ATTR(matrix_effect_breath, 0660, razer_attr_read_mode_breath, razer_attr_write_mode_breath); -void razer_kraken_init(struct razer_kraken_device *dev, struct usb_interface *intf) +static void razer_kraken_init(struct razer_kraken_device *dev, struct usb_interface *intf) { struct usb_device *usb_dev = interface_to_usbdev(intf); unsigned int rand_serial = 0; @@ -857,7 +861,7 @@ { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_KRAKEN_CLASSIC_ALT) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_KRAKEN) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_KRAKEN_V2) }, - { } + { 0 } }; MODULE_DEVICE_TABLE(hid, razer_devices); diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razermouse_driver.c openrazer-2.8.0~ubuntu19.10.1/driver/razermouse_driver.c --- openrazer-2.7.0~ubuntu19.10.1/driver/razermouse_driver.c 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razermouse_driver.c 2020-05-02 11:24:51.000000000 +0000 @@ -44,15 +44,26 @@ /** * Send report to the mouse */ -int razer_get_report(struct usb_device *usb_dev, struct razer_report *request_report, struct razer_report *response_report) +static int razer_get_report(struct usb_device *usb_dev, struct razer_report *request_report, struct razer_report *response_report) { - return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, RAZER_MOUSE_WAIT_MIN_US, RAZER_MOUSE_WAIT_MAX_US); + switch (usb_dev->descriptor.idProduct) { + // These devices require longer waits to read their firmware, serial, and other setting values + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, RAZER_NEW_MOUSE_RECEIVER_WAIT_MIN_US, RAZER_NEW_MOUSE_RECEIVER_WAIT_MAX_US); + break; + + default: + return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, RAZER_MOUSE_WAIT_MIN_US, RAZER_MOUSE_WAIT_MAX_US); + } } /** * Function to send to device, get response, and actually check the response */ -struct razer_report razer_send_payload(struct usb_device *usb_dev, struct razer_report *request_report) +static struct razer_report razer_send_payload(struct usb_device *usb_dev, struct razer_report *request_report) { int retval = -1; struct razer_report response_report = {0}; @@ -87,7 +98,7 @@ * Specific functions for ancient devices * */ -void deathadder3_5g_set_scroll_led_state(struct razer_mouse_device *device, unsigned int enabled) +static void deathadder3_5g_set_scroll_led_state(struct razer_mouse_device *device, unsigned int enabled) { if (enabled == 1) { device->da3_5g.leds |= 0x02; @@ -100,7 +111,7 @@ mutex_unlock(&device->lock); } -void deathadder3_5g_set_logo_led_state(struct razer_mouse_device *device, unsigned int enabled) +static void deathadder3_5g_set_logo_led_state(struct razer_mouse_device *device, unsigned int enabled) { if (enabled == 1) { device->da3_5g.leds |= 0x01; @@ -113,7 +124,7 @@ mutex_unlock(&device->lock); } -void deathadder3_5g_set_poll_rate(struct razer_mouse_device *device, unsigned short poll_rate) +static void deathadder3_5g_set_poll_rate(struct razer_mouse_device *device, unsigned short poll_rate) { switch(poll_rate) { case 1000: @@ -135,7 +146,7 @@ mutex_unlock(&device->lock); } -void deathadder3_5g_set_dpi(struct razer_mouse_device *device, unsigned short dpi) +static void deathadder3_5g_set_dpi(struct razer_mouse_device *device, unsigned short dpi) { switch(dpi) { case 450: @@ -295,10 +306,22 @@ device_type = "Razer DeathAdder 3500\n"; break; + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + device_type = "Razer Lancehead (Wired)\n"; + break; + + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: + device_type = "Razer Lancehead (Wireless)\n"; + break; + case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: device_type = "Razer Lancehead Tournament Edition\n"; break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + device_type = "Razer Mamba Elite\n"; + break; + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: device_type = "Razer Deathadder Essential\n"; break; @@ -311,6 +334,54 @@ device_type = "Razer Deathadder 1800\n"; break; + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + device_type = "Razer Lancehead Wireless (Receiver)\n"; + break; + + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + device_type = "Razer Lancehead Wireless (Wired)\n"; + break; + + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + device_type = "Razer Mamba Wireless (Receiver)\n"; + break; + + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + device_type = "Razer Mamba Wireless (Wired)\n"; + break; + + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + device_type = "Razer Abyssus Elite (D.Va Edition)\n"; + break; + + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + device_type = "Razer Abyssus Essential\n"; + break; + + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + device_type = "Razer DeathAdder Essential (White Edition)\n"; + break; + + case USB_DEVICE_ID_RAZER_VIPER: + device_type = "Razer Viper\n"; + break; + + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: + device_type = "Razer Viper Ultimate (Wired)\n"; + break; + + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: + device_type = "Razer Viper Ultimate (Wireless)\n"; + break; + + case USB_DEVICE_ID_RAZER_BASILISK: + device_type = "Razer Basilisk\n"; + break; + + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + device_type = "Razer Deathadder V2\n"; + break; + default: device_type = "Unknown Device\n"; } @@ -338,9 +409,21 @@ return sprintf(buf, "v%d.%d\n", 0x01, 0x00); break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report.transaction_id.id = 0x1f; + break; + case USB_DEVICE_ID_RAZER_NAGA_HEX_V2: case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report.transaction_id.id = 0x3f; break; } @@ -414,8 +497,21 @@ case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: case USB_DEVICE_ID_RAZER_NAGA_CHROMA: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + report = razer_chroma_extended_matrix_effect_custom_frame(); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_effect_custom_frame(); + report.transaction_id.id = 0x1f; break; case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS: @@ -630,7 +726,15 @@ case USB_DEVICE_ID_RAZER_NAGA_HEX_V2: case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report.transaction_id.id = 0x3f; break; } @@ -654,7 +758,22 @@ struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); struct razer_report report = razer_chroma_misc_get_battery_level(); - struct razer_report response_report = razer_send_payload(usb_dev, &report); + struct razer_report response_report = {0}; + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + report.transaction_id.id = 0x3f; + break; + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report.transaction_id.id = 0x1f; + break; + } + + response_report = razer_send_payload(usb_dev, &report); return sprintf(buf, "%d\n", response_report.arguments[1]); } @@ -669,7 +788,22 @@ struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); struct razer_report report = razer_chroma_misc_get_charging_status(); - struct razer_report response_report = razer_send_payload(usb_dev, &report); + struct razer_report response_report = {0}; + + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + report.transaction_id.id = 0x3f; + break; + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report.transaction_id.id = 0x1f; + break; + } + + response_report = razer_send_payload(usb_dev, &report); return sprintf(buf, "%d\n", response_report.arguments[1]); } @@ -749,7 +883,15 @@ case USB_DEVICE_ID_RAZER_NAGA_HEX_V2: case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report.transaction_id.id = 0x3f; break; } @@ -800,9 +942,17 @@ case USB_DEVICE_ID_RAZER_NAGA_HEX_V2: case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_MAMBA_WIRED: case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report.transaction_id.id = 0x3f; break; } @@ -842,6 +992,11 @@ report.transaction_id.id = 0x3f; break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_brightness(VARSTORE, 0x00, brightness); + report.transaction_id.id = 0x1F; + break; + case USB_DEVICE_ID_RAZER_NAGA_TRINITY: // Naga Trinity uses the LED 0x00 and Matrix Brightness report = razer_chroma_extended_matrix_brightness(VARSTORE, 0x00, brightness); @@ -886,6 +1041,11 @@ report.transaction_id.id = 0x3f; break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_get_brightness(VARSTORE, 0x00); + report.transaction_id.id = 0x1F; + break; + case USB_DEVICE_ID_RAZER_NAGA_TRINITY: // Naga Trinity uses the LED 0x00 and Matrix Brightness report = razer_chroma_extended_matrix_get_brightness(VARSTORE, 0x00); @@ -897,6 +1057,9 @@ } response = razer_send_payload(usb_dev, &report); + if (response.status != RAZER_CMD_SUCCESSFUL) { + return 0; + } // Brightness is at arg[0] for dock and arg[1] for led_brightness return sprintf(buf, "%d\n", response.arguments[brightness_index]); } @@ -972,8 +1135,10 @@ case USB_DEVICE_ID_RAZER_OROCHI_2013: case USB_DEVICE_ID_RAZER_IMPERATOR: + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: varstore = VARSTORE; break; + default: varstore = NOSTORE; break; @@ -998,9 +1163,21 @@ switch(device->usb_pid) { // New devices set the device ID properly case USB_DEVICE_ID_RAZER_NAGA_HEX_V2: case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report.transaction_id.id = 0x3f; break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report.transaction_id.id = 0x1f; + break; } razer_send_payload(device->usb_dev, &report); @@ -1056,6 +1233,11 @@ report = razer_chroma_misc_get_dpi_xy_byte(); break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_misc_get_dpi_xy(NOSTORE); + report.transaction_id.id = 0x1f; + break; + case USB_DEVICE_ID_RAZER_OROCHI_2013: case USB_DEVICE_ID_RAZER_IMPERATOR: report = razer_chroma_misc_get_dpi_xy(VARSTORE); @@ -1063,9 +1245,18 @@ case USB_DEVICE_ID_RAZER_NAGA_HEX_V2: case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_misc_get_dpi_xy(NOSTORE); report.transaction_id.id = 0x3f; + break; default: report = razer_chroma_misc_get_dpi_xy(NOSTORE); @@ -1166,7 +1357,7 @@ } if(offset + row_length > count) { - printk(KERN_ALERT "razermouse: Not enough RGB to fill row\n"); + printk(KERN_ALERT "razermouse: Not enough RGB to fill row (%d)\n", (int)(offset + row_length - count)); break; } @@ -1179,7 +1370,15 @@ case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: case USB_DEVICE_ID_RAZER_NAGA_CHROMA: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_extended_matrix_set_custom_frame(row_id, start_col, stop_col, (unsigned char*)&buf[offset]); break; @@ -1193,6 +1392,11 @@ case USB_DEVICE_ID_RAZER_DIAMONDBACK_CHROMA: report = razer_chroma_misc_one_row_set_custom_frame(start_col, stop_col, (unsigned char*)&buf[offset]); break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_set_custom_frame2(row_id, start_col, stop_col, (unsigned char*)&buf[offset], 0); + report.transaction_id.id = 0x1f; + break; } razer_send_payload(usb_dev, &report); @@ -1220,9 +1424,22 @@ case USB_DEVICE_ID_RAZER_DEATHADDER_3_5G: // Doesn't support device mode, exit early return count; break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report.transaction_id.id = 0x1f; + break; + case USB_DEVICE_ID_RAZER_NAGA_HEX_V2: case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report.transaction_id.id = 0x3f; break; } @@ -1256,9 +1473,21 @@ case USB_DEVICE_ID_RAZER_NAGA_HEX_V2: case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: report.transaction_id.id = 0x3f; break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report.transaction_id.id = 0x1f; + break; } mutex_lock(&device->lock); @@ -1284,9 +1513,23 @@ report.transaction_id.id = 0x3F; break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_get_brightness(VARSTORE, SCROLL_WHEEL_LED); + report.transaction_id.id = 0x1f; + break; + case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_extended_matrix_get_brightness(VARSTORE, SCROLL_WHEEL_LED); break; @@ -1316,9 +1559,23 @@ report.transaction_id.id = 0x3F; break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_brightness(VARSTORE, SCROLL_WHEEL_LED, brightness); + report.transaction_id.id = 0x1f; + break; + case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_extended_matrix_brightness(VARSTORE, SCROLL_WHEEL_LED, brightness); break; @@ -1348,9 +1605,28 @@ report.transaction_id.id = 0x3F; break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_get_brightness(VARSTORE, LOGO_LED); + report.transaction_id.id = 0x1f; + break; + case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + case USB_DEVICE_ID_RAZER_VIPER: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_extended_matrix_get_brightness(VARSTORE, LOGO_LED); break; @@ -1380,9 +1656,28 @@ report.transaction_id.id = 0x3F; break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_brightness(VARSTORE, LOGO_LED, brightness); + report.transaction_id.id = 0x1f; + break; + case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + case USB_DEVICE_ID_RAZER_VIPER: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_extended_matrix_brightness(VARSTORE, LOGO_LED, brightness); break; @@ -1396,10 +1691,7 @@ return count; } -/** - * Read device file "left_led_brightness" - */ -static ssize_t razer_attr_read_left_led_brightness(struct device *dev, struct device_attribute *attr, char *buf) +static ssize_t razer_attr_read_side_led_brightness(struct device *dev, struct device_attribute *attr, char *buf, int side) { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); @@ -1407,12 +1699,21 @@ struct razer_report response = {0}; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_get_brightness(VARSTORE, LEFT_SIDE_LED); + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_get_brightness(VARSTORE, side); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_get_brightness(VARSTORE, side); + report.transaction_id.id = 0x1f; break; default: - report = razer_chroma_standard_get_led_brightness(VARSTORE, LEFT_SIDE_LED); + report = razer_chroma_standard_get_led_brightness(VARSTORE, side); break; } @@ -1421,10 +1722,7 @@ return sprintf(buf, "%d\n", response.arguments[2]); } -/** - * Write device file "left_led_brightness" - */ -static ssize_t razer_attr_write_left_led_brightness(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_side_led_brightness(struct device *dev, struct device_attribute *attr, const char *buf, size_t count, int side) { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); @@ -1432,12 +1730,21 @@ struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_brightness(VARSTORE, LEFT_SIDE_LED, brightness); + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_brightness(VARSTORE, side, brightness); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_brightness(VARSTORE, side, brightness); + report.transaction_id.id = 0x1f; break; default: - report = razer_chroma_standard_set_led_brightness(VARSTORE, LEFT_SIDE_LED, brightness); + report = razer_chroma_standard_set_led_brightness(VARSTORE, side, brightness); break; } @@ -1447,28 +1754,27 @@ } /** - * Read device file "right_led_brightness" + * Read device file "left_led_brightness" */ -static ssize_t razer_attr_read_right_led_brightness(struct device *dev, struct device_attribute *attr, char *buf) +static ssize_t razer_attr_read_left_led_brightness(struct device *dev, struct device_attribute *attr, char *buf) { - struct usb_interface *intf = to_usb_interface(dev->parent); - struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = {0}; - struct razer_report response = {0}; - - switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_get_brightness(VARSTORE, RIGHT_SIDE_LED); - break; - - default: - report = razer_chroma_standard_get_led_brightness(VARSTORE, RIGHT_SIDE_LED); - break; - } + return razer_attr_read_side_led_brightness(dev, attr, buf, LEFT_SIDE_LED); +} - response = razer_send_payload(usb_dev, &report); +/** + * Write device file "left_led_brightness" + */ +static ssize_t razer_attr_write_left_led_brightness(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_led_brightness(dev, attr, buf, count, LEFT_SIDE_LED); +} - return sprintf(buf, "%d\n", response.arguments[2]); +/** + * Read device file "right_led_brightness" + */ +static ssize_t razer_attr_read_right_led_brightness(struct device *dev, struct device_attribute *attr, char *buf) +{ + return razer_attr_read_side_led_brightness(dev, attr, buf, RIGHT_SIDE_LED); } /** @@ -1476,24 +1782,7 @@ */ static ssize_t razer_attr_write_right_led_brightness(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct usb_interface *intf = to_usb_interface(dev->parent); - struct usb_device *usb_dev = interface_to_usbdev(intf); - unsigned char brightness = (unsigned char)simple_strtoul(buf, NULL, 10); - struct razer_report report = {0}; - - switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_brightness(VARSTORE, RIGHT_SIDE_LED, brightness); - break; - - default: - report = razer_chroma_standard_set_led_brightness(VARSTORE, RIGHT_SIDE_LED, brightness); - break; - } - - razer_send_payload(usb_dev, &report); - - return count; + return razer_attr_write_side_led_brightness(dev, attr, buf, count, RIGHT_SIDE_LED); } /** @@ -1775,9 +2064,22 @@ struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_effect_wave(VARSTORE, SCROLL_WHEEL_LED, direction); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_effect_wave(VARSTORE, SCROLL_WHEEL_LED, direction); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: scroll_mode_wave not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -1803,9 +2105,26 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, SCROLL_WHEEL_LED); break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, SCROLL_WHEEL_LED); + report.transaction_id.id = 0x1f; + break; + + default: + printk(KERN_WARNING "razermouse: scroll_mode_spectrum not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -1834,9 +2153,26 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, SCROLL_WHEEL_LED, speed, (struct razer_rgb*)&buf[1]); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, SCROLL_WHEEL_LED, speed, (struct razer_rgb*)&buf[1]); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: scroll_mode_reactive not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -1878,8 +2214,18 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: switch(count) { case 3: // Single colour mode report = razer_chroma_extended_matrix_effect_breathing_single(VARSTORE, SCROLL_WHEEL_LED, (struct razer_rgb*)&buf[0]); @@ -1896,9 +2242,17 @@ break; } - report.transaction_id.id = 0x3f; - razer_send_payload(usb_dev, &report); + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report.transaction_id.id = 0x1f; + break; + + default: + report.transaction_id.id = 0x3f; + break; + } + razer_send_payload(usb_dev, &report); return count; } @@ -1922,10 +2276,28 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + report = razer_chroma_extended_matrix_effect_static(VARSTORE, SCROLL_WHEEL_LED, (struct razer_rgb*)&buf[0]); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_effect_static(VARSTORE, SCROLL_WHEEL_LED, (struct razer_rgb*)&buf[0]); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: scroll_mode_static not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -1954,10 +2326,28 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + report = razer_chroma_extended_matrix_effect_none(VARSTORE, SCROLL_WHEEL_LED); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_effect_none(VARSTORE, SCROLL_WHEEL_LED); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: scroll_mode_static not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -1977,13 +2367,25 @@ struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_effect_wave(VARSTORE, LOGO_LED, direction); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_effect_wave(VARSTORE, LOGO_LED, direction); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: logo_mode_wave not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); - return count; } @@ -2005,9 +2407,28 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, LOGO_LED); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, LOGO_LED); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: logo_mode_spectrum not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -2035,9 +2456,28 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, LOGO_LED, speed, (struct razer_rgb*)&buf[1]); break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, LOGO_LED, speed, (struct razer_rgb*)&buf[1]); + report.transaction_id.id = 0x1f; + break; + + default: + printk(KERN_WARNING "razermouse: logo_mode_reactive not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -2079,8 +2519,23 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + case USB_DEVICE_ID_RAZER_VIPER: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: switch(count) { case 3: // Single colour mode report = razer_chroma_extended_matrix_effect_breathing_single(VARSTORE, LOGO_LED, (struct razer_rgb*)&buf[0]); @@ -2097,9 +2552,17 @@ break; } - report.transaction_id.id = 0x3f; - razer_send_payload(usb_dev, &report); + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report.transaction_id.id = 0x1f; + break; + + default: + report.transaction_id.id = 0x3f; + break; + } + razer_send_payload(usb_dev, &report); return count; } @@ -2122,10 +2585,33 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + case USB_DEVICE_ID_RAZER_VIPER: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: report = razer_chroma_extended_matrix_effect_static(VARSTORE, LOGO_LED, (struct razer_rgb*)&buf[0]); break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_effect_static(VARSTORE, LOGO_LED, (struct razer_rgb*)&buf[0]); + report.transaction_id.id = 0x1f; + break; + + default: + printk(KERN_WARNING "razermouse: logo_mode_static not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -2154,22 +2640,40 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + case USB_DEVICE_ID_RAZER_VIPER: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + report = razer_chroma_extended_matrix_effect_none(VARSTORE, LOGO_LED); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_effect_none(VARSTORE, LOGO_LED); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: logo_mode_none not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); return count; } -/** - * Write device file "left_mode_wave" (for extended mouse matrix effects) - * - * Wave effect mode is activated whenever the file is written to - */ -static ssize_t razer_attr_write_left_mode_wave(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_side_mode_wave(struct device *dev, struct device_attribute *attr, const char *buf, size_t count, int side) { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); @@ -2177,9 +2681,22 @@ struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_wave(VARSTORE, LEFT_SIDE_LED, direction); + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_effect_wave(VARSTORE, side, direction); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_effect_wave(VARSTORE, side, direction); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: left/right mode_wave not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -2188,130 +2705,48 @@ } /** - * Write device file "left_mode_spectrum" (for extended mouse matrix effects) + * Write device file "left_mode_wave" (for extended mouse matrix effects) * - * Spectrum effect mode is activated whenever the file is written to + * Wave effect mode is activated whenever the file is written to */ -static ssize_t razer_attr_write_left_mode_spectrum(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_left_mode_wave(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct usb_interface *intf = to_usb_interface(dev->parent); - struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = {0}; - - switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, LEFT_SIDE_LED); - break; - } - - razer_send_payload(usb_dev, &report); - return count; -} + return razer_attr_write_side_mode_wave(dev, attr, buf, count, LEFT_SIDE_LED); +} /** - * Write device file "left_mode_reactive" (for extended mouse matrix effects) + * Write device file "right_mode_wave" (for extended mouse matrix effects) * - * Sets reactive mode when this file is written to. A speed byte and 3 RGB bytes should be written + * Wave effect mode is activated whenever the file is written to */ -static ssize_t razer_attr_write_left_mode_reactive(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_right_mode_wave(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct usb_interface *intf = to_usb_interface(dev->parent); - struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = {0}; - - if(count == 4) { - unsigned char speed = (unsigned char)buf[0]; - - switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, LEFT_SIDE_LED, speed, (struct razer_rgb*)&buf[1]); - break; - } - - razer_send_payload(usb_dev, &report); - - } else { - printk(KERN_WARNING "razermouse: Reactive only accepts Speed, RGB (4byte)"); - } - return count; + return razer_attr_write_side_mode_wave(dev, attr, buf, count, RIGHT_SIDE_LED); } -/** - * Write device file "left_mode_breath" (for extended mouse matrix effects) - * - * Sets breathing mode by writing 1, 3 or 6 bytes - */ -static ssize_t razer_attr_write_left_mode_breath(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_side_mode_spectrum(struct device *dev, struct device_attribute *attr, const char *buf, size_t count, int side) { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - switch(count) { - case 3: // Single colour mode - report = razer_chroma_extended_matrix_effect_breathing_single(VARSTORE, LEFT_SIDE_LED, (struct razer_rgb*)&buf[0]); - break; - - case 6: // Dual colour mode - report = razer_chroma_extended_matrix_effect_breathing_dual(VARSTORE, LEFT_SIDE_LED, (struct razer_rgb*)&buf[0], (struct razer_rgb*)&buf[3]); - break; - - default: // "Random" colour mode - report = razer_chroma_extended_matrix_effect_breathing_random(VARSTORE, LEFT_SIDE_LED); - break; - } + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, side); break; - } - - report.transaction_id.id = 0x3f; - razer_send_payload(usb_dev, &report); - return count; -} - -/** - * Write device file "left_mode_static" (for extended mouse matrix effects) - * - * Set the mouse to static mode when 3 RGB bytes are written - */ -static ssize_t razer_attr_write_left_mode_static(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) -{ - struct usb_interface *intf = to_usb_interface(dev->parent); - struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = {0}; - - if(count == 3) { - switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_static(VARSTORE, LEFT_SIDE_LED, (struct razer_rgb*)&buf[0]); - break; - } - - razer_send_payload(usb_dev, &report); - } else { - printk(KERN_WARNING "razermouse: Static mode only accepts RGB (3byte)"); - } - - return count; -} - -/** - * Write device file "left_mode_none" (for extended mouse matrix effects) - * - * No effect is activated whenever this file is written to - */ -static ssize_t razer_attr_write_left_mode_none(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) -{ - struct usb_interface *intf = to_usb_interface(dev->parent); - struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = {0}; - - switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_none(VARSTORE, LEFT_SIDE_LED); + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, side); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: left/right mode_spectrum not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -2319,26 +2754,13 @@ } /** - * Write device file "right_mode_wave" (for extended mouse matrix effects) + * Write device file "left_mode_spectrum" (for extended mouse matrix effects) * - * Wave effect mode is activated whenever the file is written to + * Spectrum effect mode is activated whenever the file is written to */ -static ssize_t razer_attr_write_right_mode_wave(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_left_mode_spectrum(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct usb_interface *intf = to_usb_interface(dev->parent); - struct usb_device *usb_dev = interface_to_usbdev(intf); - unsigned char direction = (unsigned char)simple_strtoul(buf, NULL, 10); - struct razer_report report = {0}; - - switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_wave(VARSTORE, RIGHT_SIDE_LED, direction); - break; - } - - razer_send_payload(usb_dev, &report); - - return count; + return razer_attr_write_side_mode_spectrum(dev, attr, buf, count, LEFT_SIDE_LED); } /** @@ -2348,26 +2770,10 @@ */ static ssize_t razer_attr_write_right_mode_spectrum(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - struct usb_interface *intf = to_usb_interface(dev->parent); - struct usb_device *usb_dev = interface_to_usbdev(intf); - struct razer_report report = {0}; - - switch(usb_dev->descriptor.idProduct) { - case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_spectrum(VARSTORE, RIGHT_SIDE_LED); - break; - } - - razer_send_payload(usb_dev, &report); - return count; + return razer_attr_write_side_mode_spectrum(dev, attr, buf, count, RIGHT_SIDE_LED); } -/** - * Write device file "right_mode_reactive" (for extended mouse matrix effects) - * - * Sets reactive mode when this file is written to. A speed byte and 3 RGB bytes should be written - */ -static ssize_t razer_attr_write_right_mode_reactive(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_side_mode_reactive(struct device *dev, struct device_attribute *attr, const char *buf, size_t count, int side) { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); @@ -2377,9 +2783,22 @@ unsigned char speed = (unsigned char)buf[0]; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, RIGHT_SIDE_LED, speed, (struct razer_rgb*)&buf[1]); + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, side, speed, (struct razer_rgb*)&buf[1]); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_effect_reactive(VARSTORE, side, speed, (struct razer_rgb*)&buf[1]); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: left/right mode_reactive not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -2391,46 +2810,89 @@ } /** - * Write device file "right_mode_breath" (for extended mouse matrix effects) + * Write device file "left_mode_reactive" (for extended mouse matrix effects) * - * Sets breathing mode by writing 1, 3 or 6 bytes + * Sets reactive mode when this file is written to. A speed byte and 3 RGB bytes should be written */ -static ssize_t razer_attr_write_right_mode_breath(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_left_mode_reactive(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_mode_reactive(dev, attr, buf, count, LEFT_SIDE_LED); +} + +/** + * Write device file "right_mode_reactive" (for extended mouse matrix effects) + * + * Sets reactive mode when this file is written to. A speed byte and 3 RGB bytes should be written + */ +static ssize_t razer_attr_write_right_mode_reactive(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_mode_reactive(dev, attr, buf, count, RIGHT_SIDE_LED); +} + +static ssize_t razer_attr_write_side_mode_breath(struct device *dev, struct device_attribute *attr, const char *buf, size_t count, int side) { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: switch(count) { case 3: // Single colour mode - report = razer_chroma_extended_matrix_effect_breathing_single(VARSTORE, RIGHT_SIDE_LED, (struct razer_rgb*)&buf[0]); + report = razer_chroma_extended_matrix_effect_breathing_single(VARSTORE, side, (struct razer_rgb*)&buf[0]); break; case 6: // Dual colour mode - report = razer_chroma_extended_matrix_effect_breathing_dual(VARSTORE, RIGHT_SIDE_LED, (struct razer_rgb*)&buf[0], (struct razer_rgb*)&buf[3]); + report = razer_chroma_extended_matrix_effect_breathing_dual(VARSTORE, side, (struct razer_rgb*)&buf[0], (struct razer_rgb*)&buf[3]); break; default: // "Random" colour mode - report = razer_chroma_extended_matrix_effect_breathing_random(VARSTORE, RIGHT_SIDE_LED); + report = razer_chroma_extended_matrix_effect_breathing_random(VARSTORE, side); break; } break; } - report.transaction_id.id = 0x3f; - razer_send_payload(usb_dev, &report); + switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report.transaction_id.id = 0x1f; + break; + + default: + report.transaction_id.id = 0x3f; + break; + } + razer_send_payload(usb_dev, &report); return count; } /** - * Write device file "right_mode_static" (for extended mouse matrix effects) + * Write device file "left_mode_breath" (for extended mouse matrix effects) * - * Set the mouse to static mode when 3 RGB bytes are written + * Sets breathing mode by writing 1, 3 or 6 bytes */ -static ssize_t razer_attr_write_right_mode_static(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_left_mode_breath(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_mode_breath(dev, attr, buf, count, LEFT_SIDE_LED); +} + +/** + * Write device file "right_mode_breath" (for extended mouse matrix effects) + * + * Sets breathing mode by writing 1, 3 or 6 bytes + */ +static ssize_t razer_attr_write_right_mode_breath(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_mode_breath(dev, attr, buf, count, RIGHT_SIDE_LED); +} + +static ssize_t razer_attr_write_side_mode_static(struct device *dev, struct device_attribute *attr, const char *buf, size_t count, int side) { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); @@ -2438,8 +2900,16 @@ if(count == 3) { switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_static(VARSTORE, RIGHT_SIDE_LED, (struct razer_rgb*)&buf[0]); + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_effect_static(VARSTORE, side, (struct razer_rgb*)&buf[0]); + break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_effect_static(VARSTORE, side, (struct razer_rgb*)&buf[0]); + report.transaction_id.id = 0x1f; break; } @@ -2452,20 +2922,48 @@ } /** - * Write device file "right_mode_none" (for extended mouse matrix effects) + * Write device file "left_mode_static" (for extended mouse matrix effects) * - * No effect is activated whenever this file is written to + * Set the mouse to static mode when 3 RGB bytes are written */ -static ssize_t razer_attr_write_right_mode_none(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +static ssize_t razer_attr_write_left_mode_static(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_mode_static(dev, attr, buf, count, LEFT_SIDE_LED); +} + +/** + * Write device file "right_mode_static" (for extended mouse matrix effects) + * + * Set the mouse to static mode when 3 RGB bytes are written + */ +static ssize_t razer_attr_write_right_mode_static(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_mode_static(dev, attr, buf, count, RIGHT_SIDE_LED); +} + +static ssize_t razer_attr_write_side_mode_none(struct device *dev, struct device_attribute *attr, const char *buf, size_t count, int side) { struct usb_interface *intf = to_usb_interface(dev->parent); struct usb_device *usb_dev = interface_to_usbdev(intf); struct razer_report report = {0}; switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: - report = razer_chroma_extended_matrix_effect_none(VARSTORE, RIGHT_SIDE_LED); + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + report = razer_chroma_extended_matrix_effect_none(VARSTORE, side); + break; + + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + report = razer_chroma_extended_matrix_effect_none(VARSTORE, side); + report.transaction_id.id = 0x1f; break; + + default: + printk(KERN_WARNING "razermouse: left/right mode_none not supported for this model"); + return count; } razer_send_payload(usb_dev, &report); @@ -2473,6 +2971,26 @@ } /** + * Write device file "left_mode_none" (for extended mouse matrix effects) + * + * No effect is activated whenever this file is written to + */ +static ssize_t razer_attr_write_left_mode_none(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_mode_none(dev, attr, buf, count, LEFT_SIDE_LED); +} + +/** + * Write device file "right_mode_none" (for extended mouse matrix effects) + * + * No effect is activated whenever this file is written to + */ +static ssize_t razer_attr_write_right_mode_none(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + return razer_attr_write_side_mode_none(dev, attr, buf, count, RIGHT_SIDE_LED); +} + +/** * Write device file "backlight_led_state" */ static ssize_t razer_attr_write_backlight_led_state(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) @@ -2641,7 +3159,7 @@ /** * Mouse init function */ -void razer_mouse_init(struct razer_mouse_device *dev, struct usb_interface *intf, struct hid_device *hdev) +static void razer_mouse_init(struct razer_mouse_device *dev, struct usb_interface *intf, struct hid_device *hdev) { struct usb_device *usb_dev = interface_to_usbdev(intf); unsigned int rand_serial = 0; @@ -2653,6 +3171,7 @@ dev->usb_vid = usb_dev->descriptor.idVendor; dev->usb_pid = usb_dev->descriptor.idProduct; dev->usb_interface_protocol = intf->cur_altsetting->desc.bInterfaceProtocol; + dev->usb_interface_subclass = intf->cur_altsetting->desc.bInterfaceSubClass; // Get a "random" integer get_random_bytes(&rand_serial, sizeof(unsigned int)); @@ -2677,6 +3196,7 @@ int retval = 0; struct usb_interface *intf = to_usb_interface(hdev->dev.parent); struct razer_mouse_device *dev = NULL; + unsigned char expected_subclass = 0xFF; dev = kzalloc(sizeof(struct razer_mouse_device), GFP_KERNEL); @@ -2689,7 +3209,14 @@ // Init data razer_mouse_init(dev, intf, hdev); - if(dev->usb_interface_protocol == USB_INTERFACE_PROTOCOL_MOUSE) { + switch(dev->usb_pid) { + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: + expected_subclass = 0x01; + break; + } + + if(dev->usb_interface_protocol == USB_INTERFACE_PROTOCOL_MOUSE + && (expected_subclass == 0xFF || dev->usb_interface_subclass == expected_subclass)) { CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_version); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_test); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_firmware_version); @@ -2698,6 +3225,30 @@ CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_device_mode); switch(dev->usb_pid) { + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_poll_rate); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_dpi); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_brightness); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_spectrum); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_reactive); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_breath); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_none); + break; + + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_effect); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_colour); + /* fall through */ + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_level); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_status); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_low_threshold); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_device_idle_time); + /* fall through */ case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_poll_rate); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_dpi); @@ -2734,6 +3285,8 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_poll_rate); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_dpi); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_brightness); @@ -2795,6 +3348,7 @@ case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_effect); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_colour); + /* fall through */ case USB_DEVICE_ID_RAZER_MAMBA_WIRED: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_level); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_status); @@ -2836,6 +3390,7 @@ case USB_DEVICE_ID_RAZER_ABYSSUS: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_state); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_poll_rate); break; case USB_DEVICE_ID_RAZER_IMPERATOR: @@ -2954,7 +3509,48 @@ CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_dpi); break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_dpi); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_poll_rate); + + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_brightness); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_wave); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_spectrum); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_reactive); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_breath); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_none); + + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_led_brightness); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_wave); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_spectrum); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_reactive); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_breath); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_none); + + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_left_led_brightness); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_left_matrix_effect_wave); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_left_matrix_effect_spectrum); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_left_matrix_effect_reactive); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_left_matrix_effect_breath); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_left_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_left_matrix_effect_none); + + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_right_led_brightness); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_right_matrix_effect_wave); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_right_matrix_effect_spectrum); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_right_matrix_effect_reactive); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_right_matrix_effect_breath); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_right_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_right_matrix_effect_none); + + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); + break; + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_dpi); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_poll_rate); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_brightness); @@ -2973,6 +3569,48 @@ CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_brightness); CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_static); break; + + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_effect); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_colour); + /* fall through */ + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_level); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_status); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_low_threshold); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_device_idle_time); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_poll_rate); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_dpi); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_brightness); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_spectrum); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_reactive); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_breath); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_none); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_led_brightness); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_spectrum); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_reactive); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_breath); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_scroll_matrix_effect_none); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_custom); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_custom_frame); + break; + + case USB_DEVICE_ID_RAZER_VIPER: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_level); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_status); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_poll_rate); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_low_threshold); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_device_idle_time); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_dpi); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_led_brightness); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_breath); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_static); + CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_logo_matrix_effect_none); + break; } } @@ -3023,6 +3661,30 @@ device_remove_file(&hdev->dev, &dev_attr_device_mode); switch(usb_dev->descriptor.idProduct) { + case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: + case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: + device_remove_file(&hdev->dev, &dev_attr_poll_rate); + device_remove_file(&hdev->dev, &dev_attr_dpi); + device_remove_file(&hdev->dev, &dev_attr_logo_led_brightness); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_spectrum); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_reactive); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_breath); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_none); + break; + + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER: + device_remove_file(&hdev->dev, &dev_attr_charge_effect); + device_remove_file(&hdev->dev, &dev_attr_charge_colour); + /* fall through */ + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED: + case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED: + device_remove_file(&hdev->dev, &dev_attr_charge_level); + device_remove_file(&hdev->dev, &dev_attr_charge_status); + device_remove_file(&hdev->dev, &dev_attr_charge_low_threshold); + device_remove_file(&hdev->dev, &dev_attr_device_idle_time); + /* fall through */ case USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED: device_remove_file(&hdev->dev, &dev_attr_poll_rate); device_remove_file(&hdev->dev, &dev_attr_dpi); @@ -3059,6 +3721,8 @@ break; case USB_DEVICE_ID_RAZER_DEATHADDER_ELITE: + case USB_DEVICE_ID_RAZER_BASILISK: + case USB_DEVICE_ID_RAZER_DEATHADDER_V2: device_remove_file(&hdev->dev, &dev_attr_poll_rate); device_remove_file(&hdev->dev, &dev_attr_dpi); device_remove_file(&hdev->dev, &dev_attr_logo_led_brightness); @@ -3120,6 +3784,7 @@ case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS: device_remove_file(&hdev->dev, &dev_attr_charge_effect); device_remove_file(&hdev->dev, &dev_attr_charge_colour); + /* fall through */ case USB_DEVICE_ID_RAZER_MAMBA_WIRED: device_remove_file(&hdev->dev, &dev_attr_charge_level); device_remove_file(&hdev->dev, &dev_attr_charge_status); @@ -3161,6 +3826,7 @@ case USB_DEVICE_ID_RAZER_ABYSSUS: device_remove_file(&hdev->dev, &dev_attr_logo_led_state); + device_remove_file(&hdev->dev, &dev_attr_poll_rate); break; case USB_DEVICE_ID_RAZER_IMPERATOR: @@ -3268,7 +3934,48 @@ device_remove_file(&hdev->dev, &dev_attr_dpi); break; + case USB_DEVICE_ID_RAZER_MAMBA_ELITE: + device_remove_file(&hdev->dev, &dev_attr_dpi); + device_remove_file(&hdev->dev, &dev_attr_poll_rate); + + device_remove_file(&hdev->dev, &dev_attr_logo_led_brightness); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_wave); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_spectrum); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_reactive); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_breath); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_none); + + device_remove_file(&hdev->dev, &dev_attr_scroll_led_brightness); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_wave); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_spectrum); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_reactive); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_breath); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_none); + + device_remove_file(&hdev->dev, &dev_attr_left_led_brightness); + device_remove_file(&hdev->dev, &dev_attr_left_matrix_effect_wave); + device_remove_file(&hdev->dev, &dev_attr_left_matrix_effect_spectrum); + device_remove_file(&hdev->dev, &dev_attr_left_matrix_effect_reactive); + device_remove_file(&hdev->dev, &dev_attr_left_matrix_effect_breath); + device_remove_file(&hdev->dev, &dev_attr_left_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_left_matrix_effect_none); + + device_remove_file(&hdev->dev, &dev_attr_right_led_brightness); + device_remove_file(&hdev->dev, &dev_attr_right_matrix_effect_wave); + device_remove_file(&hdev->dev, &dev_attr_right_matrix_effect_spectrum); + device_remove_file(&hdev->dev, &dev_attr_right_matrix_effect_reactive); + device_remove_file(&hdev->dev, &dev_attr_right_matrix_effect_breath); + device_remove_file(&hdev->dev, &dev_attr_right_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_right_matrix_effect_none); + + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); + device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); + break; + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL: + case USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION: device_remove_file(&hdev->dev, &dev_attr_dpi); device_remove_file(&hdev->dev, &dev_attr_poll_rate); device_remove_file(&hdev->dev, &dev_attr_logo_led_brightness); @@ -3287,6 +3994,48 @@ device_remove_file(&hdev->dev, &dev_attr_matrix_brightness); device_remove_file(&hdev->dev, &dev_attr_matrix_effect_static); break; + + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: + device_remove_file(&hdev->dev, &dev_attr_charge_effect); + device_remove_file(&hdev->dev, &dev_attr_charge_colour); + /* fall through */ + case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + device_remove_file(&hdev->dev, &dev_attr_charge_level); + device_remove_file(&hdev->dev, &dev_attr_charge_status); + device_remove_file(&hdev->dev, &dev_attr_charge_low_threshold); + device_remove_file(&hdev->dev, &dev_attr_device_idle_time); + device_remove_file(&hdev->dev, &dev_attr_poll_rate); + device_remove_file(&hdev->dev, &dev_attr_dpi); + device_remove_file(&hdev->dev, &dev_attr_logo_led_brightness); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_spectrum); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_reactive); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_breath); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_none); + device_remove_file(&hdev->dev, &dev_attr_scroll_led_brightness); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_spectrum); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_reactive); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_breath); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_scroll_matrix_effect_none); + device_remove_file(&hdev->dev, &dev_attr_matrix_effect_custom); + device_remove_file(&hdev->dev, &dev_attr_matrix_custom_frame); + break; + + case USB_DEVICE_ID_RAZER_VIPER: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: + case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: + device_remove_file(&hdev->dev, &dev_attr_charge_level); + device_remove_file(&hdev->dev, &dev_attr_charge_status); + device_remove_file(&hdev->dev, &dev_attr_poll_rate); + device_remove_file(&hdev->dev, &dev_attr_charge_low_threshold); + device_remove_file(&hdev->dev, &dev_attr_device_idle_time); + device_remove_file(&hdev->dev, &dev_attr_dpi); + device_remove_file(&hdev->dev, &dev_attr_logo_led_brightness); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_breath); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_static); + device_remove_file(&hdev->dev, &dev_attr_logo_matrix_effect_none); + break; } } @@ -3329,11 +4078,26 @@ { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DIAMONDBACK_CHROMA) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_ABYSSUS_V2) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHADDER_3500) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_NAGA_TRINITY) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_MAMBA_ELITE) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHADDER_1800) }, - { } + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_VIPER) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_BASILISK) }, + { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_DEATHADDER_V2) }, + { 0 } }; MODULE_DEVICE_TABLE(hid, razer_devices); diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razermouse_driver.h openrazer-2.8.0~ubuntu19.10.1/driver/razermouse_driver.h --- openrazer-2.7.0~ubuntu19.10.1/driver/razermouse_driver.h 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razermouse_driver.h 2020-05-02 11:24:51.000000000 +0000 @@ -37,12 +37,27 @@ #define USB_DEVICE_ID_RAZER_NAGA_HEX_V2 0x0050 #define USB_DEVICE_ID_RAZER_NAGA_CHROMA 0x0053 #define USB_DEVICE_ID_RAZER_DEATHADDER_3500 0x0054 +#define USB_DEVICE_ID_RAZER_LANCEHEAD_WIRED 0x0059 +#define USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS 0x005A #define USB_DEVICE_ID_RAZER_ABYSSUS_V2 0x005B #define USB_DEVICE_ID_RAZER_DEATHADDER_ELITE 0x005C #define USB_DEVICE_ID_RAZER_ABYSSUS_2000 0x005E #define USB_DEVICE_ID_RAZER_LANCEHEAD_TE_WIRED 0x0060 +#define USB_DEVICE_ID_RAZER_BASILISK 0x0064 #define USB_DEVICE_ID_RAZER_NAGA_TRINITY 0x0067 +#define USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION 0x006A +#define USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL 0x006B +#define USB_DEVICE_ID_RAZER_MAMBA_ELITE 0x006C #define USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL 0x006E +#define USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_RECEIVER 0x006F +#define USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS_WIRED 0x0070 +#define USB_DEVICE_ID_RAZER_DEATHADDER_ESSENTIAL_WHITE_EDITION 0x0071 +#define USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER 0x0072 +#define USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED 0x0073 +#define USB_DEVICE_ID_RAZER_VIPER 0x0078 +#define USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED 0x007A +#define USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS 0x007B +#define USB_DEVICE_ID_RAZER_DEATHADDER_V2 0x0084 /* Each keyboard report has 90 bytes*/ #define RAZER_REPORT_LEN 0x5A @@ -54,10 +69,14 @@ #define RAZER_MOUSE_WAIT_MIN_US 600 #define RAZER_MOUSE_WAIT_MAX_US 800 +#define RAZER_NEW_MOUSE_RECEIVER_WAIT_MIN_US 31000 +#define RAZER_NEW_MOUSE_RECEIVER_WAIT_MAX_US 31100 + struct razer_mouse_device { struct usb_device *usb_dev; struct mutex lock; unsigned char usb_interface_protocol; + unsigned char usb_interface_subclass; unsigned short usb_vid; unsigned short usb_pid; diff -Nru openrazer-2.7.0~ubuntu19.10.1/driver/razermousemat_driver.c openrazer-2.8.0~ubuntu19.10.1/driver/razermousemat_driver.c --- openrazer-2.7.0~ubuntu19.10.1/driver/razermousemat_driver.c 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/driver/razermousemat_driver.c 2020-05-02 11:24:51.000000000 +0000 @@ -45,7 +45,7 @@ /** * Send report to the mousemat */ -int razer_get_report(struct usb_device *usb_dev, struct razer_report *request_report, struct razer_report *response_report) +static int razer_get_report(struct usb_device *usb_dev, struct razer_report *request_report, struct razer_report *response_report) { return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, RAZER_MOUSEMAT_WAIT_MIN_US, RAZER_MOUSEMAT_WAIT_MAX_US); } @@ -53,7 +53,7 @@ /** * Function to send to device, get response, and actually check the response */ -struct razer_report razer_send_payload(struct usb_device *usb_dev, struct razer_report *request_report) +static struct razer_report razer_send_payload(struct usb_device *usb_dev, struct razer_report *request_report) { int retval = -1; struct razer_report response_report = {0}; @@ -781,7 +781,7 @@ { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_FIREFLY_HYPERFLUX) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_GOLIATHUS_CHROMA) }, { HID_USB_DEVICE(USB_VENDOR_ID_RAZER,USB_DEVICE_ID_RAZER_GOLIATHUS_CHROMA_EXTENDED) }, - { } + { 0 } }; MODULE_DEVICE_TABLE(hid, razer_devices); diff -Nru openrazer-2.7.0~ubuntu19.10.1/.github/FUNDING.yml openrazer-2.8.0~ubuntu19.10.1/.github/FUNDING.yml --- openrazer-2.7.0~ubuntu19.10.1/.github/FUNDING.yml 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/.github/FUNDING.yml 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1 @@ +custom: ["https://www.paypal.me/z3ntu", "https://www.paypal.me/LukeHorwell", "https://www.paypal.me/terrycain1337"] diff -Nru openrazer-2.7.0~ubuntu19.10.1/.github/ISSUE_TEMPLATE/support.md openrazer-2.8.0~ubuntu19.10.1/.github/ISSUE_TEMPLATE/support.md --- openrazer-2.7.0~ubuntu19.10.1/.github/ISSUE_TEMPLATE/support.md 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/.github/ISSUE_TEMPLATE/support.md 2020-05-02 11:24:51.000000000 +0000 @@ -7,7 +7,7 @@ --- - + ### Distribution diff -Nru openrazer-2.7.0~ubuntu19.10.1/install_files/appstream/io.github.openrazer.openrazer.metainfo.xml openrazer-2.8.0~ubuntu19.10.1/install_files/appstream/io.github.openrazer.openrazer.metainfo.xml --- openrazer-2.7.0~ubuntu19.10.1/install_files/appstream/io.github.openrazer.openrazer.metainfo.xml 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/install_files/appstream/io.github.openrazer.openrazer.metainfo.xml 2020-05-02 11:24:51.000000000 +0000 @@ -40,13 +40,28 @@ usb:v1532p0050d* usb:v1532p0053d* usb:v1532p0054d* + usb:v1532p0059d* + usb:v1532p005Ad* usb:v1532p005Bd* usb:v1532p005Cd* usb:v1532p005Ed* usb:v1532p0060d* + usb:v1532p0064d* usb:v1532p0067d* usb:v1532p0068d* + usb:v1532p006Ad* + usb:v1532p006Bd* + usb:v1532p006Cd* usb:v1532p006Ed* + usb:v1532p006Fd* + usb:v1532p0070d* + usb:v1532p0071d* + usb:v1532p0072d* + usb:v1532p0073d* + usb:v1532p0078d* + usb:v1532p007Ad* + usb:v1532p007Bd* + usb:v1532p0084D* usb:v1532p010Dd* usb:v1532p010Ed* usb:v1532p010Fd* @@ -80,26 +95,36 @@ usb:v1532p0227d* usb:v1532p0228d* usb:v1532p022Ad* + usb:v1532p022Bd* usb:v1532p022Dd* usb:v1532p022Fd* usb:v1532p0232d* usb:v1532p0233d* + usb:v1532p0234d* usb:v1532p0235d* + usb:v1532p0237d* usb:v1532p0239d* usb:v1532p023Ad* usb:v1532p023Bd* usb:v1532p0240d* usb:v1532p0241d* + usb:v1532p0243d* usb:v1532p0245d* usb:v1532p0246d* usb:v1532p024Ad* + usb:v1532p024Cd* + usb:v1532p024Dd* usb:v1532p0501d* usb:v1532p0504d* usb:v1532p0506d* usb:v1532p0510d* + usb:v1532p0517d* + usb:v1532p0518d* usb:v1532p0C00d* usb:v1532p0C01d* usb:v1532p0C02d* usb:v1532p0F07d* + usb:v1532p0F08d* + usb:v1532p0F09d* diff -Nru openrazer-2.7.0~ubuntu19.10.1/install_files/dkms/dkms.conf openrazer-2.8.0~ubuntu19.10.1/install_files/dkms/dkms.conf --- openrazer-2.7.0~ubuntu19.10.1/install_files/dkms/dkms.conf 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/install_files/dkms/dkms.conf 2020-05-02 11:24:51.000000000 +0000 @@ -1,5 +1,5 @@ PACKAGE_NAME="openrazer-driver" -PACKAGE_VERSION="2.7.0" +PACKAGE_VERSION="2.8.0" AUTOINSTALL="yes" MAKE="KERNELDIR=/lib/modules/${kernelver}/build make driver" diff -Nru openrazer-2.7.0~ubuntu19.10.1/install_files/udev/99-razer.rules openrazer-2.8.0~ubuntu19.10.1/install_files/udev/99-razer.rules --- openrazer-2.7.0~ubuntu19.10.1/install_files/udev/99-razer.rules 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/install_files/udev/99-razer.rules 2020-05-02 11:24:51.000000000 +0000 @@ -5,12 +5,12 @@ LABEL="razer_vendor" # Mice -ATTRS{idProduct}=="0013|0016|0020|0024|0025|002e|002f|0032|0034|0036|0037|0038|0039|0040|0041|0042|0043|0044|0045|0046|0048|004c|0050|0053|0054|005b|005c|005e|0060|0067|006e", \ +ATTRS{idProduct}=="0013|0016|0020|0024|0025|002e|002f|0032|0034|0036|0037|0038|0039|0040|0041|0042|0043|0044|0045|0046|0048|004c|0050|0053|0054|0059|005a|005b|005c|005e|0060|0064|0067|006a|006b|006c|006e|006f|0070|0071|0072|0073|0078|007a|007b|0084", \ ATTRS{idVendor}=="1532", \ ENV{ID_RAZER_CHROMA}="1", ENV{RAZER_DRIVER}="razermouse" # Keyboards -ATTRS{idProduct}=="010d|010e|0111|0113|011b|011a|010f|0201|0202|0203|0204|0205|0207|0208|0209|020f|0210|0211|0214|0216|021a|0217|021a|021e|021f|0220|0221|0224|0225|0226|0227|0228|022a|022d|022f|0232|0233|0235|0239|023a|023b|0240|0241|0245|0246|024a", \ +ATTRS{idProduct}=="010d|010e|010f|0111|0113|011a|011b|0201|0202|0203|0204|0205|0207|0208|0209|020f|0210|0211|0214|0216|0217|021a|021e|021f|0220|0221|0224|0225|0226|0227|0228|022a|022b|022d|022f|0232|0233|0234|0235|0237|0239|023a|023b|0240|0241|0243|0245|0246|024a|024c|024d", \ ATTRS{idVendor}=="1532", \ ENV{ID_RAZER_CHROMA}="1", ENV{RAZER_DRIVER}="razerkbd" @@ -24,8 +24,8 @@ ATTRS{idVendor}=="1532", \ ENV{ID_RAZER_CHROMA}="1", ENV{RAZER_DRIVER}="razerkraken" -# Accessories - Mug, Base Station, HDK -ATTRS{idProduct}=="0f07", \ +# Accessories - Nommo Chroma, Nommo Pro, Mug, Base Station, HDK +ATTRS{idProduct}=="0517|0518|0f07|0f08|0f09", \ ATTRS{idVendor}=="1532", \ ENV{ID_RAZER_CHROMA}="1", ENV{RAZER_DRIVER}="razeraccessory" diff -Nru openrazer-2.7.0~ubuntu19.10.1/Makefile openrazer-2.8.0~ubuntu19.10.1/Makefile --- openrazer-2.7.0~ubuntu19.10.1/Makefile 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/Makefile 2020-05-02 11:24:51.000000000 +0000 @@ -12,7 +12,7 @@ PYTHONDIR?=$(shell python3 -c 'import sys; print(sys.path[-1])') DKMS_NAME?=openrazer-driver -DKMS_VER?=2.7.0 +DKMS_VER?=2.8.0 # Build all target diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/devices/__init__.py openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/devices/__init__.py --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/devices/__init__.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/devices/__init__.py 2020-05-02 11:24:51.000000000 +0000 @@ -131,6 +131,10 @@ 'lighting_backlight': self._has_feature('razer.device.lighting.backlight'), 'lighting_backlight_active': self._has_feature('razer.device.lighting.backlight', 'setBacklightActive'), + + 'lighting_profile_led_red': self._has_feature('razer.device.lighting.profile_led', 'setRedLED'), + 'lighting_profile_led_green': self._has_feature('razer.device.lighting.profile_led', 'setGreenLED'), + 'lighting_profile_led_blue': self._has_feature('razer.device.lighting.profile_led', 'setBlueLED'), } # Nasty hack to convert dbus.Int32 into native diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/devices/keyboard.py openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/devices/keyboard.py --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/devices/keyboard.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/devices/keyboard.py 2020-05-02 11:24:51.000000000 +0000 @@ -24,6 +24,9 @@ if self.has('macro_mode_led'): self._dbus_interfaces['macro_mode_led'] = _dbus.Interface(self._dbus, "razer.device.led.macromode") + if self.has('lighting_profile_led_red') or self.has('lighting_profile_led_green') or self.has('lighting_profile_led_blue'): + self._dbus_interfaces['profile_led'] = _dbus.Interface(self._dbus, "razer.device.lighting.profile_led") + @property def game_mode_led(self) -> bool: """ @@ -104,6 +107,78 @@ if self.has('macro_mode_led_effect') and value in (MACRO_LED_STATIC, MACRO_LED_BLINK): self._dbus_interfaces['macro_mode_led'].setMacroEffect(value) + @property + def profile_led_red(self) -> bool: + """ + Get red profile LED state + + :return: Red profile LED state + :rtype: bool + """ + if self.has('lighting_profile_led_red'): + return bool(self._dbus_interfaces['profile_led'].getRedLED()) + else: + return False + + @profile_led_red.setter + def profile_led_red(self, enable: bool): + """ + Set red profile LED state + + :param enable: Status of red profile LED + :type enable: bool + """ + if self.has('lighting_profile_led_red'): + self._dbus_interfaces['profile_led'].setRedLED(enable) + + @property + def profile_led_green(self) -> bool: + """ + Get green profile LED state + + :return: Green profile LED state + :rtype: bool + """ + if self.has('lighting_profile_led_green'): + return bool(self._dbus_interfaces['profile_led'].getGreenLED()) + else: + return False + + @profile_led_green.setter + def profile_led_green(self, enable: bool): + """ + Set green profile LED state + + :param enable: Status of green profile LED + :type enable: bool + """ + if self.has('lighting_profile_led_green'): + self._dbus_interfaces['profile_led'].setGreenLED(enable) + + @property + def profile_led_blue(self) -> bool: + """ + Get blue profile LED state + + :return: Blue profile LED state + :rtype: bool + """ + if self.has('lighting_profile_led_blue'): + return bool(self._dbus_interfaces['profile_led'].getBlueLED()) + else: + return False + + @profile_led_blue.setter + def profile_led_blue(self, enable: bool): + """ + Set blue profile LED state + + :param enable: Status of blue profile LED + :type enable: bool + """ + if self.has('lighting_profile_led_blue'): + self._dbus_interfaces['profile_led'].setBlueLED(enable) + DEVICE_PID_MAP = { diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/devices/mice.py openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/devices/mice.py --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/devices/mice.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/devices/mice.py 2020-05-02 11:24:51.000000000 +0000 @@ -15,9 +15,12 @@ self._capabilities['poll_rate'] = self._has_feature('razer.device.misc', ('getPollRate', 'setPollRate')) self._capabilities['dpi'] = self._has_feature('razer.device.dpi', ('getDPI', 'setDPI')) self._capabilities['available_dpi'] = self._has_feature('razer.device.dpi', 'availableDPI') + self._capabilities['battery'] = self._has_feature('razer.device.power', 'getBattery') if self.has('dpi'): self._dbus_interfaces['dpi'] = _dbus.Interface(self._dbus, "razer.device.dpi") + if self.has('battery'): + self._dbus_interfaces['power'] = _dbus.Interface(self._dbus, "razer.device.power") @property def max_dpi(self) -> int: @@ -129,3 +132,42 @@ else: raise NotImplementedError() + + @property + def battery_level(self) -> int: + """ + Get battery level from device + + :return: Battery level (0-100) + """ + if self.has('battery'): + return int(self._dbus_interfaces['power'].getBattery()) + + @property + def is_charging(self) -> bool: + """ + Get whether the device is charging or not + + :return: Boolean + """ + if self.has('battery'): + return bool(self._dbus_interfaces['power'].isCharging()) + + def set_idle_time(self, idle_time) -> None: + """ + Sets the idle time on the device + + :param idle_time: the time in seconds + """ + if self.has('battery'): + self._dbus_interfaces['power'].setIdleTime(idle_time) + + def set_low_battery_threshold(self, threshold) -> None: + """ + Set the low battery threshold as a percentage + + :param threshold: Battery threshold as a percentage + :type threshold: int + """ + if self.has('battery'): + self._dbus_interfaces['power'].setLowBatteryThreshold(threshold) diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/__init__.py openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/__init__.py --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/__init__.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/__init__.py 2020-05-02 11:24:51.000000000 +0000 @@ -3,7 +3,7 @@ from openrazer.client.device import RazerDeviceFactory as _RazerDeviceFactory from openrazer.client import constants -__version__ = '2.7.0' +__version__ = '2.8.0' class DaemonNotFound(Exception): diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/macro.py openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/macro.py --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/client/macro.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/client/macro.py 2020-05-02 11:24:51.000000000 +0000 @@ -66,7 +66,7 @@ def del_macro(self, bind_key: str): key_map = keyboard.KEY_MAPPING map_str = "keyboard.KEY_MAPPING" - if self.name in ["Razer Orbweaver", "Razer Orbweaver Chroma"]: + if self.name in ["Razer Orbweaver", "Razer Orbweaver Chroma", "Razer Tartarus V2", "Razer Tartarus Chroma V2"]: key_map = keyboard.ORBWEAVER_KEY_MAPPING map_str = "keyboard.ORBWEAVER_KEY_MAPPING" elif self.name in ["Razer Tartarus", "Razer Tartarus Chroma", "Razer Nostromo"]: diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerabyssuselitedvaedition.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerabyssuselitedvaedition.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerabyssuselitedvaedition.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerabyssuselitedvaedition.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,17 @@ +[device] +dir_name = 0003:1532:006A.0001 +name = Razer Abyssus Elite (D.Va Edition) +event = Razer_D.Va_Razer_Abyssus_Elite-if01-event-kbd + Razer_D.Va_Razer_Abyssus_Elite-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000064 + rw,logo_led_brightness,0 + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + rw,poll_rate,500 + rw,dpi,800:800 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerabyssusessential.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerabyssusessential.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerabyssusessential.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerabyssusessential.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,17 @@ +[device] +dir_name = 0003:1532:006B.0001 +name = Razer Abyssus Essential +event = Razer_Razer_Abyssus_Essential-if01-event-kbd + Razer_Razer_Abyssus_Essential-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000065 + rw,logo_led_brightness,0 + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + rw,poll_rate,500 + rw,dpi,800:800 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerbasilisk.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerbasilisk.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerbasilisk.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerbasilisk.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,25 @@ +[device] +dir_name = 0003:1532:0064.0001 +name = Razer Basilisk +event = Razer_Basilisk-if01-event-kbd + Razer_Basilisk-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000070 + rw,logo_led_brightness,0 + rw,scroll_led_brightness,0 + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + w,scroll_matrix_effect_spectrum + w,scroll_matrix_effect_reactive + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_static + w,scroll_matrix_effect_none + w,matrix_effect_custom + w,matrix_custom_frame + rw,poll_rate,500 + rw,dpi,800:800 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razercynosachroma.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razercynosachroma.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razercynosachroma.cfg 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razercynosachroma.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -7,6 +7,7 @@ r,device_type,%(name)s r,firmware_version,v1.0 r,device_serial,XX0000000004 + r,kbd_layout,01 w,matrix_effect_wave w,matrix_effect_spectrum w,matrix_effect_starlight diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerdeathadderessentialwhiteedition.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerdeathadderessentialwhiteedition.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerdeathadderessentialwhiteedition.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerdeathadderessentialwhiteedition.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,19 @@ +[device] +dir_name = 0003:1532:0071.0001 +name = Razer DeathAdder Essential (White Edition) +event = Razer_Razer_DeathAdder_Essential_White_Edition-if01-event-kbd + Razer_Razer_DeathAdder_Essential_White_Edition-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000066 + rw,logo_led_brightness,0 + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + rw,scroll_led_brightness,0 + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_static + w,scroll_matrix_effect_none + rw,poll_rate,500 + rw,dpi,800:800 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlancehead.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlancehead.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlancehead.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlancehead.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,47 @@ +[device] +dir_name = 0003:1532:005A.0001 +name = Razer Lancehead (Wireless) +event = Razer_Lancehead-if01-event-kbd + Razer_Lancehead-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000072 + r,charge_level,255 + r,charge_status,1 + w,charge_low_threshold + w,device_idle_time + w,charge_effect + w,charge_colour + rw,logo_led_brightness,0 + rw,scroll_led_brightness,0 + rw,left_led_brightness,0 + rw,right_led_brightness,0 + w,logo_matrix_effect_wave + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + w,scroll_matrix_effect_wave + w,scroll_matrix_effect_spectrum + w,scroll_matrix_effect_reactive + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_static + w,scroll_matrix_effect_none + w,left_matrix_effect_wave + w,left_matrix_effect_spectrum + w,left_matrix_effect_reactive + w,left_matrix_effect_breath + w,left_matrix_effect_static + w,left_matrix_effect_none + w,right_matrix_effect_wave + w,right_matrix_effect_spectrum + w,right_matrix_effect_reactive + w,right_matrix_effect_breath + w,right_matrix_effect_static + w,right_matrix_effect_none + w,matrix_effect_custom + w,matrix_custom_frame + rw,poll_rate,500 + rw,dpi,800:800 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwired.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwired.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwired.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwired.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,45 @@ +[device] +dir_name = 0003:1532:0059.0001 +name = Razer Lancehead (Wired) +event = Razer_Lancehead-if01-event-kbd + Razer_Lancehead-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000071 + r,charge_level,255 + r,charge_status,1 + w,charge_low_threshold + w,device_idle_time + rw,logo_led_brightness,0 + rw,scroll_led_brightness,0 + rw,left_led_brightness,0 + rw,right_led_brightness,0 + w,logo_matrix_effect_wave + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + w,scroll_matrix_effect_wave + w,scroll_matrix_effect_spectrum + w,scroll_matrix_effect_reactive + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_static + w,scroll_matrix_effect_none + w,left_matrix_effect_wave + w,left_matrix_effect_spectrum + w,left_matrix_effect_reactive + w,left_matrix_effect_breath + w,left_matrix_effect_static + w,left_matrix_effect_none + w,right_matrix_effect_wave + w,right_matrix_effect_spectrum + w,right_matrix_effect_reactive + w,right_matrix_effect_breath + w,right_matrix_effect_static + w,right_matrix_effect_none + w,matrix_effect_custom + w,matrix_custom_frame + rw,poll_rate,500 + rw,dpi,800:800 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwirelessreceiver.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwirelessreceiver.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwirelessreceiver.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwirelessreceiver.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,47 @@ +[device] +dir_name = 0003:1532:006F.0001 +name = Razer Lancehead Wireless (Receiver) +event = Razer_Lancehead_Wireless-if01-event-kbd + Razer_Lancehead_Wireless-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000073 + r,charge_level,255 + r,charge_status,1 + w,charge_low_threshold + w,device_idle_time + w,charge_effect + w,charge_colour + rw,logo_led_brightness,0 + rw,scroll_led_brightness,0 + rw,left_led_brightness,0 + rw,right_led_brightness,0 + w,logo_matrix_effect_wave + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + w,scroll_matrix_effect_wave + w,scroll_matrix_effect_spectrum + w,scroll_matrix_effect_reactive + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_static + w,scroll_matrix_effect_none + w,left_matrix_effect_wave + w,left_matrix_effect_spectrum + w,left_matrix_effect_reactive + w,left_matrix_effect_breath + w,left_matrix_effect_static + w,left_matrix_effect_none + w,right_matrix_effect_wave + w,right_matrix_effect_spectrum + w,right_matrix_effect_reactive + w,right_matrix_effect_breath + w,right_matrix_effect_static + w,right_matrix_effect_none + w,matrix_effect_custom + w,matrix_custom_frame + rw,poll_rate,500 + rw,dpi,800:800 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwirelesswired.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwirelesswired.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwirelesswired.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerlanceheadwirelesswired.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,45 @@ +[device] +dir_name = 0003:1532:0070.0001 +name = Razer Lancehead Wireless (Wired) +event = Razer_Lancehead_Wireless-if01-event-kbd + Razer_Lancehead_Wireless-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000074 + r,charge_level,255 + r,charge_status,1 + w,charge_low_threshold + w,device_idle_time + rw,logo_led_brightness,0 + rw,scroll_led_brightness,0 + rw,left_led_brightness,0 + rw,right_led_brightness,0 + w,logo_matrix_effect_wave + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + w,scroll_matrix_effect_wave + w,scroll_matrix_effect_spectrum + w,scroll_matrix_effect_reactive + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_static + w,scroll_matrix_effect_none + w,left_matrix_effect_wave + w,left_matrix_effect_spectrum + w,left_matrix_effect_reactive + w,left_matrix_effect_breath + w,left_matrix_effect_static + w,left_matrix_effect_none + w,right_matrix_effect_wave + w,right_matrix_effect_spectrum + w,right_matrix_effect_reactive + w,right_matrix_effect_breath + w,right_matrix_effect_static + w,right_matrix_effect_none + w,matrix_effect_custom + w,matrix_custom_frame + rw,poll_rate,500 + rw,dpi,800:800 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambaelite.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambaelite.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambaelite.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambaelite.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,41 @@ +[device] +dir_name = 0000:1532:006C.0001 +name = Razer Mamba Elite +files = r,version,1.0.0 + r,device_type,%(name)s + rw,device_mode, + r,firmware_version,v1.1 + r,device_serial,XX0000000060 + rw,dpi,800:800 + rw,poll_rate,500 + rw,left_led_brightness,0 + w,left_matrix_effect_breath + w,left_matrix_effect_none + w,left_matrix_effect_reactive + w,left_matrix_effect_spectrum + w,left_matrix_effect_static + w,left_matrix_effect_wave + rw,logo_led_brightness,0 + w,logo_matrix_effect_breath + w,logo_matrix_effect_none + w,logo_matrix_effect_reactive + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_static + w,logo_matrix_effect_wave + w,matrix_brightness,0 + w,matrix_custom_frame + w,matrix_effect_custom + rw,right_led_brightness,0 + w,right_matrix_effect_breath + w,right_matrix_effect_none + w,right_matrix_effect_reactive + w,right_matrix_effect_spectrum + w,right_matrix_effect_static + w,right_matrix_effect_wave + rw,scroll_led_brightness,0 + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_none + w,scroll_matrix_effect_reactive + w,scroll_matrix_effect_spectrum + w,scroll_matrix_effect_static + w,scroll_matrix_effect_wave diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambawirelessreceiver.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambawirelessreceiver.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambawirelessreceiver.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambawirelessreceiver.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,32 @@ +[device] +dir_name = 0003:1532:0072.0001 +name = Razer Mamba Wireless (Receiver) +event = Razer_Mamba_Wireless_Receiver-if01-event-kbd + Razer_Mamba_Wireless_Receiver-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + rw,device_mode, + r,firmware_version,v1.1 + r,device_serial,XX0000000062 + rw,poll_rate,500 + rw,dpi,800:800 + r,charge_level,255 + r,charge_status,1 + w,charge_low_threshold + w,device_idle_time + w,charge_effect + w,charge_colour + rw,logo_led_brightness,0 + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + rw,scroll_led_brightness,0 + w,scroll_matrix_effect_spectrum + w,scroll_matrix_effect_reactive + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_static + w,scroll_matrix_effect_none + w,matrix_effect_custom + w,matrix_custom_frame diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambawirelesswired.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambawirelesswired.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambawirelesswired.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razermambawirelesswired.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,30 @@ +[device] +dir_name = 0003:1532:0073.0001 +name = Razer Mamba Wireless (Wired) +event = Razer_Mamba_Wireless_000000000000-if01-event-kbd + Razer_Mamba_Wireless_000000000000-if02-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + rw,device_mode, + r,firmware_version,v1.1 + r,device_serial,XX0000000063 + rw,poll_rate,500 + rw,dpi,800:800 + r,charge_level,255 + r,charge_status,1 + w,charge_low_threshold + w,device_idle_time + rw,logo_led_brightness,0 + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_reactive + w,logo_matrix_effect_breath + w,logo_matrix_effect_static + w,logo_matrix_effect_none + rw,scroll_led_brightness,0 + w,scroll_matrix_effect_spectrum + w,scroll_matrix_effect_reactive + w,scroll_matrix_effect_breath + w,scroll_matrix_effect_static + w,scroll_matrix_effect_none + w,matrix_effect_custom + w,matrix_custom_frame diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerornata.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerornata.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerornata.cfg 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerornata.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -7,6 +7,7 @@ r,device_type,%(name)s r,firmware_version,v1.0 r,device_serial,XX0000000023 + r,kbd_layout,01 w,matrix_effect_wave w,matrix_effect_starlight w,matrix_effect_none diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerornatachroma.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerornatachroma.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerornatachroma.cfg 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerornatachroma.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -7,6 +7,7 @@ r,device_type,%(name)s r,firmware_version,v1.0 r,device_serial,XX0000000022 + r,kbd_layout,01 w,matrix_effect_wave w,matrix_effect_spectrum w,matrix_effect_starlight diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razertartarusv2.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razertartarusv2.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razertartarusv2.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razertartarusv2.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,18 @@ +[device] +dir_name = 0003:1532:022B.0001 +name = Razer Tartarus v2 +event = Razer_Tartarus_V2-event-kbd + Razer_Tartarus_V2-if01-event-kbd +files = r,version,1.0.0 + r,device_type,%(name)s + r,firmware_version,v1.0 + r,device_serial,XX0000000061 + r,kbd_layout,01 + w,matrix_effect_spectrum + w,matrix_effect_none + w,matrix_effect_breath + w,matrix_effect_static + rw,profile_led_red,0 + rw,profile_led_green,0 + rw,profile_led_blue,0 + rw,matrix_brightness,0 diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviper.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviper.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviper.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviper.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,17 @@ +[device] +dir_name = 0000:1532:0078.0001 +name = Razer Viper +files = r,version,1.0.0 + r,device_type,%(name)s + rw,device_mode, + r,firmware_version,v1.1 + r,device_serial,XX0000000069 + rw,dpi,800:800 + rw,poll_rate,500 + rw,logo_led_brightness,0 + w,logo_matrix_effect_breath + w,logo_matrix_effect_none + w,logo_matrix_effect_reactive + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_static + w,logo_matrix_effect_wave diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviperultimatewired.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviperultimatewired.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviperultimatewired.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviperultimatewired.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,17 @@ +[device] +dir_name = 0000:1532:007A.0001 +name = Razer Viper Ultimate Wired +files = r,version,1.0.0 + r,device_type,%(name)s + rw,device_mode, + r,firmware_version,v1.1 + r,device_serial,XX0000000067 + rw,dpi,800:800 + rw,poll_rate,500 + rw,logo_led_brightness,0 + w,logo_matrix_effect_breath + w,logo_matrix_effect_none + w,logo_matrix_effect_reactive + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_static + w,logo_matrix_effect_wave diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviperultimatewireless.cfg openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviperultimatewireless.cfg --- openrazer-2.7.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviperultimatewireless.cfg 1970-01-01 00:00:00.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/openrazer/_fake_driver/razerviperultimatewireless.cfg 2020-05-02 11:24:51.000000000 +0000 @@ -0,0 +1,17 @@ +[device] +dir_name = 0000:1532:007B.0001 +name = Razer Viper Ultimate Wireless +files = r,version,1.0.0 + r,device_type,%(name)s + rw,device_mode, + r,firmware_version,v1.1 + r,device_serial,XX0000000068 + rw,dpi,800:800 + rw,poll_rate,500 + rw,logo_led_brightness,0 + w,logo_matrix_effect_breath + w,logo_matrix_effect_none + w,logo_matrix_effect_reactive + w,logo_matrix_effect_spectrum + w,logo_matrix_effect_static + w,logo_matrix_effect_wave diff -Nru openrazer-2.7.0~ubuntu19.10.1/pylib/setup.py openrazer-2.8.0~ubuntu19.10.1/pylib/setup.py --- openrazer-2.7.0~ubuntu19.10.1/pylib/setup.py 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/pylib/setup.py 2020-05-02 11:24:51.000000000 +0000 @@ -4,6 +4,6 @@ setup( name="openrazer", - version="2.7.0", + version="2.8.0", packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]) ) diff -Nru openrazer-2.7.0~ubuntu19.10.1/README.md openrazer-2.8.0~ubuntu19.10.1/README.md --- openrazer-2.7.0~ubuntu19.10.1/README.md 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/README.md 2020-05-02 11:24:51.000000000 +0000 @@ -34,24 +34,29 @@ | Razer Blade Stealth (Late 2016) | 1532:0220 | | Razer BlackWidow Chroma V2 | 1532:0221 | | Razer Blade (Late 2016) | 1532:0224 | -| Razer Cynosa Chroma | 1532:022A | -| Razer Blade Stealth (Mid 2017) | 1532:022D | | Razer Blade Pro (2017) | 1532:0225 | | Razer Huntsman Elite | 1532:0226 | | Razer Huntsman | 1532:0227 | | Razer BlackWidow Elite | 1532:0228 | +| Razer Cynosa Chroma | 1532:022A | +| Razer Blade Stealth (Mid 2017) | 1532:022D | | Razer Blade Pro FullHD (2017) | 1532:022F | | Razer Blade Stealth (Late 2017) | 1532:0232 | | Razer Blade 15 (2018) | 1532:0233 | +| Razer Blade Pro 17 (2019) | 1532:0234 | | Razer BlackWidow Lite (2018) | 1532:0235 | +| Razer BlackWidow Essential | 1532:0237 | | Razer Blade Stealth (2019) | 1532:0239 | | Razer Blade 15 (2019) Advanced | 1532:023A | | Razer Blade 15 (2018) Base Model | 1532:023B | | Razer Blade 15 (2018) Mercury | 1532:0240 | | Razer BlackWidow (2019) | 1532:0241 | +| Razer Huntsman Tournament Edition | 1532:0243 | | Razer Blade 15 (Mid 2019) Mercury | 1532:0245 | | Razer Blade 15 (Mid 2019) Base | 1532:0246 | | Razer Blade Stealth (Late 2019) | 1532:024A | +| Razer Blade Pro (Late 2019) | 1532:024C | +| Razer Blade 15 Studio Edition (2019) | 1532:024D | ### Mice | Device | USB VID:PID | @@ -81,12 +86,27 @@ | Razer Naga Hex V2 | 1532:0050 | | Razer Naga Chroma | 1532:0053 | | Razer DeathAdder 3500 | 1532:0054 | +| Razer Lancehead (Wired) | 1532:0059 | +| Razer Lancehead (Wireless) | 1532:005A | | Razer Abyssus V2 | 1532:005B | | Razer DeathAdder Elite | 1532:005C | | Razer Abyssus 2000 | 1532:005E | | Razer Lancehead Tournament Edition | 1532:0060 | +| Razer Basilisk | 1532:0064 | | Razer Naga Trinity | 1532:0067 | +| Razer Abyssus Elite (D.Va Edition) | 1532:006A | +| Razer Abyssus Essential | 1532:006B | +| Razer Mamba Elite (Wired) | 1532:006C | | Razer DeathAdder Essential | 1532:006E | +| Razer Lancehead Wireless (Receiver) | 1532:006F | +| Razer Lancehead Wireless (Wired) | 1532:0070 | +| Razer DeathAdder Essential (White Edition) | 1532:0071 | +| Razer Mamba Wireless (Receiver) | 1532:0072 | +| Razer Mamba Wireless (Wired) | 1532:0073 | +| Razer Viper | 1532:0078 | +| Razer Viper Ultimate (Wired) | 1532:007A | +| Razer Viper Ultimate (Wireless) | 1532:007B | +| Razer DeathAdder V2 | 1532:0084 | ### Mousemats | Device | USB VID:PID | @@ -113,7 +133,12 @@ | Razer Orbweaver Chroma | 1532:0207 | | Razer Tartarus Chroma | 1532:0208 | | Razer Core | 1532:0215 | +| Razer Tartarus V2 | 1532:022B | +| Razer Nommo Chroma | 1532:0517 | +| Razer Nommo Pro | 1532:0518 | | Razer Chroma Mug Holder | 1532:0F07 | +| Razer Base Station Chroma | 1532:0F08 | +| Razer Chroma Hardware Development Kit (HDK) | 1532:0F09 | #### Determining the Device ID Razer devices use a USB VID (Vendor ID) of `1532`. You can identify the USB PID (Product ID) by typing: diff -Nru openrazer-2.7.0~ubuntu19.10.1/scripts/build_debs.sh openrazer-2.8.0~ubuntu19.10.1/scripts/build_debs.sh --- openrazer-2.7.0~ubuntu19.10.1/scripts/build_debs.sh 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/scripts/build_debs.sh 2020-05-02 11:24:51.000000000 +0000 @@ -6,24 +6,24 @@ NC='\033[0m' TEMP_DIR=$(mktemp --suffix="_deb_build_tmp" -d) -ROOT=$(git rev-parse --show-toplevel) +ROOT="$(git rev-parse --show-toplevel)" echo -e "${BLUE}Temp DIR: ${TEMP_DIR}${NC}" echo -e "${BLUE}Copying source to temporary build directory${NC}" # Go to root of directory -cd ${ROOT} +cd "${ROOT}" # Extract version from changelog -VERSION=$(cat ${ROOT}/debian/changelog | grep -m 1 -oP '(?<=openrazer \()[^\-\)]+') +VERSION=$(cat "${ROOT}/debian/changelog" | grep -m 1 -oP '(?<=openrazer \()[^\-\)]+') ORIG_TAR="openrazer_${VERSION}.orig.tar.gz" # Add a -0 revision to changelog for building -sed -i 's|'$VERSION')|'$VERSION'-0)|' ${ROOT}/debian/changelog +sed -i 's|'$VERSION')|'$VERSION'-0)|' "${ROOT}/debian/changelog" #git archive ${CURRENT_BRANCH} | gzip > ${TEMP_DIR}/${ORIG_TAR} -tar --exclude-vcs --exclude-vcs-ignores -zcf ${TEMP_DIR}/${ORIG_TAR} -C ${ROOT} . +tar --exclude-vcs --exclude-vcs-ignores -zcf ${TEMP_DIR}/${ORIG_TAR} -C "${ROOT}" . cd ${TEMP_DIR} @@ -34,17 +34,17 @@ dpkg-buildpackage -us -uc > ${TEMP_DIR}/build.log 2>&1 result_code=$? -cd ${CWD} +cd "${CWD}" if [ $result_code = 0 ]; then echo -e "${GREEN}Deb packages build successfully. Copied to ./dist/${NC}" - mkdir -p ${ROOT}/dist/ - cp ${TEMP_DIR}/*.deb ${ROOT}/dist/ + mkdir -p "${ROOT}/dist/" + cp ${TEMP_DIR}/*.deb "${ROOT}/dist/" else echo -e "${RED}Failed to generate deb files. Check ${TEMP_DIR}/build.log for more details${NC}" fi # Add a -0 revision to changelog for building -sed -i 's|'$VERSION'-0)|'$VERSION')|' ${ROOT}/debian/changelog +sed -i 's|'$VERSION'-0)|'$VERSION')|' "${ROOT}/debian/changelog" diff -Nru openrazer-2.7.0~ubuntu19.10.1/scripts/build_source_debs.sh openrazer-2.8.0~ubuntu19.10.1/scripts/build_source_debs.sh --- openrazer-2.7.0~ubuntu19.10.1/scripts/build_source_debs.sh 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/scripts/build_source_debs.sh 2020-05-02 11:24:51.000000000 +0000 @@ -13,14 +13,14 @@ echo -e "${BLUE}Copying source to temporary build directory${NC}" # Go to root of directory -cd ${ROOT} +cd "${ROOT}" # Extract version from changelog -VERSION=$(cat ${ROOT}/debian/changelog | grep -m 1 -oP '(?<=openrazer \()[^\-\)]+') +VERSION=$(cat "${ROOT}/debian/changelog" | grep -m 1 -oP '(?<=openrazer \()[^\-\)]+') ORIG_TAR="openrazer_${VERSION}.orig.tar.gz" #git archive ${CURRENT_BRANCH} | gzip > ${TEMP_DIR}/${ORIG_TAR} -tar --exclude-vcs --exclude-vcs-ignores -zcf ${TEMP_DIR}/${ORIG_TAR} -C ${ROOT} . +tar --exclude-vcs --exclude-vcs-ignores -zcf ${TEMP_DIR}/${ORIG_TAR} -C "${ROOT}" . cd ${TEMP_DIR} @@ -32,7 +32,7 @@ result_code=$? -cd ${CWD} +cd "${CWD}" if [ $result_code = 0 ]; then echo -e "${GREEN}Source Deb packages build successfully. Running pbuilder${NC}" diff -Nru openrazer-2.7.0~ubuntu19.10.1/scripts/ci/check-astyle-formatting.sh openrazer-2.8.0~ubuntu19.10.1/scripts/ci/check-astyle-formatting.sh --- openrazer-2.7.0~ubuntu19.10.1/scripts/ci/check-astyle-formatting.sh 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/scripts/ci/check-astyle-formatting.sh 2020-05-02 11:24:51.000000000 +0000 @@ -27,8 +27,7 @@ if [ $RETURN -eq 1 ]; then echo "" >&2 - echo "Make sure you have run astyle with the following options:" >&2 - echo $OPTIONS >&2 + echo "You can run ./scripts/format_source.sh to automatically format those files." >&2 fi exit $RETURN diff -Nru openrazer-2.7.0~ubuntu19.10.1/scripts/ci/check-autopep8-formatting.sh openrazer-2.8.0~ubuntu19.10.1/scripts/ci/check-autopep8-formatting.sh --- openrazer-2.7.0~ubuntu19.10.1/scripts/ci/check-autopep8-formatting.sh 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/scripts/ci/check-autopep8-formatting.sh 2020-05-02 11:24:51.000000000 +0000 @@ -20,8 +20,7 @@ if [ $RETURN -eq 1 ]; then echo "" >&2 - echo "Make sure you have run autopep8 with the following options:" >&2 - echo $OPTIONS >&2 + echo "You can run ./scripts/format_source.sh to automatically format those files." >&2 fi exit $RETURN diff -Nru openrazer-2.7.0~ubuntu19.10.1/scripts/ci/test-duplicate-fake-driver-serials.sh openrazer-2.8.0~ubuntu19.10.1/scripts/ci/test-duplicate-fake-driver-serials.sh --- openrazer-2.7.0~ubuntu19.10.1/scripts/ci/test-duplicate-fake-driver-serials.sh 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/scripts/ci/test-duplicate-fake-driver-serials.sh 2020-05-02 11:24:51.000000000 +0000 @@ -19,6 +19,7 @@ echo -e "Duplicate: ${GREEN}$line${NC} in files:" grep -rl "$line" $searchfolder done <<< "$duplicates" + echo "If you need a new fake serial number, you can use ./scripts/get_next_fake_driver_serial.sh" exit 1 fi diff -Nru openrazer-2.7.0~ubuntu19.10.1/scripts/wireshark/razer.lua openrazer-2.8.0~ubuntu19.10.1/scripts/wireshark/razer.lua --- openrazer-2.7.0~ubuntu19.10.1/scripts/wireshark/razer.lua 2020-01-11 10:33:51.000000000 +0000 +++ openrazer-2.8.0~ubuntu19.10.1/scripts/wireshark/razer.lua 2020-05-02 11:24:51.000000000 +0000 @@ -16,20 +16,20 @@ } local f = razer_proto.fields -f.f_reqtype = ProtoField.uint8("razer.request_type", "Request Type", base.HEX, req_types) -- 1b +f.f_status = ProtoField.uint8("razer.status", "Request Type", base.HEX, req_types) -- 1b f.f_id = ProtoField.uint8("razer.id", "ID", base.HEX) -- 1b Possibly I2C range -f.f_reserved1 = ProtoField.bytes("razer.reserved1", "Reserved 1", base.HEX) -- 3b +f.f_remaining_packets = ProtoField.uint16("razer.remaining_packets", "Remaining Packets", base.DEC) -- 2b +f.f_protocol_type = ProtoField.uint8("razer.protocol_type", "Protocol Type", base.HEX) -- 1b f.f_number_parameter_bytes = ProtoField.uint8("razer.num_params", "Number of parameters", base.HEX) -- 1b Number of bytes after command byte -f.f_reserved2 = ProtoField.uint8("razer.reserver2", "Reserved 2", base.HEX) -- 1b Possibly I2C range also -f.f_command = ProtoField.uint8("razer.command", "Command", base.HEX) -- 1b Command byte -f.f_sub_command = ProtoField.uint8("razer.sub_command", "Sub Command", base.HEX) -- 1b Sub Command byte -f.f_command_params = ProtoField.bytes("razer.command_params", "Command parameters", base.HEX) -- 79b Params (has been known to be 80 including sub_cmd e.g. razermouse) +f.f_command_class = ProtoField.uint8("razer.command_class", "Command Class", base.HEX) -- 1b Command byte +f.f_command_id = ProtoField.uint8("razer.command_id", "Command ID", base.HEX) -- 1b Sub Command byte +f.f_command_params = ProtoField.bytes("razer.command_params", "Command parameters", base.SPACE) -- 80b Params f.f_crc = ProtoField.uint8("razer.crc", "CRC", base.HEX) -- 1b CRC checksum f.f_end_marker = ProtoField.uint8("razer.end", "End", base.HEX) -- 1b End marker -local f_usb_ep_num = Field.new("usb.endpoint_number.endpoint") -- should be 0 -local f_usb_ep_dir = Field.new("usb.endpoint_number.direction") -- 1 IN, 0 OUT +local f_usb_ep_num = Field.new("usb.endpoint_address.number") -- should be 0 +local f_usb_ep_dir = Field.new("usb.endpoint_address.direction") -- 1 IN, 0 OUT local f_data_len = Field.new("usb.data_len") -- should be 90 local f_urb_len = Field.new("usb.urb_len") -- should be 90 @@ -45,13 +45,11 @@ WRITEMEM32 = 5, TRACECOUNT = 6 } - + local expected = responses.NOTSET function razer_proto.dissector(buffer, pinfo, tree) - - --[[This was very helpful for working out the field names I could use with Field.new() local fields = { all_field_infos() } for ix, finfo in ipairs(fields) do @@ -67,48 +65,44 @@ if (data_length.value == 90 and urb_length.value == 90) then pinfo.cols["protocol"] = "Razer" - local offset = 0 + -- seek to the last 90 bytes + local offset = buffer:len() - 90 local t_razer = tree:add(razer_proto, buffer()) - + if (data_direction.value == 0) then pinfo.cols["info"]:append("Request") else pinfo.cols["info"]:append("Response") end - + -- Add REQ,RES byte - t_razer:add(f.f_reqtype, buffer(offset, 1)) + t_razer:add(f.f_status, buffer(offset, 1)) offset = offset + 1 -- Add ID t_razer:add(f.f_id, buffer(offset, 1)) offset = offset + 1 - -- Add Reserved 1 - t_razer:add(f.f_reserved1, buffer(offset, 3)) - offset = offset + 3 + -- Add Remaining packets + t_razer:add(f.f_remaining_packets, buffer(offset, 2)) + offset = offset + 2 + -- Add Protocol Type + t_razer:add(f.f_protocol_type, buffer(offset, 1)) + offset = offset + 1 -- Add Number of parameters bytes local num_params = buffer(offset, 1):le_uint() t_razer:add(f.f_number_parameter_bytes, buffer(offset, 1)) -- specifid buffer here instead of num params so it highlights in wireshark offset = offset + 1 - -- Add Reserved 2 - t_razer:add(f.f_reserved2, buffer(offset, 1)) - offset = offset + 1 - - -- Add Command - t_razer:add(f.f_command, buffer(offset, 1)) + -- Add Command class + t_razer:add(f.f_command_class, buffer(offset, 1)) offset = offset + 1 - - -- Add sub command - t_razer:add(f.f_sub_command, buffer(offset, 1)) + -- Add Command ID + t_razer:add(f.f_command_id, buffer(offset, 1)) offset = offset + 1 - -- Add command params - t_razer:add(f.f_command_params, buffer(offset, num_params - 1)) - offset = offset + 79 -- skip to the end - + t_razer:add(f.f_command_params, buffer(offset, num_params)) + offset = offset + 80 -- skip to the end -- Add CRC t_razer:add(f.f_crc, buffer(offset, 1)) offset = offset + 1 - -- Add end t_razer:add(f.f_end_marker, buffer(offset, 1)) offset = offset + 1