Lines Matching refs:phm

149 	struct hpi_message *phm, struct hpi_response *phr);
151 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm,
156 static void subsys_create_adapter(struct hpi_message *phm,
159 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);
178 struct hpi_message *phm, struct hpi_response *phr);
181 struct hpi_message *phm, struct hpi_response *phr);
184 struct hpi_message *phm, struct hpi_response *phr);
187 struct hpi_message *phm, struct hpi_response *phr);
190 struct hpi_message *phm, struct hpi_response *phr);
193 struct hpi_message *phm, struct hpi_response *phr);
196 struct hpi_message *phm, struct hpi_response *phr);
199 struct hpi_message *phm, struct hpi_response *phr);
202 struct hpi_message *phm, struct hpi_response *phr);
205 struct hpi_message *phm, struct hpi_response *phr);
208 struct hpi_message *phm, struct hpi_response *phr);
233 struct hpi_message *phm, struct hpi_response *phr) in subsys_message() argument
235 switch (phm->function) { in subsys_message()
237 subsys_create_adapter(phm, phr); in subsys_message()
246 struct hpi_message *phm, struct hpi_response *phr) in control_message() argument
252 switch (phm->function) { in control_message()
256 if (hpi_check_control_cache(phw->p_cache, phm, phr)) { in control_message()
258 } else if (phm->u.c.attribute == HPI_METER_PEAK) { in control_message()
263 hw_message(pao, phm, phr); in control_message()
268 hw_message(pao, phm, phr); in control_message()
271 hw_message(pao, phm, phr); in control_message()
273 hpi_cmn_control_cache_sync_to_msg(phw->p_cache, phm, in control_message()
283 struct hpi_message *phm, struct hpi_response *phr) in adapter_message() argument
285 switch (phm->function) { in adapter_message()
287 adapter_delete(pao, phm, phr); in adapter_message()
290 hw_message(pao, phm, phr); in adapter_message()
296 struct hpi_message *phm, struct hpi_response *phr) in outstream_message() argument
299 if (phm->obj_index >= HPI_MAX_STREAMS) { in outstream_message()
303 "on adapter index %d\n", phm->obj_index, in outstream_message()
304 phm->adapter_index); in outstream_message()
308 switch (phm->function) { in outstream_message()
310 outstream_write(pao, phm, phr); in outstream_message()
313 outstream_get_info(pao, phm, phr); in outstream_message()
316 outstream_host_buffer_allocate(pao, phm, phr); in outstream_message()
319 outstream_host_buffer_get_info(pao, phm, phr); in outstream_message()
322 outstream_host_buffer_free(pao, phm, phr); in outstream_message()
325 outstream_start(pao, phm, phr); in outstream_message()
328 outstream_open(pao, phm, phr); in outstream_message()
331 outstream_reset(pao, phm, phr); in outstream_message()
334 hw_message(pao, phm, phr); in outstream_message()
340 struct hpi_message *phm, struct hpi_response *phr) in instream_message() argument
343 if (phm->obj_index >= HPI_MAX_STREAMS) { in instream_message()
347 "on adapter index %d\n", phm->obj_index, in instream_message()
348 phm->adapter_index); in instream_message()
352 switch (phm->function) { in instream_message()
354 instream_read(pao, phm, phr); in instream_message()
357 instream_get_info(pao, phm, phr); in instream_message()
360 instream_host_buffer_allocate(pao, phm, phr); in instream_message()
363 instream_host_buffer_get_info(pao, phm, phr); in instream_message()
366 instream_host_buffer_free(pao, phm, phr); in instream_message()
369 instream_start(pao, phm, phr); in instream_message()
372 hw_message(pao, phm, phr); in instream_message()
382 void _HPI_6205(struct hpi_adapter_obj *pao, struct hpi_message *phm, in _HPI_6205() argument
386 && (phm->function != HPI_ADAPTER_DEBUG_READ)) { in _HPI_6205()
388 hpi_init_response(phr, phm->object, phm->function, in _HPI_6205()
390 HPI_DEBUG_LOG(WARNING, " %d,%d dsp crashed.\n", phm->object, in _HPI_6205()
391 phm->function); in _HPI_6205()
396 if (phm->function != HPI_SUBSYS_CREATE_ADAPTER) in _HPI_6205()
400 switch (phm->type) { in _HPI_6205()
402 switch (phm->object) { in _HPI_6205()
404 subsys_message(pao, phm, phr); in _HPI_6205()
408 adapter_message(pao, phm, phr); in _HPI_6205()
412 control_message(pao, phm, phr); in _HPI_6205()
416 outstream_message(pao, phm, phr); in _HPI_6205()
420 instream_message(pao, phm, phr); in _HPI_6205()
424 hw_message(pao, phm, phr); in _HPI_6205()
435 void HPI_6205(struct hpi_message *phm, struct hpi_response *phr) in HPI_6205() argument
439 if (phm->object != HPI_OBJ_SUBSYSTEM) { in HPI_6205()
441 pao = hpi_find_adapter(phm->adapter_index); in HPI_6205()
444 _HPI_6205(NULL, phm, phr); in HPI_6205()
449 _HPI_6205(pao, phm, phr); in HPI_6205()
451 hpi_init_response(phr, phm->object, phm->function, in HPI_6205()
463 static void subsys_create_adapter(struct hpi_message *phm, in subsys_create_adapter() argument
482 ao.pci = *phm->u.s.resource.r.pci; in subsys_create_adapter()
503 struct hpi_message *phm, struct hpi_response *phr) in adapter_delete() argument
746 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_allocate() argument
749 u32 command = phm->u.d.u.buffer.command; in outstream_host_buffer_allocate()
753 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_host_buffer_allocate()
760 phm->u.d.u.buffer.buffer_size = in outstream_host_buffer_allocate()
761 roundup_pow_of_two(phm->u.d.u.buffer.buffer_size); in outstream_host_buffer_allocate()
765 phw->outstream_host_buffer_size[phm->obj_index]; in outstream_host_buffer_allocate()
767 phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
769 if (phw->outstream_host_buffer_size[phm->obj_index] == in outstream_host_buffer_allocate()
770 phm->u.d.u.buffer.buffer_size) { in outstream_host_buffer_allocate()
775 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_host_buffer_allocate()
778 [phm->obj_index]); in outstream_host_buffer_allocate()
781 [phm->obj_index], phm->u.d.u.buffer.buffer_size, in outstream_host_buffer_allocate()
786 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
791 (&phw->outstream_host_buffers[phm->obj_index], in outstream_host_buffer_allocate()
792 &phm->u.d.u.buffer.pci_address); in outstream_host_buffer_allocate()
798 phm->u.d.u.buffer.pci_address; in outstream_host_buffer_allocate()
802 [phm->obj_index]); in outstream_host_buffer_allocate()
803 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
816 if (phm->u.d.u.buffer.buffer_size & (phm->u.d.u.buffer. in outstream_host_buffer_allocate()
820 phm->u.d.u.buffer.buffer_size); in outstream_host_buffer_allocate()
824 phw->outstream_host_buffer_size[phm->obj_index] = in outstream_host_buffer_allocate()
825 phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
826 status = &interface->outstream_host_buffer_status[phm-> in outstream_host_buffer_allocate()
832 status->size_in_bytes = phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
835 hw_message(pao, phm, phr); in outstream_host_buffer_allocate()
839 outstream_host_buffers[phm->obj_index])) { in outstream_host_buffer_allocate()
841 [phm->obj_index]); in outstream_host_buffer_allocate()
842 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
848 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_get_info() argument
855 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_host_buffer_get_info()
858 outstream_host_buffers[phm->obj_index], in outstream_host_buffer_get_info()
863 status = &interface->outstream_host_buffer_status[phm-> in outstream_host_buffer_get_info()
877 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_free() argument
880 u32 command = phm->u.d.u.buffer.command; in outstream_host_buffer_free()
882 if (phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_host_buffer_free()
885 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_free()
886 hw_message(pao, phm, phr); in outstream_host_buffer_free()
892 [phm->obj_index]); in outstream_host_buffer_free()
909 struct hpi_message *phm, struct hpi_response *phr) in outstream_write() argument
916 if (!phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_write()
918 hw_message(pao, phm, phr); in outstream_write()
922 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_write()
923 status = &interface->outstream_host_buffer_status[phm->obj_index]; in outstream_write()
926 if (space_available < phm->u.d.u.data.data_size) { in outstream_write()
933 if (phm->u.d.u.data.pb_data in outstream_write()
934 && hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_write()
938 u8 *p_app_data = (u8 *)phm->u.d.u.data.pb_data; in outstream_write()
941 outstream_host_buffers[phm->obj_index], in outstream_write()
950 min(phm->u.d.u.data.data_size, in outstream_write()
959 phm->u.d.u.data.data_size - l_first_write); in outstream_write()
968 if (phw->flag_outstream_just_reset[phm->obj_index]) { in outstream_write()
970 u16 function = phm->function; in outstream_write()
971 phw->flag_outstream_just_reset[phm->obj_index] = 0; in outstream_write()
972 phm->function = HPI_OSTREAM_SET_FORMAT; in outstream_write()
973 hw_message(pao, phm, phr); /* send the format to the DSP */ in outstream_write()
974 phm->function = function; in outstream_write()
979 status->host_index += phm->u.d.u.data.data_size; in outstream_write()
983 struct hpi_message *phm, struct hpi_response *phr) in outstream_get_info() argument
989 if (!phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_get_info()
990 hw_message(pao, phm, phr); in outstream_get_info()
994 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_get_info()
996 status = &interface->outstream_host_buffer_status[phm->obj_index]; in outstream_get_info()
1009 struct hpi_message *phm, struct hpi_response *phr) in outstream_start() argument
1011 hw_message(pao, phm, phr); in outstream_start()
1015 struct hpi_message *phm, struct hpi_response *phr) in outstream_reset() argument
1018 phw->flag_outstream_just_reset[phm->obj_index] = 1; in outstream_reset()
1019 hw_message(pao, phm, phr); in outstream_reset()
1023 struct hpi_message *phm, struct hpi_response *phr) in outstream_open() argument
1025 outstream_reset(pao, phm, phr); in outstream_open()
1032 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_allocate() argument
1035 u32 command = phm->u.d.u.buffer.command; in instream_host_buffer_allocate()
1039 hpi_init_response(phr, phm->object, phm->function, 0); in instream_host_buffer_allocate()
1044 phm->u.d.u.buffer.buffer_size = in instream_host_buffer_allocate()
1045 roundup_pow_of_two(phm->u.d.u.buffer.buffer_size); in instream_host_buffer_allocate()
1047 phw->instream_host_buffer_size[phm->obj_index]; in instream_host_buffer_allocate()
1049 phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1051 if (phw->instream_host_buffer_size[phm->obj_index] == in instream_host_buffer_allocate()
1052 phm->u.d.u.buffer.buffer_size) { in instream_host_buffer_allocate()
1057 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_host_buffer_allocate()
1060 [phm->obj_index]); in instream_host_buffer_allocate()
1062 err = hpios_locked_mem_alloc(&phw->instream_host_buffers[phm-> in instream_host_buffer_allocate()
1063 obj_index], phm->u.d.u.buffer.buffer_size, in instream_host_buffer_allocate()
1068 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1073 (&phw->instream_host_buffers[phm->obj_index], in instream_host_buffer_allocate()
1074 &phm->u.d.u.buffer.pci_address); in instream_host_buffer_allocate()
1078 phm->u.d.u.buffer.pci_address; in instream_host_buffer_allocate()
1081 [phm->obj_index]); in instream_host_buffer_allocate()
1082 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1092 if (phm->u.d.u.buffer.buffer_size & (phm->u.d.u.buffer. in instream_host_buffer_allocate()
1096 phm->u.d.u.buffer.buffer_size); in instream_host_buffer_allocate()
1101 phw->instream_host_buffer_size[phm->obj_index] = in instream_host_buffer_allocate()
1102 phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1103 status = &interface->instream_host_buffer_status[phm-> in instream_host_buffer_allocate()
1109 status->size_in_bytes = phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1112 hw_message(pao, phm, phr); in instream_host_buffer_allocate()
1116 instream_host_buffers[phm->obj_index])) { in instream_host_buffer_allocate()
1118 [phm->obj_index]); in instream_host_buffer_allocate()
1119 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1125 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_get_info() argument
1132 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_host_buffer_get_info()
1135 instream_host_buffers[phm->obj_index], in instream_host_buffer_get_info()
1140 status = &interface->instream_host_buffer_status[phm-> in instream_host_buffer_get_info()
1154 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_free() argument
1157 u32 command = phm->u.d.u.buffer.command; in instream_host_buffer_free()
1159 if (phw->instream_host_buffer_size[phm->obj_index]) { in instream_host_buffer_free()
1162 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_free()
1163 hw_message(pao, phm, phr); in instream_host_buffer_free()
1169 [phm->obj_index]); in instream_host_buffer_free()
1182 struct hpi_message *phm, struct hpi_response *phr) in instream_start() argument
1184 hw_message(pao, phm, phr); in instream_start()
1193 struct hpi_message *phm, struct hpi_response *phr) in instream_read() argument
1201 u8 *p_app_data = (u8 *)phm->u.d.u.data.pb_data; in instream_read()
1203 if (!phw->instream_host_buffer_size[phm->obj_index]) { in instream_read()
1204 hw_message(pao, phm, phr); in instream_read()
1207 hpi_init_response(phr, phm->object, phm->function, 0); in instream_read()
1209 status = &interface->instream_host_buffer_status[phm->obj_index]; in instream_read()
1211 if (data_available < phm->u.d.u.data.data_size) { in instream_read()
1216 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_read()
1219 instream_host_buffers[phm->obj_index], in instream_read()
1228 min(phm->u.d.u.data.data_size, in instream_read()
1238 phm->u.d.u.data.data_size - l_first_read); in instream_read()
1240 status->host_index += phm->u.d.u.data.data_size; in instream_read()
1244 struct hpi_message *phm, struct hpi_response *phr) in instream_get_info() argument
1249 if (!phw->instream_host_buffer_size[phm->obj_index]) { in instream_get_info()
1250 hw_message(pao, phm, phr); in instream_get_info()
1254 status = &interface->instream_host_buffer_status[phm->obj_index]; in instream_get_info()
1256 hpi_init_response(phr, phm->object, phm->function, 0); in instream_get_info()
2101 struct hpi_message *phm, struct hpi_response *phr) in message_response_sequence() argument
2109 if (phm->size > sizeof(interface->u.message_buffer)) { in message_response_sequence()
2114 "message len %d too big for buffer %zd \n", phm->size, in message_response_sequence()
2127 memcpy(&interface->u.message_buffer, phm, phm->size); in message_response_sequence()
2172 if (phm->function == HPI_ADAPTER_CLOSE) { in message_response_sequence()
2180 err = hpi_validate_response(phm, phr); in message_response_sequence()
2184 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, in hw_message() argument
2192 err = message_response_sequence(pao, phm, phr); in hw_message()
2215 switch (phm->function) { in hw_message()
2218 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2219 phm->u.d.u.data.data_size, H620_HIF_SEND_DATA); in hw_message()
2224 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2225 phm->u.d.u.data.data_size, H620_HIF_GET_DATA); in hw_message()