sbp_targ.c (121186) | sbp_targ.c (122529) |
---|---|
1/* 2 * Copyright (C) 2003 3 * Hidetoshi Shimokawa. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * | 1/* 2 * Copyright (C) 2003 3 * Hidetoshi Shimokawa. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/sys/dev/firewire/sbp_targ.c 121186 2003-10-18 05:41:31Z simokawa $ | 34 * $FreeBSD: head/sys/dev/firewire/sbp_targ.c 122529 2003-11-12 04:06:21Z simokawa $ |
35 */ 36 37#include <sys/param.h> 38#include <sys/kernel.h> 39#include <sys/systm.h> 40#include <sys/sysctl.h> 41#include <sys/types.h> 42#include <sys/conf.h> --- 423 unchanged lines hidden (view full) --- 466static void 467sbp_targ_free_orbi(struct fw_xfer *xfer) 468{ 469 struct orb_info *orbi; 470 471 orbi = (struct orb_info *)xfer->sc; 472 if (xfer->resp != 0) { 473 /* XXX */ | 35 */ 36 37#include <sys/param.h> 38#include <sys/kernel.h> 39#include <sys/systm.h> 40#include <sys/sysctl.h> 41#include <sys/types.h> 42#include <sys/conf.h> --- 423 unchanged lines hidden (view full) --- 466static void 467sbp_targ_free_orbi(struct fw_xfer *xfer) 468{ 469 struct orb_info *orbi; 470 471 orbi = (struct orb_info *)xfer->sc; 472 if (xfer->resp != 0) { 473 /* XXX */ |
474 printf("%s: xfer->resp != 0\n", __FUNCTION__); | 474 printf("%s: xfer->resp = %d\n", __FUNCTION__, xfer->resp); |
475 } 476 free(orbi, M_SBP_TARG); 477 fw_xfer_free(xfer); 478} 479 480static void 481sbp_targ_status_FIFO(struct orb_info *orbi, 482 u_int32_t fifo_hi, u_int32_t fifo_lo, int dequeue) --- 101 unchanged lines hidden (view full) --- 584 585 orbi = (struct orb_info *)xfer->sc; 586 587 if (debug) 588 printf("%s: resp=%d refcount=%d\n", __FUNCTION__, 589 xfer->resp, orbi->refcount); 590 591 if (xfer->resp != 0) { | 475 } 476 free(orbi, M_SBP_TARG); 477 fw_xfer_free(xfer); 478} 479 480static void 481sbp_targ_status_FIFO(struct orb_info *orbi, 482 u_int32_t fifo_hi, u_int32_t fifo_lo, int dequeue) --- 101 unchanged lines hidden (view full) --- 584 585 orbi = (struct orb_info *)xfer->sc; 586 587 if (debug) 588 printf("%s: resp=%d refcount=%d\n", __FUNCTION__, 589 xfer->resp, orbi->refcount); 590 591 if (xfer->resp != 0) { |
592 printf("%s: xfer->resp != 0\n", __FUNCTION__); | 592 printf("%s: xfer->resp = %d\n", __FUNCTION__, xfer->resp); |
593 orbi->status.resp = SBP_TRANS_FAIL; 594 orbi->status.status = htonl(OBJ_DATA | SBE_TIMEOUT /*XXX*/); 595 orbi->status.dead = 1; 596 sbp_targ_abort(STAILQ_NEXT(orbi, link)); 597 } 598 599 orbi->refcount --; 600 --- 128 unchanged lines hidden (view full) --- 729 printf("%s: orbi aborted\n", __FUNCTION__); 730 sbp_targ_remove_orb_info(orbi->lstate, orbi); 731 free(orbi->page_table, M_SBP_TARG); 732 free(orbi, M_SBP_TARG); 733 fw_xfer_free(xfer); 734 return; 735 } 736 if (xfer->resp != 0) { | 593 orbi->status.resp = SBP_TRANS_FAIL; 594 orbi->status.status = htonl(OBJ_DATA | SBE_TIMEOUT /*XXX*/); 595 orbi->status.dead = 1; 596 sbp_targ_abort(STAILQ_NEXT(orbi, link)); 597 } 598 599 orbi->refcount --; 600 --- 128 unchanged lines hidden (view full) --- 729 printf("%s: orbi aborted\n", __FUNCTION__); 730 sbp_targ_remove_orb_info(orbi->lstate, orbi); 731 free(orbi->page_table, M_SBP_TARG); 732 free(orbi, M_SBP_TARG); 733 fw_xfer_free(xfer); 734 return; 735 } 736 if (xfer->resp != 0) { |
737 printf("%s: xfer->resp != 0\n", __FUNCTION__); | 737 printf("%s: xfer->resp = %d\n", __FUNCTION__, xfer->resp); |
738 orbi->status.resp = SBP_TRANS_FAIL; 739 orbi->status.status = htonl(OBJ_PT | SBE_TIMEOUT /*XXX*/); 740 orbi->status.dead = 1; 741 orbi->status.len = 1; 742 sbp_targ_abort(STAILQ_NEXT(orbi, link)); 743 744 sbp_targ_status_FIFO(orbi, 745 orbi->lstate->fifo_hi, orbi->lstate->fifo_lo, /*dequeue*/1); --- 262 unchanged lines hidden (view full) --- 1008 struct orb_info *orbi; 1009 struct ccb_accept_tio *atio; 1010 struct sbp_targ_lstate *lstate; 1011 u_char *bytes; 1012 int i; 1013 1014 orbi = (struct orb_info *)xfer->sc; 1015 if (xfer->resp != 0) { | 738 orbi->status.resp = SBP_TRANS_FAIL; 739 orbi->status.status = htonl(OBJ_PT | SBE_TIMEOUT /*XXX*/); 740 orbi->status.dead = 1; 741 orbi->status.len = 1; 742 sbp_targ_abort(STAILQ_NEXT(orbi, link)); 743 744 sbp_targ_status_FIFO(orbi, 745 orbi->lstate->fifo_hi, orbi->lstate->fifo_lo, /*dequeue*/1); --- 262 unchanged lines hidden (view full) --- 1008 struct orb_info *orbi; 1009 struct ccb_accept_tio *atio; 1010 struct sbp_targ_lstate *lstate; 1011 u_char *bytes; 1012 int i; 1013 1014 orbi = (struct orb_info *)xfer->sc; 1015 if (xfer->resp != 0) { |
1016 printf("%s: xfer->resp != 0\n", __FUNCTION__); | 1016 printf("%s: xfer->resp = %d\n", __FUNCTION__, xfer->resp); |
1017 orbi->status.resp = SBP_TRANS_FAIL; 1018 orbi->status.status = htonl(OBJ_ORB | SBE_TIMEOUT /*XXX*/); 1019 orbi->status.dead = 1; 1020 orbi->status.len = 1; 1021 sbp_targ_abort(STAILQ_NEXT(orbi, link)); 1022 1023 sbp_targ_status_FIFO(orbi, 1024 orbi->lstate->fifo_hi, orbi->lstate->fifo_lo, /*dequeue*/1); --- 96 unchanged lines hidden (view full) --- 1121 struct fw_pkt *fp; 1122 u_int32_t *orb; 1123 struct morb4 *orb4; 1124 struct orb_info *orbi; 1125 int i; 1126 1127 orbi = (struct orb_info *)xfer->sc; 1128 if (xfer->resp != 0) { | 1017 orbi->status.resp = SBP_TRANS_FAIL; 1018 orbi->status.status = htonl(OBJ_ORB | SBE_TIMEOUT /*XXX*/); 1019 orbi->status.dead = 1; 1020 orbi->status.len = 1; 1021 sbp_targ_abort(STAILQ_NEXT(orbi, link)); 1022 1023 sbp_targ_status_FIFO(orbi, 1024 orbi->lstate->fifo_hi, orbi->lstate->fifo_lo, /*dequeue*/1); --- 96 unchanged lines hidden (view full) --- 1121 struct fw_pkt *fp; 1122 u_int32_t *orb; 1123 struct morb4 *orb4; 1124 struct orb_info *orbi; 1125 int i; 1126 1127 orbi = (struct orb_info *)xfer->sc; 1128 if (xfer->resp != 0) { |
1129 printf("%s: xfer->resp != 0\n", __FUNCTION__); | 1129 printf("%s: xfer->resp = %d\n", __FUNCTION__, xfer->resp); |
1130 orbi->status.resp = SBP_TRANS_FAIL; 1131 orbi->status.status = htonl(OBJ_ORB | SBE_TIMEOUT /*XXX*/); 1132 orbi->status.dead = 1; 1133 orbi->status.len = 1; 1134 sbp_targ_abort(STAILQ_NEXT(orbi, link)); 1135 1136 sbp_targ_status_FIFO(orbi, 1137 orbi->lstate->fifo_hi, orbi->lstate->fifo_lo, /*dequeue*/0); --- 60 unchanged lines hidden (view full) --- 1198static void 1199sbp_targ_pointer_handler(struct fw_xfer *xfer) 1200{ 1201 struct orb_info *orbi; 1202 u_int32_t orb0, orb1; 1203 1204 orbi = (struct orb_info *)xfer->sc; 1205 if (xfer->resp != 0) { | 1130 orbi->status.resp = SBP_TRANS_FAIL; 1131 orbi->status.status = htonl(OBJ_ORB | SBE_TIMEOUT /*XXX*/); 1132 orbi->status.dead = 1; 1133 orbi->status.len = 1; 1134 sbp_targ_abort(STAILQ_NEXT(orbi, link)); 1135 1136 sbp_targ_status_FIFO(orbi, 1137 orbi->lstate->fifo_hi, orbi->lstate->fifo_lo, /*dequeue*/0); --- 60 unchanged lines hidden (view full) --- 1198static void 1199sbp_targ_pointer_handler(struct fw_xfer *xfer) 1200{ 1201 struct orb_info *orbi; 1202 u_int32_t orb0, orb1; 1203 1204 orbi = (struct orb_info *)xfer->sc; 1205 if (xfer->resp != 0) { |
1206 printf("%s: xfer->resp != 0\n", __FUNCTION__); | 1206 printf("%s: xfer->resp = %d\n", __FUNCTION__, xfer->resp); |
1207 goto done; 1208 } 1209 1210 orb0 = ntohl(orbi->orb[0]); 1211 orb1 = ntohl(orbi->orb[1]); 1212 if ((orb0 & (1 << 31)) != 0) { 1213 printf("%s: invalid pointer\n", __FUNCTION__); 1214 goto done; --- 336 unchanged lines hidden --- | 1207 goto done; 1208 } 1209 1210 orb0 = ntohl(orbi->orb[0]); 1211 orb1 = ntohl(orbi->orb[1]); 1212 if ((orb0 & (1 << 31)) != 0) { 1213 printf("%s: invalid pointer\n", __FUNCTION__); 1214 goto done; --- 336 unchanged lines hidden --- |