Lines Matching refs:ept

191 	struct ept_data ept[NUM_EPT];	/* Array of registered endpoints. */  member
613 struct ept_data *ept; in find_ept_by_name() local
624 ept = &dev_data->ept[i]; in find_ept_by_name()
625 if (atomic_get(&ept->state) == EPT_CONFIGURED && in find_ept_by_name()
626 strncmp(ept->cfg->name, name, name_size) == 0) { in find_ept_by_name()
652 struct ept_data *ept; in match_bound_msg() local
665 ept = &dev_data->ept[ept_index]; in match_bound_msg()
666 ept->addr = ept_addr; in match_bound_msg()
667 dev_data->ept_map[ept->addr] = ept_index; in match_bound_msg()
668 valid_state = atomic_cas(&ept->state, EPT_CONFIGURED, EPT_READY); in match_bound_msg()
675 if (ept->cfg->cb.bound != NULL) { in match_bound_msg()
676 ept->cfg->cb.bound(ept->cfg->priv); in match_bound_msg()
695 static int send_bound_message(struct backend_data *dev_data, struct ept_data *ept) in send_bound_message() argument
702 msg_len = strlen(ept->cfg->name) + 1; in send_bound_message()
706 strcpy(buffer, ept->cfg->name); in send_bound_message()
707 r = send_block(dev_data, MSG_BOUND, ept->addr, r, msg_len); in send_bound_message()
736 struct ept_data *ept = NULL; in ept_bound_process() local
749 ept = &dev_data->ept[i]; in ept_bound_process()
750 matching_state = atomic_cas(&ept->state, EPT_CONFIGURED, in ept_bound_process()
753 r = send_bound_message(dev_data, ept); in ept_bound_process()
755 atomic_set(&ept->state, EPT_UNCONFIGURED); in ept_bound_process()
791 ept = &dev_data->ept[i]; in ept_bound_process()
792 matching_state = atomic_cas(&ept->rebound_state, EPT_REBOUNDING, in ept_bound_process()
795 if (ept->cfg->cb.bound != NULL) { in ept_bound_process()
796 ept->cfg->cb.bound(ept->cfg->priv); in ept_bound_process()
810 struct ept_data *ept; in get_ept_and_rx_validate() local
818 ept = &dev_data->ept[dev_data->ept_map[ept_addr]]; in get_ept_and_rx_validate()
820 state = atomic_get(&ept->state); in get_ept_and_rx_validate()
824 if (atomic_get(&ept->rebound_state) != EPT_NORMAL) { in get_ept_and_rx_validate()
829 atomic_set(&ept->state, EPT_READY); in get_ept_and_rx_validate()
830 if (ept->cfg->cb.bound != NULL) { in get_ept_and_rx_validate()
831 ept->cfg->cb.bound(ept->cfg->priv); in get_ept_and_rx_validate()
834 LOG_ERR("Invalid state %d of receiving endpoint %d", state, ept->addr); in get_ept_and_rx_validate()
838 return ept; in get_ept_and_rx_validate()
849 struct ept_data *ept; in received_data() local
855 ept = get_ept_and_rx_validate(dev_data, ept_addr); in received_data()
856 if (buffer == NULL || ept == NULL) { in received_data()
866 ept->cfg->cb.received(buffer, size, ept->cfg->priv); in received_data()
952 struct ept_data *ept; in control_received() local
975 ept = get_ept_and_rx_validate(dev_data, ept_addr); in control_received()
976 if (ept == NULL) { in control_received()
1056 struct ept_data *ept = token; in send() local
1072 r = send_block(dev_data, MSG_DATA, ept->addr, r, len); in send()
1087 struct ept_data *ept = NULL; in register_ept() local
1094 ept = &dev_data->ept[ept_index]; in register_ept()
1095 if (ept->cfg == cfg) { in register_ept()
1096 matching_state = atomic_cas(&ept->rebound_state, EPT_DEREGISTERED, in register_ept()
1119 ept = &dev_data->ept[ept_index]; in register_ept()
1120 ept->cfg = cfg; in register_ept()
1122 ept->addr = ept_index; in register_ept()
1123 dev_data->ept_map[ept->addr] = ept->addr; in register_ept()
1125 atomic_set(&ept->state, EPT_CONFIGURED); in register_ept()
1128 *token = ept; in register_ept()
1145 struct ept_data *ept = token; in deregister_ept() local
1148 matching_state = atomic_cas(&ept->rebound_state, EPT_NORMAL, EPT_DEREGISTERED); in deregister_ept()
1206 struct ept_data *ept = token; in send_nocopy() local
1216 return send_block(dev_data, MSG_DATA, ept->addr, r, len); in send_nocopy()