hid.c (256281) | hid.c (281566) |
---|---|
1/* 2 * hid.c 3 */ 4 5/*- 6 * Copyright (c) 2006 Maksim Yevmenkin <m_evmenkin@yahoo.com> 7 * All rights reserved. 8 * --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * $Id: hid.c,v 1.5 2006/09/07 21:06:53 max Exp $ | 1/* 2 * hid.c 3 */ 4 5/*- 6 * Copyright (c) 2006 Maksim Yevmenkin <m_evmenkin@yahoo.com> 7 * All rights reserved. 8 * --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * $Id: hid.c,v 1.5 2006/09/07 21:06:53 max Exp $ |
31 * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/hid.c 221448 2011-05-04 17:58:15Z emax $ | 31 * $FreeBSD: stable/10/usr.sbin/bluetooth/bthidd/hid.c 281566 2015-04-15 22:02:52Z rakuco $ |
32 */ 33 34#include <sys/consio.h> 35#include <sys/mouse.h> 36#include <sys/queue.h> 37#include <assert.h> 38#include <bluetooth.h> 39#include <dev/usb/usb.h> --- 120 unchanged lines hidden (view full) --- 160 161 for (d = hid_start_parse(hid_device->desc, 1 << hid_input, -1); 162 hid_get_item(d, &h) > 0; ) { 163 if ((h.flags & HIO_CONST) || (h.report_ID != report_id) || 164 (h.kind != hid_input)) 165 continue; 166 167 page = HID_PAGE(h.usage); | 32 */ 33 34#include <sys/consio.h> 35#include <sys/mouse.h> 36#include <sys/queue.h> 37#include <assert.h> 38#include <bluetooth.h> 39#include <dev/usb/usb.h> --- 120 unchanged lines hidden (view full) --- 160 161 for (d = hid_start_parse(hid_device->desc, 1 << hid_input, -1); 162 hid_get_item(d, &h) > 0; ) { 163 if ((h.flags & HIO_CONST) || (h.report_ID != report_id) || 164 (h.kind != hid_input)) 165 continue; 166 167 page = HID_PAGE(h.usage); |
168 usage = HID_USAGE(h.usage); | |
169 val = hid_get_data(data, &h); 170 | 168 val = hid_get_data(data, &h); 169 |
170 /* 171 * When the input field is an array and the usage is specified 172 * with a range instead of an ID, we have to derive the actual 173 * usage by using the item value as an index in the usage range 174 * list. 175 */ 176 if ((h.flags & HIO_VARIABLE)) { 177 usage = HID_USAGE(h.usage); 178 } else { 179 const uint32_t usage_offset = val - h.logical_minimum; 180 usage = HID_USAGE(h.usage_minimum + usage_offset); 181 } 182 |
|
171 switch (page) { 172 case HUP_GENERIC_DESKTOP: 173 switch (usage) { 174 case HUG_X: 175 mouse_x = val; 176 mevents ++; 177 break; 178 --- 230 unchanged lines hidden --- | 183 switch (page) { 184 case HUP_GENERIC_DESKTOP: 185 switch (usage) { 186 case HUG_X: 187 mouse_x = val; 188 mevents ++; 189 break; 190 --- 230 unchanged lines hidden --- |