Skip to content

Commit

Permalink
Added firmware v1.30 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ccMSC committed Jul 30, 2015
1 parent 81e3044 commit 1b0a9f7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
21 changes: 10 additions & 11 deletions FIRMWARE
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@ Hash: SHA256

!BEGIN FW ENTRIES

# Vendor Model FW URL Min.ckb File Name SHA256
Corsair K65RGB 1.12 http://www3.corsair.com/software/HID/K65RGB.zip 0.0.1 K65RGB_app112.bin 4d730a6c6716c59e2c0a73a1afeeef8ee6a5384b07d7baace4e4c333b6c956c6
Corsair K70RGB 1.20 http://www3.corsair.com/software/HID/K70RGB.zip 0.1.2 K70_app120.bin 9748efd89b878e050e121b08c780e81bca5922a8eb0f7e5288f486850493d60e
Corsair K95RGB 1.20 http://www3.corsair.com/software/HID/K95RGB.zip 0.1.2 K95_app120.bin 8a46a97469abe8cee2ae07a463d152686afa0d0f628023694d739a6491d2fd64
# Vendor Model FW URL Min.ckb File Name SHA256
Corsair K70RGB 1.20 http://www3.corsair.com/software/HID/K70RGB.zip 0.1.6 K70RGB_app130.bin e4ec7852d0457e3eeea794f2a278228c3eb3e26de03973960afa453698968cf5
Corsair K95RGB 1.20 http://www3.corsair.com/software/HID/K95RGB.zip 0.1.6 K95RGB_app130.bin 192d3ca125cb560dce2a764b9e29491875d5073c34b0845de48e805a27de3699

!END FW ENTRIES

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJVQEoDAAoJEBXtkzSNyNMJB9YH/0/ryPtJ1j4oMSjOf1noIS58
nYf9dUzkKImCSW4lY87zhKhVkvrePIBEaPHdjX52u/QfPyj6kfbSGrre8JrybcLf
+moC1WGdiZuKcVdF1+s6hkZfn1bK/o4wfwlGPckQYV7l5tA9s5mLMguDoqpEghQ+
T0lCMCLbnkwx1S4MXZfT1KT7SKItdh/k/VMlmJ6aGVATNhAbePpmpP/BtXyXud6v
PAbZqwoRrue4aYujiPuJ65nG72RTnDFdGLFSMGSDNaENw5+9yQIyfTQ4K4aSiDqk
6esMKdHYgVvCbcmUBJ3HdsxiF+lnMb6/wZzefZkEcUm+H35H5EyfdxKOpU/FP1U=
=1GyY
iQEcBAEBCAAGBQJVuXuoAAoJEBXtkzSNyNMJm+wIAIGk24ITzfqpb1lVrXdujOGs
Uy5j7hqroB6lCLDiOP+Fug3pKPB8gqoiYpK4qzL8EBtAGpHNUv/oqa7JfMhEZ5pJ
j9rxavCF8RBmATypG+F3dbTl4VsU8H+aiI8prVqiioRBcbpT9p0YvsBgWln5wzbm
Aixshi9luXPmgaid/+P1yKq5H+W23CoZOCBPIMNs48Cej+hm8cm9hO5REmh1FiL7
jmP8+Dnqq8dDtPVPlH1w5p8U6KICz816BCVzHXmVgpasFQb2TFVnoYEOBq2RK3YA
z8I9sRGjB6rlurmwScRfs8SKbClyobatgTJ2Yf4LvTBFA6XVvSTAnqQhwsjtGrw=
=tOM2
-----END PGP SIGNATURE-----
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
beta-v0.1.5
beta-v0.1.6
26 changes: 18 additions & 8 deletions src/ckb-daemon/usb_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@ static char kbsyspath[DEV_MAX][FILENAME_MAX];
int os_usbsend(usbdevice* kb, const uchar* out_msg, int is_recv, const char* file, int line){
int res;
if(kb->fwversion >= 0x120){
#if 0 // Change to #if 1 if using valgrind (4 padding bytes between timeout/data; valgrind thinks they're uninit'd and complains)
struct usbdevfs_bulktransfer transfer;
memset(&transfer, 0, sizeof(transfer));
transfer.ep = 3; transfer.len = MSG_SIZE; transfer.timeout = 5000; transfer.data = (void*)out_msg;
#else
struct usbdevfs_bulktransfer transfer = { 3, MSG_SIZE, 5000, (void*)out_msg };
#endif
transfer.ep = (kb->fwversion >= 0x130) ? 4 : 3;
transfer.len = MSG_SIZE;
transfer.timeout = 5000;
transfer.data = (void*)out_msg;
res = ioctl(kb->handle, USBDEVFS_BULK, &transfer);
} else {
struct usbdevfs_ctrltransfer transfer = { 0x21, 0x09, 0x0300, 0x03, MSG_SIZE, 5000, (void*)out_msg };
Expand All @@ -37,8 +36,19 @@ int os_usbsend(usbdevice* kb, const uchar* out_msg, int is_recv, const char* fil

int os_usbrecv(usbdevice* kb, uchar* in_msg, const char* file, int line){
DELAY_MEDIUM(kb);
struct usbdevfs_ctrltransfer transfer = { 0xa1, 0x01, 0x0300, 0x03, MSG_SIZE, 5000, in_msg };
int res = ioctl(kb->handle, USBDEVFS_CONTROL, &transfer);
int res;
if(kb->fwversion >= 0x130){
struct usbdevfs_bulktransfer transfer;
memset(&transfer, 0, sizeof(transfer));
transfer.ep = 0x84;
transfer.len = MSG_SIZE;
transfer.timeout = 5000;
transfer.data = in_msg;
res = ioctl(kb->handle, USBDEVFS_BULK, &transfer);
} else {
struct usbdevfs_ctrltransfer transfer = { 0xa1, 0x01, 0x0300, 0x03, MSG_SIZE, 5000, in_msg };
res = ioctl(kb->handle, USBDEVFS_CONTROL, &transfer);
}
if(res <= 0){
if(res == -1 && errno == ETIMEDOUT){
ckb_warn_fn("%s (continuing)\n", file, line, strerror(errno));
Expand Down Expand Up @@ -71,7 +81,7 @@ void* os_inputmain(void* context){
ckb_info("Starting input thread for %s%d\n", devpath, index);

// Monitor input transfers on all endpoints
int urbcount = IS_RGB(vendor, product) ? 4 : 3;
int urbcount = 3;
struct usbdevfs_urb urbs[urbcount];
memset(urbs, 0, sizeof(urbs));
urbs[0].buffer_length = 8;
Expand Down

0 comments on commit 1b0a9f7

Please sign in to comment.