Deleted Added
full compact
sbp_targ.c (230558) sbp_targ.c (237601)
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 230558 2012-01-25 23:33:50Z sbruno $
34 * $FreeBSD: head/sys/dev/firewire/sbp_targ.c 237601 2012-06-26 14:51:35Z ken $
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>

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

528}
529
530static void
531sbp_targ_send_lstate_events(struct sbp_targ_softc *sc,
532 struct sbp_targ_lstate *lstate)
533{
534#if 0
535 struct ccb_hdr *ccbh;
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>

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

528}
529
530static void
531sbp_targ_send_lstate_events(struct sbp_targ_softc *sc,
532 struct sbp_targ_lstate *lstate)
533{
534#if 0
535 struct ccb_hdr *ccbh;
536 struct ccb_immed_notify *inot;
536 struct ccb_immediate_notify *inot;
537
538 printf("%s: not implemented yet\n", __func__);
539#endif
540}
541
542
543static __inline void
544sbp_targ_remove_orb_info_locked(struct sbp_targ_login *login, struct orb_info *orbi)

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

903 status = sbp_targ_find_devs(sc, ccb, &lstate, 0);
904 if (status != CAM_REQ_CMP)
905 return (status);
906
907 accb = ccb->cab.abort_ccb;
908
909 if (accb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO)
910 list = &lstate->accept_tios;
537
538 printf("%s: not implemented yet\n", __func__);
539#endif
540}
541
542
543static __inline void
544sbp_targ_remove_orb_info_locked(struct sbp_targ_login *login, struct orb_info *orbi)

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

903 status = sbp_targ_find_devs(sc, ccb, &lstate, 0);
904 if (status != CAM_REQ_CMP)
905 return (status);
906
907 accb = ccb->cab.abort_ccb;
908
909 if (accb->ccb_h.func_code == XPT_ACCEPT_TARGET_IO)
910 list = &lstate->accept_tios;
911 else if (accb->ccb_h.func_code == XPT_IMMED_NOTIFY)
911 else if (accb->ccb_h.func_code == XPT_IMMEDIATE_NOTIFY)
912 list = &lstate->immed_notifies;
913 else
914 return (CAM_UA_ABORT);
915
916 curelm = SLIST_FIRST(list);
917 found = 0;
918 if (curelm == &accb->ccb_h) {
919 found = 1;

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

1296 login->flags &= ~F_ATIO_STARVED;
1297 sbp_targ_fetch_orb(lstate->sc,
1298 login->fwdev,
1299 login->last_hi, login->last_lo,
1300 login, FETCH_CMD);
1301 }
1302 }
1303 break;
912 list = &lstate->immed_notifies;
913 else
914 return (CAM_UA_ABORT);
915
916 curelm = SLIST_FIRST(list);
917 found = 0;
918 if (curelm == &accb->ccb_h) {
919 found = 1;

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

1296 login->flags &= ~F_ATIO_STARVED;
1297 sbp_targ_fetch_orb(lstate->sc,
1298 login->fwdev,
1299 login->last_hi, login->last_lo,
1300 login, FETCH_CMD);
1301 }
1302 }
1303 break;
1304 case XPT_NOTIFY_ACK: /* recycle notify ack */
1305 case XPT_IMMED_NOTIFY: /* Add Immediate Notify Resource */
1304 case XPT_NOTIFY_ACKNOWLEDGE: /* recycle notify ack */
1305 case XPT_IMMEDIATE_NOTIFY: /* Add Immediate Notify Resource */
1306 if (status != CAM_REQ_CMP) {
1307 ccb->ccb_h.status = status;
1308 xpt_done(ccb);
1309 break;
1310 }
1311 SLIST_INSERT_HEAD(&lstate->immed_notifies, &ccb->ccb_h,
1312 sim_links.sle);
1313 ccb->ccb_h.status = CAM_REQ_INPROG;

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

1344 break;
1345 }
1346 case XPT_ABORT:
1347 {
1348 union ccb *accb = ccb->cab.abort_ccb;
1349
1350 switch (accb->ccb_h.func_code) {
1351 case XPT_ACCEPT_TARGET_IO:
1306 if (status != CAM_REQ_CMP) {
1307 ccb->ccb_h.status = status;
1308 xpt_done(ccb);
1309 break;
1310 }
1311 SLIST_INSERT_HEAD(&lstate->immed_notifies, &ccb->ccb_h,
1312 sim_links.sle);
1313 ccb->ccb_h.status = CAM_REQ_INPROG;

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

1344 break;
1345 }
1346 case XPT_ABORT:
1347 {
1348 union ccb *accb = ccb->cab.abort_ccb;
1349
1350 switch (accb->ccb_h.func_code) {
1351 case XPT_ACCEPT_TARGET_IO:
1352 case XPT_IMMED_NOTIFY:
1352 case XPT_IMMEDIATE_NOTIFY:
1353 ccb->ccb_h.status = sbp_targ_abort_ccb(sc, ccb);
1354 break;
1355 case XPT_CONT_TARGET_IO:
1356 /* XXX */
1357 ccb->ccb_h.status = CAM_UA_ABORT;
1358 break;
1359 default:
1360 printf("%s: aborting unknown function %d\n",

--- 711 unchanged lines hidden ---
1353 ccb->ccb_h.status = sbp_targ_abort_ccb(sc, ccb);
1354 break;
1355 case XPT_CONT_TARGET_IO:
1356 /* XXX */
1357 ccb->ccb_h.status = CAM_UA_ABORT;
1358 break;
1359 default:
1360 printf("%s: aborting unknown function %d\n",

--- 711 unchanged lines hidden ---