Lines Matching refs:ptask

806 static void fwnet_free_ptask(struct fwnet_packet_task *ptask)  in fwnet_free_ptask()  argument
808 dev_kfree_skb_any(ptask->skb); in fwnet_free_ptask()
809 kmem_cache_free(fwnet_packet_task_cache, ptask); in fwnet_free_ptask()
819 static int fwnet_send_packet(struct fwnet_packet_task *ptask);
821 static void fwnet_transmit_packet_done(struct fwnet_packet_task *ptask) in fwnet_transmit_packet_done() argument
823 struct fwnet_device *dev = ptask->dev; in fwnet_transmit_packet_done()
824 struct sk_buff *skb = ptask->skb; in fwnet_transmit_packet_done()
830 ptask->outstanding_pkts--; in fwnet_transmit_packet_done()
833 free = (ptask->outstanding_pkts == 0 && ptask->enqueued); in fwnet_transmit_packet_done()
837 if (ptask->outstanding_pkts == 0) { in fwnet_transmit_packet_done()
844 if (ptask->outstanding_pkts > 0) { in fwnet_transmit_packet_done()
851 lf = fwnet_get_hdr_lf(&ptask->hdr); in fwnet_transmit_packet_done()
858 ptask->outstanding_pkts, lf, ptask->hdr.w0, in fwnet_transmit_packet_done()
859 ptask->hdr.w1); in fwnet_transmit_packet_done()
864 dg_size = fwnet_get_hdr_dg_size(&ptask->hdr); in fwnet_transmit_packet_done()
865 fg_off = ptask->max_payload - RFC2374_FRAG_HDR_SIZE; in fwnet_transmit_packet_done()
866 datagram_label = fwnet_get_hdr_dgl(&ptask->hdr); in fwnet_transmit_packet_done()
870 dg_size = fwnet_get_hdr_dg_size(&ptask->hdr); in fwnet_transmit_packet_done()
871 fg_off = fwnet_get_hdr_fg_off(&ptask->hdr) in fwnet_transmit_packet_done()
872 + ptask->max_payload - RFC2374_FRAG_HDR_SIZE; in fwnet_transmit_packet_done()
873 datagram_label = fwnet_get_hdr_dgl(&ptask->hdr); in fwnet_transmit_packet_done()
877 if (ptask->dest_node == IEEE1394_ALL_NODES) { in fwnet_transmit_packet_done()
879 ptask->max_payload + IEEE1394_GASP_HDR_SIZE); in fwnet_transmit_packet_done()
881 skb_pull(skb, ptask->max_payload); in fwnet_transmit_packet_done()
883 if (ptask->outstanding_pkts > 1) { in fwnet_transmit_packet_done()
884 fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_INTFRAG, in fwnet_transmit_packet_done()
887 fwnet_make_sf_hdr(&ptask->hdr, RFC2374_HDR_LASTFRAG, in fwnet_transmit_packet_done()
889 ptask->max_payload = skb->len + RFC2374_FRAG_HDR_SIZE; in fwnet_transmit_packet_done()
891 fwnet_send_packet(ptask); in fwnet_transmit_packet_done()
895 fwnet_free_ptask(ptask); in fwnet_transmit_packet_done()
898 static void fwnet_transmit_packet_failed(struct fwnet_packet_task *ptask) in fwnet_transmit_packet_failed() argument
900 struct fwnet_device *dev = ptask->dev; in fwnet_transmit_packet_failed()
907 ptask->outstanding_pkts = 0; in fwnet_transmit_packet_failed()
910 free = ptask->enqueued; in fwnet_transmit_packet_failed()
920 fwnet_free_ptask(ptask); in fwnet_transmit_packet_failed()
926 struct fwnet_packet_task *ptask = data; in fwnet_write_complete() local
931 fwnet_transmit_packet_done(ptask); in fwnet_write_complete()
934 dev_err(&ptask->dev->netdev->dev, in fwnet_write_complete()
943 fwnet_transmit_packet_failed(ptask); in fwnet_write_complete()
947 static int fwnet_send_packet(struct fwnet_packet_task *ptask) in fwnet_send_packet() argument
955 dev = ptask->dev; in fwnet_send_packet()
956 tx_len = ptask->max_payload; in fwnet_send_packet()
957 switch (fwnet_get_hdr_lf(&ptask->hdr)) { in fwnet_send_packet()
959 bufhdr = skb_push(ptask->skb, RFC2374_UNFRAG_HDR_SIZE); in fwnet_send_packet()
960 put_unaligned_be32(ptask->hdr.w0, &bufhdr->w0); in fwnet_send_packet()
966 bufhdr = skb_push(ptask->skb, RFC2374_FRAG_HDR_SIZE); in fwnet_send_packet()
967 put_unaligned_be32(ptask->hdr.w0, &bufhdr->w0); in fwnet_send_packet()
968 put_unaligned_be32(ptask->hdr.w1, &bufhdr->w1); in fwnet_send_packet()
974 if (ptask->dest_node == IEEE1394_ALL_NODES) { in fwnet_send_packet()
985 switch (ptask->skb->protocol) { in fwnet_send_packet()
995 p = skb_push(ptask->skb, IEEE1394_GASP_HDR_SIZE); in fwnet_send_packet()
1001 fw_send_request(dev->card, &ptask->transaction, in fwnet_send_packet()
1005 generation, SCODE_100, 0ULL, ptask->skb->data, in fwnet_send_packet()
1006 tx_len + 8, fwnet_write_complete, ptask); in fwnet_send_packet()
1011 free = (ptask->outstanding_pkts == 0 && !ptask->enqueued); in fwnet_send_packet()
1013 ptask->enqueued = true; in fwnet_send_packet()
1022 fw_send_request(dev->card, &ptask->transaction, in fwnet_send_packet()
1023 TCODE_WRITE_BLOCK_REQUEST, ptask->dest_node, in fwnet_send_packet()
1024 ptask->generation, ptask->speed, ptask->fifo_addr, in fwnet_send_packet()
1025 ptask->skb->data, tx_len, fwnet_write_complete, ptask); in fwnet_send_packet()
1030 free = (ptask->outstanding_pkts == 0 && !ptask->enqueued); in fwnet_send_packet()
1032 ptask->enqueued = true; in fwnet_send_packet()
1041 fwnet_free_ptask(ptask); in fwnet_send_packet()
1235 struct fwnet_packet_task *ptask; in fwnet_tx() local
1248 ptask = kmem_cache_alloc(fwnet_packet_task_cache, GFP_ATOMIC); in fwnet_tx()
1249 if (ptask == NULL) in fwnet_tx()
1285 ptask->fifo_addr = FWNET_NO_FIFO_ADDR; in fwnet_tx()
1286 ptask->generation = 0; in fwnet_tx()
1287 ptask->dest_node = IEEE1394_ALL_NODES; in fwnet_tx()
1288 ptask->speed = SCODE_100; in fwnet_tx()
1303 ptask->fifo_addr = get_unaligned_be48(ha->uc.fifo); in fwnet_tx()
1304 ptask->generation = generation; in fwnet_tx()
1305 ptask->dest_node = dest_node; in fwnet_tx()
1306 ptask->speed = peer->speed; in fwnet_tx()
1309 ptask->hdr.w0 = 0; in fwnet_tx()
1310 ptask->hdr.w1 = 0; in fwnet_tx()
1311 ptask->skb = skb; in fwnet_tx()
1312 ptask->dev = dev; in fwnet_tx()
1316 fwnet_make_uf_hdr(&ptask->hdr, ntohs(proto)); in fwnet_tx()
1317 ptask->outstanding_pkts = 1; in fwnet_tx()
1324 fwnet_make_ff_hdr(&ptask->hdr, ntohs(proto), dg_size, in fwnet_tx()
1326 ptask->outstanding_pkts = DIV_ROUND_UP(dg_size, max_payload); in fwnet_tx()
1335 ptask->max_payload = max_payload; in fwnet_tx()
1336 ptask->enqueued = 0; in fwnet_tx()
1338 fwnet_send_packet(ptask); in fwnet_tx()
1345 if (ptask) in fwnet_tx()
1346 kmem_cache_free(fwnet_packet_task_cache, ptask); in fwnet_tx()