Lines Matching refs:hw
346 struct joystick_hwdata *hw; local
363 hw = (struct joystick_hwdata *)
365 if (hw == NULL) {
369 joy->hwdata = hw;
370 hw->fd = fd;
371 hw->path = SDL_strdup(path);
373 hw->type = BSDJOY_JOY;
381 hw->type = BSDJOY_UHID;
387 hw->axis_map[ax] = -1;
389 hw->repdesc = hid_get_report_desc(fd);
390 if (hw->repdesc == NULL) {
391 SDL_SetError("%s: USB_GET_REPORT_DESC: %s", hw->path,
395 rep = &hw->inreport;
434 if (report_alloc(rep, hw->repdesc, REPORT_INPUT) < 0) {
439 hw->path);
443 hdata = hid_start_parse(hw->repdesc, 1 << hid_input, rep->rid);
445 hdata = hid_start_parse(hw->repdesc, 1 << hid_input);
448 SDL_SetError("%s: Cannot start HID parser", hw->path);
456 hw->axis_map[i] = -1;
484 hw->axis_map[joyaxe] = 1;
507 if (hw->axis_map[i] > 0)
508 hw->axis_map[i] = joy->naxes++;
511 SDL_SetError("%s: Not a joystick, ignoring", hw->path);
528 close(hw->fd);
529 SDL_free(hw->path);
530 SDL_free(hw);