Deleted Added
full compact
fwohci.c (123740) fwohci.c (124145)
1/*
2 * Copyright (c) 2003 Hidetoshi Shimokawa
3 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
1/*
2 * Copyright (c) 2003 Hidetoshi Shimokawa
3 * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 17 unchanged lines hidden (view full) ---

26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 * $FreeBSD: head/sys/dev/firewire/fwohci.c 123740 2003-12-23 02:36:43Z peter $
34 * $FreeBSD: head/sys/dev/firewire/fwohci.c 124145 2004-01-05 14:21:18Z simokawa $
35 *
36 */
37
38#define ATRQ_CH 0
39#define ATRS_CH 1
40#define ARRQ_CH 2
41#define ARRS_CH 3
42#define ITX_CH 4

--- 2723 unchanged lines hidden (view full) ---

2766 if (hlen == 0)
2767 /* XXX need reset */
2768 goto out;
2769 if (hlen < 0) {
2770 dbch->pdb_tr = db_tr;
2771 dbch->buf_offset = - dbch->buf_offset;
2772 /* sanity check */
2773 if (resCount != 0)
35 *
36 */
37
38#define ATRQ_CH 0
39#define ATRS_CH 1
40#define ARRQ_CH 2
41#define ARRS_CH 3
42#define ITX_CH 4

--- 2723 unchanged lines hidden (view full) ---

2766 if (hlen == 0)
2767 /* XXX need reset */
2768 goto out;
2769 if (hlen < 0) {
2770 dbch->pdb_tr = db_tr;
2771 dbch->buf_offset = - dbch->buf_offset;
2772 /* sanity check */
2773 if (resCount != 0)
2774 printf("resCount != 0 !?\n");
2774 printf("resCount = %d !?\n",
2775 resCount);
2776 /* XXX clear pdb_tr */
2775 goto out;
2776 }
2777 offset = 0;
2778 nvec = 0;
2779 }
2780 plen = fwohci_get_plen(sc, dbch, fp) - offset;
2781 if (plen < 0) {
2782 /* minimum header size + trailer
2783 = sizeof(fw_pkt) so this shouldn't happens */
2784 printf("plen(%d) is negative! offset=%d\n",
2785 plen, offset);
2777 goto out;
2778 }
2779 offset = 0;
2780 nvec = 0;
2781 }
2782 plen = fwohci_get_plen(sc, dbch, fp) - offset;
2783 if (plen < 0) {
2784 /* minimum header size + trailer
2785 = sizeof(fw_pkt) so this shouldn't happens */
2786 printf("plen(%d) is negative! offset=%d\n",
2787 plen, offset);
2788 /* XXX clear pdb_tr */
2786 goto out;
2787 }
2788 if (plen > 0) {
2789 len -= plen;
2790 if (len < 0) {
2791 dbch->pdb_tr = db_tr;
2792 if (firewire_debug)
2793 printf("splitted payload\n");
2794 /* sanity check */
2795 if (resCount != 0)
2789 goto out;
2790 }
2791 if (plen > 0) {
2792 len -= plen;
2793 if (len < 0) {
2794 dbch->pdb_tr = db_tr;
2795 if (firewire_debug)
2796 printf("splitted payload\n");
2797 /* sanity check */
2798 if (resCount != 0)
2796 printf("resCount != 0 !?\n");
2799 printf("resCount = %d !?\n",
2800 resCount);
2801 /* XXX clear pdb_tr */
2797 goto out;
2798 }
2799 vec[nvec].iov_base = ld;
2800 vec[nvec].iov_len = plen;
2801 nvec ++;
2802 ld += plen;
2803 }
2804 dbch->buf_offset = ld - (u_int8_t *)db_tr->buf;

--- 81 unchanged lines hidden ---
2802 goto out;
2803 }
2804 vec[nvec].iov_base = ld;
2805 vec[nvec].iov_len = plen;
2806 nvec ++;
2807 ld += plen;
2808 }
2809 dbch->buf_offset = ld - (u_int8_t *)db_tr->buf;

--- 81 unchanged lines hidden ---