Lines Matching +full:sfc +full:- +full:no +full:- +full:dma

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Function Control Protocol (IEC 61883-1) helper functions
10 #include <linux/firewire-constants.h>
20 #include "amdtp-stream.h"
32 unsigned int sfc; in avc_general_set_sig_fmt() local
38 for (sfc = 0; sfc < CIP_SFC_COUNT; sfc++) { in avc_general_set_sig_fmt()
39 if (amdtp_rate_table[sfc] == rate) { in avc_general_set_sig_fmt()
45 return -EINVAL; in avc_general_set_sig_fmt()
49 return -ENOMEM; in avc_general_set_sig_fmt()
59 buf[5] = 0x07 & sfc; /* FDF-hi. AM824, frequency */ in avc_general_set_sig_fmt()
60 buf[6] = 0xff; /* FDF-mid. AM824, SYT hi (not used)*/ in avc_general_set_sig_fmt()
61 buf[7] = 0xff; /* FDF-low. AM824, SYT lo (not used) */ in avc_general_set_sig_fmt()
63 /* do transaction and check buf[1-5] are the same against command */ in avc_general_set_sig_fmt()
69 err = -EIO; in avc_general_set_sig_fmt()
71 err = -ENOSYS; in avc_general_set_sig_fmt()
73 err = -EINVAL; in avc_general_set_sig_fmt()
88 unsigned int sfc; in avc_general_get_sig_fmt() local
94 return -ENOMEM; in avc_general_get_sig_fmt()
104 buf[5] = 0xff; /* FDF-hi. AM824, frequency */ in avc_general_get_sig_fmt()
105 buf[6] = 0xff; /* FDF-mid. AM824, SYT hi (not used) */ in avc_general_get_sig_fmt()
106 buf[7] = 0xff; /* FDF-low. AM824, SYT lo (not used) */ in avc_general_get_sig_fmt()
108 /* do transaction and check buf[1-4] are the same against command */ in avc_general_get_sig_fmt()
114 err = -EIO; in avc_general_get_sig_fmt()
116 err = -ENOSYS; in avc_general_get_sig_fmt()
118 err = -EINVAL; in avc_general_get_sig_fmt()
120 err = -EAGAIN; in avc_general_get_sig_fmt()
124 /* check sfc field and pick up rate */ in avc_general_get_sig_fmt()
125 sfc = 0x07 & buf[5]; in avc_general_get_sig_fmt()
126 if (sfc >= CIP_SFC_COUNT) { in avc_general_get_sig_fmt()
127 err = -EAGAIN; /* also in transition */ in avc_general_get_sig_fmt()
131 *rate = amdtp_rate_table[sfc]; in avc_general_get_sig_fmt()
148 return -EINVAL; in avc_general_get_plug_info()
152 return -ENOMEM; in avc_general_get_plug_info()
164 err = -EIO; in avc_general_get_plug_info()
166 err = -ENOSYS; in avc_general_get_plug_info()
168 err = -EINVAL; in avc_general_get_plug_info()
170 err = -EAGAIN; in avc_general_get_plug_info()
208 * fcp_avc_transaction - send an AV/C command and wait for its response
210 * @command: a buffer containing the command frame; must be DMA-able
263 * 'AV/C General Specification' define no time limit in fcp_avc_transaction()
277 dev_err(&t.unit->device, "FCP command timed out\n"); in fcp_avc_transaction()
278 ret = -EIO; in fcp_avc_transaction()
292 * fcp_bus_reset - inform the target handler about a bus reset
305 if (t->unit == unit && in fcp_bus_reset()
306 (t->state == STATE_PENDING || in fcp_bus_reset()
307 t->state == STATE_DEFERRED)) { in fcp_bus_reset()
308 t->state = STATE_BUS_RESET; in fcp_bus_reset()
309 wake_up(&t->wait); in fcp_bus_reset()
324 p2 = transaction->response_buffer; in is_matching_response()
325 mask = transaction->response_match_bytes; in is_matching_response()
333 if (--length == 0) in is_matching_response()
351 struct fw_device *device = fw_parent_device(t->unit); in fcp_response()
352 if (device->card != card || in fcp_response()
353 device->generation != generation) in fcp_response()
356 if (device->node_id != source) in fcp_response()
359 if (t->state == STATE_PENDING && in fcp_response()
361 if (t->deferrable && *(const u8 *)data == 0x0f) { in fcp_response()
362 t->state = STATE_DEFERRED; in fcp_response()
364 t->state = STATE_COMPLETE; in fcp_response()
365 t->response_size = min_t(unsigned int, length, in fcp_response()
366 t->response_size); in fcp_response()
367 memcpy(t->response_buffer, data, in fcp_response()
368 t->response_size); in fcp_response()
370 wake_up(&t->wait); in fcp_response()