Lines Matching refs:packet

1289 	struct fw_packet *packet;  member
1298 struct fw_packet *packet) in at_context_queue_packet() argument
1309 packet->ack = RCODE_SEND_ERROR; in at_context_queue_packet()
1314 d[0].res_count = cpu_to_le16(packet->timestamp); in at_context_queue_packet()
1322 tcode = (packet->header[0] >> 4) & 0x0f; in at_context_queue_packet()
1334 header[0] = cpu_to_le32((packet->header[0] & 0xffff) | in at_context_queue_packet()
1335 (packet->speed << 16)); in at_context_queue_packet()
1336 header[1] = cpu_to_le32((packet->header[1] & 0xffff) | in at_context_queue_packet()
1337 (packet->header[0] & 0xffff0000)); in at_context_queue_packet()
1338 header[2] = cpu_to_le32(packet->header[2]); in at_context_queue_packet()
1341 header[3] = cpu_to_le32(packet->header[3]); in at_context_queue_packet()
1343 header[3] = (__force __le32) packet->header[3]; in at_context_queue_packet()
1345 d[0].req_count = cpu_to_le16(packet->header_length); in at_context_queue_packet()
1350 (packet->speed << 16)); in at_context_queue_packet()
1351 header[1] = cpu_to_le32(packet->header[1]); in at_context_queue_packet()
1352 header[2] = cpu_to_le32(packet->header[2]); in at_context_queue_packet()
1355 if (is_ping_packet(&packet->header[1])) in at_context_queue_packet()
1360 header[0] = cpu_to_le32((packet->header[0] & 0xffff) | in at_context_queue_packet()
1361 (packet->speed << 16)); in at_context_queue_packet()
1362 header[1] = cpu_to_le32(packet->header[0] & 0xffff0000); in at_context_queue_packet()
1368 packet->ack = RCODE_SEND_ERROR; in at_context_queue_packet()
1374 driver_data->packet = packet; in at_context_queue_packet()
1375 packet->driver_data = driver_data; in at_context_queue_packet()
1377 if (packet->payload_length > 0) { in at_context_queue_packet()
1378 if (packet->payload_length > sizeof(driver_data->inline_data)) { in at_context_queue_packet()
1380 packet->payload, in at_context_queue_packet()
1381 packet->payload_length, in at_context_queue_packet()
1384 packet->ack = RCODE_SEND_ERROR; in at_context_queue_packet()
1387 packet->payload_bus = payload_bus; in at_context_queue_packet()
1388 packet->payload_mapped = true; in at_context_queue_packet()
1390 memcpy(driver_data->inline_data, packet->payload, in at_context_queue_packet()
1391 packet->payload_length); in at_context_queue_packet()
1395 d[2].req_count = cpu_to_le16(packet->payload_length); in at_context_queue_packet()
1409 if (ohci->generation != packet->generation) { in at_context_queue_packet()
1410 if (packet->payload_mapped) in at_context_queue_packet()
1412 packet->payload_length, DMA_TO_DEVICE); in at_context_queue_packet()
1413 packet->ack = RCODE_GENERATION; in at_context_queue_packet()
1443 struct fw_packet *packet; in handle_at_packet() local
1452 packet = driver_data->packet; in handle_at_packet()
1453 if (packet == NULL) in handle_at_packet()
1457 if (packet->payload_mapped) in handle_at_packet()
1458 dma_unmap_single(ohci->card.device, packet->payload_bus, in handle_at_packet()
1459 packet->payload_length, DMA_TO_DEVICE); in handle_at_packet()
1462 packet->timestamp = le16_to_cpu(last->res_count); in handle_at_packet()
1464 log_ar_at_event(ohci, 'T', packet->speed, packet->header, evt); in handle_at_packet()
1469 packet->ack = RCODE_CANCELLED; in handle_at_packet()
1477 packet->ack = RCODE_GENERATION; in handle_at_packet()
1482 packet->ack = RCODE_GENERATION; in handle_at_packet()
1488 packet->ack = RCODE_NO_ACK; in handle_at_packet()
1499 packet->ack = evt - 0x10; in handle_at_packet()
1504 packet->ack = RCODE_GENERATION; in handle_at_packet()
1510 packet->ack = RCODE_SEND_ERROR; in handle_at_packet()
1514 packet->callback(packet, &ohci->card, packet->ack); in handle_at_packet()
1526 struct fw_packet *packet, u32 csr) in handle_local_rom() argument
1531 tcode = HEADER_GET_TCODE(packet->header[0]); in handle_local_rom()
1533 length = HEADER_GET_DATA_LENGTH(packet->header[3]); in handle_local_rom()
1539 fw_fill_response(&response, packet->header, in handle_local_rom()
1542 fw_fill_response(&response, packet->header, in handle_local_rom()
1545 fw_fill_response(&response, packet->header, RCODE_COMPLETE, in handle_local_rom()
1553 struct fw_packet *packet, u32 csr) in handle_local_lock() argument
1560 tcode = HEADER_GET_TCODE(packet->header[0]); in handle_local_lock()
1561 length = HEADER_GET_DATA_LENGTH(packet->header[3]); in handle_local_lock()
1562 payload = packet->payload; in handle_local_lock()
1563 ext_tcode = HEADER_GET_EXTENDED_TCODE(packet->header[3]); in handle_local_lock()
1573 fw_fill_response(&response, packet->header, in handle_local_lock()
1587 fw_fill_response(&response, packet->header, in handle_local_lock()
1594 fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0); in handle_local_lock()
1600 static void handle_local_request(struct context *ctx, struct fw_packet *packet) in handle_local_request() argument
1605 packet->ack = ACK_PENDING; in handle_local_request()
1606 packet->callback(packet, &ctx->ohci->card, packet->ack); in handle_local_request()
1611 HEADER_GET_OFFSET_HIGH(packet->header[1]) << 32) | in handle_local_request()
1612 packet->header[2]; in handle_local_request()
1617 handle_local_rom(ctx->ohci, packet, csr); in handle_local_request()
1623 handle_local_lock(ctx->ohci, packet, csr); in handle_local_request()
1627 fw_core_handle_request(&ctx->ohci->card, packet); in handle_local_request()
1629 fw_core_handle_response(&ctx->ohci->card, packet); in handle_local_request()
1634 packet->ack = ACK_COMPLETE; in handle_local_request()
1635 packet->callback(packet, &ctx->ohci->card, packet->ack); in handle_local_request()
1639 static void at_context_transmit(struct context *ctx, struct fw_packet *packet) in at_context_transmit() argument
1646 if (HEADER_GET_DESTINATION(packet->header[0]) == ctx->ohci->node_id && in at_context_transmit()
1647 ctx->ohci->generation == packet->generation) { in at_context_transmit()
1649 handle_local_request(ctx, packet); in at_context_transmit()
1653 ret = at_context_queue_packet(ctx, packet); in at_context_transmit()
1657 packet->callback(packet, &ctx->ohci->card, packet->ack); in at_context_transmit()
2539 static void ohci_send_request(struct fw_card *card, struct fw_packet *packet) in ohci_send_request() argument
2543 at_context_transmit(&ohci->at_request_ctx, packet); in ohci_send_request()
2546 static void ohci_send_response(struct fw_card *card, struct fw_packet *packet) in ohci_send_response() argument
2550 at_context_transmit(&ohci->at_response_ctx, packet); in ohci_send_response()
2553 static int ohci_cancel_packet(struct fw_card *card, struct fw_packet *packet) in ohci_cancel_packet() argument
2557 struct driver_data *driver_data = packet->driver_data; in ohci_cancel_packet()
2562 if (packet->ack != 0) in ohci_cancel_packet()
2565 if (packet->payload_mapped) in ohci_cancel_packet()
2566 dma_unmap_single(ohci->card.device, packet->payload_bus, in ohci_cancel_packet()
2567 packet->payload_length, DMA_TO_DEVICE); in ohci_cancel_packet()
2569 log_ar_at_event(ohci, 'T', packet->speed, packet->header, 0x20); in ohci_cancel_packet()
2570 driver_data->packet = NULL; in ohci_cancel_packet()
2571 packet->ack = RCODE_CANCELLED; in ohci_cancel_packet()
2572 packet->callback(packet, &ohci->card, packet->ack); in ohci_cancel_packet()
3202 struct fw_iso_packet *packet, in queue_iso_transmit() argument
3214 p = packet; in queue_iso_transmit()
3306 struct fw_iso_packet *packet, in queue_iso_packet_per_buffer() argument
3321 packet_count = packet->header_length / ctx->base.header_size; in queue_iso_packet_per_buffer()
3328 payload_per_buffer = packet->payload_length / packet_count; in queue_iso_packet_per_buffer()
3340 if (packet->skip && i == 0) in queue_iso_packet_per_buffer()
3377 if (packet->interrupt && i == packet_count - 1) in queue_iso_packet_per_buffer()
3387 struct fw_iso_packet *packet, in queue_iso_buffer_fill() argument
3397 rest = packet->payload_length; in queue_iso_buffer_fill()
3412 if (packet->skip && i == 0) in queue_iso_buffer_fill()
3414 if (packet->interrupt && i == z - 1) in queue_iso_buffer_fill()
3443 struct fw_iso_packet *packet, in ohci_queue_iso() argument
3454 ret = queue_iso_transmit(ctx, packet, buffer, payload); in ohci_queue_iso()
3457 ret = queue_iso_packet_per_buffer(ctx, packet, buffer, payload); in ohci_queue_iso()
3460 ret = queue_iso_buffer_fill(ctx, packet, buffer, payload); in ohci_queue_iso()