Bug#945181: ITA: libg15render -- Library for interfacing with the Logitech G15 keyboards

2019-11-20 Thread Alexander Ponyatykh
Package: wnpp
Severity: normal

I'm the new maintainer of the g15daemon package (bug#928158). It was
reintroduced after deletion along with all related packages at the request of
the previous maintainer (bug#914888). libg15render is the only package that
has not been removed.
Since Giacomo Catenazzi no longer maintains this package, I'd like to adopt it
and maintain togeather with other packages related to g15daemon. I tried to
contact him and ask to fill a RFA report, but I didn't receive a response. So
I've filled out this ITA request without a preliminary RFA.

I've prepared a new release on Salsa, which updates packaging to the latest
version of the policy:
https://salsa.debian.org/lazyranma-guest/libg15render



Bug#928159: ITP: libg15 -- Library for interfacing with the Logitech keyboards

2019-04-28 Thread Alexander Ponyatykh
Package: wnpp
Severity: wishlist
Owner: Alexander Ponyatykh 

* Package name: libg15
  Version : 1.2.7
  Upstream Authors: Philip Lawatsch , Alex Ibrado 
, Anthony J. Mirabella , Mike Lampard 

* URL : https://sourceforge.net/projects/g15tools/
* License : GPL v2 or later
  Programming Lang: C
  Description : Library for interfacing with the Logitech keyboards

I'd like to reintroduce g15daemon package, and this library is it's dependency. 
For more inforamtion please see bug#928158.



Bug#928158: ITP: g15daemon -- provides multiple virtual screens for the LCD on the Logitech G11 and G15 keyboards.

2019-04-28 Thread Alexander Ponyatykh
Package: wnpp
Severity: wishlist
Owner: Alexander Ponyatykh 

* Package name: g15daemon
  Version : 1.9.5.3
  Upstream Authors: Mike Lampard , Sven Ludwig, James 
Green, Philip Lawatsch 
* URL : https://sourceforge.net/p/g15daemon/code/HEAD/tree/trunk/
* License : GPL v2 or later
  Programming Lang: C
  Description : G15daemon provides multiple virtual screens for the LCD on 
the Logitech G11 and G15 keyboards.

I would like to reintroduce this package. It was deleted at the request of the 
previous maintainer because of the abandoned upstream. While it is true that it 
is no longer being developed, this is not a problem, because it is completed, 
works as intended almost flawlessly, and most bugs have been already fixed by 
the community.

G15daemon is the only way to use LCD of Logitech keyboards, there are no 
alternatives.

Here is my Ubuntu PPA with the latest version of the package, cleaned up and 
converted to the 3.0 format:
https://launchpad.net/~lazyranma/+archive/ubuntu/g15daemon

I will need a sponsor to review and upload new packages.



Bug#785578: libusb occasionally hangs after suspend/resume

2015-05-17 Thread Alexander Ponyatykh
   }
+
+close(fd);
+  }
+
+  /*
+   * There should be one device left in the devices list and that should be
+   * the root device
+   */
+  for (i = 0; i < sizeof(devices) / sizeof(devices[0]); i++) {
+if (devices[i])
+  bus->root_dev = devices[i];
+  }
+
+  return 0;
+}
+
+static int check_usb_vfs(const char *dirname)
+{
+  DIR *dir;
+  struct dirent *entry;
+  int found = 0;
+
+  dir = opendir(dirname);
+  if (!dir)
+return 0;
+
+  while ((entry = readdir(dir)) != NULL) {
+/* Skip anything starting with a . */
+if (entry->d_name[0] == '.')
+  continue;
+
+/* We assume if we find any files that it must be the right place */
+found = 1;
+break;
+  }
+
+  closedir(dir);
+
+  return found;
+}
+
+void usb_os_init(void)
+{
+  /* Find the path to the virtual filesystem */
+  if (getenv("USB_DEVFS_PATH")) {
+if (check_usb_vfs(getenv("USB_DEVFS_PATH"))) {
+  strncpy(usb_path, getenv("USB_DEVFS_PATH"), sizeof(usb_path) - 1);
+  usb_path[sizeof(usb_path) - 1] = 0;
+} else if (usb_debug)
+  fprintf(stderr, "usb_os_init: couldn't find USB VFS in USB_DEVFS_PATH\n");
+  }
+
+  if (!usb_path[0]) {
+if (check_usb_vfs("/dev/bus/usb")) {
+  strncpy(usb_path, "/dev/bus/usb", sizeof(usb_path) - 1);
+  usb_path[sizeof(usb_path) - 1] = 0;
+} else if (check_usb_vfs("/proc/bus/usb")) {
+  strncpy(usb_path, "/proc/bus/usb", sizeof(usb_path) - 1);
+  usb_path[sizeof(usb_path) - 1] = 0;
+} else
+  usb_path[0] = 0;	/* No path, no USB support */
+  }
+
+  if (usb_debug) {
+if (usb_path[0])
+  fprintf(stderr, "usb_os_init: Found USB VFS at %s\n", usb_path);
+else
+  fprintf(stderr, "usb_os_init: No USB VFS found, is it mounted?\n");
+  }
+}
+
+int usb_resetep(usb_dev_handle *dev, unsigned int ep)
+{
+  int ret;
+
+  ret = ioctl(dev->fd, IOCTL_USB_RESETEP, &ep);
+  if (ret)
+USB_ERROR_STR(-errno, "could not reset ep %d: %s", ep,
+	strerror(errno));
+
+  return 0;
+}
+
+int usb_clear_halt(usb_dev_handle *dev, unsigned int ep)
+{
+  int ret;
+
+  ret = ioctl(dev->fd, IOCTL_USB_CLEAR_HALT, &ep);
+  if (ret)
+USB_ERROR_STR(-errno, "could not clear/halt ep %d: %s", ep,
+	strerror(errno));
+
+  return 0;
+}
+
+int usb_reset(usb_dev_handle *dev)
+{
+  int ret;
+
+  ret = ioctl(dev->fd, IOCTL_USB_RESET, NULL);
+  if (ret)
+ USB_ERROR_STR(-errno, "could not reset: %s", strerror(errno));
+
+  return 0;
+}
+
+int usb_get_driver_np(usb_dev_handle *dev, int interface, char *name,
+	unsigned int namelen)
+{
+  struct usb_getdriver getdrv;
+  int ret;
+
+  getdrv.interface = interface;
+  ret = ioctl(dev->fd, IOCTL_USB_GETDRIVER, &getdrv);
+  if (ret)
+USB_ERROR_STR(-errno, "could not get bound driver: %s", strerror(errno));
+
+  strncpy(name, getdrv.driver, namelen - 1);
+  name[namelen - 1] = 0;
+
+  return 0;
+}
+
+int usb_detach_kernel_driver_np(usb_dev_handle *dev, int interface)
+{
+  struct usb_ioctl command;
+  int ret;
+
+  command.ifno = interface;
+  command.ioctl_code = IOCTL_USB_DISCONNECT;
+  command.data = NULL;
+
+  ret = ioctl(dev->fd, IOCTL_USB_IOCTL, &command);
+  if (ret)
+USB_ERROR_STR(-errno, "could not detach kernel driver from interface %d: %s",
+interface, strerror(errno));
+
+  return 0;
+}
+

=== modified file '.pc/applied-patches'
--- .pc/applied-patches	2014-07-03 20:17:03 +
+++ .pc/applied-patches	2015-05-17 16:46:05 +
@@ -10,4 +10,5 @@
 09_dummy.diff
 10_hurd.diff
 11_transfer_timeout.diff
+12_hang_after_resume.diff
 91_ac_prog_cxx.diff

=== modified file 'debian/changelog'

=== added file 'debian/patches/12_hang_after_resume.diff'
--- debian/patches/12_hang_after_resume.diff	1970-01-01 00:00:00 +
+++ debian/patches/12_hang_after_resume.diff	2015-05-17 16:45:30 +
@@ -0,0 +1,47 @@
+Description: Fix occasional hang after suspend/resume.
+ After suspend/resume linux kernel may loose our requests, and 
+ usb_urb_transfer() will wait forever for lost requests to complete. With this
+ patch lost request are properly handled.
+ Also fixes race condition leading to stack corruption.
+Author: Alexander Ponyatykh 
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libusb/+bug/1455924
+Forwarded: no
+Last-Update: 2015-05-17
+===
+--- a/linux.c
 b/linux.c
+@@ -166,7 +166,7 @@
+   int bytesdone = 0, requested;
+   struct timeval tv, tv_ref, tv_now;
+   struct usb_urb *context;
+-  int ret, waiting;
++  int ret, waiting, our_urb_dequeued;  
+ 
+   /*
+* HACK: The use of urb.usercontext is a hack to get threaded applications
+@@ -277,7 +277,24 @@
+  * then we need to reap it or else the next time we call this function,
+  * we'll get the previous com