Lines Matching defs:length
48 static void put_command_and_length(u8 *data, int command, int length)
53 data[3] = length;
56 static void put_checksum(u8 *check_string, int length)
59 dprintk(verbose, DST_CA_DEBUG, 1, " -> string length : 0x%02x", length);
60 check_string[length] = dst_check_sum (check_string, length);
61 dprintk(verbose, DST_CA_DEBUG, 1, " -> checksum : 0x%02x", check_string[length]);
130 int length, str_length;
146 length = state->messages[5];
147 str_length = length - 6;
150 dprintk(verbose, DST_CA_ERROR, 1, "Invalid string length returned in ca_get_app_info(). Recovering.");
153 // First, the command and length fields
154 put_command_and_length(&state->messages[0], CA_APP_INFO, length);
159 // Set string length and copy string
186 // Set the command and length of the output
323 static int handle_dst_tag(struct dst_state *state, struct ca_msg *p_ca_message, struct ca_msg *hw_buffer, u32 length)
329 if (length > 247) {
333 hw_buffer->msg[0] = (length & 0xff) + 7;
338 hw_buffer->msg[5] = length & 0xff;
342 * Need to compute length for EN50221 section 8.3.2, for the time being
345 memcpy(&hw_buffer->msg[7], &p_ca_message->msg[4], length);
351 static int write_to_8820(struct dst_state *state, struct ca_msg *hw_buffer, u8 length, u8 reply)
353 if ((dst_put_ci(state, hw_buffer->msg, length, hw_buffer->msg, reply)) < 0) {
367 u32 length = 0;
372 length = length_field & 0x7f;
373 dprintk(verbose, DST_CA_DEBUG, 1, " Length=[%02x]\n", length);
377 length = length << 8;
378 length += asn_1_array[count + 1];
379 dprintk(verbose, DST_CA_DEBUG, 1, " Length=[%04x]", length);
382 return length;
385 static int debug_string(u8 *msg, u32 length, u32 offset)
390 for (i = offset; i < length; i++)
400 u32 length = 0;
403 length = asn_1_decode(&p_ca_message->msg[3]);
404 dprintk(verbose, DST_CA_DEBUG, 1, " CA Message length=[%d]", length);
405 debug_string(&p_ca_message->msg[4], length, 0); /* length is excluding tag & length */
407 memset(hw_buffer->msg, '\0', length);
408 handle_dst_tag(state, p_ca_message, hw_buffer, length);
411 debug_string(hw_buffer->msg, (length + tag_length), 0); /* tags too */
412 write_to_8820(state, hw_buffer, (length + tag_length), reply);
625 static ssize_t dst_ca_read(struct file *file, char __user *buffer, size_t length, loff_t *offset)
632 static ssize_t dst_ca_write(struct file *file, const char __user *buffer, size_t length, loff_t *offset)