Lines Matching refs:ibi

132 	struct hci_pio_ibi_data ibi;  member
759 struct hci_pio_ibi_data *ibi = &pio->ibi; in hci_pio_get_ibi_segment() local
763 p = ibi->data_ptr; in hci_pio_get_ibi_segment()
764 p += (ibi->seg_len - ibi->seg_cnt) / 4; in hci_pio_get_ibi_segment()
766 while ((nr_words = ibi->seg_cnt/4)) { in hci_pio_get_ibi_segment()
775 ibi->seg_cnt -= nr_words * 4; in hci_pio_get_ibi_segment()
776 DBG("now %d left %d", nr_words * 4, ibi->seg_cnt); in hci_pio_get_ibi_segment()
781 if (ibi->seg_cnt) { in hci_pio_get_ibi_segment()
794 DBG("trailing %d", ibi->seg_cnt); in hci_pio_get_ibi_segment()
797 while (ibi->seg_cnt--) { in hci_pio_get_ibi_segment()
808 struct hci_pio_ibi_data *ibi = &pio->ibi; in hci_pio_prep_new_ibi() local
824 ibi->addr = FIELD_GET(IBI_TARGET_ADDR, ibi_status); in hci_pio_prep_new_ibi()
826 dev_err(&hci->master.dev, "IBI error from %#x\n", ibi->addr); in hci_pio_prep_new_ibi()
830 ibi->last_seg = ibi_status & IBI_LAST_STATUS; in hci_pio_prep_new_ibi()
831 ibi->seg_len = FIELD_GET(IBI_DATA_LENGTH, ibi_status); in hci_pio_prep_new_ibi()
832 ibi->seg_cnt = ibi->seg_len; in hci_pio_prep_new_ibi()
834 dev = i3c_hci_addr_to_dev(hci, ibi->addr); in hci_pio_prep_new_ibi()
837 "IBI for unknown device %#x\n", ibi->addr); in hci_pio_prep_new_ibi()
843 ibi->max_len = dev_ibi->max_len; in hci_pio_prep_new_ibi()
845 if (ibi->seg_len > ibi->max_len) { in hci_pio_prep_new_ibi()
847 ibi->seg_len, ibi->max_len); in hci_pio_prep_new_ibi()
851 ibi->slot = i3c_generic_ibi_get_free_slot(dev_ibi->pool); in hci_pio_prep_new_ibi()
852 if (!ibi->slot) { in hci_pio_prep_new_ibi()
855 ibi->slot->len = 0; in hci_pio_prep_new_ibi()
856 ibi->data_ptr = ibi->slot->data; in hci_pio_prep_new_ibi()
863 struct hci_pio_ibi_data *ibi = &pio->ibi; in hci_pio_free_ibi_slot() local
866 if (ibi->slot) { in hci_pio_free_ibi_slot()
867 dev_ibi = ibi->slot->dev->common.master_priv; in hci_pio_free_ibi_slot()
868 i3c_generic_ibi_recycle_slot(dev_ibi->pool, ibi->slot); in hci_pio_free_ibi_slot()
869 ibi->slot = NULL; in hci_pio_free_ibi_slot()
875 struct hci_pio_ibi_data *ibi = &pio->ibi; in hci_pio_process_ibi() local
877 if (!ibi->slot && !ibi->seg_cnt && ibi->last_seg) in hci_pio_process_ibi()
885 if (ibi->slot) { in hci_pio_process_ibi()
888 ibi->slot->len += ibi->seg_len; in hci_pio_process_ibi()
889 ibi->data_ptr += ibi->seg_len; in hci_pio_process_ibi()
890 if (ibi->last_seg) { in hci_pio_process_ibi()
892 i3c_master_queue_ibi(ibi->slot->dev, ibi->slot); in hci_pio_process_ibi()
893 ibi->slot = NULL; in hci_pio_process_ibi()
897 } else if (ibi->seg_cnt) { in hci_pio_process_ibi()
909 } while (--ibi->seg_cnt); in hci_pio_process_ibi()
910 if (ibi->last_seg) in hci_pio_process_ibi()
920 if (ibi->addr != ibi_addr) { in hci_pio_process_ibi()
924 ibi->addr, ibi_addr); in hci_pio_process_ibi()
927 ibi->last_seg = ibi_status & IBI_LAST_STATUS; in hci_pio_process_ibi()
928 ibi->seg_len = FIELD_GET(IBI_DATA_LENGTH, ibi_status); in hci_pio_process_ibi()
929 ibi->seg_cnt = ibi->seg_len; in hci_pio_process_ibi()
930 if (ibi->slot && ibi->slot->len + ibi->seg_len > ibi->max_len) { in hci_pio_process_ibi()
933 ibi->slot->len + ibi->seg_len, ibi->max_len); in hci_pio_process_ibi()