Lines Matching refs:cdm

288 static int		xptedtmatch(struct ccb_dev_match *cdm);
289 static int xptperiphlistmatch(struct ccb_dev_match *cdm);
1699 struct ccb_dev_match *cdm;
1703 cdm = (struct ccb_dev_match *)arg;
1709 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1710 && (cdm->pos.cookie.bus == bus)
1711 && (cdm->pos.position_type & CAM_DEV_POS_TARGET)
1712 && (cdm->pos.cookie.target != NULL))
1715 retval = xptbusmatch(cdm->patterns, cdm->num_patterns, bus);
1721 cdm->status = CAM_DEV_MATCH_ERROR;
1731 spaceleft = cdm->match_buf_len - (cdm->num_matches *
1740 bzero(&cdm->pos, sizeof(cdm->pos));
1741 cdm->pos.position_type =
1744 cdm->pos.cookie.bus = bus;
1745 cdm->pos.generations[CAM_BUS_GENERATION]=
1747 cdm->status = CAM_DEV_MATCH_MORE;
1750 j = cdm->num_matches;
1751 cdm->num_matches++;
1752 cdm->matches[j].type = DEV_MATCH_BUS;
1753 cdm->matches[j].result.bus_result.path_id = bus->path_id;
1754 cdm->matches[j].result.bus_result.bus_id = bus->sim->bus_id;
1755 cdm->matches[j].result.bus_result.unit_number =
1757 strlcpy(cdm->matches[j].result.bus_result.dev_name,
1759 sizeof(cdm->matches[j].result.bus_result.dev_name));
1774 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1775 && (cdm->pos.cookie.bus == bus)
1776 && (cdm->pos.position_type & CAM_DEV_POS_TARGET)
1777 && (cdm->pos.cookie.target != NULL)) {
1778 if ((cdm->pos.generations[CAM_TARGET_GENERATION] !=
1781 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
1784 target = (struct cam_et *)cdm->pos.cookie.target;
1796 struct ccb_dev_match *cdm;
1800 cdm = (struct ccb_dev_match *)arg;
1808 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1809 && (cdm->pos.cookie.bus == bus)
1810 && (cdm->pos.position_type & CAM_DEV_POS_TARGET)
1811 && (cdm->pos.cookie.target == target)
1812 && (cdm->pos.position_type & CAM_DEV_POS_DEVICE)
1813 && (cdm->pos.cookie.device != NULL)) {
1814 if (cdm->pos.generations[CAM_DEV_GENERATION] !=
1817 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
1820 device = (struct cam_ed *)cdm->pos.cookie.device;
1834 struct ccb_dev_match *cdm;
1837 cdm = (struct ccb_dev_match *)arg;
1844 if ((cdm->pos.position_type & CAM_DEV_POS_DEVICE)
1845 && (cdm->pos.cookie.device == device)
1846 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH)
1847 && (cdm->pos.cookie.periph != NULL))
1850 retval = xptdevicematch(cdm->patterns, cdm->num_patterns,
1854 cdm->status = CAM_DEV_MATCH_ERROR;
1864 spaceleft = cdm->match_buf_len - (cdm->num_matches *
1873 bzero(&cdm->pos, sizeof(cdm->pos));
1874 cdm->pos.position_type =
1878 cdm->pos.cookie.bus = device->target->bus;
1879 cdm->pos.generations[CAM_BUS_GENERATION]=
1881 cdm->pos.cookie.target = device->target;
1882 cdm->pos.generations[CAM_TARGET_GENERATION] =
1884 cdm->pos.cookie.device = device;
1885 cdm->pos.generations[CAM_DEV_GENERATION] =
1887 cdm->status = CAM_DEV_MATCH_MORE;
1890 j = cdm->num_matches;
1891 cdm->num_matches++;
1892 cdm->matches[j].type = DEV_MATCH_DEVICE;
1893 cdm->matches[j].result.device_result.path_id =
1895 cdm->matches[j].result.device_result.target_id =
1897 cdm->matches[j].result.device_result.target_lun =
1899 cdm->matches[j].result.device_result.protocol =
1902 &cdm->matches[j].result.device_result.inq_data,
1905 &cdm->matches[j].result.device_result.ident_data,
1910 cdm->matches[j].result.device_result.flags =
1913 cdm->matches[j].result.device_result.flags =
1930 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
1931 && (cdm->pos.cookie.bus == bus)
1932 && (cdm->pos.position_type & CAM_DEV_POS_TARGET)
1933 && (cdm->pos.cookie.target == device->target)
1934 && (cdm->pos.position_type & CAM_DEV_POS_DEVICE)
1935 && (cdm->pos.cookie.device == device)
1936 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH)
1937 && (cdm->pos.cookie.periph != NULL)) {
1938 if (cdm->pos.generations[CAM_PERIPH_GENERATION] !=
1942 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
1945 periph = (struct cam_periph *)cdm->pos.cookie.periph;
1958 struct ccb_dev_match *cdm;
1961 cdm = (struct ccb_dev_match *)arg;
1963 retval = xptperiphmatch(cdm->patterns, cdm->num_patterns, periph);
1966 cdm->status = CAM_DEV_MATCH_ERROR;
1977 spaceleft = cdm->match_buf_len - (cdm->num_matches *
1986 bzero(&cdm->pos, sizeof(cdm->pos));
1987 cdm->pos.position_type =
1992 cdm->pos.cookie.bus = periph->path->bus;
1993 cdm->pos.generations[CAM_BUS_GENERATION]=
1995 cdm->pos.cookie.target = periph->path->target;
1996 cdm->pos.generations[CAM_TARGET_GENERATION] =
1998 cdm->pos.cookie.device = periph->path->device;
1999 cdm->pos.generations[CAM_DEV_GENERATION] =
2001 cdm->pos.cookie.periph = periph;
2002 cdm->pos.generations[CAM_PERIPH_GENERATION] =
2004 cdm->status = CAM_DEV_MATCH_MORE;
2008 j = cdm->num_matches;
2009 cdm->num_matches++;
2010 cdm->matches[j].type = DEV_MATCH_PERIPH;
2011 cdm->matches[j].result.periph_result.path_id =
2013 cdm->matches[j].result.periph_result.target_id =
2015 cdm->matches[j].result.periph_result.target_lun =
2017 cdm->matches[j].result.periph_result.unit_number =
2019 l = sizeof(cdm->matches[j].result.periph_result.periph_name);
2020 strlcpy(cdm->matches[j].result.periph_result.periph_name,
2028 xptedtmatch(struct ccb_dev_match *cdm)
2033 cdm->num_matches = 0;
2040 if ((cdm->pos.position_type & CAM_DEV_POS_BUS)
2041 && (cdm->pos.cookie.bus != NULL)) {
2042 if (cdm->pos.generations[CAM_BUS_GENERATION] !=
2045 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
2048 bus = (struct cam_eb *)cdm->pos.cookie.bus;
2054 ret = xptbustraverse(bus, xptedtbusfunc, cdm);
2063 cdm->status = CAM_DEV_MATCH_LAST;
2072 struct ccb_dev_match *cdm;
2074 cdm = (struct ccb_dev_match *)arg;
2077 if ((cdm->pos.position_type & CAM_DEV_POS_PDPTR)
2078 && (cdm->pos.cookie.pdrv == pdrv)
2079 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH)
2080 && (cdm->pos.cookie.periph != NULL)) {
2081 if (cdm->pos.generations[CAM_PERIPH_GENERATION] !=
2084 cdm->status = CAM_DEV_MATCH_LIST_CHANGED;
2087 periph = (struct cam_periph *)cdm->pos.cookie.periph;
2099 struct ccb_dev_match *cdm;
2102 cdm = (struct ccb_dev_match *)arg;
2104 retval = xptperiphmatch(cdm->patterns, cdm->num_patterns, periph);
2107 cdm->status = CAM_DEV_MATCH_ERROR;
2118 spaceleft = cdm->match_buf_len - (cdm->num_matches *
2130 bzero(&cdm->pos, sizeof(cdm->pos));
2131 cdm->pos.position_type =
2150 cdm->status = CAM_DEV_MATCH_ERROR;
2154 cdm->pos.cookie.pdrv = pdrv;
2160 cdm->pos.cookie.periph = periph;
2161 cdm->pos.generations[CAM_PERIPH_GENERATION] =
2163 cdm->status = CAM_DEV_MATCH_MORE;
2167 j = cdm->num_matches;
2168 cdm->num_matches++;
2169 cdm->matches[j].type = DEV_MATCH_PERIPH;
2170 cdm->matches[j].result.periph_result.path_id =
2178 cdm->matches[j].result.periph_result.target_id =
2181 cdm->matches[j].result.periph_result.target_id =
2185 cdm->matches[j].result.periph_result.target_lun =
2188 cdm->matches[j].result.periph_result.target_lun =
2191 cdm->matches[j].result.periph_result.unit_number =
2193 l = sizeof(cdm->matches[j].result.periph_result.periph_name);
2194 strlcpy(cdm->matches[j].result.periph_result.periph_name,
2202 xptperiphlistmatch(struct ccb_dev_match *cdm)
2206 cdm->num_matches = 0;
2218 if ((cdm->pos.position_type & CAM_DEV_POS_PDPTR)
2219 && (cdm->pos.cookie.pdrv != NULL))
2221 (struct periph_driver **)cdm->pos.cookie.pdrv,
2222 xptplistpdrvfunc, cdm);
2224 ret = xptpdrvtraverse(NULL, xptplistpdrvfunc, cdm);
2234 cdm->status = CAM_DEV_MATCH_LAST;
2916 struct ccb_dev_match *cdm;
2918 cdm = &start_ccb->cdm;
2934 if (cdm->pos.position_type != CAM_DEV_POS_NONE)
2935 position_type = cdm->pos.position_type;
2941 for (i = 0; i < cdm->num_patterns; i++) {
2942 if ((cdm->patterns[i].type == DEV_MATCH_BUS)
2943 ||(cdm->patterns[i].type == DEV_MATCH_DEVICE)){
2949 if (cdm->num_patterns == 0)
2957 xptedtmatch(cdm);
2960 xptperiphlistmatch(cdm);
2963 cdm->status = CAM_DEV_MATCH_ERROR;
2967 if (cdm->status == CAM_DEV_MATCH_ERROR)