Lines Matching refs:phm

138 	struct hpi_message *phm, struct hpi_response *phr);
140 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
145 static void subsys_create_adapter(struct hpi_message *phm,
148 struct hpi_message *phm, struct hpi_response *phr);
159 struct hpi_message *phm, struct hpi_response *phr);
162 struct hpi_message *phm, struct hpi_response *phr);
165 struct hpi_message *phm, struct hpi_response *phr);
167 struct hpi_message *phm, struct hpi_response *phr);
170 struct hpi_message *phm, struct hpi_response *phr);
173 struct hpi_message *phm, struct hpi_response *phr);
176 struct hpi_message *phm, struct hpi_response *phr);
179 struct hpi_message *phm, struct hpi_response *phr);
182 struct hpi_message *phm, struct hpi_response *phr);
185 struct hpi_message *phm, struct hpi_response *phr);
188 struct hpi_message *phm, struct hpi_response *phr);
191 struct hpi_message *phm, struct hpi_response *phr);
194 struct hpi_message *phm, struct hpi_response *phr);
197 struct hpi_message *phm, struct hpi_response *phr);
222 struct hpi_message *phm, struct hpi_response *phr) in subsys_message() argument
224 switch (phm->function) { in subsys_message()
226 subsys_create_adapter(phm, phr); in subsys_message()
235 struct hpi_message *phm, struct hpi_response *phr) in control_message() argument
241 switch (phm->function) { in control_message()
245 if (hpi_check_control_cache(phw->p_cache, phm, phr)) { in control_message()
247 } else if (phm->u.c.attribute == HPI_METER_PEAK) { in control_message()
252 hw_message(pao, phm, phr); in control_message()
257 hw_message(pao, phm, phr); in control_message()
260 hw_message(pao, phm, phr); in control_message()
262 hpi_cmn_control_cache_sync_to_msg(phw->p_cache, phm, in control_message()
272 struct hpi_message *phm, struct hpi_response *phr) in adapter_message() argument
274 switch (phm->function) { in adapter_message()
276 adapter_delete(pao, phm, phr); in adapter_message()
279 hw_message(pao, phm, phr); in adapter_message()
285 struct hpi_message *phm, struct hpi_response *phr) in outstream_message() argument
288 if (phm->obj_index >= HPI_MAX_STREAMS) { in outstream_message()
292 "on adapter index %d\n", phm->obj_index, in outstream_message()
293 phm->adapter_index); in outstream_message()
297 switch (phm->function) { in outstream_message()
299 outstream_write(pao, phm, phr); in outstream_message()
302 outstream_get_info(pao, phm, phr); in outstream_message()
305 outstream_host_buffer_allocate(pao, phm, phr); in outstream_message()
308 outstream_host_buffer_get_info(pao, phm, phr); in outstream_message()
311 outstream_host_buffer_free(pao, phm, phr); in outstream_message()
314 outstream_start(pao, phm, phr); in outstream_message()
317 outstream_open(pao, phm, phr); in outstream_message()
320 outstream_reset(pao, phm, phr); in outstream_message()
323 hw_message(pao, phm, phr); in outstream_message()
329 struct hpi_message *phm, struct hpi_response *phr) in instream_message() argument
332 if (phm->obj_index >= HPI_MAX_STREAMS) { in instream_message()
336 "on adapter index %d\n", phm->obj_index, in instream_message()
337 phm->adapter_index); in instream_message()
341 switch (phm->function) { in instream_message()
343 instream_read(pao, phm, phr); in instream_message()
346 instream_get_info(pao, phm, phr); in instream_message()
349 instream_host_buffer_allocate(pao, phm, phr); in instream_message()
352 instream_host_buffer_get_info(pao, phm, phr); in instream_message()
355 instream_host_buffer_free(pao, phm, phr); in instream_message()
358 instream_start(pao, phm, phr); in instream_message()
361 hw_message(pao, phm, phr); in instream_message()
371 void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, in _HPI_6205() argument
375 && (phm->function != HPI_ADAPTER_DEBUG_READ)) { in _HPI_6205()
377 hpi_init_response(phr, phm->object, phm->function, in _HPI_6205()
379 HPI_DEBUG_LOG(WARNING, " %d,%d dsp crashed.\n", phm->object, in _HPI_6205()
380 phm->function); in _HPI_6205()
385 if (phm->function != HPI_SUBSYS_CREATE_ADAPTER) in _HPI_6205()
389 switch (phm->type) { in _HPI_6205()
391 switch (phm->object) { in _HPI_6205()
393 subsys_message(pao, phm, phr); in _HPI_6205()
397 adapter_message(pao, phm, phr); in _HPI_6205()
401 control_message(pao, phm, phr); in _HPI_6205()
405 outstream_message(pao, phm, phr); in _HPI_6205()
409 instream_message(pao, phm, phr); in _HPI_6205()
413 hw_message(pao, phm, phr); in _HPI_6205()
424 void HPI_6205(struct hpi_message *phm, struct hpi_response *phr) in HPI_6205() argument
428 if (phm->object != HPI_OBJ_SUBSYSTEM) { in HPI_6205()
430 pao = hpi_find_adapter(phm->adapter_index); in HPI_6205()
433 _HPI_6205(NULL, phm, phr); in HPI_6205()
438 _HPI_6205(pao, phm, phr); in HPI_6205()
440 hpi_init_response(phr, phm->object, phm->function, in HPI_6205()
452 static void subsys_create_adapter(struct hpi_message *phm, in subsys_create_adapter() argument
471 ao.pci = *phm->u.s.resource.r.pci; in subsys_create_adapter()
492 struct hpi_message *phm, struct hpi_response *phr) in adapter_delete() argument
730 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_allocate() argument
733 u32 command = phm->u.d.u.buffer.command; in outstream_host_buffer_allocate()
737 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_host_buffer_allocate()
744 phm->u.d.u.buffer.buffer_size = in outstream_host_buffer_allocate()
745 roundup_pow_of_two(phm->u.d.u.buffer.buffer_size); in outstream_host_buffer_allocate()
749 phw->outstream_host_buffer_size[phm->obj_index]; in outstream_host_buffer_allocate()
751 phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
753 if (phw->outstream_host_buffer_size[phm->obj_index] == in outstream_host_buffer_allocate()
754 phm->u.d.u.buffer.buffer_size) { in outstream_host_buffer_allocate()
759 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_host_buffer_allocate()
762 [phm->obj_index]); in outstream_host_buffer_allocate()
765 [phm->obj_index], phm->u.d.u.buffer.buffer_size, in outstream_host_buffer_allocate()
770 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
775 (&phw->outstream_host_buffers[phm->obj_index], in outstream_host_buffer_allocate()
776 &phm->u.d.u.buffer.pci_address); in outstream_host_buffer_allocate()
782 phm->u.d.u.buffer.pci_address; in outstream_host_buffer_allocate()
786 [phm->obj_index]); in outstream_host_buffer_allocate()
787 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
800 if (phm->u.d.u.buffer.buffer_size & (phm->u.d.u.buffer. in outstream_host_buffer_allocate()
804 phm->u.d.u.buffer.buffer_size); in outstream_host_buffer_allocate()
808 phw->outstream_host_buffer_size[phm->obj_index] = in outstream_host_buffer_allocate()
809 phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
810 status = &interface->outstream_host_buffer_status[phm-> in outstream_host_buffer_allocate()
816 status->size_in_bytes = phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
819 hw_message(pao, phm, phr); in outstream_host_buffer_allocate()
823 outstream_host_buffers[phm->obj_index])) { in outstream_host_buffer_allocate()
825 [phm->obj_index]); in outstream_host_buffer_allocate()
826 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
832 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_get_info() argument
839 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_host_buffer_get_info()
842 outstream_host_buffers[phm->obj_index], in outstream_host_buffer_get_info()
847 status = &interface->outstream_host_buffer_status[phm-> in outstream_host_buffer_get_info()
861 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_free() argument
864 u32 command = phm->u.d.u.buffer.command; in outstream_host_buffer_free()
866 if (phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_host_buffer_free()
869 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_free()
870 hw_message(pao, phm, phr); in outstream_host_buffer_free()
876 [phm->obj_index]); in outstream_host_buffer_free()
893 struct hpi_message *phm, struct hpi_response *phr) in outstream_write() argument
900 if (!phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_write()
902 hw_message(pao, phm, phr); in outstream_write()
906 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_write()
907 status = &interface->outstream_host_buffer_status[phm->obj_index]; in outstream_write()
910 if (space_available < phm->u.d.u.data.data_size) { in outstream_write()
917 if (phm->u.d.u.data.pb_data in outstream_write()
918 && hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_write()
922 u8 *p_app_data = (u8 *)phm->u.d.u.data.pb_data; in outstream_write()
925 outstream_host_buffers[phm->obj_index], in outstream_write()
934 min(phm->u.d.u.data.data_size, in outstream_write()
943 phm->u.d.u.data.data_size - l_first_write); in outstream_write()
952 if (phw->flag_outstream_just_reset[phm->obj_index]) { in outstream_write()
954 u16 function = phm->function; in outstream_write()
955 phw->flag_outstream_just_reset[phm->obj_index] = 0; in outstream_write()
956 phm->function = HPI_OSTREAM_SET_FORMAT; in outstream_write()
957 hw_message(pao, phm, phr); /* send the format to the DSP */ in outstream_write()
958 phm->function = function; in outstream_write()
963 status->host_index += phm->u.d.u.data.data_size; in outstream_write()
967 struct hpi_message *phm, struct hpi_response *phr) in outstream_get_info() argument
973 if (!phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_get_info()
974 hw_message(pao, phm, phr); in outstream_get_info()
978 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_get_info()
980 status = &interface->outstream_host_buffer_status[phm->obj_index]; in outstream_get_info()
993 struct hpi_message *phm, struct hpi_response *phr) in outstream_start() argument
995 hw_message(pao, phm, phr); in outstream_start()
999 struct hpi_message *phm, struct hpi_response *phr) in outstream_reset() argument
1002 phw->flag_outstream_just_reset[phm->obj_index] = 1; in outstream_reset()
1003 hw_message(pao, phm, phr); in outstream_reset()
1007 struct hpi_message *phm, struct hpi_response *phr) in outstream_open() argument
1009 outstream_reset(pao, phm, phr); in outstream_open()
1016 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_allocate() argument
1019 u32 command = phm->u.d.u.buffer.command; in instream_host_buffer_allocate()
1023 hpi_init_response(phr, phm->object, phm->function, 0); in instream_host_buffer_allocate()
1028 phm->u.d.u.buffer.buffer_size = in instream_host_buffer_allocate()
1029 roundup_pow_of_two(phm->u.d.u.buffer.buffer_size); in instream_host_buffer_allocate()
1031 phw->instream_host_buffer_size[phm->obj_index]; in instream_host_buffer_allocate()
1033 phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1035 if (phw->instream_host_buffer_size[phm->obj_index] == in instream_host_buffer_allocate()
1036 phm->u.d.u.buffer.buffer_size) { in instream_host_buffer_allocate()
1041 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_host_buffer_allocate()
1044 [phm->obj_index]); in instream_host_buffer_allocate()
1046 err = hpios_locked_mem_alloc(&phw->instream_host_buffers[phm-> in instream_host_buffer_allocate()
1047 obj_index], phm->u.d.u.buffer.buffer_size, in instream_host_buffer_allocate()
1052 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1057 (&phw->instream_host_buffers[phm->obj_index], in instream_host_buffer_allocate()
1058 &phm->u.d.u.buffer.pci_address); in instream_host_buffer_allocate()
1062 phm->u.d.u.buffer.pci_address; in instream_host_buffer_allocate()
1065 [phm->obj_index]); in instream_host_buffer_allocate()
1066 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1076 if (phm->u.d.u.buffer.buffer_size & (phm->u.d.u.buffer. in instream_host_buffer_allocate()
1080 phm->u.d.u.buffer.buffer_size); in instream_host_buffer_allocate()
1085 phw->instream_host_buffer_size[phm->obj_index] = in instream_host_buffer_allocate()
1086 phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1087 status = &interface->instream_host_buffer_status[phm-> in instream_host_buffer_allocate()
1093 status->size_in_bytes = phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1096 hw_message(pao, phm, phr); in instream_host_buffer_allocate()
1100 instream_host_buffers[phm->obj_index])) { in instream_host_buffer_allocate()
1102 [phm->obj_index]); in instream_host_buffer_allocate()
1103 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1109 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_get_info() argument
1116 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_host_buffer_get_info()
1119 instream_host_buffers[phm->obj_index], in instream_host_buffer_get_info()
1124 status = &interface->instream_host_buffer_status[phm-> in instream_host_buffer_get_info()
1138 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_free() argument
1141 u32 command = phm->u.d.u.buffer.command; in instream_host_buffer_free()
1143 if (phw->instream_host_buffer_size[phm->obj_index]) { in instream_host_buffer_free()
1146 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_free()
1147 hw_message(pao, phm, phr); in instream_host_buffer_free()
1153 [phm->obj_index]); in instream_host_buffer_free()
1166 struct hpi_message *phm, struct hpi_response *phr) in instream_start() argument
1168 hw_message(pao, phm, phr); in instream_start()
1177 struct hpi_message *phm, struct hpi_response *phr) in instream_read() argument
1185 u8 *p_app_data = (u8 *)phm->u.d.u.data.pb_data; in instream_read()
1187 if (!phw->instream_host_buffer_size[phm->obj_index]) { in instream_read()
1188 hw_message(pao, phm, phr); in instream_read()
1191 hpi_init_response(phr, phm->object, phm->function, 0); in instream_read()
1193 status = &interface->instream_host_buffer_status[phm->obj_index]; in instream_read()
1195 if (data_available < phm->u.d.u.data.data_size) { in instream_read()
1200 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_read()
1203 instream_host_buffers[phm->obj_index], in instream_read()
1212 min(phm->u.d.u.data.data_size, in instream_read()
1222 phm->u.d.u.data.data_size - l_first_read); in instream_read()
1224 status->host_index += phm->u.d.u.data.data_size; in instream_read()
1228 struct hpi_message *phm, struct hpi_response *phr) in instream_get_info() argument
1233 if (!phw->instream_host_buffer_size[phm->obj_index]) { in instream_get_info()
1234 hw_message(pao, phm, phr); in instream_get_info()
1238 status = &interface->instream_host_buffer_status[phm->obj_index]; in instream_get_info()
1240 hpi_init_response(phr, phm->object, phm->function, 0); in instream_get_info()
2085 struct hpi_message *phm, struct hpi_response *phr) in message_response_sequence() argument
2093 if (phm->size > sizeof(interface->u.message_buffer)) { in message_response_sequence()
2098 "message len %d too big for buffer %zd \n", phm->size, in message_response_sequence()
2111 memcpy(&interface->u.message_buffer, phm, phm->size); in message_response_sequence()
2156 if (phm->function == HPI_ADAPTER_CLOSE) { in message_response_sequence()
2164 err = hpi_validate_response(phm, phr); in message_response_sequence()
2168 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, in hw_message() argument
2176 err = message_response_sequence(pao, phm, phr); in hw_message()
2199 switch (phm->function) { in hw_message()
2202 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2203 phm->u.d.u.data.data_size, H620_HIF_SEND_DATA); in hw_message()
2208 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2209 phm->u.d.u.data.data_size, H620_HIF_GET_DATA); in hw_message()