Lines Matching defs:packet

62 			       struct arm_spe_pkt *packet)
72 case 1: packet->payload = *(uint8_t *)buf; break;
73 case 2: packet->payload = le16_to_cpu(*(uint16_t *)buf); break;
74 case 4: packet->payload = le32_to_cpu(*(uint32_t *)buf); break;
75 case 8: packet->payload = le64_to_cpu(*(uint64_t *)buf); break;
82 static int arm_spe_get_pad(struct arm_spe_pkt *packet)
84 packet->type = ARM_SPE_PAD;
89 struct arm_spe_pkt *packet)
96 packet->type = ARM_SPE_PAD;
100 static int arm_spe_get_end(struct arm_spe_pkt *packet)
102 packet->type = ARM_SPE_END;
107 struct arm_spe_pkt *packet)
109 packet->type = ARM_SPE_TIMESTAMP;
110 return arm_spe_get_payload(buf, len, 0, packet);
114 struct arm_spe_pkt *packet)
116 packet->type = ARM_SPE_EVENTS;
123 packet->index = arm_spe_payload_len(buf[0]);
125 return arm_spe_get_payload(buf, len, 0, packet);
129 struct arm_spe_pkt *packet)
131 packet->type = ARM_SPE_DATA_SOURCE;
132 return arm_spe_get_payload(buf, len, 0, packet);
136 struct arm_spe_pkt *packet)
138 packet->type = ARM_SPE_CONTEXT;
139 packet->index = SPE_CTX_PKT_HDR_INDEX(buf[0]);
140 return arm_spe_get_payload(buf, len, 0, packet);
144 struct arm_spe_pkt *packet)
146 packet->type = ARM_SPE_OP_TYPE;
147 packet->index = SPE_OP_PKT_HDR_CLASS(buf[0]);
148 return arm_spe_get_payload(buf, len, 0, packet);
152 const unsigned char ext_hdr, struct arm_spe_pkt *packet)
154 packet->type = ARM_SPE_COUNTER;
157 packet->index = SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]);
159 packet->index = SPE_HDR_SHORT_INDEX(buf[0]);
161 return arm_spe_get_payload(buf, len, ext_hdr, packet);
165 const unsigned char ext_hdr, struct arm_spe_pkt *packet)
167 packet->type = ARM_SPE_ADDRESS;
170 packet->index = SPE_HDR_EXTENDED_INDEX(buf[0], buf[1]);
172 packet->index = SPE_HDR_SHORT_INDEX(buf[0]);
174 return arm_spe_get_payload(buf, len, ext_hdr, packet);
178 struct arm_spe_pkt *packet)
183 memset(packet, 0, sizeof(struct arm_spe_pkt));
191 return arm_spe_get_pad(packet);
194 return arm_spe_get_end(packet);
197 return arm_spe_get_timestamp(buf, len, packet);
200 return arm_spe_get_events(buf, len, packet);
203 return arm_spe_get_data_source(buf, len, packet);
206 return arm_spe_get_context(buf, len, packet);
209 return arm_spe_get_op_type(buf, len, packet);
219 return arm_spe_get_alignment(buf, len, packet);
225 * address packet and counter packet, so don't need to distinguish if
229 return arm_spe_get_addr(buf, len, ext_hdr, packet);
232 return arm_spe_get_counter(buf, len, ext_hdr, packet);
238 struct arm_spe_pkt *packet)
242 ret = arm_spe_do_get_packet(buf, len, packet);
246 if (ret > 0 && packet->type == ARM_SPE_PAD) {
292 static int arm_spe_pkt_desc_event(const struct arm_spe_pkt *packet,
295 u64 payload = packet->payload;
332 static int arm_spe_pkt_desc_op_type(const struct arm_spe_pkt *packet,
335 u64 payload = packet->payload;
338 switch (packet->index) {
427 static int arm_spe_pkt_desc_addr(const struct arm_spe_pkt *packet,
430 int ns, el, idx = packet->index;
432 u64 payload = packet->payload;
469 static int arm_spe_pkt_desc_counter(const struct arm_spe_pkt *packet,
472 u64 payload = packet->payload;
473 const char *name = arm_spe_pkt_name(packet->type);
479 switch (packet->index) {
496 int arm_spe_pkt_desc(const struct arm_spe_pkt *packet, char *buf,
499 int idx = packet->index;
500 unsigned long long payload = packet->payload;
501 const char *name = arm_spe_pkt_name(packet->type);
506 switch (packet->type) {
513 err = arm_spe_pkt_desc_event(packet, buf, buf_len);
516 err = arm_spe_pkt_desc_op_type(packet, buf, buf_len);
523 err = arm_spe_pkt_desc_addr(packet, buf, buf_len);
530 err = arm_spe_pkt_desc_counter(packet, buf, buf_len);
533 /* Unknown packet type */
542 name, payload, packet->index);