Deleted Added
full compact
cam_xpt.c (217368) cam_xpt.c (218909)
1/*-
2 * Implementation of the Common Access Method Transport (XPT) layer.
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Implementation of the Common Access Method Transport (XPT) layer.
3 *
4 * Copyright (c) 1997, 1998, 1999 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/cam/cam_xpt.c 217368 2011-01-13 18:20:27Z mdf $");
31__FBSDID("$FreeBSD: head/sys/cam/cam_xpt.c 218909 2011-02-21 09:01:34Z brucec $");
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/systm.h>
36#include <sys/types.h>
37#include <sys/malloc.h>
38#include <sys/kernel.h>
39#include <sys/time.h>

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

312 int retval;
313
314 if ((dev->drvq.entries > 0) &&
315 (dev->ccbq.devq_openings > 0) &&
316 (cam_ccbq_frozen(&dev->ccbq, CAM_PRIORITY_TO_RL(
317 CAMQ_GET_PRIO(&dev->drvq))) == 0)) {
318 /*
319 * The priority of a device waiting for CCB resources
32
33#include <sys/param.h>
34#include <sys/bus.h>
35#include <sys/systm.h>
36#include <sys/types.h>
37#include <sys/malloc.h>
38#include <sys/kernel.h>
39#include <sys/time.h>

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

312 int retval;
313
314 if ((dev->drvq.entries > 0) &&
315 (dev->ccbq.devq_openings > 0) &&
316 (cam_ccbq_frozen(&dev->ccbq, CAM_PRIORITY_TO_RL(
317 CAMQ_GET_PRIO(&dev->drvq))) == 0)) {
318 /*
319 * The priority of a device waiting for CCB resources
320 * is that of the the highest priority peripheral driver
320 * is that of the highest priority peripheral driver
321 * enqueued.
322 */
323 retval = xpt_schedule_dev(&bus->sim->devq->alloc_queue,
324 &dev->alloc_ccb_entry.pinfo,
325 CAMQ_GET_PRIO(&dev->drvq));
326 } else {
327 retval = 0;
328 }

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

335{
336 int retval;
337
338 if ((dev->ccbq.queue.entries > 0) &&
339 (dev->ccbq.dev_openings > 0) &&
340 (cam_ccbq_frozen_top(&dev->ccbq) == 0)) {
341 /*
342 * The priority of a device waiting for controller
321 * enqueued.
322 */
323 retval = xpt_schedule_dev(&bus->sim->devq->alloc_queue,
324 &dev->alloc_ccb_entry.pinfo,
325 CAMQ_GET_PRIO(&dev->drvq));
326 } else {
327 retval = 0;
328 }

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

335{
336 int retval;
337
338 if ((dev->ccbq.queue.entries > 0) &&
339 (dev->ccbq.dev_openings > 0) &&
340 (cam_ccbq_frozen_top(&dev->ccbq) == 0)) {
341 /*
342 * The priority of a device waiting for controller
343 * resources is that of the the highest priority CCB
343 * resources is that of the highest priority CCB
344 * enqueued.
345 */
346 retval =
347 xpt_schedule_dev(&bus->sim->devq->send_queue,
348 &dev->send_ccb_entry.pinfo,
349 CAMQ_GET_PRIO(&dev->ccbq.queue));
350 } else {
351 retval = 0;

--- 4491 unchanged lines hidden ---
344 * enqueued.
345 */
346 retval =
347 xpt_schedule_dev(&bus->sim->devq->send_queue,
348 &dev->send_ccb_entry.pinfo,
349 CAMQ_GET_PRIO(&dev->ccbq.queue));
350 } else {
351 retval = 0;

--- 4491 unchanged lines hidden ---