| .. | .. |
|---|
| 73 | 73 | #define URB_ASYNC_UNLINK 0 |
|---|
| 74 | 74 | #endif |
|---|
| 75 | 75 | |
|---|
| 76 | | -/* 802.2 LLC/SNAP header used for Ethernet encapsulation over 802.11 */ |
|---|
| 77 | | -static const u8 encaps_hdr[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00}; |
|---|
| 78 | | -#define ENCAPS_OVERHEAD (sizeof(encaps_hdr) + 2) |
|---|
| 79 | | - |
|---|
| 80 | 76 | struct header_struct { |
|---|
| 81 | 77 | /* 802.3 */ |
|---|
| 82 | 78 | u8 dest[ETH_ALEN]; |
|---|
| .. | .. |
|---|
| 162 | 158 | |
|---|
| 163 | 159 | |
|---|
| 164 | 160 | #define EZUSB_REQUEST_FW_TRANS 0xA0 |
|---|
| 165 | | -#define EZUSB_REQUEST_TRIGER 0xAA |
|---|
| 161 | +#define EZUSB_REQUEST_TRIGGER 0xAA |
|---|
| 166 | 162 | #define EZUSB_REQUEST_TRIG_AC 0xAC |
|---|
| 167 | 163 | #define EZUSB_CPUCS_REG 0x7F92 |
|---|
| 168 | 164 | |
|---|
| .. | .. |
|---|
| 206 | 202 | __le16 crc; /* CRC up to here */ |
|---|
| 207 | 203 | __le16 hermes_len; |
|---|
| 208 | 204 | __le16 hermes_rid; |
|---|
| 209 | | - u8 data[0]; |
|---|
| 205 | + u8 data[]; |
|---|
| 210 | 206 | } __packed; |
|---|
| 211 | 207 | |
|---|
| 212 | 208 | /* Table of devices that work or may work with this driver */ |
|---|
| .. | .. |
|---|
| 369 | 365 | return ctx; |
|---|
| 370 | 366 | } |
|---|
| 371 | 367 | |
|---|
| 372 | | - |
|---|
| 373 | | -/* Hopefully the real complete_all will soon be exported, in the mean |
|---|
| 374 | | - * while this should work. */ |
|---|
| 375 | | -static inline void ezusb_complete_all(struct completion *comp) |
|---|
| 376 | | -{ |
|---|
| 377 | | - complete(comp); |
|---|
| 378 | | - complete(comp); |
|---|
| 379 | | - complete(comp); |
|---|
| 380 | | - complete(comp); |
|---|
| 381 | | -} |
|---|
| 382 | | - |
|---|
| 383 | 368 | static void ezusb_ctx_complete(struct request_context *ctx) |
|---|
| 384 | 369 | { |
|---|
| 385 | 370 | struct ezusb_priv *upriv = ctx->upriv; |
|---|
| .. | .. |
|---|
| 413 | 398 | |
|---|
| 414 | 399 | netif_wake_queue(dev); |
|---|
| 415 | 400 | } |
|---|
| 416 | | - ezusb_complete_all(&ctx->done); |
|---|
| 401 | + complete_all(&ctx->done); |
|---|
| 417 | 402 | ezusb_request_context_put(ctx); |
|---|
| 418 | 403 | break; |
|---|
| 419 | 404 | |
|---|
| .. | .. |
|---|
| 423 | 408 | /* This is normal, as all request contexts get flushed |
|---|
| 424 | 409 | * when the device is disconnected */ |
|---|
| 425 | 410 | err("Called, CTX not terminating, but device gone"); |
|---|
| 426 | | - ezusb_complete_all(&ctx->done); |
|---|
| 411 | + complete_all(&ctx->done); |
|---|
| 427 | 412 | ezusb_request_context_put(ctx); |
|---|
| 428 | 413 | break; |
|---|
| 429 | 414 | } |
|---|
| .. | .. |
|---|
| 438 | 423 | } |
|---|
| 439 | 424 | } |
|---|
| 440 | 425 | |
|---|
| 441 | | -/** |
|---|
| 426 | +/* |
|---|
| 442 | 427 | * ezusb_req_queue_run: |
|---|
| 443 | 428 | * Description: |
|---|
| 444 | 429 | * Note: Only one active CTX at any one time, because there's no |
|---|
| 445 | 430 | * other (reliable) way to match the response URB to the correct |
|---|
| 446 | 431 | * CTX. |
|---|
| 447 | | - **/ |
|---|
| 432 | + */ |
|---|
| 448 | 433 | static void ezusb_req_queue_run(struct ezusb_priv *upriv) |
|---|
| 449 | 434 | { |
|---|
| 450 | 435 | unsigned long flags; |
|---|
| .. | .. |
|---|
| 550 | 535 | flags); |
|---|
| 551 | 536 | break; |
|---|
| 552 | 537 | } |
|---|
| 553 | | - /* fall through */ |
|---|
| 538 | + fallthrough; |
|---|
| 554 | 539 | case EZUSB_CTX_RESP_RECEIVED: |
|---|
| 555 | 540 | /* IN already received before this OUT-ACK */ |
|---|
| 556 | 541 | ctx->state = EZUSB_CTX_COMPLETE; |
|---|
| .. | .. |
|---|
| 572 | 557 | case EZUSB_CTX_REQ_SUBMITTED: |
|---|
| 573 | 558 | case EZUSB_CTX_RESP_RECEIVED: |
|---|
| 574 | 559 | ctx->state = EZUSB_CTX_REQ_FAILED; |
|---|
| 575 | | - /* fall through */ |
|---|
| 560 | + fallthrough; |
|---|
| 576 | 561 | |
|---|
| 577 | 562 | case EZUSB_CTX_REQ_FAILED: |
|---|
| 578 | 563 | case EZUSB_CTX_REQ_TIMEOUT: |
|---|
| .. | .. |
|---|
| 694 | 679 | * get the chance to run themselves. So we make sure |
|---|
| 695 | 680 | * that we don't sleep for ever */ |
|---|
| 696 | 681 | int msecs = DEF_TIMEOUT * (1000 / HZ); |
|---|
| 697 | | - while (!ctx->done.done && msecs--) |
|---|
| 682 | + |
|---|
| 683 | + while (!try_wait_for_completion(&ctx->done) && msecs--) |
|---|
| 698 | 684 | udelay(1000); |
|---|
| 699 | 685 | } else { |
|---|
| 700 | | - wait_event_interruptible(ctx->done.wait, |
|---|
| 701 | | - ctx->done.done); |
|---|
| 686 | + wait_for_completion(&ctx->done); |
|---|
| 702 | 687 | } |
|---|
| 703 | 688 | break; |
|---|
| 704 | 689 | default: |
|---|
| .. | .. |
|---|
| 719 | 704 | return crc; |
|---|
| 720 | 705 | } |
|---|
| 721 | 706 | |
|---|
| 722 | | -/** |
|---|
| 707 | +/* |
|---|
| 723 | 708 | * ezusb_fill_req: |
|---|
| 724 | 709 | * |
|---|
| 725 | 710 | * if data == NULL and length > 0 the data is assumed to be already in |
|---|
| .. | .. |
|---|
| 912 | 897 | case EZUSB_CTX_REQ_SUBMITTED: |
|---|
| 913 | 898 | if (!ctx->in_rid) |
|---|
| 914 | 899 | break; |
|---|
| 900 | + fallthrough; |
|---|
| 915 | 901 | default: |
|---|
| 916 | 902 | err("%s: Unexpected context state %d", __func__, |
|---|
| 917 | 903 | state); |
|---|
| 918 | | - /* fall though */ |
|---|
| 904 | + fallthrough; |
|---|
| 919 | 905 | case EZUSB_CTX_REQ_TIMEOUT: |
|---|
| 920 | 906 | case EZUSB_CTX_REQ_FAILED: |
|---|
| 921 | 907 | case EZUSB_CTX_RESP_TIMEOUT: |
|---|
| .. | .. |
|---|
| 1332 | 1318 | netdev_dbg(upriv->dev, "sending control message\n"); |
|---|
| 1333 | 1319 | retval = usb_control_msg(upriv->udev, |
|---|
| 1334 | 1320 | usb_sndctrlpipe(upriv->udev, 0), |
|---|
| 1335 | | - EZUSB_REQUEST_TRIGER, |
|---|
| 1321 | + EZUSB_REQUEST_TRIGGER, |
|---|
| 1336 | 1322 | USB_TYPE_VENDOR | USB_RECIP_DEVICE | |
|---|
| 1337 | 1323 | USB_DIR_OUT, 0x0, 0x0, NULL, 0, |
|---|
| 1338 | 1324 | DEF_TIMEOUT); |
|---|
| 1339 | 1325 | if (retval < 0) { |
|---|
| 1340 | | - err("EZUSB_REQUEST_TRIGER failed retval %d", retval); |
|---|
| 1326 | + err("EZUSB_REQUEST_TRIGGER failed retval %d", retval); |
|---|
| 1341 | 1327 | return retval; |
|---|
| 1342 | 1328 | } |
|---|
| 1343 | 1329 | #if 0 |
|---|