Lines Matching refs:cdm

275 static int		xptedtmatch(struct ccb_dev_match *cdm);
276 static int xptperiphlistmatch(struct ccb_dev_match *cdm);
1578 struct ccb_dev_match *cdm;
1582 cdm = (struct ccb_dev_match *)arg;
1588 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1589 && (cdm->pos.cookie.bus == bus)
1590 && (cdm->pos.position_type & CAM_DEV_POS_TARGET)
1591 && (cdm->pos.cookie.target != NULL))
1594 retval = xptbusmatch(cdm->patterns, cdm->num_patterns, bus);
1600 cdm->status = CAM_DEV_MATCH_ERROR;
1610 spaceleft = cdm->match_buf_len - (cdm->num_matches *
1619 bzero(&cdm->pos, sizeof(cdm->pos));
1620 cdm->pos.position_type =
1623 cdm->pos.cookie.bus = bus;
1624 cdm->pos.generations[CAM_BUS_GENERATION]=
1626 cdm->status = CAM_DEV_MATCH_MORE;
1629 j = cdm->num_matches;
1630 cdm->num_matches++;
1631 cdm->matches[j].type = DEV_MATCH_BUS;
1632 cdm->matches[j].result.bus_result.path_id = bus->path_id;
1633 cdm->matches[j].result.bus_result.bus_id = bus->sim->bus_id;
1634 cdm->matches[j].result.bus_result.unit_number =
1636 strlcpy(cdm->matches[j].result.bus_result.dev_name,
1638 sizeof(cdm->matches[j].result.bus_result.dev_name));
1653 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1654 && (cdm->pos.cookie.bus == bus)
1655 && (cdm->pos.position_type & CAM_DEV_POS_TARGET)
1656 && (cdm->pos.cookie.target != NULL)) {
1657 if ((cdm->pos.generations[CAM_TARGET_GENERATION] !=
1660 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
1663 target = (struct cam_et *)cdm->pos.cookie.target;
1675 struct ccb_dev_match *cdm;
1679 cdm = (struct ccb_dev_match *)arg;
1687 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1688 && (cdm->pos.cookie.bus == bus)
1689 && (cdm->pos.position_type & CAM_DEV_POS_TARGET)
1690 && (cdm->pos.cookie.target == target)
1691 && (cdm->pos.position_type & CAM_DEV_POS_DEVICE)
1692 && (cdm->pos.cookie.device != NULL)) {
1693 if (cdm->pos.generations[CAM_DEV_GENERATION] !=
1696 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
1699 device = (struct cam_ed *)cdm->pos.cookie.device;
1713 struct ccb_dev_match *cdm;
1716 cdm = (struct ccb_dev_match *)arg;
1723 if ((cdm->pos.position_type & CAM_DEV_POS_DEVICE)
1724 && (cdm->pos.cookie.device == device)
1725 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH)
1726 && (cdm->pos.cookie.periph != NULL))
1729 retval = xptdevicematch(cdm->patterns, cdm->num_patterns,
1733 cdm->status = CAM_DEV_MATCH_ERROR;
1743 spaceleft = cdm->match_buf_len - (cdm->num_matches *
1752 bzero(&cdm->pos, sizeof(cdm->pos));
1753 cdm->pos.position_type =
1757 cdm->pos.cookie.bus = device->target->bus;
1758 cdm->pos.generations[CAM_BUS_GENERATION]=
1760 cdm->pos.cookie.target = device->target;
1761 cdm->pos.generations[CAM_TARGET_GENERATION] =
1763 cdm->pos.cookie.device = device;
1764 cdm->pos.generations[CAM_DEV_GENERATION] =
1766 cdm->status = CAM_DEV_MATCH_MORE;
1769 j = cdm->num_matches;
1770 cdm->num_matches++;
1771 cdm->matches[j].type = DEV_MATCH_DEVICE;
1772 cdm->matches[j].result.device_result.path_id =
1774 cdm->matches[j].result.device_result.target_id =
1776 cdm->matches[j].result.device_result.target_lun =
1778 cdm->matches[j].result.device_result.protocol =
1781 &cdm->matches[j].result.device_result.inq_data,
1784 &cdm->matches[j].result.device_result.ident_data,
1789 cdm->matches[j].result.device_result.flags =
1792 cdm->matches[j].result.device_result.flags =
1809 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1810 && (cdm->pos.cookie.bus == bus)
1811 && (cdm->pos.position_type & CAM_DEV_POS_TARGET)
1812 && (cdm->pos.cookie.target == device->target)
1813 && (cdm->pos.position_type & CAM_DEV_POS_DEVICE)
1814 && (cdm->pos.cookie.device == device)
1815 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH)
1816 && (cdm->pos.cookie.periph != NULL)) {
1817 if (cdm->pos.generations[CAM_PERIPH_GENERATION] !=
1821 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
1824 periph = (struct cam_periph *)cdm->pos.cookie.periph;
1837 struct ccb_dev_match *cdm;
1840 cdm = (struct ccb_dev_match *)arg;
1842 retval = xptperiphmatch(cdm->patterns, cdm->num_patterns, periph);
1845 cdm->status = CAM_DEV_MATCH_ERROR;
1856 spaceleft = cdm->match_buf_len - (cdm->num_matches *
1865 bzero(&cdm->pos, sizeof(cdm->pos));
1866 cdm->pos.position_type =
1871 cdm->pos.cookie.bus = periph->path->bus;
1872 cdm->pos.generations[CAM_BUS_GENERATION]=
1874 cdm->pos.cookie.target = periph->path->target;
1875 cdm->pos.generations[CAM_TARGET_GENERATION] =
1877 cdm->pos.cookie.device = periph->path->device;
1878 cdm->pos.generations[CAM_DEV_GENERATION] =
1880 cdm->pos.cookie.periph = periph;
1881 cdm->pos.generations[CAM_PERIPH_GENERATION] =
1883 cdm->status = CAM_DEV_MATCH_MORE;
1887 j = cdm->num_matches;
1888 cdm->num_matches++;
1889 cdm->matches[j].type = DEV_MATCH_PERIPH;
1890 cdm->matches[j].result.periph_result.path_id =
1892 cdm->matches[j].result.periph_result.target_id =
1894 cdm->matches[j].result.periph_result.target_lun =
1896 cdm->matches[j].result.periph_result.unit_number =
1898 l = sizeof(cdm->matches[j].result.periph_result.periph_name);
1899 strlcpy(cdm->matches[j].result.periph_result.periph_name,
1907 xptedtmatch(struct ccb_dev_match *cdm)
1912 cdm->num_matches = 0;
1919 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1920 && (cdm->pos.cookie.bus != NULL)) {
1921 if (cdm->pos.generations[CAM_BUS_GENERATION] !=
1924 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
1927 bus = (struct cam_eb *)cdm->pos.cookie.bus;
1933 ret = xptbustraverse(bus, xptedtbusfunc, cdm);
1942 cdm->status = CAM_DEV_MATCH_LAST;
1951 struct ccb_dev_match *cdm;
1953 cdm = (struct ccb_dev_match *)arg;
1956 if ((cdm->pos.position_type & CAM_DEV_POS_PDPTR)
1957 && (cdm->pos.cookie.pdrv == pdrv)
1958 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH)
1959 && (cdm->pos.cookie.periph != NULL)) {
1960 if (cdm->pos.generations[CAM_PERIPH_GENERATION] !=
1963 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
1966 periph = (struct cam_periph *)cdm->pos.cookie.periph;
1978 struct ccb_dev_match *cdm;
1981 cdm = (struct ccb_dev_match *)arg;
1983 retval = xptperiphmatch(cdm->patterns, cdm->num_patterns, periph);
1986 cdm->status = CAM_DEV_MATCH_ERROR;
1997 spaceleft = cdm->match_buf_len - (cdm->num_matches *
2009 bzero(&cdm->pos, sizeof(cdm->pos));
2010 cdm->pos.position_type =
2029 cdm->status = CAM_DEV_MATCH_ERROR;
2033 cdm->pos.cookie.pdrv = pdrv;
2039 cdm->pos.cookie.periph = periph;
2040 cdm->pos.generations[CAM_PERIPH_GENERATION] =
2042 cdm->status = CAM_DEV_MATCH_MORE;
2046 j = cdm->num_matches;
2047 cdm->num_matches++;
2048 cdm->matches[j].type = DEV_MATCH_PERIPH;
2049 cdm->matches[j].result.periph_result.path_id =
2057 cdm->matches[j].result.periph_result.target_id =
2060 cdm->matches[j].result.periph_result.target_id =
2064 cdm->matches[j].result.periph_result.target_lun =
2067 cdm->matches[j].result.periph_result.target_lun =
2070 cdm->matches[j].result.periph_result.unit_number =
2072 l = sizeof(cdm->matches[j].result.periph_result.periph_name);
2073 strlcpy(cdm->matches[j].result.periph_result.periph_name,
2081 xptperiphlistmatch(struct ccb_dev_match *cdm)
2085 cdm->num_matches = 0;
2097 if ((cdm->pos.position_type & CAM_DEV_POS_PDPTR)
2098 && (cdm->pos.cookie.pdrv != NULL))
2100 (struct periph_driver **)cdm->pos.cookie.pdrv,
2101 xptplistpdrvfunc, cdm);
2103 ret = xptpdrvtraverse(NULL, xptplistpdrvfunc, cdm);
2113 cdm->status = CAM_DEV_MATCH_LAST;
2815 struct ccb_dev_match *cdm;
2817 cdm = &start_ccb->cdm;
2833 if (cdm->pos.position_type != CAM_DEV_POS_NONE)
2834 position_type = cdm->pos.position_type;
2840 for (i = 0; i < cdm->num_patterns; i++) {
2841 if ((cdm->patterns[i].type == DEV_MATCH_BUS)
2842 ||(cdm->patterns[i].type == DEV_MATCH_DEVICE)){
2848 if (cdm->num_patterns == 0)
2856 xptedtmatch(cdm);
2859 xptperiphlistmatch(cdm);
2862 cdm->status = CAM_DEV_MATCH_ERROR;
2866 if (cdm->status == CAM_DEV_MATCH_ERROR)