lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3BF066A8BAB61C43B779966CEE6D7FA09B6CC9DB38@e6.universe.dart.spb>
Date:	Tue, 8 Feb 2011 16:54:59 +0300
From:	Anton Chikin <Anton.Chikin@...aart.com>
To:	Henrik Rydberg <rydberg@...omail.se>,
	Anton Chikin <kverlin@...il.com>
CC:	"jkosina@...e.cz" <jkosina@...e.cz>,
	"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Gregory Burmistrov <grig@...aart.com>
Subject: RE: [PATCH] HID: added new driver for Panasonic Elite Panaboard
 UB-T780 and UB-T880


Hi Henrik,

Few words about usbhid_submit_report() usage, which seems to be wrong:

> +static int ubt880_switch_mode(struct hid_device *hid, unsigned char 
> +mode) {
> +	int rc = 0;
> +
> +	struct hid_report *report = NULL;
> +	struct hid_report *report_cur = NULL;
> +	__s32 *val = NULL;
> +	/** Packet forming */
> +
> +	UBT_DUMMY_DEBUG
> +
> +	list_for_each_entry(report, &hid->report_enum[HID_FEATURE_REPORT].report_list, list)
> +	{
> +		if (hid->report_enum[HID_FEATURE_REPORT].numbered) {
> +			report_cur = report;
> +		}
> +	}
> +
> +	if (report_cur == NULL) {
> +		if (ubt_debug)
> +			printk(KERN_DEBUG "ubt880 : switch mode : report_cur = 0");
> +		return rc;
> +	}
> +
> +	if (ubt_debug)
> +		printk(KERN_DEBUG "ubt880: switch mode: reportid = %d", report_cur->id);
> +	val = report_cur->field[0]->value;
> +
> +	switch (mode) {
> +	case MODE_MOUSE: {
> +		mode = 0x0;
> +		break;
> +	}
> +	case MODE_SINGLETOUCH: {
> +		mode = 0x01;
> +		break;
> +	}
> +	case MODE_DGTZR: {
> +		mode = 0x02;
> +		break;
> +	}
> +	default: {
> +		rc = -EIO;
> +		return rc;
> +	}
> +	}
> +	val[0] = mode;
> +	UBT_DUMMY_DEBUG
> +	if (ubt_debug)
> +		printk(KERN_DEBUG "ubt880 :switch_mode: usbhid_submit_report drv=%p p=%p mode=%d", hid, report_cur, mode);
> +	/*Send report to device*/
> +
> +	usbhid_submit_report(hid, report_cur, USB_DIR_OUT);
> +	UBT_DUMMY_DEBUG
> +	return rc;
> +}

> There ought to be a function in hid to help you achieve this.
I thought so, but I can't find anything suitable. There are functions in usbhid to work with leds and nothing else.
On the other hand - Linux Cross Referencer reports heavy usage of usbhid_submit_report() in hid drivers.

With best regards,
Anton
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ