vub300 371 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = kref_to_vub300_mmc_host(kref); vub300 372 drivers/mmc/host/vub300.c struct mmc_host *mmc = vub300->mmc; vub300 373 drivers/mmc/host/vub300.c usb_free_urb(vub300->command_out_urb); vub300 374 drivers/mmc/host/vub300.c vub300->command_out_urb = NULL; vub300 375 drivers/mmc/host/vub300.c usb_free_urb(vub300->command_res_urb); vub300 376 drivers/mmc/host/vub300.c vub300->command_res_urb = NULL; vub300 377 drivers/mmc/host/vub300.c usb_put_dev(vub300->udev); vub300 385 drivers/mmc/host/vub300.c static void vub300_queue_cmnd_work(struct vub300_mmc_host *vub300) vub300 387 drivers/mmc/host/vub300.c kref_get(&vub300->kref); vub300 388 drivers/mmc/host/vub300.c if (queue_work(cmndworkqueue, &vub300->cmndwork)) { vub300 401 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 405 drivers/mmc/host/vub300.c static void vub300_queue_poll_work(struct vub300_mmc_host *vub300, int delay) vub300 407 drivers/mmc/host/vub300.c kref_get(&vub300->kref); vub300 408 drivers/mmc/host/vub300.c if (queue_delayed_work(pollworkqueue, &vub300->pollwork, delay)) { vub300 421 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 425 drivers/mmc/host/vub300.c static void vub300_queue_dead_work(struct vub300_mmc_host *vub300) vub300 427 drivers/mmc/host/vub300.c kref_get(&vub300->kref); vub300 428 drivers/mmc/host/vub300.c if (queue_work(deadworkqueue, &vub300->deadwork)) { vub300 441 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 447 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = (struct vub300_mmc_host *)urb->context; vub300 449 drivers/mmc/host/vub300.c vub300->usb_transport_fail = urb->status; vub300 450 drivers/mmc/host/vub300.c complete(&vub300->irqpoll_complete); vub300 455 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = (struct vub300_mmc_host *)urb->context; vub300 457 drivers/mmc/host/vub300.c vub300->usb_transport_fail = urb->status; vub300 458 drivers/mmc/host/vub300.c complete(&vub300->irqpoll_complete); vub300 463 drivers/mmc/host/vub300.c usb_rcvbulkpipe(vub300->udev, vub300->cmnd_res_ep); vub300 464 drivers/mmc/host/vub300.c usb_fill_bulk_urb(vub300->command_res_urb, vub300->udev, pipe, vub300 465 drivers/mmc/host/vub300.c &vub300->resp, sizeof(vub300->resp), vub300 466 drivers/mmc/host/vub300.c irqpoll_res_completed, vub300); vub300 467 drivers/mmc/host/vub300.c vub300->command_res_urb->actual_length = 0; vub300 468 drivers/mmc/host/vub300.c ret = usb_submit_urb(vub300->command_res_urb, GFP_ATOMIC); vub300 470 drivers/mmc/host/vub300.c vub300->usb_transport_fail = ret; vub300 471 drivers/mmc/host/vub300.c complete(&vub300->irqpoll_complete); vub300 477 drivers/mmc/host/vub300.c static void send_irqpoll(struct vub300_mmc_host *vub300) vub300 482 drivers/mmc/host/vub300.c vub300->cmnd.poll.header_size = 22; vub300 483 drivers/mmc/host/vub300.c vub300->cmnd.poll.header_type = 1; vub300 484 drivers/mmc/host/vub300.c vub300->cmnd.poll.port_number = 0; vub300 485 drivers/mmc/host/vub300.c vub300->cmnd.poll.command_type = 2; vub300 486 drivers/mmc/host/vub300.c vub300->cmnd.poll.poll_timeout_lsb = 0xFF & (unsigned)timeout; vub300 487 drivers/mmc/host/vub300.c vub300->cmnd.poll.poll_timeout_msb = 0xFF & (unsigned)(timeout >> 8); vub300 488 drivers/mmc/host/vub300.c usb_fill_bulk_urb(vub300->command_out_urb, vub300->udev, vub300 489 drivers/mmc/host/vub300.c usb_sndbulkpipe(vub300->udev, vub300->cmnd_out_ep) vub300 490 drivers/mmc/host/vub300.c , &vub300->cmnd, sizeof(vub300->cmnd) vub300 491 drivers/mmc/host/vub300.c , irqpoll_out_completed, vub300); vub300 492 drivers/mmc/host/vub300.c retval = usb_submit_urb(vub300->command_out_urb, GFP_KERNEL); vub300 494 drivers/mmc/host/vub300.c vub300->usb_transport_fail = retval; vub300 495 drivers/mmc/host/vub300.c vub300_queue_poll_work(vub300, 1); vub300 496 drivers/mmc/host/vub300.c complete(&vub300->irqpoll_complete); vub300 503 drivers/mmc/host/vub300.c static void new_system_port_status(struct vub300_mmc_host *vub300) vub300 505 drivers/mmc/host/vub300.c int old_card_present = vub300->card_present; vub300 507 drivers/mmc/host/vub300.c (0x0001 & vub300->system_port_status.port_flags) ? 1 : 0; vub300 508 drivers/mmc/host/vub300.c vub300->read_only = vub300 509 drivers/mmc/host/vub300.c (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0; vub300 511 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, "card just inserted\n"); vub300 512 drivers/mmc/host/vub300.c vub300->card_present = 1; vub300 513 drivers/mmc/host/vub300.c vub300->bus_width = 0; vub300 515 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, "EMPTY Processing Disabled", vub300 516 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 518 drivers/mmc/host/vub300.c vub300->vub_name[0] = 0; vub300 519 drivers/mmc/host/vub300.c mmc_detect_change(vub300->mmc, 1); vub300 521 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, "card just ejected\n"); vub300 522 drivers/mmc/host/vub300.c vub300->card_present = 0; vub300 523 drivers/mmc/host/vub300.c mmc_detect_change(vub300->mmc, 0); vub300 529 drivers/mmc/host/vub300.c static void __add_offloaded_reg_to_fifo(struct vub300_mmc_host *vub300, vub300 533 drivers/mmc/host/vub300.c u8 r = vub300->fn[func].offload_point + vub300->fn[func].offload_count; vub300 534 drivers/mmc/host/vub300.c memcpy(&vub300->fn[func].reg[MAXREGMASK & r], register_access, vub300 536 drivers/mmc/host/vub300.c vub300->fn[func].offload_count += 1; vub300 537 drivers/mmc/host/vub300.c vub300->total_offload_count += 1; vub300 540 drivers/mmc/host/vub300.c static void add_offloaded_reg(struct vub300_mmc_host *vub300, vub300 547 drivers/mmc/host/vub300.c u8 regs = vub300->dynamic_register_count; vub300 549 drivers/mmc/host/vub300.c while (0 < regs-- && 1 == vub300->sdio_register[i].activate) { vub300 550 drivers/mmc/host/vub300.c if (vub300->sdio_register[i].func_num == func && vub300 551 drivers/mmc/host/vub300.c vub300->sdio_register[i].sdio_reg == Register) { vub300 552 drivers/mmc/host/vub300.c if (vub300->sdio_register[i].prepared == 0) vub300 553 drivers/mmc/host/vub300.c vub300->sdio_register[i].prepared = 1; vub300 554 drivers/mmc/host/vub300.c vub300->sdio_register[i].response = vub300 556 drivers/mmc/host/vub300.c vub300->sdio_register[i].regvalue = vub300 564 drivers/mmc/host/vub300.c __add_offloaded_reg_to_fifo(vub300, register_access, func); vub300 567 drivers/mmc/host/vub300.c static void check_vub300_port_status(struct vub300_mmc_host *vub300) vub300 575 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0), vub300 578 drivers/mmc/host/vub300.c 0x0000, 0x0000, &vub300->system_port_status, vub300 579 drivers/mmc/host/vub300.c sizeof(vub300->system_port_status), HZ); vub300 580 drivers/mmc/host/vub300.c if (sizeof(vub300->system_port_status) == retval) vub300 581 drivers/mmc/host/vub300.c new_system_port_status(vub300); vub300 584 drivers/mmc/host/vub300.c static void __vub300_irqpoll_response(struct vub300_mmc_host *vub300) vub300 587 drivers/mmc/host/vub300.c if (vub300->command_res_urb->actual_length == 0) vub300 590 drivers/mmc/host/vub300.c switch (vub300->resp.common.header_type) { vub300 592 drivers/mmc/host/vub300.c mutex_lock(&vub300->irq_mutex); vub300 593 drivers/mmc/host/vub300.c if (vub300->irq_enabled) vub300 594 drivers/mmc/host/vub300.c mmc_signal_sdio_irq(vub300->mmc); vub300 596 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 597 drivers/mmc/host/vub300.c vub300->irq_disabled = 1; vub300 598 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 601 drivers/mmc/host/vub300.c if (vub300->resp.error.error_code == SD_ERROR_NO_DEVICE) vub300 602 drivers/mmc/host/vub300.c check_vub300_port_status(vub300); vub300 605 drivers/mmc/host/vub300.c vub300->system_port_status = vub300->resp.status; vub300 606 drivers/mmc/host/vub300.c new_system_port_status(vub300); vub300 607 drivers/mmc/host/vub300.c if (!vub300->card_present) vub300 608 drivers/mmc/host/vub300.c vub300_queue_poll_work(vub300, HZ / 5); vub300 612 drivers/mmc/host/vub300.c int offloaded_data_length = vub300->resp.common.header_size - 3; vub300 616 drivers/mmc/host/vub300.c add_offloaded_reg(vub300, &vub300->resp.irq.reg[ri]); vub300 619 drivers/mmc/host/vub300.c mutex_lock(&vub300->irq_mutex); vub300 620 drivers/mmc/host/vub300.c if (vub300->irq_enabled) vub300 621 drivers/mmc/host/vub300.c mmc_signal_sdio_irq(vub300->mmc); vub300 623 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 624 drivers/mmc/host/vub300.c vub300->irq_disabled = 1; vub300 625 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 630 drivers/mmc/host/vub300.c int offloaded_data_length = vub300->resp.common.header_size - 3; vub300 634 drivers/mmc/host/vub300.c add_offloaded_reg(vub300, &vub300->resp.irq.reg[ri]); vub300 637 drivers/mmc/host/vub300.c mutex_lock(&vub300->irq_mutex); vub300 638 drivers/mmc/host/vub300.c if (vub300->irq_enabled) vub300 639 drivers/mmc/host/vub300.c mmc_signal_sdio_irq(vub300->mmc); vub300 641 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 642 drivers/mmc/host/vub300.c vub300->irq_disabled = 0; vub300 643 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 647 drivers/mmc/host/vub300.c vub300_queue_poll_work(vub300, 1); vub300 654 drivers/mmc/host/vub300.c static void __do_poll(struct vub300_mmc_host *vub300) vub300 658 drivers/mmc/host/vub300.c mod_timer(&vub300->inactivity_timer, jiffies + HZ); vub300 659 drivers/mmc/host/vub300.c init_completion(&vub300->irqpoll_complete); vub300 660 drivers/mmc/host/vub300.c send_irqpoll(vub300); vub300 661 drivers/mmc/host/vub300.c commretval = wait_for_completion_timeout(&vub300->irqpoll_complete, vub300 663 drivers/mmc/host/vub300.c if (vub300->usb_transport_fail) { vub300 666 drivers/mmc/host/vub300.c vub300->usb_timed_out = 1; vub300 667 drivers/mmc/host/vub300.c usb_kill_urb(vub300->command_out_urb); vub300 668 drivers/mmc/host/vub300.c usb_kill_urb(vub300->command_res_urb); vub300 670 drivers/mmc/host/vub300.c __vub300_irqpoll_response(vub300); vub300 679 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = container_of(work, vub300 681 drivers/mmc/host/vub300.c if (!vub300->interface) { vub300 682 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 685 drivers/mmc/host/vub300.c mutex_lock(&vub300->cmd_mutex); vub300 686 drivers/mmc/host/vub300.c if (vub300->cmd) { vub300 687 drivers/mmc/host/vub300.c vub300_queue_poll_work(vub300, 1); vub300 688 drivers/mmc/host/vub300.c } else if (!vub300->card_present) { vub300 691 drivers/mmc/host/vub300.c mutex_lock(&vub300->irq_mutex); vub300 692 drivers/mmc/host/vub300.c if (!vub300->irq_enabled) { vub300 693 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 694 drivers/mmc/host/vub300.c } else if (vub300->irqs_queued) { vub300 695 drivers/mmc/host/vub300.c vub300->irqs_queued -= 1; vub300 696 drivers/mmc/host/vub300.c mmc_signal_sdio_irq(vub300->mmc); vub300 697 drivers/mmc/host/vub300.c mod_timer(&vub300->inactivity_timer, jiffies + HZ); vub300 698 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 700 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 701 drivers/mmc/host/vub300.c __do_poll(vub300); vub300 704 drivers/mmc/host/vub300.c mutex_unlock(&vub300->cmd_mutex); vub300 705 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 710 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = vub300 712 drivers/mmc/host/vub300.c if (!vub300->interface) { vub300 713 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 716 drivers/mmc/host/vub300.c mutex_lock(&vub300->cmd_mutex); vub300 717 drivers/mmc/host/vub300.c if (vub300->cmd) { vub300 724 drivers/mmc/host/vub300.c } else if (vub300->card_present) { vub300 725 drivers/mmc/host/vub300.c check_vub300_port_status(vub300); vub300 726 drivers/mmc/host/vub300.c } else if (vub300->mmc && vub300->mmc->card) { vub300 734 drivers/mmc/host/vub300.c check_vub300_port_status(vub300); vub300 736 drivers/mmc/host/vub300.c mod_timer(&vub300->inactivity_timer, jiffies + HZ); vub300 737 drivers/mmc/host/vub300.c mutex_unlock(&vub300->cmd_mutex); vub300 738 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 743 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = from_timer(vub300, t, vub300 745 drivers/mmc/host/vub300.c if (!vub300->interface) { vub300 746 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 747 drivers/mmc/host/vub300.c } else if (vub300->cmd) { vub300 748 drivers/mmc/host/vub300.c mod_timer(&vub300->inactivity_timer, jiffies + HZ); vub300 750 drivers/mmc/host/vub300.c vub300_queue_dead_work(vub300); vub300 751 drivers/mmc/host/vub300.c mod_timer(&vub300->inactivity_timer, jiffies + HZ); vub300 793 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = (struct vub300_mmc_host *)urb->context; vub300 796 drivers/mmc/host/vub300.c } else if (vub300->command_res_urb->actual_length == 0) { vub300 801 drivers/mmc/host/vub300.c } else if (!vub300->data) { vub300 803 drivers/mmc/host/vub300.c } else if (vub300->resp.common.header_type != 0x02) { vub300 808 drivers/mmc/host/vub300.c } else if (vub300->urb) { vub300 809 drivers/mmc/host/vub300.c vub300->cmd->error = vub300 810 drivers/mmc/host/vub300.c vub300_response_error(vub300->resp.error.error_code); vub300 811 drivers/mmc/host/vub300.c usb_unlink_urb(vub300->urb); vub300 813 drivers/mmc/host/vub300.c vub300->cmd->error = vub300 814 drivers/mmc/host/vub300.c vub300_response_error(vub300->resp.error.error_code); vub300 815 drivers/mmc/host/vub300.c usb_sg_cancel(&vub300->sg_request); vub300 817 drivers/mmc/host/vub300.c complete(&vub300->command_complete); /* got_response_in */ vub300 822 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = (struct vub300_mmc_host *)urb->context; vub300 824 drivers/mmc/host/vub300.c complete(&vub300->command_complete); vub300 828 drivers/mmc/host/vub300.c usb_rcvbulkpipe(vub300->udev, vub300->cmnd_res_ep); vub300 829 drivers/mmc/host/vub300.c usb_fill_bulk_urb(vub300->command_res_urb, vub300->udev, pipe, vub300 830 drivers/mmc/host/vub300.c &vub300->resp, sizeof(vub300->resp), vub300 831 drivers/mmc/host/vub300.c command_res_completed, vub300); vub300 832 drivers/mmc/host/vub300.c vub300->command_res_urb->actual_length = 0; vub300 833 drivers/mmc/host/vub300.c ret = usb_submit_urb(vub300->command_res_urb, GFP_ATOMIC); vub300 844 drivers/mmc/host/vub300.c complete(&vub300->command_complete); vub300 852 drivers/mmc/host/vub300.c static void snoop_block_size_and_bus_width(struct vub300_mmc_host *vub300, vub300 856 drivers/mmc/host/vub300.c vub300->fbs[1] = (cmd_arg << 8) | (0x00FF & vub300->fbs[1]); vub300 858 drivers/mmc/host/vub300.c vub300->fbs[1] = (0xFF & cmd_arg) | (0xFF00 & vub300->fbs[1]); vub300 860 drivers/mmc/host/vub300.c vub300->fbs[2] = (cmd_arg << 8) | (0x00FF & vub300->fbs[2]); vub300 862 drivers/mmc/host/vub300.c vub300->fbs[2] = (0xFF & cmd_arg) | (0xFF00 & vub300->fbs[2]); vub300 864 drivers/mmc/host/vub300.c vub300->fbs[3] = (cmd_arg << 8) | (0x00FF & vub300->fbs[3]); vub300 866 drivers/mmc/host/vub300.c vub300->fbs[3] = (0xFF & cmd_arg) | (0xFF00 & vub300->fbs[3]); vub300 868 drivers/mmc/host/vub300.c vub300->fbs[4] = (cmd_arg << 8) | (0x00FF & vub300->fbs[4]); vub300 870 drivers/mmc/host/vub300.c vub300->fbs[4] = (0xFF & cmd_arg) | (0xFF00 & vub300->fbs[4]); vub300 872 drivers/mmc/host/vub300.c vub300->fbs[5] = (cmd_arg << 8) | (0x00FF & vub300->fbs[5]); vub300 874 drivers/mmc/host/vub300.c vub300->fbs[5] = (0xFF & cmd_arg) | (0xFF00 & vub300->fbs[5]); vub300 876 drivers/mmc/host/vub300.c vub300->fbs[6] = (cmd_arg << 8) | (0x00FF & vub300->fbs[6]); vub300 878 drivers/mmc/host/vub300.c vub300->fbs[6] = (0xFF & cmd_arg) | (0xFF00 & vub300->fbs[6]); vub300 880 drivers/mmc/host/vub300.c vub300->fbs[7] = (cmd_arg << 8) | (0x00FF & vub300->fbs[7]); vub300 882 drivers/mmc/host/vub300.c vub300->fbs[7] = (0xFF & cmd_arg) | (0xFF00 & vub300->fbs[7]); vub300 884 drivers/mmc/host/vub300.c vub300->bus_width = 1; vub300 886 drivers/mmc/host/vub300.c vub300->bus_width = 4; vub300 889 drivers/mmc/host/vub300.c static void send_command(struct vub300_mmc_host *vub300) vub300 892 drivers/mmc/host/vub300.c struct mmc_command *cmd = vub300->cmd; vub300 893 drivers/mmc/host/vub300.c struct mmc_data *data = vub300->data; vub300 897 drivers/mmc/host/vub300.c if (vub300->app_spec) { vub300 901 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 903 drivers/mmc/host/vub300.c vub300->bus_width = 1; vub300 905 drivers/mmc/host/vub300.c vub300->bus_width = 4; vub300 907 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, vub300 913 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 917 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 921 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 925 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 929 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 933 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 937 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 940 drivers/mmc/host/vub300.c vub300->resp_len = 0; vub300 942 drivers/mmc/host/vub300.c complete(&vub300->command_complete); vub300 945 drivers/mmc/host/vub300.c vub300->app_spec = 0; vub300 950 drivers/mmc/host/vub300.c vub300->resp_len = 0; vub300 954 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 958 drivers/mmc/host/vub300.c vub300->resp_len = 17; vub300 962 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 966 drivers/mmc/host/vub300.c vub300->resp_len = 0; vub300 970 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 974 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 978 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 982 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 986 drivers/mmc/host/vub300.c vub300->resp_len = 17; vub300 990 drivers/mmc/host/vub300.c vub300->resp_len = 17; vub300 994 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 998 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1002 drivers/mmc/host/vub300.c vub300->resp_len = 0; vub300 1005 drivers/mmc/host/vub300.c for (i = 0; i < ARRAY_SIZE(vub300->fbs); i++) vub300 1006 drivers/mmc/host/vub300.c vub300->fbs[i] = 0xFFFF & cmd->arg; vub300 1008 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1016 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1021 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1027 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1031 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1035 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1039 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1040 drivers/mmc/host/vub300.c snoop_block_size_and_bus_width(vub300, cmd->arg); vub300 1044 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1048 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1049 drivers/mmc/host/vub300.c vub300->app_spec = 1; vub300 1053 drivers/mmc/host/vub300.c vub300->resp_len = 6; vub300 1056 drivers/mmc/host/vub300.c vub300->resp_len = 0; vub300 1058 drivers/mmc/host/vub300.c complete(&vub300->command_complete); vub300 1066 drivers/mmc/host/vub300.c vub300->cmnd.head.header_size = 20; vub300 1067 drivers/mmc/host/vub300.c vub300->cmnd.head.header_type = 0x00; vub300 1068 drivers/mmc/host/vub300.c vub300->cmnd.head.port_number = 0; /* "0" means port 1 */ vub300 1069 drivers/mmc/host/vub300.c vub300->cmnd.head.command_type = 0x00; /* standard read command */ vub300 1070 drivers/mmc/host/vub300.c vub300->cmnd.head.response_type = response_type; vub300 1071 drivers/mmc/host/vub300.c vub300->cmnd.head.command_index = cmd->opcode; vub300 1072 drivers/mmc/host/vub300.c vub300->cmnd.head.arguments[0] = cmd->arg >> 24; vub300 1073 drivers/mmc/host/vub300.c vub300->cmnd.head.arguments[1] = cmd->arg >> 16; vub300 1074 drivers/mmc/host/vub300.c vub300->cmnd.head.arguments[2] = cmd->arg >> 8; vub300 1075 drivers/mmc/host/vub300.c vub300->cmnd.head.arguments[3] = cmd->arg >> 0; vub300 1078 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[0] = 0; vub300 1079 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[1] = 0; vub300 1080 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[0] = (vub300->fbs[fn] >> 8) & 0xFF; vub300 1081 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[1] = (vub300->fbs[fn] >> 0) & 0xFF; vub300 1082 drivers/mmc/host/vub300.c vub300->cmnd.head.command_type = 0x00; vub300 1083 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[0] = 0; vub300 1084 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[1] = 0; vub300 1085 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[2] = 0; vub300 1086 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[3] = 0; vub300 1088 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[0] = 0; vub300 1089 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[1] = 0; vub300 1090 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[0] = (vub300->fbs[0] >> 8) & 0xFF; vub300 1091 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[1] = (vub300->fbs[0] >> 0) & 0xFF; vub300 1092 drivers/mmc/host/vub300.c vub300->cmnd.head.command_type = 0x00; vub300 1093 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[0] = 0; vub300 1094 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[1] = 0; vub300 1095 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[2] = 0; vub300 1096 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[3] = 0; vub300 1099 drivers/mmc/host/vub300.c if (0x08 & vub300->cmnd.head.arguments[0]) { /* BLOCK MODE */ vub300 1100 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[0] = vub300 1102 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[1] = vub300 1104 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[0] = vub300 1106 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[1] = vub300 1109 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[0] = 0; vub300 1110 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[1] = 0; vub300 1111 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[0] = vub300 1112 drivers/mmc/host/vub300.c (vub300->datasize >> 8) & 0xFF; vub300 1113 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[1] = vub300 1114 drivers/mmc/host/vub300.c (vub300->datasize >> 0) & 0xFF; vub300 1116 drivers/mmc/host/vub300.c vub300->cmnd.head.command_type = vub300 1118 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[0] = vub300 1119 drivers/mmc/host/vub300.c (vub300->datasize >> 24) & 0xFF; vub300 1120 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[1] = vub300 1121 drivers/mmc/host/vub300.c (vub300->datasize >> 16) & 0xFF; vub300 1122 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[2] = vub300 1123 drivers/mmc/host/vub300.c (vub300->datasize >> 8) & 0xFF; vub300 1124 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[3] = vub300 1125 drivers/mmc/host/vub300.c (vub300->datasize >> 0) & 0xFF; vub300 1126 drivers/mmc/host/vub300.c if (vub300->datasize < vub300->fbs[fn]) { vub300 1127 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[0] = 0; vub300 1128 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[1] = 0; vub300 1131 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[0] = (data->blocks >> 8) & 0xFF; vub300 1132 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[1] = (data->blocks >> 0) & 0xFF; vub300 1133 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[0] = (data->blksz >> 8) & 0xFF; vub300 1134 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[1] = (data->blksz >> 0) & 0xFF; vub300 1135 drivers/mmc/host/vub300.c vub300->cmnd.head.command_type = vub300 1137 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[0] = vub300 1138 drivers/mmc/host/vub300.c (vub300->datasize >> 24) & 0xFF; vub300 1139 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[1] = vub300 1140 drivers/mmc/host/vub300.c (vub300->datasize >> 16) & 0xFF; vub300 1141 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[2] = vub300 1142 drivers/mmc/host/vub300.c (vub300->datasize >> 8) & 0xFF; vub300 1143 drivers/mmc/host/vub300.c vub300->cmnd.head.transfer_size[3] = vub300 1144 drivers/mmc/host/vub300.c (vub300->datasize >> 0) & 0xFF; vub300 1145 drivers/mmc/host/vub300.c if (vub300->datasize < vub300->fbs[0]) { vub300 1146 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[0] = 0; vub300 1147 drivers/mmc/host/vub300.c vub300->cmnd.head.block_count[1] = 0; vub300 1150 drivers/mmc/host/vub300.c if (vub300->cmnd.head.block_size[0] || vub300->cmnd.head.block_size[1]) { vub300 1151 drivers/mmc/host/vub300.c u16 block_size = vub300->cmnd.head.block_size[1] | vub300 1152 drivers/mmc/host/vub300.c (vub300->cmnd.head.block_size[0] << 8); vub300 1155 drivers/mmc/host/vub300.c vub300->cmnd.head.block_boundary[0] = vub300 1157 drivers/mmc/host/vub300.c vub300->cmnd.head.block_boundary[1] = vub300 1160 drivers/mmc/host/vub300.c vub300->cmnd.head.block_boundary[0] = 0; vub300 1161 drivers/mmc/host/vub300.c vub300->cmnd.head.block_boundary[1] = 0; vub300 1163 drivers/mmc/host/vub300.c usb_fill_bulk_urb(vub300->command_out_urb, vub300->udev, vub300 1164 drivers/mmc/host/vub300.c usb_sndbulkpipe(vub300->udev, vub300->cmnd_out_ep), vub300 1165 drivers/mmc/host/vub300.c &vub300->cmnd, sizeof(vub300->cmnd), vub300 1166 drivers/mmc/host/vub300.c command_out_completed, vub300); vub300 1167 drivers/mmc/host/vub300.c retval = usb_submit_urb(vub300->command_out_urb, GFP_KERNEL); vub300 1170 drivers/mmc/host/vub300.c complete(&vub300->command_complete); vub300 1183 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = from_timer(vub300, t, vub300 1185 drivers/mmc/host/vub300.c vub300->usb_timed_out = 1; vub300 1186 drivers/mmc/host/vub300.c usb_sg_cancel(&vub300->sg_request); vub300 1187 drivers/mmc/host/vub300.c usb_unlink_urb(vub300->command_out_urb); vub300 1188 drivers/mmc/host/vub300.c usb_unlink_urb(vub300->command_res_urb); vub300 1199 drivers/mmc/host/vub300.c static void __download_offload_pseudocode(struct vub300_mmc_host *vub300, vub300 1208 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, "using %s for SDIO offload processing\n", vub300 1209 drivers/mmc/host/vub300.c vub300->vub_name); vub300 1213 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, "using offload firmware %s %s\n", fw->data, vub300 1214 drivers/mmc/host/vub300.c vub300->vub_name); vub300 1216 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, vub300 1218 drivers/mmc/host/vub300.c vub300->vub_name); vub300 1219 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, "corrupt offload pseudocode", vub300 1220 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1239 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, vub300 1240 drivers/mmc/host/vub300.c usb_sndctrlpipe(vub300->udev, 0), vub300 1249 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, vub300 1252 drivers/mmc/host/vub300.c vub300->vub_name); vub300 1253 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, vub300 1255 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1259 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, vub300 1261 drivers/mmc/host/vub300.c fw->data, vub300->vub_name); vub300 1262 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, "corrupt interrupt pseudocode", vub300 1263 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1282 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, vub300 1283 drivers/mmc/host/vub300.c usb_sndctrlpipe(vub300->udev, 0), vub300 1292 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, vub300 1295 drivers/mmc/host/vub300.c vub300->vub_name); vub300 1296 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, vub300 1298 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1302 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, vub300 1304 drivers/mmc/host/vub300.c fw->data, vub300->vub_name); vub300 1305 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, "corrupt transfer pseudocode", vub300 1306 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1312 drivers/mmc/host/vub300.c int I = vub300->dynamic_register_count = register_count; vub300 1316 drivers/mmc/host/vub300.c vub300->sdio_register[i].func_num = *data++; vub300 1326 drivers/mmc/host/vub300.c vub300->sdio_register[i].sdio_reg = func_num; vub300 1327 drivers/mmc/host/vub300.c vub300->sdio_register[i].activate = 1; vub300 1328 drivers/mmc/host/vub300.c vub300->sdio_register[i].prepared = 0; vub300 1331 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, vub300 1333 drivers/mmc/host/vub300.c vub300->dynamic_register_count); vub300 1336 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, vub300 1338 drivers/mmc/host/vub300.c vub300->vub_name); vub300 1339 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, "corrupt dynamic registers", vub300 1340 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1347 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, "SDIO pseudocode download failed", vub300 1348 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1355 drivers/mmc/host/vub300.c static void download_offload_pseudocode(struct vub300_mmc_host *vub300) vub300 1357 drivers/mmc/host/vub300.c struct mmc_card *card = vub300->mmc->card; vub300 1360 drivers/mmc/host/vub300.c int l = snprintf(vub300->vub_name, sizeof(vub300->vub_name), vub300 1366 drivers/mmc/host/vub300.c l += snprintf(vub300->vub_name + l, vub300 1367 drivers/mmc/host/vub300.c sizeof(vub300->vub_name) - l, "_%04X%04X", vub300 1370 drivers/mmc/host/vub300.c snprintf(vub300->vub_name + l, sizeof(vub300->vub_name) - l, ".bin"); vub300 1371 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, "requesting offload firmware %s\n", vub300 1372 drivers/mmc/host/vub300.c vub300->vub_name); vub300 1373 drivers/mmc/host/vub300.c retval = request_firmware(&fw, vub300->vub_name, &card->dev); vub300 1375 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, "vub_default.bin", vub300 1376 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1377 drivers/mmc/host/vub300.c retval = request_firmware(&fw, vub300->vub_name, &card->dev); vub300 1379 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, vub300 1381 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1383 drivers/mmc/host/vub300.c __download_offload_pseudocode(vub300, fw); vub300 1387 drivers/mmc/host/vub300.c __download_offload_pseudocode(vub300, fw); vub300 1397 drivers/mmc/host/vub300.c static int vub300_usb_bulk_msg(struct vub300_mmc_host *vub300, vub300 1402 drivers/mmc/host/vub300.c struct usb_device *usb_dev = vub300->udev; vub300 1405 drivers/mmc/host/vub300.c vub300->urb = usb_alloc_urb(0, GFP_KERNEL); vub300 1406 drivers/mmc/host/vub300.c if (!vub300->urb) vub300 1408 drivers/mmc/host/vub300.c usb_fill_bulk_urb(vub300->urb, usb_dev, pipe, data, len, vub300 1411 drivers/mmc/host/vub300.c vub300->urb->context = &done; vub300 1412 drivers/mmc/host/vub300.c vub300->urb->actual_length = 0; vub300 1413 drivers/mmc/host/vub300.c retval = usb_submit_urb(vub300->urb, GFP_KERNEL); vub300 1419 drivers/mmc/host/vub300.c usb_kill_urb(vub300->urb); vub300 1421 drivers/mmc/host/vub300.c retval = vub300->urb->status; vub300 1424 drivers/mmc/host/vub300.c *actual_length = vub300->urb->actual_length; vub300 1425 drivers/mmc/host/vub300.c usb_free_urb(vub300->urb); vub300 1426 drivers/mmc/host/vub300.c vub300->urb = NULL; vub300 1430 drivers/mmc/host/vub300.c static int __command_read_data(struct vub300_mmc_host *vub300, vub300 1434 drivers/mmc/host/vub300.c int linear_length = vub300->datasize; vub300 1435 drivers/mmc/host/vub300.c int padded_length = vub300->large_usb_packets ? vub300 1441 drivers/mmc/host/vub300.c pipe = usb_rcvbulkpipe(vub300->udev, vub300->data_inp_ep); vub300 1442 drivers/mmc/host/vub300.c result = usb_sg_init(&vub300->sg_request, vub300->udev, vub300 1446 drivers/mmc/host/vub300.c usb_unlink_urb(vub300->command_out_urb); vub300 1447 drivers/mmc/host/vub300.c usb_unlink_urb(vub300->command_res_urb); vub300 1452 drivers/mmc/host/vub300.c vub300->sg_transfer_timer.expires = vub300 1455 drivers/mmc/host/vub300.c add_timer(&vub300->sg_transfer_timer); vub300 1456 drivers/mmc/host/vub300.c usb_sg_wait(&vub300->sg_request); vub300 1457 drivers/mmc/host/vub300.c del_timer(&vub300->sg_transfer_timer); vub300 1458 drivers/mmc/host/vub300.c if (vub300->sg_request.status < 0) { vub300 1459 drivers/mmc/host/vub300.c cmd->error = vub300->sg_request.status; vub300 1463 drivers/mmc/host/vub300.c data->bytes_xfered = vub300->datasize; vub300 1471 drivers/mmc/host/vub300.c unsigned pipe = usb_rcvbulkpipe(vub300->udev, vub300 1472 drivers/mmc/host/vub300.c vub300->data_inp_ep); vub300 1474 drivers/mmc/host/vub300.c result = vub300_usb_bulk_msg(vub300, pipe, buf, vub300 1491 drivers/mmc/host/vub300.c data->bytes_xfered = vub300->datasize; vub300 1502 drivers/mmc/host/vub300.c static int __command_write_data(struct vub300_mmc_host *vub300, vub300 1506 drivers/mmc/host/vub300.c unsigned pipe = usb_sndbulkpipe(vub300->udev, vub300->data_out_ep); vub300 1507 drivers/mmc/host/vub300.c int linear_length = vub300->datasize; vub300 1514 drivers/mmc/host/vub300.c vub300->padded_buffer, vub300 1515 drivers/mmc/host/vub300.c sizeof(vub300->padded_buffer)); vub300 1516 drivers/mmc/host/vub300.c memset(vub300->padded_buffer + linear_length, 0, vub300 1517 drivers/mmc/host/vub300.c sizeof(vub300->padded_buffer) - linear_length); vub300 1518 drivers/mmc/host/vub300.c result = vub300_usb_bulk_msg(vub300, pipe, vub300->padded_buffer, vub300 1519 drivers/mmc/host/vub300.c sizeof(vub300->padded_buffer), vub300 1521 drivers/mmc/host/vub300.c (sizeof(vub300->padded_buffer) / vub300 1527 drivers/mmc/host/vub300.c data->bytes_xfered = vub300->datasize; vub300 1529 drivers/mmc/host/vub300.c } else if ((!vub300->large_usb_packets && (0 < modulo_64_length)) || vub300 1530 drivers/mmc/host/vub300.c (vub300->large_usb_packets && (64 > modulo_512_length)) vub300 1542 drivers/mmc/host/vub300.c vub300_usb_bulk_msg(vub300, pipe, buf, vub300 1550 drivers/mmc/host/vub300.c data->bytes_xfered = vub300->datasize; vub300 1560 drivers/mmc/host/vub300.c result = usb_sg_init(&vub300->sg_request, vub300->udev, vub300 1564 drivers/mmc/host/vub300.c usb_unlink_urb(vub300->command_out_urb); vub300 1565 drivers/mmc/host/vub300.c usb_unlink_urb(vub300->command_res_urb); vub300 1569 drivers/mmc/host/vub300.c vub300->sg_transfer_timer.expires = vub300 1572 drivers/mmc/host/vub300.c add_timer(&vub300->sg_transfer_timer); vub300 1573 drivers/mmc/host/vub300.c usb_sg_wait(&vub300->sg_request); vub300 1577 drivers/mmc/host/vub300.c del_timer(&vub300->sg_transfer_timer); vub300 1578 drivers/mmc/host/vub300.c if (vub300->sg_request.status < 0) { vub300 1579 drivers/mmc/host/vub300.c cmd->error = vub300->sg_request.status; vub300 1582 drivers/mmc/host/vub300.c data->bytes_xfered = vub300->datasize; vub300 1590 drivers/mmc/host/vub300.c static void __vub300_command_response(struct vub300_mmc_host *vub300, vub300 1598 drivers/mmc/host/vub300.c wait_for_completion_timeout(&vub300->command_complete, vub300 1603 drivers/mmc/host/vub300.c vub300->usb_timed_out = 1; vub300 1604 drivers/mmc/host/vub300.c usb_kill_urb(vub300->command_out_urb); vub300 1605 drivers/mmc/host/vub300.c usb_kill_urb(vub300->command_res_urb); vub300 1607 drivers/mmc/host/vub300.c result = usb_lock_device_for_reset(vub300->udev, vub300 1608 drivers/mmc/host/vub300.c vub300->interface); vub300 1610 drivers/mmc/host/vub300.c result = usb_reset_device(vub300->udev); vub300 1611 drivers/mmc/host/vub300.c usb_unlock_device(vub300->udev); vub300 1615 drivers/mmc/host/vub300.c usb_kill_urb(vub300->command_out_urb); vub300 1616 drivers/mmc/host/vub300.c usb_kill_urb(vub300->command_res_urb); vub300 1623 drivers/mmc/host/vub300.c } else if (vub300->command_out_urb->status) { vub300 1624 drivers/mmc/host/vub300.c vub300->usb_transport_fail = vub300->command_out_urb->status; vub300 1625 drivers/mmc/host/vub300.c cmd->error = -EPROTO == vub300->command_out_urb->status ? vub300 1626 drivers/mmc/host/vub300.c -ESHUTDOWN : vub300->command_out_urb->status; vub300 1627 drivers/mmc/host/vub300.c } else if (vub300->command_res_urb->status) { vub300 1628 drivers/mmc/host/vub300.c vub300->usb_transport_fail = vub300->command_res_urb->status; vub300 1629 drivers/mmc/host/vub300.c cmd->error = -EPROTO == vub300->command_res_urb->status ? vub300 1630 drivers/mmc/host/vub300.c -ESHUTDOWN : vub300->command_res_urb->status; vub300 1631 drivers/mmc/host/vub300.c } else if (vub300->resp.common.header_type == 0x00) { vub300 1636 drivers/mmc/host/vub300.c } else if (vub300->resp.common.header_type == RESPONSE_ERROR) { vub300 1638 drivers/mmc/host/vub300.c vub300_response_error(vub300->resp.error.error_code); vub300 1639 drivers/mmc/host/vub300.c if (vub300->data) vub300 1640 drivers/mmc/host/vub300.c usb_sg_cancel(&vub300->sg_request); vub300 1641 drivers/mmc/host/vub300.c } else if (vub300->resp.common.header_type == RESPONSE_PIGGYBACKED) { vub300 1643 drivers/mmc/host/vub300.c vub300->resp.common.header_size - vub300 1648 drivers/mmc/host/vub300.c add_offloaded_reg(vub300, &vub300->resp.pig.reg[ri]); vub300 1651 drivers/mmc/host/vub300.c vub300->resp.common.header_size = vub300 1653 drivers/mmc/host/vub300.c vub300->resp.common.header_type = 0x00; vub300 1655 drivers/mmc/host/vub300.c } else if (vub300->resp.common.header_type == RESPONSE_PIG_DISABLED) { vub300 1657 drivers/mmc/host/vub300.c vub300->resp.common.header_size - vub300 1662 drivers/mmc/host/vub300.c add_offloaded_reg(vub300, &vub300->resp.pig.reg[ri]); vub300 1665 drivers/mmc/host/vub300.c mutex_lock(&vub300->irq_mutex); vub300 1666 drivers/mmc/host/vub300.c if (vub300->irqs_queued) { vub300 1667 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 1668 drivers/mmc/host/vub300.c } else if (vub300->irq_enabled) { vub300 1669 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 1670 drivers/mmc/host/vub300.c vub300_queue_poll_work(vub300, 0); vub300 1672 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 1674 drivers/mmc/host/vub300.c vub300->irq_disabled = 1; vub300 1675 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 1676 drivers/mmc/host/vub300.c vub300->resp.common.header_size = vub300 1678 drivers/mmc/host/vub300.c vub300->resp.common.header_type = 0x00; vub300 1680 drivers/mmc/host/vub300.c } else if (vub300->resp.common.header_type == RESPONSE_PIG_ENABLED) { vub300 1682 drivers/mmc/host/vub300.c vub300->resp.common.header_size - vub300 1687 drivers/mmc/host/vub300.c add_offloaded_reg(vub300, &vub300->resp.pig.reg[ri]); vub300 1690 drivers/mmc/host/vub300.c mutex_lock(&vub300->irq_mutex); vub300 1691 drivers/mmc/host/vub300.c if (vub300->irqs_queued) { vub300 1692 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 1693 drivers/mmc/host/vub300.c } else if (vub300->irq_enabled) { vub300 1694 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 1695 drivers/mmc/host/vub300.c vub300_queue_poll_work(vub300, 0); vub300 1697 drivers/mmc/host/vub300.c vub300->irqs_queued += 1; vub300 1699 drivers/mmc/host/vub300.c vub300->irq_disabled = 0; vub300 1700 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 1701 drivers/mmc/host/vub300.c vub300->resp.common.header_size = vub300 1703 drivers/mmc/host/vub300.c vub300->resp.common.header_type = 0x00; vub300 1710 drivers/mmc/host/vub300.c static void construct_request_response(struct vub300_mmc_host *vub300, vub300 1713 drivers/mmc/host/vub300.c int resp_len = vub300->resp_len; vub300 1717 drivers/mmc/host/vub300.c u8 *r = vub300->resp.response.command_response; vub300 1741 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = vub300 1743 drivers/mmc/host/vub300.c if (!vub300->interface) { vub300 1744 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 1747 drivers/mmc/host/vub300.c struct mmc_request *req = vub300->req; vub300 1748 drivers/mmc/host/vub300.c struct mmc_command *cmd = vub300->cmd; vub300 1749 drivers/mmc/host/vub300.c struct mmc_data *data = vub300->data; vub300 1751 drivers/mmc/host/vub300.c mutex_lock(&vub300->cmd_mutex); vub300 1752 drivers/mmc/host/vub300.c init_completion(&vub300->command_complete); vub300 1753 drivers/mmc/host/vub300.c if (likely(vub300->vub_name[0]) || !vub300->mmc->card) { vub300 1759 drivers/mmc/host/vub300.c } else if (0 == vub300->mmc->card->sdio_funcs) { vub300 1760 drivers/mmc/host/vub300.c strncpy(vub300->vub_name, "SD memory device", vub300 1761 drivers/mmc/host/vub300.c sizeof(vub300->vub_name)); vub300 1763 drivers/mmc/host/vub300.c download_offload_pseudocode(vub300); vub300 1765 drivers/mmc/host/vub300.c send_command(vub300); vub300 1769 drivers/mmc/host/vub300.c data_length = __command_read_data(vub300, cmd, data); vub300 1771 drivers/mmc/host/vub300.c data_length = __command_write_data(vub300, cmd, data); vub300 1772 drivers/mmc/host/vub300.c __vub300_command_response(vub300, cmd, data, data_length); vub300 1773 drivers/mmc/host/vub300.c vub300->req = NULL; vub300 1774 drivers/mmc/host/vub300.c vub300->cmd = NULL; vub300 1775 drivers/mmc/host/vub300.c vub300->data = NULL; vub300 1778 drivers/mmc/host/vub300.c check_vub300_port_status(vub300); vub300 1779 drivers/mmc/host/vub300.c mutex_unlock(&vub300->cmd_mutex); vub300 1780 drivers/mmc/host/vub300.c mmc_request_done(vub300->mmc, req); vub300 1781 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 1784 drivers/mmc/host/vub300.c construct_request_response(vub300, cmd); vub300 1785 drivers/mmc/host/vub300.c vub300->resp_len = 0; vub300 1786 drivers/mmc/host/vub300.c mutex_unlock(&vub300->cmd_mutex); vub300 1787 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 1788 drivers/mmc/host/vub300.c mmc_request_done(vub300->mmc, req); vub300 1794 drivers/mmc/host/vub300.c static int examine_cyclic_buffer(struct vub300_mmc_host *vub300, vub300 1802 drivers/mmc/host/vub300.c int first = MAXREGMASK & vub300->fn[Function].offload_point; vub300 1803 drivers/mmc/host/vub300.c struct offload_registers_access *rf = &vub300->fn[Function].reg[first]; vub300 1814 drivers/mmc/host/vub300.c vub300->fn[Function].offload_point += 1; vub300 1815 drivers/mmc/host/vub300.c vub300->fn[Function].offload_count -= 1; vub300 1816 drivers/mmc/host/vub300.c vub300->total_offload_count -= 1; vub300 1820 drivers/mmc/host/vub300.c u8 register_count = vub300->fn[Function].offload_count - 1; vub300 1821 drivers/mmc/host/vub300.c u32 register_point = vub300->fn[Function].offload_point + 1; vub300 1825 drivers/mmc/host/vub300.c &vub300->fn[Function].reg[point]; vub300 1836 drivers/mmc/host/vub300.c vub300->fn[Function].offload_point += delta; vub300 1837 drivers/mmc/host/vub300.c vub300->fn[Function].offload_count -= delta; vub300 1838 drivers/mmc/host/vub300.c vub300->total_offload_count -= delta; vub300 1851 drivers/mmc/host/vub300.c static int satisfy_request_from_offloaded_data(struct vub300_mmc_host *vub300, vub300 1855 drivers/mmc/host/vub300.c u8 regs = vub300->dynamic_register_count; vub300 1860 drivers/mmc/host/vub300.c if ((vub300->sdio_register[i].func_num == func) && vub300 1861 drivers/mmc/host/vub300.c (vub300->sdio_register[i].sdio_reg == reg)) { vub300 1862 drivers/mmc/host/vub300.c if (!vub300->sdio_register[i].prepared) { vub300 1869 drivers/mmc/host/vub300.c vub300->sdio_register[i].prepared = 0; vub300 1875 drivers/mmc/host/vub300.c u8 rsp2 = vub300->sdio_register[i].response; vub300 1876 drivers/mmc/host/vub300.c u8 rsp3 = vub300->sdio_register[i].regvalue; vub300 1877 drivers/mmc/host/vub300.c vub300->sdio_register[i].prepared = 0; vub300 1890 drivers/mmc/host/vub300.c if (vub300->total_offload_count == 0) vub300 1892 drivers/mmc/host/vub300.c else if (vub300->fn[func].offload_count == 0) vub300 1895 drivers/mmc/host/vub300.c return examine_cyclic_buffer(vub300, cmd, func); vub300 1901 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300 1902 drivers/mmc/host/vub300.c if (!vub300->interface) { vub300 1908 drivers/mmc/host/vub300.c if (!vub300->card_powered) { vub300 1913 drivers/mmc/host/vub300.c if (!vub300->card_present) { vub300 1918 drivers/mmc/host/vub300.c if (vub300->usb_transport_fail) { vub300 1919 drivers/mmc/host/vub300.c cmd->error = vub300->usb_transport_fail; vub300 1923 drivers/mmc/host/vub300.c if (!vub300->interface) { vub300 1928 drivers/mmc/host/vub300.c kref_get(&vub300->kref); vub300 1929 drivers/mmc/host/vub300.c mutex_lock(&vub300->cmd_mutex); vub300 1930 drivers/mmc/host/vub300.c mod_timer(&vub300->inactivity_timer, jiffies + HZ); vub300 1936 drivers/mmc/host/vub300.c satisfy_request_from_offloaded_data(vub300, cmd)) { vub300 1938 drivers/mmc/host/vub300.c mutex_unlock(&vub300->cmd_mutex); vub300 1939 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 1943 drivers/mmc/host/vub300.c vub300->cmd = cmd; vub300 1944 drivers/mmc/host/vub300.c vub300->req = req; vub300 1945 drivers/mmc/host/vub300.c vub300->data = data; vub300 1947 drivers/mmc/host/vub300.c vub300->datasize = data->blksz * data->blocks; vub300 1949 drivers/mmc/host/vub300.c vub300->datasize = 0; vub300 1950 drivers/mmc/host/vub300.c vub300_queue_cmnd_work(vub300); vub300 1951 drivers/mmc/host/vub300.c mutex_unlock(&vub300->cmd_mutex); vub300 1952 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 1964 drivers/mmc/host/vub300.c static void __set_clock_speed(struct vub300_mmc_host *vub300, u8 buf[8], vub300 1991 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0), vub300 1996 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, "SET_CLOCK_SPEED" vub300 1999 drivers/mmc/host/vub300.c dev_dbg(&vub300->udev->dev, "SET_CLOCK_SPEED" vub300 2006 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300 2007 drivers/mmc/host/vub300.c if (!vub300->interface) vub300 2009 drivers/mmc/host/vub300.c kref_get(&vub300->kref); vub300 2010 drivers/mmc/host/vub300.c mutex_lock(&vub300->cmd_mutex); vub300 2011 drivers/mmc/host/vub300.c if ((ios->power_mode == MMC_POWER_OFF) && vub300->card_powered) { vub300 2012 drivers/mmc/host/vub300.c vub300->card_powered = 0; vub300 2013 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0), vub300 2019 drivers/mmc/host/vub300.c } else if ((ios->power_mode == MMC_POWER_UP) && !vub300->card_powered) { vub300 2020 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0), vub300 2025 drivers/mmc/host/vub300.c vub300->card_powered = 1; vub300 2029 drivers/mmc/host/vub300.c __set_clock_speed(vub300, buf, ios); vub300 2035 drivers/mmc/host/vub300.c mutex_unlock(&vub300->cmd_mutex); vub300 2036 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 2041 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300 2042 drivers/mmc/host/vub300.c return vub300->read_only; vub300 2047 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300 2048 drivers/mmc/host/vub300.c if (!vub300->interface) vub300 2050 drivers/mmc/host/vub300.c kref_get(&vub300->kref); vub300 2052 drivers/mmc/host/vub300.c mutex_lock(&vub300->irq_mutex); vub300 2053 drivers/mmc/host/vub300.c if (vub300->irqs_queued) { vub300 2054 drivers/mmc/host/vub300.c vub300->irqs_queued -= 1; vub300 2055 drivers/mmc/host/vub300.c mmc_signal_sdio_irq(vub300->mmc); vub300 2056 drivers/mmc/host/vub300.c } else if (vub300->irq_disabled) { vub300 2057 drivers/mmc/host/vub300.c vub300->irq_disabled = 0; vub300 2058 drivers/mmc/host/vub300.c vub300->irq_enabled = 1; vub300 2059 drivers/mmc/host/vub300.c vub300_queue_poll_work(vub300, 0); vub300 2060 drivers/mmc/host/vub300.c } else if (vub300->irq_enabled) { vub300 2063 drivers/mmc/host/vub300.c vub300->irq_enabled = 1; vub300 2064 drivers/mmc/host/vub300.c vub300_queue_poll_work(vub300, 0); vub300 2066 drivers/mmc/host/vub300.c mutex_unlock(&vub300->irq_mutex); vub300 2068 drivers/mmc/host/vub300.c vub300->irq_enabled = 0; vub300 2070 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 2075 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = mmc_priv(mmc); vub300 2076 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, "NO host QUIRKS for this card\n"); vub300 2090 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300; vub300 2177 drivers/mmc/host/vub300.c vub300 = mmc_priv(mmc); vub300 2178 drivers/mmc/host/vub300.c vub300->mmc = mmc; vub300 2179 drivers/mmc/host/vub300.c vub300->card_powered = 0; vub300 2180 drivers/mmc/host/vub300.c vub300->bus_width = 0; vub300 2181 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[0] = 0x00; vub300 2182 drivers/mmc/host/vub300.c vub300->cmnd.head.block_size[1] = 0x00; vub300 2183 drivers/mmc/host/vub300.c vub300->app_spec = 0; vub300 2184 drivers/mmc/host/vub300.c mutex_init(&vub300->cmd_mutex); vub300 2185 drivers/mmc/host/vub300.c mutex_init(&vub300->irq_mutex); vub300 2186 drivers/mmc/host/vub300.c vub300->command_out_urb = command_out_urb; vub300 2187 drivers/mmc/host/vub300.c vub300->command_res_urb = command_res_urb; vub300 2188 drivers/mmc/host/vub300.c vub300->usb_timed_out = 0; vub300 2189 drivers/mmc/host/vub300.c vub300->dynamic_register_count = 0; vub300 2191 drivers/mmc/host/vub300.c for (i = 0; i < ARRAY_SIZE(vub300->fn); i++) { vub300 2192 drivers/mmc/host/vub300.c vub300->fn[i].offload_point = 0; vub300 2193 drivers/mmc/host/vub300.c vub300->fn[i].offload_count = 0; vub300 2196 drivers/mmc/host/vub300.c vub300->total_offload_count = 0; vub300 2197 drivers/mmc/host/vub300.c vub300->irq_enabled = 0; vub300 2198 drivers/mmc/host/vub300.c vub300->irq_disabled = 0; vub300 2199 drivers/mmc/host/vub300.c vub300->irqs_queued = 0; vub300 2201 drivers/mmc/host/vub300.c for (i = 0; i < ARRAY_SIZE(vub300->sdio_register); i++) vub300 2202 drivers/mmc/host/vub300.c vub300->sdio_register[i++].activate = 0; vub300 2204 drivers/mmc/host/vub300.c vub300->udev = udev; vub300 2205 drivers/mmc/host/vub300.c vub300->interface = interface; vub300 2206 drivers/mmc/host/vub300.c vub300->cmnd_res_ep = 0; vub300 2207 drivers/mmc/host/vub300.c vub300->cmnd_out_ep = 0; vub300 2208 drivers/mmc/host/vub300.c vub300->data_inp_ep = 0; vub300 2209 drivers/mmc/host/vub300.c vub300->data_out_ep = 0; vub300 2211 drivers/mmc/host/vub300.c for (i = 0; i < ARRAY_SIZE(vub300->fbs); i++) vub300 2212 drivers/mmc/host/vub300.c vub300->fbs[i] = 512; vub300 2223 drivers/mmc/host/vub300.c vub300->large_usb_packets = 0; vub300 2228 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, vub300 2234 drivers/mmc/host/vub300.c vub300->large_usb_packets = 1; vub300 2236 drivers/mmc/host/vub300.c if (!vub300->cmnd_res_ep) { vub300 2237 drivers/mmc/host/vub300.c vub300->cmnd_res_ep = vub300 2239 drivers/mmc/host/vub300.c } else if (!vub300->data_inp_ep) { vub300 2240 drivers/mmc/host/vub300.c vub300->data_inp_ep = vub300 2243 drivers/mmc/host/vub300.c dev_warn(&vub300->udev->dev, vub300 2248 drivers/mmc/host/vub300.c if (!vub300->cmnd_out_ep) { vub300 2249 drivers/mmc/host/vub300.c vub300->cmnd_out_ep = vub300 2251 drivers/mmc/host/vub300.c } else if (!vub300->data_out_ep) { vub300 2252 drivers/mmc/host/vub300.c vub300->data_out_ep = vub300 2255 drivers/mmc/host/vub300.c dev_warn(&vub300->udev->dev, vub300 2260 drivers/mmc/host/vub300.c dev_warn(&vub300->udev->dev, vub300 2265 drivers/mmc/host/vub300.c if (vub300->cmnd_res_ep && vub300->cmnd_out_ep && vub300 2266 drivers/mmc/host/vub300.c vub300->data_inp_ep && vub300->data_out_ep) { vub300 2267 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, vub300 2270 drivers/mmc/host/vub300.c vub300->large_usb_packets ? "LARGE" : "SMALL", vub300 2271 drivers/mmc/host/vub300.c vub300->cmnd_out_ep, vub300->cmnd_res_ep, vub300 2272 drivers/mmc/host/vub300.c vub300->data_out_ep, vub300->data_inp_ep); vub300 2275 drivers/mmc/host/vub300.c dev_err(&vub300->udev->dev, vub300 2281 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0), vub300 2284 drivers/mmc/host/vub300.c 0x0000, 0x0000, &vub300->hc_info, vub300 2285 drivers/mmc/host/vub300.c sizeof(vub300->hc_info), HZ); vub300 2289 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0), vub300 2295 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, vub300 2301 drivers/mmc/host/vub300.c vub300->large_usb_packets ? 512 : 64); vub300 2303 drivers/mmc/host/vub300.c usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0), vub300 2306 drivers/mmc/host/vub300.c 0x0000, 0x0000, &vub300->system_port_status, vub300 2307 drivers/mmc/host/vub300.c sizeof(vub300->system_port_status), HZ); vub300 2310 drivers/mmc/host/vub300.c } else if (sizeof(vub300->system_port_status) == retval) { vub300 2311 drivers/mmc/host/vub300.c vub300->card_present = vub300 2312 drivers/mmc/host/vub300.c (0x0001 & vub300->system_port_status.port_flags) ? 1 : 0; vub300 2313 drivers/mmc/host/vub300.c vub300->read_only = vub300 2314 drivers/mmc/host/vub300.c (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0; vub300 2318 drivers/mmc/host/vub300.c usb_set_intfdata(interface, vub300); vub300 2319 drivers/mmc/host/vub300.c INIT_DELAYED_WORK(&vub300->pollwork, vub300_pollwork_thread); vub300 2320 drivers/mmc/host/vub300.c INIT_WORK(&vub300->cmndwork, vub300_cmndwork_thread); vub300 2321 drivers/mmc/host/vub300.c INIT_WORK(&vub300->deadwork, vub300_deadwork_thread); vub300 2322 drivers/mmc/host/vub300.c kref_init(&vub300->kref); vub300 2323 drivers/mmc/host/vub300.c timer_setup(&vub300->sg_transfer_timer, vub300_sg_timed_out, 0); vub300 2324 drivers/mmc/host/vub300.c kref_get(&vub300->kref); vub300 2325 drivers/mmc/host/vub300.c timer_setup(&vub300->inactivity_timer, vub300 2327 drivers/mmc/host/vub300.c vub300->inactivity_timer.expires = jiffies + HZ; vub300 2328 drivers/mmc/host/vub300.c add_timer(&vub300->inactivity_timer); vub300 2329 drivers/mmc/host/vub300.c if (vub300->card_present) vub300 2330 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, vub300 2335 drivers/mmc/host/vub300.c dev_info(&vub300->udev->dev, vub300 2358 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = usb_get_intfdata(interface); vub300 2359 drivers/mmc/host/vub300.c if (!vub300 || !vub300->mmc) { vub300 2362 drivers/mmc/host/vub300.c struct mmc_host *mmc = vub300->mmc; vub300 2363 drivers/mmc/host/vub300.c if (!vub300->mmc) { vub300 2369 drivers/mmc/host/vub300.c vub300->interface = NULL; vub300 2370 drivers/mmc/host/vub300.c kref_put(&vub300->kref, vub300_delete); vub300 2395 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = usb_get_intfdata(intf); vub300 2396 drivers/mmc/host/vub300.c mutex_lock(&vub300->cmd_mutex); vub300 2402 drivers/mmc/host/vub300.c struct vub300_mmc_host *vub300 = usb_get_intfdata(intf); vub300 2404 drivers/mmc/host/vub300.c vub300->errors = -EPIPE; vub300 2405 drivers/mmc/host/vub300.c mutex_unlock(&vub300->cmd_mutex);