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