MFNetBSD: ukbd.c (1.52), usbdi.c (1.54), usbdi.h (1.35)

date: 2000/01/16 09:37:18;  author: augustss;
    Let usbd_set_polling() work on a usbd_device_handle instead of
    a usbd_interface_handle.
This commit is contained in:
Josef Karthauser 2002-04-07 13:16:18 +00:00
parent 9db21c5fd1
commit 7c21b0290d
3 changed files with 8 additions and 6 deletions

View File

@ -1314,19 +1314,21 @@ Static int
ukbd_poll(keyboard_t *kbd, int on)
{
ukbd_state_t *state;
usbd_device_handle dev;
int s;
state = (ukbd_state_t *)kbd->kb_data;
usbd_interface2device_handle(state->ks_iface, &dev);
s = splusb();
if (on) {
if (state->ks_polling == 0)
usbd_set_polling(state->ks_iface, on);
usbd_set_polling(dev, on);
++state->ks_polling;
} else {
--state->ks_polling;
if (state->ks_polling == 0)
usbd_set_polling(state->ks_iface, on);
usbd_set_polling(dev, on);
}
splx(s);
return 0;

View File

@ -1080,12 +1080,12 @@ usbd_dopoll(usbd_interface_handle iface)
}
void
usbd_set_polling(usbd_interface_handle iface, int on)
usbd_set_polling(usbd_device_handle dev, int on)
{
if (on)
iface->device->bus->use_polling++;
dev->bus->use_polling++;
else
iface->device->bus->use_polling--;
dev->bus->use_polling--;
}

View File

@ -160,7 +160,7 @@ usb_endpoint_descriptor_t *usbd_find_edesc(usb_config_descriptor_t *cd,
int endptidx);
void usbd_dopoll(usbd_interface_handle);
void usbd_set_polling(usbd_interface_handle iface, int on);
void usbd_set_polling(usbd_device_handle dev, int on);
const char *usbd_errstr(usbd_status err);