From 80b673f602728e97bbc567d201da7dd93cfeecf5 Mon Sep 17 00:00:00 2001 From: Jari Kalinainen Date: Thu, 12 Aug 2021 20:45:32 +0300 Subject: add support for naga pro --- src/lib/razerdevice.c | 2 ++ src/lib/razermouse_driver.c | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'src/lib') diff --git a/src/lib/razerdevice.c b/src/lib/razerdevice.c index e77b5d1..8c4df51 100755 --- a/src/lib/razerdevice.c +++ b/src/lib/razerdevice.c @@ -108,6 +108,8 @@ bool is_mouse(IOUSBDeviceInterface **usb_dev) case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE: case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE_RECEIVER: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_ABYSSUS_ELITE_DVA_EDITION: case USB_DEVICE_ID_RAZER_ABYSSUS_ESSENTIAL: case USB_DEVICE_ID_RAZER_MAMBA_ELITE: diff --git a/src/lib/razermouse_driver.c b/src/lib/razermouse_driver.c index 68002d9..80a1bb7 100644 --- a/src/lib/razermouse_driver.c +++ b/src/lib/razermouse_driver.c @@ -56,6 +56,8 @@ static int razer_get_report(IOUSBDeviceInterface **usb_dev, struct razer_report case USB_DEVICE_ID_RAZER_LANCEHEAD_WIRELESS: case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_RECEIVER: case USB_DEVICE_ID_RAZER_MAMBA_WIRELESS_WIRED: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE_RECEIVER: return razer_get_usb_response(usb_dev, 0x00, request_report, 0x00, response_report, RAZER_NEW_MOUSE_RECEIVER_WAIT_MIN_US); break; @@ -173,6 +175,8 @@ ssize_t razer_attr_write_side_mode_static(IOUSBDeviceInterface **usb_dev, const case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: case USB_DEVICE_ID_RAZER_BASILISK: case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE: @@ -233,6 +237,8 @@ ssize_t razer_attr_write_side_mode_static_no_store(IOUSBDeviceInterface **usb_de case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: case USB_DEVICE_ID_RAZER_BASILISK: case USB_DEVICE_ID_RAZER_BASILISK_ULTIMATE: @@ -290,6 +296,8 @@ ssize_t razer_attr_write_side_mode_spectrum(IOUSBDeviceInterface **usb_dev, cons case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -360,6 +368,8 @@ ssize_t razer_attr_write_side_mode_breath(IOUSBDeviceInterface **usb_dev, const case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -429,6 +439,8 @@ ssize_t razer_attr_write_side_mode_none(IOUSBDeviceInterface **usb_dev, const ch case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -589,6 +601,8 @@ ssize_t razer_attr_write_logo_mode_static(IOUSBDeviceInterface **usb_dev, const case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -658,6 +672,8 @@ ssize_t razer_attr_write_scroll_mode_static(IOUSBDeviceInterface **usb_dev, cons case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -750,6 +766,8 @@ ssize_t razer_attr_write_logo_mode_static_no_store(IOUSBDeviceInterface **usb_de case USB_DEVICE_ID_RAZER_VIPER_8KHZ: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -822,6 +840,8 @@ ssize_t razer_attr_write_scroll_mode_static_no_store(IOUSBDeviceInterface **usb_ case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -908,6 +928,8 @@ ssize_t razer_attr_write_logo_mode_spectrum(IOUSBDeviceInterface **usb_dev, cons case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -967,6 +989,8 @@ ssize_t razer_attr_write_scroll_mode_spectrum(IOUSBDeviceInterface **usb_dev, co case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1062,6 +1086,8 @@ ssize_t razer_attr_write_logo_mode_breath(IOUSBDeviceInterface **usb_dev, const case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1150,6 +1176,8 @@ ssize_t razer_attr_write_scroll_mode_breath(IOUSBDeviceInterface **usb_dev, cons case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1243,6 +1271,8 @@ ssize_t razer_attr_write_logo_mode_none(IOUSBDeviceInterface **usb_dev, const ch case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1305,6 +1335,8 @@ ssize_t razer_attr_write_scroll_mode_none(IOUSBDeviceInterface **usb_dev, const case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1434,6 +1466,8 @@ ssize_t razer_attr_write_logo_mode_reactive(IOUSBDeviceInterface **usb_dev, cons case USB_DEVICE_ID_RAZER_VIPER_MINI: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRED: case USB_DEVICE_ID_RAZER_NAGA_TRINITY: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRELESS: case USB_DEVICE_ID_RAZER_DEATHADDER_V2_PRO_WIRED: case USB_DEVICE_ID_RAZER_VIPER_ULTIMATE_WIRELESS: @@ -1826,6 +1860,8 @@ void razer_attr_write_matrix_brightness(IOUSBDeviceInterface **usb_dev, unsigned break; case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_brightness(VARSTORE, 0x00, brightness); report.transaction_id.id = 0x1F; @@ -1875,6 +1911,8 @@ ushort razer_attr_read_matrix_brightness(IOUSBDeviceInterface **usb_dev) break; case USB_DEVICE_ID_RAZER_NAGA_LEFT_HANDED_2020: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRELESS: + case USB_DEVICE_ID_RAZER_NAGA_PRO_WIRED: case USB_DEVICE_ID_RAZER_MAMBA_ELITE: report = razer_chroma_extended_matrix_get_brightness(VARSTORE, 0x00); report.transaction_id.id = 0x1F; -- cgit v1.2.3