Deleted Added
full compact
ata-all.c (209944) ata-all.c (210471)
1/*-
2 * Copyright (c) 1998 - 2008 S�ren Schmidt <sos@FreeBSD.org>
3 * 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

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 - 2008 S�ren Schmidt <sos@FreeBSD.org>
3 * 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

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/ata/ata-all.c 209944 2010-07-12 12:16:11Z mav $");
28__FBSDID("$FreeBSD: head/sys/dev/ata/ata-all.c 210471 2010-07-25 15:43:52Z mav $");
29
30#include "opt_ata.h"
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/ata.h>
34#include <sys/kernel.h>
35#include <sys/module.h>
36#include <sys/endian.h>

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

43#include <sys/sema.h>
44#include <sys/taskqueue.h>
45#include <vm/uma.h>
46#include <machine/stdarg.h>
47#include <machine/resource.h>
48#include <machine/bus.h>
49#include <sys/rman.h>
50#include <dev/ata/ata-all.h>
29
30#include "opt_ata.h"
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/ata.h>
34#include <sys/kernel.h>
35#include <sys/module.h>
36#include <sys/endian.h>

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

43#include <sys/sema.h>
44#include <sys/taskqueue.h>
45#include <vm/uma.h>
46#include <machine/stdarg.h>
47#include <machine/resource.h>
48#include <machine/bus.h>
49#include <sys/rman.h>
50#include <dev/ata/ata-all.h>
51#include <dev/pci/pcivar.h>
51#include <ata_if.h>
52
53#ifdef ATA_CAM
54#include <cam/cam.h>
55#include <cam/cam_ccb.h>
56#include <cam/cam_sim.h>
57#include <cam/cam_xpt_sim.h>
58#include <cam/cam_debug.h>

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

1518 return (-1);
1519 }
1520 return (0);
1521}
1522
1523static void
1524ataaction(struct cam_sim *sim, union ccb *ccb)
1525{
52#include <ata_if.h>
53
54#ifdef ATA_CAM
55#include <cam/cam.h>
56#include <cam/cam_ccb.h>
57#include <cam/cam_sim.h>
58#include <cam/cam_xpt_sim.h>
59#include <cam/cam_debug.h>

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

1519 return (-1);
1520 }
1521 return (0);
1522}
1523
1524static void
1525ataaction(struct cam_sim *sim, union ccb *ccb)
1526{
1526 device_t dev;
1527 device_t dev, parent;
1527 struct ata_channel *ch;
1528
1529 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ataaction func_code=%x\n",
1530 ccb->ccb_h.func_code));
1531
1532 ch = (struct ata_channel *)cam_sim_softc(sim);
1533 dev = ch->dev;
1534 switch (ccb->ccb_h.func_code) {

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

1669 case XPT_TERM_IO: /* Terminate the I/O process */
1670 /* XXX Implement */
1671 ccb->ccb_h.status = CAM_REQ_INVALID;
1672 break;
1673 case XPT_PATH_INQ: /* Path routing inquiry */
1674 {
1675 struct ccb_pathinq *cpi = &ccb->cpi;
1676
1528 struct ata_channel *ch;
1529
1530 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ataaction func_code=%x\n",
1531 ccb->ccb_h.func_code));
1532
1533 ch = (struct ata_channel *)cam_sim_softc(sim);
1534 dev = ch->dev;
1535 switch (ccb->ccb_h.func_code) {

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

1670 case XPT_TERM_IO: /* Terminate the I/O process */
1671 /* XXX Implement */
1672 ccb->ccb_h.status = CAM_REQ_INVALID;
1673 break;
1674 case XPT_PATH_INQ: /* Path routing inquiry */
1675 {
1676 struct ccb_pathinq *cpi = &ccb->cpi;
1677
1678 parent = device_get_parent(dev);
1677 cpi->version_num = 1; /* XXX??? */
1678 cpi->hba_inquiry = PI_SDTR_ABLE;
1679 cpi->target_sprt = 0;
1680 cpi->hba_misc = PIM_SEQSCAN;
1681 cpi->hba_eng_cnt = 0;
1682 if (ch->flags & ATA_NO_SLAVE)
1683 cpi->max_target = 0;
1684 else

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

1697 if (ch->flags & ATA_SATA)
1698 cpi->transport = XPORT_SATA;
1699 else
1700 cpi->transport = XPORT_ATA;
1701 cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
1702 cpi->protocol = PROTO_ATA;
1703 cpi->protocol_version = PROTO_VERSION_UNSPECIFIED;
1704 cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS;
1679 cpi->version_num = 1; /* XXX??? */
1680 cpi->hba_inquiry = PI_SDTR_ABLE;
1681 cpi->target_sprt = 0;
1682 cpi->hba_misc = PIM_SEQSCAN;
1683 cpi->hba_eng_cnt = 0;
1684 if (ch->flags & ATA_NO_SLAVE)
1685 cpi->max_target = 0;
1686 else

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

1699 if (ch->flags & ATA_SATA)
1700 cpi->transport = XPORT_SATA;
1701 else
1702 cpi->transport = XPORT_ATA;
1703 cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
1704 cpi->protocol = PROTO_ATA;
1705 cpi->protocol_version = PROTO_VERSION_UNSPECIFIED;
1706 cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS;
1707 if (device_get_devclass(device_get_parent(parent)) ==
1708 devclass_find("pci")) {
1709 cpi->hba_vendor = pci_get_vendor(parent);
1710 cpi->hba_device = pci_get_device(parent);
1711 cpi->hba_subvendor = pci_get_subvendor(parent);
1712 cpi->hba_subdevice = pci_get_subdevice(parent);
1713 }
1705 cpi->ccb_h.status = CAM_REQ_CMP;
1706 break;
1707 }
1708 default:
1709 ccb->ccb_h.status = CAM_REQ_INVALID;
1710 break;
1711 }
1712 xpt_done(ccb);

--- 81 unchanged lines hidden ---
1714 cpi->ccb_h.status = CAM_REQ_CMP;
1715 break;
1716 }
1717 default:
1718 ccb->ccb_h.status = CAM_REQ_INVALID;
1719 break;
1720 }
1721 xpt_done(ccb);

--- 81 unchanged lines hidden ---