Lines Matching defs:cmb
27 #include <asm/cmb.h>
219 if (!cdev->private->cmb)
287 cmb_data = cdev->private->cmb;
305 if (!cdev->private->cmb)
355 cmb_data = cdev->private->cmb;
370 * struct cmb_area - container for global cmb data
378 struct cmb *mem;
405 * struct cmb - basic channel measurement block
418 * The cmb area made up from these blocks must be a contiguous array and may
420 * Only one cmb area can be present in the system.
422 struct cmb {
440 struct cmb *cmb;
451 * Find first unused cmb in cmb_area.mem.
453 * remains sorted by ->cmb->hw_data pointers.
455 cmb = cmb_area.mem;
458 data = node->cmb;
459 if ((struct cmb*)data->hw_block > cmb)
461 cmb++;
463 if (cmb - cmb_area.mem >= cmb_area.num_channels) {
468 /* insert new cmb */
470 cmb_data->hw_block = cmb;
471 cdev->private->cmb = cmb_data;
481 struct cmb *mem;
490 cmb_data->last_block = kzalloc(sizeof(struct cmb), GFP_KERNEL);
495 cmb_data->size = sizeof(struct cmb);
500 size = sizeof(struct cmb) * cmb_area.num_channels;
543 cmb_data = priv->cmb;
544 priv->cmb = NULL;
552 size = sizeof(struct cmb) * cmb_area.num_channels;
568 if (!cdev->private->cmb) {
572 cmb_data = cdev->private->cmb;
573 offset = mme ? (struct cmb *)cmb_data->hw_block - cmb_area.mem : 0;
600 struct cmb *cmb;
605 cmb_data = cdev->private->cmb;
609 cmb = cmb_data->hw_block;
612 ret = __cmb_utilization(cmb->device_connect_time,
613 cmb->function_pending_time,
614 cmb->device_disconnect_time,
618 ret = cmb->ssch_rsch_count;
621 ret = cmb->sample_count;
624 val = cmb->device_connect_time;
627 val = cmb->function_pending_time;
630 val = cmb->device_disconnect_time;
633 val = cmb->control_unit_queuing_time;
636 val = cmb->device_active_only_time;
641 ret = time_to_avg_nsec(val, cmb->sample_count);
649 struct cmb *cmb;
659 cmb_data = cdev->private->cmb;
668 cmb = cmb_data->last_block;
679 data->ssch_rsch_count = cmb->ssch_rsch_count;
680 data->sample_count = cmb->sample_count;
683 data->device_connect_time = time_to_nsec(cmb->device_connect_time);
684 data->function_pending_time = time_to_nsec(cmb->function_pending_time);
686 time_to_nsec(cmb->device_disconnect_time);
688 = time_to_nsec(cmb->control_unit_queuing_time);
690 = time_to_nsec(cmb->device_active_only_time);
707 enabled = !!cdev->private->cmb;
725 /* ******** extended cmb handling ********/
783 if (cdev->private->cmb)
786 cdev->private->cmb = cmb_data;
816 cmb_data = cdev->private->cmb;
817 cdev->private->cmb = NULL;
839 if (!cdev->private->cmb) {
843 cmb_data = cdev->private->cmb;
854 struct cmbe *cmb;
859 cmb_data = cdev->private->cmb;
863 cmb = cmb_data->hw_block;
866 ret = __cmb_utilization(cmb->device_connect_time,
867 cmb->function_pending_time,
868 cmb->device_disconnect_time,
872 ret = cmb->ssch_rsch_count;
875 ret = cmb->sample_count;
878 val = cmb->device_connect_time;
881 val = cmb->function_pending_time;
884 val = cmb->device_disconnect_time;
887 val = cmb->control_unit_queuing_time;
890 val = cmb->device_active_only_time;
893 val = cmb->device_busy_time;
896 val = cmb->initial_command_response_time;
901 ret = time_to_avg_nsec(val, cmb->sample_count);
909 struct cmbe *cmb;
919 cmb_data = cdev->private->cmb;
937 cmb = cmb_data->last_block;
939 data->ssch_rsch_count = cmb->ssch_rsch_count;
940 data->sample_count = cmb->sample_count;
943 data->device_connect_time = time_to_nsec(cmb->device_connect_time);
944 data->function_pending_time = time_to_nsec(cmb->function_pending_time);
946 time_to_nsec(cmb->device_disconnect_time);
948 = time_to_nsec(cmb->control_unit_queuing_time);
950 = time_to_nsec(cmb->device_active_only_time);
951 data->device_busy_time = time_to_nsec(cmb->device_busy_time);
953 = time_to_nsec(cmb->initial_command_response_time);