Changeset 338d54a7 in mainline for uspace/drv
- Timestamp:
- 2018-03-10T22:55:07Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 850fd32
- Parents:
- 5ef16903
- Location:
- uspace/drv
- Files:
-
- 6 edited
-
bus/usb/ohci/ohci_rh.c (modified) (4 diffs)
-
bus/usb/xhci/isoch.c (modified) (6 diffs)
-
hid/atkbd/atkbd.c (modified) (2 diffs)
-
hid/ps2mouse/ps2mouse.c (modified) (2 diffs)
-
hid/usbhid/kbd/kbddev.c (modified) (3 diffs)
-
hid/xtkbd/xtkbd.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci_rh.c
r5ef16903 r338d54a7 343 343 ohci_rh_t *hub; 344 344 unsigned port; 345 uint32_t rhda; 345 346 TEST_SIZE_INIT(0, port, hub); 346 347 const unsigned feature = uint16_usb2host(setup_packet->value); … … 349 350 { 350 351 case USB_HUB_FEATURE_PORT_POWER: /*8*/ 351 { 352 const uint32_t rhda = 353 OHCI_RD(hub->registers->rh_desc_a); 354 /* No power switching */ 355 if (rhda & RHDA_NPS_FLAG) 356 return ENOTSUP; 357 /* Ganged power switching, one port powers all */ 358 if (!(rhda & RHDA_PSM_FLAG)) { 359 OHCI_WR(hub->registers->rh_status, 360 RHS_CLEAR_GLOBAL_POWER); 361 return EOK; 362 } 363 OHCI_WR(hub->registers->rh_port_status[port], 364 RHPS_CLEAR_PORT_POWER); 352 rhda = OHCI_RD(hub->registers->rh_desc_a); 353 /* No power switching */ 354 if (rhda & RHDA_NPS_FLAG) 355 return ENOTSUP; 356 /* Ganged power switching, one port powers all */ 357 if (!(rhda & RHDA_PSM_FLAG)) { 358 OHCI_WR(hub->registers->rh_status, 359 RHS_CLEAR_GLOBAL_POWER); 365 360 return EOK; 366 361 } 367 362 OHCI_WR(hub->registers->rh_port_status[port], 363 RHPS_CLEAR_PORT_POWER); 364 return EOK; 368 365 case USB2_HUB_FEATURE_PORT_ENABLE: /*1*/ 369 366 OHCI_WR(hub->registers->rh_port_status[port], … … 407 404 ohci_rh_t *hub; 408 405 unsigned port; 406 uint32_t rhda; 409 407 TEST_SIZE_INIT(0, port, hub); 410 408 const unsigned feature = uint16_usb2host(setup_packet->value); … … 412 410 switch (feature) { 413 411 case USB_HUB_FEATURE_PORT_POWER: /*8*/ 414 { 415 const uint32_t rhda = OHCI_RD(hub->registers->rh_desc_a); 416 417 /* No power switching */ 418 if (rhda & RHDA_NPS_FLAG) 419 return EOK; 420 421 /* Ganged power switching, one port powers all */ 422 if (!(rhda & RHDA_PSM_FLAG)) { 423 OHCI_WR(hub->registers->rh_status,RHS_SET_GLOBAL_POWER); 424 return EOK; 425 } 412 rhda = OHCI_RD(hub->registers->rh_desc_a); 413 414 /* No power switching */ 415 if (rhda & RHDA_NPS_FLAG) 416 return EOK; 417 418 /* Ganged power switching, one port powers all */ 419 if (!(rhda & RHDA_PSM_FLAG)) { 420 OHCI_WR(hub->registers->rh_status,RHS_SET_GLOBAL_POWER); 421 return EOK; 426 422 } 427 423 /* Fall through, for per port power */ -
uspace/drv/bus/usb/xhci/isoch.c
r5ef16903 r338d54a7 310 310 while (isoch->transfers[isoch->hw_enqueue].state == ISOCH_FILLED) { 311 311 xhci_isoch_transfer_t * const it = &isoch->transfers[isoch->hw_enqueue]; 312 suseconds_t delay; 312 313 313 314 assert(it->state == ISOCH_FILLED); … … 317 318 318 319 switch (wd.position) { 319 case WINDOW_TOO_SOON: {320 const suseconds_tdelay = wd.offset * 125;320 case WINDOW_TOO_SOON: 321 delay = wd.offset * 125; 321 322 usb_log_debug("[isoch] delaying feeding buffer %zu for %ldus", 322 323 it - isoch->transfers, delay); … … 324 325 isoch_feed_out_timer, ep); 325 326 goto out; 326 }327 327 328 328 case WINDOW_INSIDE: … … 396 396 while (isoch->transfers[isoch->enqueue].state <= ISOCH_FILLED) { 397 397 xhci_isoch_transfer_t * const it = &isoch->transfers[isoch->enqueue]; 398 suseconds_t delay; 398 399 399 400 /* IN buffers are "filled" with free space */ … … 408 409 409 410 switch (wd.position) { 410 case WINDOW_TOO_SOON: {411 case WINDOW_TOO_SOON: 411 412 /* Not allowed to feed yet. Defer to later. */ 412 const suseconds_tdelay = wd.offset * 125;413 delay = wd.offset * 125; 413 414 usb_log_debug("[isoch] delaying feeding buffer %zu for %ldus", 414 415 it - isoch->transfers, delay); … … 416 417 isoch_feed_in_timer, ep); 417 418 goto out; 418 }419 420 419 case WINDOW_TOO_LATE: 421 420 usb_log_debug("[isoch] missed feeding buffer %zu at 0x%llx by" -
uspace/drv/hid/atkbd/atkbd.c
r5ef16903 r338d54a7 302 302 const sysarg_t method = IPC_GET_IMETHOD(*icall); 303 303 at_kbd_t *kbd = ddf_dev_data_get(ddf_fun_get_dev(fun)); 304 async_sess_t *sess; 304 305 305 306 switch (method) { 306 case KBDEV_SET_IND: {307 case KBDEV_SET_IND: 307 308 async_answer_0(icallid, ENOTSUP); 308 309 break; 309 }310 310 /* 311 311 * This might be ugly but async_callback_receive_start makes no 312 312 * difference for incorrect call and malloc failure. 313 313 */ 314 case IPC_M_CONNECT_TO_ME: { 315 async_sess_t *sess = 316 async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 314 case IPC_M_CONNECT_TO_ME: 315 sess = async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 317 316 318 317 /* Probably ENOMEM error, try again. */ … … 334 333 335 334 break; 336 }337 335 default: 338 336 ddf_msg(LVL_ERROR, "Unknown method: %d.", (int)method); -
uspace/drv/hid/ps2mouse/ps2mouse.c
r5ef16903 r338d54a7 408 408 const sysarg_t method = IPC_GET_IMETHOD(*icall); 409 409 ps2_mouse_t *mouse = ddf_dev_data_get(ddf_fun_get_dev(fun)); 410 async_sess_t *sess; 410 411 411 412 switch (method) { 412 413 /* This might be ugly but async_callback_receive_start makes no 413 414 * difference for incorrect call and malloc failure. */ 414 case IPC_M_CONNECT_TO_ME: { 415 async_sess_t *sess = 416 async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 415 case IPC_M_CONNECT_TO_ME: 416 sess = async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 417 417 /* Probably ENOMEM error, try again. */ 418 418 if (sess == NULL) { … … 431 431 } 432 432 break; 433 }434 433 default: 435 434 ddf_msg(LVL_ERROR, "Unknown method: %d.", (int)method); -
uspace/drv/hid/usbhid/kbd/kbddev.c
r5ef16903 r338d54a7 165 165 const sysarg_t method = IPC_GET_IMETHOD(*icall); 166 166 usb_kbd_t *kbd_dev = ddf_fun_data_get(fun); 167 async_sess_t *sess; 167 168 168 169 switch (method) { … … 174 175 /* This might be ugly but async_callback_receive_start makes no 175 176 * difference for incorrect call and malloc failure. */ 176 case IPC_M_CONNECT_TO_ME: { 177 async_sess_t *sess = 178 async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 177 case IPC_M_CONNECT_TO_ME: 178 sess = async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 179 179 /* Probably ENOMEM error, try again. */ 180 180 if (sess == NULL) { … … 194 194 } 195 195 break; 196 }197 196 default: 198 197 usb_log_error("%s: Unknown method: %d.", -
uspace/drv/hid/xtkbd/xtkbd.c
r5ef16903 r338d54a7 338 338 const sysarg_t method = IPC_GET_IMETHOD(*icall); 339 339 xt_kbd_t *kbd = ddf_dev_data_get(ddf_fun_get_dev(fun)); 340 unsigned mods; 341 async_sess_t *sess; 340 342 341 343 switch (method) { 342 case KBDEV_SET_IND: {344 case KBDEV_SET_IND: 343 345 /* 344 346 * XT keyboards do not support setting mods, 345 347 * assume AT keyboard with Scan Code Set 1. 346 348 */ 347 const unsignedmods = IPC_GET_ARG1(*icall);349 mods = IPC_GET_ARG1(*icall); 348 350 const uint8_t status = 0 | 349 351 ((mods & KM_CAPS_LOCK) ? LI_CAPS : 0) | … … 362 364 async_answer_0(icallid, rc); 363 365 break; 364 }365 366 /* 366 367 * This might be ugly but async_callback_receive_start makes no 367 368 * difference for incorrect call and malloc failure. 368 369 */ 369 case IPC_M_CONNECT_TO_ME: { 370 async_sess_t *sess = 371 async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 370 case IPC_M_CONNECT_TO_ME: 371 sess = async_callback_receive_start(EXCHANGE_SERIALIZE, icall); 372 372 373 373 /* Probably ENOMEM error, try again. */ … … 389 389 390 390 break; 391 }392 391 default: 393 392 ddf_msg(LVL_ERROR, "Unknown method: %d.", (int)method);
Note:
See TracChangeset
for help on using the changeset viewer.
