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
741 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_allocate() argument
744 u32 command = phm->u.d.u.buffer.command; in outstream_host_buffer_allocate()
748 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_host_buffer_allocate()
755 phm->u.d.u.buffer.buffer_size = in outstream_host_buffer_allocate()
756 roundup_pow_of_two(phm->u.d.u.buffer.buffer_size); in outstream_host_buffer_allocate()
760 phw->outstream_host_buffer_size[phm->obj_index]; in outstream_host_buffer_allocate()
762 phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
764 if (phw->outstream_host_buffer_size[phm->obj_index] == in outstream_host_buffer_allocate()
765 phm->u.d.u.buffer.buffer_size) { in outstream_host_buffer_allocate()
770 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_host_buffer_allocate()
773 [phm->obj_index]); in outstream_host_buffer_allocate()
776 [phm->obj_index], phm->u.d.u.buffer.buffer_size, in outstream_host_buffer_allocate()
781 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
786 (&phw->outstream_host_buffers[phm->obj_index], in outstream_host_buffer_allocate()
787 &phm->u.d.u.buffer.pci_address); in outstream_host_buffer_allocate()
793 phm->u.d.u.buffer.pci_address; in outstream_host_buffer_allocate()
797 [phm->obj_index]); in outstream_host_buffer_allocate()
798 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
811 if (phm->u.d.u.buffer.buffer_size & (phm->u.d.u.buffer. in outstream_host_buffer_allocate()
815 phm->u.d.u.buffer.buffer_size); in outstream_host_buffer_allocate()
819 phw->outstream_host_buffer_size[phm->obj_index] = in outstream_host_buffer_allocate()
820 phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
821 status = &interface->outstream_host_buffer_status[phm-> in outstream_host_buffer_allocate()
827 status->size_in_bytes = phm->u.d.u.buffer.buffer_size; in outstream_host_buffer_allocate()
830 hw_message(pao, phm, phr); in outstream_host_buffer_allocate()
834 outstream_host_buffers[phm->obj_index])) { in outstream_host_buffer_allocate()
836 [phm->obj_index]); in outstream_host_buffer_allocate()
837 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_allocate()
843 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_get_info() argument
850 if (hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_host_buffer_get_info()
853 outstream_host_buffers[phm->obj_index], in outstream_host_buffer_get_info()
858 status = &interface->outstream_host_buffer_status[phm-> in outstream_host_buffer_get_info()
872 struct hpi_message *phm, struct hpi_response *phr) in outstream_host_buffer_free() argument
875 u32 command = phm->u.d.u.buffer.command; in outstream_host_buffer_free()
877 if (phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_host_buffer_free()
880 phw->outstream_host_buffer_size[phm->obj_index] = 0; in outstream_host_buffer_free()
881 hw_message(pao, phm, phr); in outstream_host_buffer_free()
887 [phm->obj_index]); in outstream_host_buffer_free()
904 struct hpi_message *phm, struct hpi_response *phr) in outstream_write() argument
911 if (!phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_write()
913 hw_message(pao, phm, phr); in outstream_write()
917 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_write()
918 status = &interface->outstream_host_buffer_status[phm->obj_index]; in outstream_write()
921 if (space_available < phm->u.d.u.data.data_size) { in outstream_write()
928 if (phm->u.d.u.data.pb_data in outstream_write()
929 && hpios_locked_mem_valid(&phw->outstream_host_buffers[phm-> in outstream_write()
933 u8 *p_app_data = (u8 *)phm->u.d.u.data.pb_data; in outstream_write()
936 outstream_host_buffers[phm->obj_index], in outstream_write()
945 min(phm->u.d.u.data.data_size, in outstream_write()
954 phm->u.d.u.data.data_size - l_first_write); in outstream_write()
963 if (phw->flag_outstream_just_reset[phm->obj_index]) { in outstream_write()
965 u16 function = phm->function; in outstream_write()
966 phw->flag_outstream_just_reset[phm->obj_index] = 0; in outstream_write()
967 phm->function = HPI_OSTREAM_SET_FORMAT; in outstream_write()
968 hw_message(pao, phm, phr); /* send the format to the DSP */ in outstream_write()
969 phm->function = function; in outstream_write()
974 status->host_index += phm->u.d.u.data.data_size; in outstream_write()
978 struct hpi_message *phm, struct hpi_response *phr) in outstream_get_info() argument
984 if (!phw->outstream_host_buffer_size[phm->obj_index]) { in outstream_get_info()
985 hw_message(pao, phm, phr); in outstream_get_info()
989 hpi_init_response(phr, phm->object, phm->function, 0); in outstream_get_info()
991 status = &interface->outstream_host_buffer_status[phm->obj_index]; in outstream_get_info()
1004 struct hpi_message *phm, struct hpi_response *phr) in outstream_start() argument
1006 hw_message(pao, phm, phr); in outstream_start()
1010 struct hpi_message *phm, struct hpi_response *phr) in outstream_reset() argument
1013 phw->flag_outstream_just_reset[phm->obj_index] = 1; in outstream_reset()
1014 hw_message(pao, phm, phr); in outstream_reset()
1018 struct hpi_message *phm, struct hpi_response *phr) in outstream_open() argument
1020 outstream_reset(pao, phm, phr); in outstream_open()
1027 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_allocate() argument
1030 u32 command = phm->u.d.u.buffer.command; in instream_host_buffer_allocate()
1034 hpi_init_response(phr, phm->object, phm->function, 0); in instream_host_buffer_allocate()
1039 phm->u.d.u.buffer.buffer_size = in instream_host_buffer_allocate()
1040 roundup_pow_of_two(phm->u.d.u.buffer.buffer_size); in instream_host_buffer_allocate()
1042 phw->instream_host_buffer_size[phm->obj_index]; in instream_host_buffer_allocate()
1044 phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1046 if (phw->instream_host_buffer_size[phm->obj_index] == in instream_host_buffer_allocate()
1047 phm->u.d.u.buffer.buffer_size) { in instream_host_buffer_allocate()
1052 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_host_buffer_allocate()
1055 [phm->obj_index]); in instream_host_buffer_allocate()
1057 err = hpios_locked_mem_alloc(&phw->instream_host_buffers[phm-> in instream_host_buffer_allocate()
1058 obj_index], phm->u.d.u.buffer.buffer_size, in instream_host_buffer_allocate()
1063 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1068 (&phw->instream_host_buffers[phm->obj_index], in instream_host_buffer_allocate()
1069 &phm->u.d.u.buffer.pci_address); in instream_host_buffer_allocate()
1073 phm->u.d.u.buffer.pci_address; in instream_host_buffer_allocate()
1076 [phm->obj_index]); in instream_host_buffer_allocate()
1077 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1087 if (phm->u.d.u.buffer.buffer_size & (phm->u.d.u.buffer. in instream_host_buffer_allocate()
1091 phm->u.d.u.buffer.buffer_size); in instream_host_buffer_allocate()
1096 phw->instream_host_buffer_size[phm->obj_index] = in instream_host_buffer_allocate()
1097 phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1098 status = &interface->instream_host_buffer_status[phm-> in instream_host_buffer_allocate()
1104 status->size_in_bytes = phm->u.d.u.buffer.buffer_size; in instream_host_buffer_allocate()
1107 hw_message(pao, phm, phr); in instream_host_buffer_allocate()
1111 instream_host_buffers[phm->obj_index])) { in instream_host_buffer_allocate()
1113 [phm->obj_index]); in instream_host_buffer_allocate()
1114 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_allocate()
1120 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_get_info() argument
1127 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_host_buffer_get_info()
1130 instream_host_buffers[phm->obj_index], in instream_host_buffer_get_info()
1135 status = &interface->instream_host_buffer_status[phm-> in instream_host_buffer_get_info()
1149 struct hpi_message *phm, struct hpi_response *phr) in instream_host_buffer_free() argument
1152 u32 command = phm->u.d.u.buffer.command; in instream_host_buffer_free()
1154 if (phw->instream_host_buffer_size[phm->obj_index]) { in instream_host_buffer_free()
1157 phw->instream_host_buffer_size[phm->obj_index] = 0; in instream_host_buffer_free()
1158 hw_message(pao, phm, phr); in instream_host_buffer_free()
1164 [phm->obj_index]); in instream_host_buffer_free()
1177 struct hpi_message *phm, struct hpi_response *phr) in instream_start() argument
1179 hw_message(pao, phm, phr); in instream_start()
1188 struct hpi_message *phm, struct hpi_response *phr) in instream_read() argument
1196 u8 *p_app_data = (u8 *)phm->u.d.u.data.pb_data; in instream_read()
1198 if (!phw->instream_host_buffer_size[phm->obj_index]) { in instream_read()
1199 hw_message(pao, phm, phr); in instream_read()
1202 hpi_init_response(phr, phm->object, phm->function, 0); in instream_read()
1204 status = &interface->instream_host_buffer_status[phm->obj_index]; in instream_read()
1206 if (data_available < phm->u.d.u.data.data_size) { in instream_read()
1211 if (hpios_locked_mem_valid(&phw->instream_host_buffers[phm-> in instream_read()
1214 instream_host_buffers[phm->obj_index], in instream_read()
1223 min(phm->u.d.u.data.data_size, in instream_read()
1233 phm->u.d.u.data.data_size - l_first_read); in instream_read()
1235 status->host_index += phm->u.d.u.data.data_size; in instream_read()
1239 struct hpi_message *phm, struct hpi_response *phr) in instream_get_info() argument
1244 if (!phw->instream_host_buffer_size[phm->obj_index]) { in instream_get_info()
1245 hw_message(pao, phm, phr); in instream_get_info()
1249 status = &interface->instream_host_buffer_status[phm->obj_index]; in instream_get_info()
1251 hpi_init_response(phr, phm->object, phm->function, 0); in instream_get_info()
2096 struct hpi_message *phm, struct hpi_response *phr) in message_response_sequence() argument
2104 if (phm->size > sizeof(interface->u.message_buffer)) { in message_response_sequence()
2109 "message len %d too big for buffer %zd \n", phm->size, in message_response_sequence()
2122 memcpy(&interface->u.message_buffer, phm, phm->size); in message_response_sequence()
2167 if (phm->function == HPI_ADAPTER_CLOSE) { in message_response_sequence()
2175 err = hpi_validate_response(phm, phr); in message_response_sequence()
2179 static void hw_message(struct hpi_adapter_obj *pao, struct hpi_message *phm, in hw_message() argument
2187 err = message_response_sequence(pao, phm, phr); in hw_message()
2210 switch (phm->function) { in hw_message()
2213 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2214 phm->u.d.u.data.data_size, H620_HIF_SEND_DATA); in hw_message()
2219 err = hpi6205_transfer_data(pao, phm->u.d.u.data.pb_data, in hw_message()
2220 phm->u.d.u.data.data_size, H620_HIF_GET_DATA); in hw_message()