Lines Matching full:cdm

282 static int		xptedtmatch(struct ccb_dev_match *cdm);
283 static int xptperiphlistmatch(struct ccb_dev_match *cdm);
1586 struct ccb_dev_match *cdm; in xptedtbusfunc() local
1590 cdm = (struct ccb_dev_match *)arg; in xptedtbusfunc()
1596 if ((cdm->pos.position_type & CAM_DEV_POS_BUS) in xptedtbusfunc()
1597 && (cdm->pos.cookie.bus == bus) in xptedtbusfunc()
1598 && (cdm->pos.position_type & CAM_DEV_POS_TARGET) in xptedtbusfunc()
1599 && (cdm->pos.cookie.target != NULL)) in xptedtbusfunc()
1602 retval = xptbusmatch(cdm->patterns, cdm->num_patterns, bus); in xptedtbusfunc()
1608 cdm->status = CAM_DEV_MATCH_ERROR; in xptedtbusfunc()
1618 spaceleft = cdm->match_buf_len - (cdm->num_matches * in xptedtbusfunc()
1627 bzero(&cdm->pos, sizeof(cdm->pos)); in xptedtbusfunc()
1628 cdm->pos.position_type = in xptedtbusfunc()
1631 cdm->pos.cookie.bus = bus; in xptedtbusfunc()
1632 cdm->pos.generations[CAM_BUS_GENERATION]= in xptedtbusfunc()
1634 cdm->status = CAM_DEV_MATCH_MORE; in xptedtbusfunc()
1637 j = cdm->num_matches; in xptedtbusfunc()
1638 cdm->num_matches++; in xptedtbusfunc()
1639 cdm->matches[j].type = DEV_MATCH_BUS; in xptedtbusfunc()
1640 cdm->matches[j].result.bus_result.path_id = bus->path_id; in xptedtbusfunc()
1641 cdm->matches[j].result.bus_result.bus_id = bus->sim->bus_id; in xptedtbusfunc()
1642 cdm->matches[j].result.bus_result.unit_number = in xptedtbusfunc()
1644 strlcpy(cdm->matches[j].result.bus_result.dev_name, in xptedtbusfunc()
1646 sizeof(cdm->matches[j].result.bus_result.dev_name)); in xptedtbusfunc()
1661 if ((cdm->pos.position_type & CAM_DEV_POS_BUS) in xptedtbusfunc()
1662 && (cdm->pos.cookie.bus == bus) in xptedtbusfunc()
1663 && (cdm->pos.position_type & CAM_DEV_POS_TARGET) in xptedtbusfunc()
1664 && (cdm->pos.cookie.target != NULL)) { in xptedtbusfunc()
1665 if ((cdm->pos.generations[CAM_TARGET_GENERATION] != in xptedtbusfunc()
1668 cdm->status = CAM_DEV_MATCH_LIST_CHANGED; in xptedtbusfunc()
1671 target = (struct cam_et *)cdm->pos.cookie.target; in xptedtbusfunc()
1683 struct ccb_dev_match *cdm; in xptedttargetfunc() local
1687 cdm = (struct ccb_dev_match *)arg; in xptedttargetfunc()
1695 if ((cdm->pos.position_type & CAM_DEV_POS_BUS) in xptedttargetfunc()
1696 && (cdm->pos.cookie.bus == bus) in xptedttargetfunc()
1697 && (cdm->pos.position_type & CAM_DEV_POS_TARGET) in xptedttargetfunc()
1698 && (cdm->pos.cookie.target == target) in xptedttargetfunc()
1699 && (cdm->pos.position_type & CAM_DEV_POS_DEVICE) in xptedttargetfunc()
1700 && (cdm->pos.cookie.device != NULL)) { in xptedttargetfunc()
1701 if (cdm->pos.generations[CAM_DEV_GENERATION] != in xptedttargetfunc()
1704 cdm->status = CAM_DEV_MATCH_LIST_CHANGED; in xptedttargetfunc()
1707 device = (struct cam_ed *)cdm->pos.cookie.device; in xptedttargetfunc()
1721 struct ccb_dev_match *cdm; in xptedtdevicefunc() local
1724 cdm = (struct ccb_dev_match *)arg; in xptedtdevicefunc()
1731 if ((cdm->pos.position_type & CAM_DEV_POS_DEVICE) in xptedtdevicefunc()
1732 && (cdm->pos.cookie.device == device) in xptedtdevicefunc()
1733 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH) in xptedtdevicefunc()
1734 && (cdm->pos.cookie.periph != NULL)) in xptedtdevicefunc()
1737 retval = xptdevicematch(cdm->patterns, cdm->num_patterns, in xptedtdevicefunc()
1741 cdm->status = CAM_DEV_MATCH_ERROR; in xptedtdevicefunc()
1751 spaceleft = cdm->match_buf_len - (cdm->num_matches * in xptedtdevicefunc()
1760 bzero(&cdm->pos, sizeof(cdm->pos)); in xptedtdevicefunc()
1761 cdm->pos.position_type = in xptedtdevicefunc()
1765 cdm->pos.cookie.bus = device->target->bus; in xptedtdevicefunc()
1766 cdm->pos.generations[CAM_BUS_GENERATION]= in xptedtdevicefunc()
1768 cdm->pos.cookie.target = device->target; in xptedtdevicefunc()
1769 cdm->pos.generations[CAM_TARGET_GENERATION] = in xptedtdevicefunc()
1771 cdm->pos.cookie.device = device; in xptedtdevicefunc()
1772 cdm->pos.generations[CAM_DEV_GENERATION] = in xptedtdevicefunc()
1774 cdm->status = CAM_DEV_MATCH_MORE; in xptedtdevicefunc()
1777 j = cdm->num_matches; in xptedtdevicefunc()
1778 cdm->num_matches++; in xptedtdevicefunc()
1779 cdm->matches[j].type = DEV_MATCH_DEVICE; in xptedtdevicefunc()
1780 cdm->matches[j].result.device_result.path_id = in xptedtdevicefunc()
1782 cdm->matches[j].result.device_result.target_id = in xptedtdevicefunc()
1784 cdm->matches[j].result.device_result.target_lun = in xptedtdevicefunc()
1786 cdm->matches[j].result.device_result.protocol = in xptedtdevicefunc()
1789 &cdm->matches[j].result.device_result.inq_data, in xptedtdevicefunc()
1792 &cdm->matches[j].result.device_result.ident_data, in xptedtdevicefunc()
1797 cdm->matches[j].result.device_result.flags = in xptedtdevicefunc()
1800 cdm->matches[j].result.device_result.flags = in xptedtdevicefunc()
1817 if ((cdm->pos.position_type & CAM_DEV_POS_BUS) in xptedtdevicefunc()
1818 && (cdm->pos.cookie.bus == bus) in xptedtdevicefunc()
1819 && (cdm->pos.position_type & CAM_DEV_POS_TARGET) in xptedtdevicefunc()
1820 && (cdm->pos.cookie.target == device->target) in xptedtdevicefunc()
1821 && (cdm->pos.position_type & CAM_DEV_POS_DEVICE) in xptedtdevicefunc()
1822 && (cdm->pos.cookie.device == device) in xptedtdevicefunc()
1823 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH) in xptedtdevicefunc()
1824 && (cdm->pos.cookie.periph != NULL)) { in xptedtdevicefunc()
1825 if (cdm->pos.generations[CAM_PERIPH_GENERATION] != in xptedtdevicefunc()
1829 cdm->status = CAM_DEV_MATCH_LIST_CHANGED; in xptedtdevicefunc()
1832 periph = (struct cam_periph *)cdm->pos.cookie.periph; in xptedtdevicefunc()
1845 struct ccb_dev_match *cdm; in xptedtperiphfunc() local
1848 cdm = (struct ccb_dev_match *)arg; in xptedtperiphfunc()
1850 retval = xptperiphmatch(cdm->patterns, cdm->num_patterns, periph); in xptedtperiphfunc()
1853 cdm->status = CAM_DEV_MATCH_ERROR; in xptedtperiphfunc()
1864 spaceleft = cdm->match_buf_len - (cdm->num_matches * in xptedtperiphfunc()
1873 bzero(&cdm->pos, sizeof(cdm->pos)); in xptedtperiphfunc()
1874 cdm->pos.position_type = in xptedtperiphfunc()
1879 cdm->pos.cookie.bus = periph->path->bus; in xptedtperiphfunc()
1880 cdm->pos.generations[CAM_BUS_GENERATION]= in xptedtperiphfunc()
1882 cdm->pos.cookie.target = periph->path->target; in xptedtperiphfunc()
1883 cdm->pos.generations[CAM_TARGET_GENERATION] = in xptedtperiphfunc()
1885 cdm->pos.cookie.device = periph->path->device; in xptedtperiphfunc()
1886 cdm->pos.generations[CAM_DEV_GENERATION] = in xptedtperiphfunc()
1888 cdm->pos.cookie.periph = periph; in xptedtperiphfunc()
1889 cdm->pos.generations[CAM_PERIPH_GENERATION] = in xptedtperiphfunc()
1891 cdm->status = CAM_DEV_MATCH_MORE; in xptedtperiphfunc()
1895 j = cdm->num_matches; in xptedtperiphfunc()
1896 cdm->num_matches++; in xptedtperiphfunc()
1897 cdm->matches[j].type = DEV_MATCH_PERIPH; in xptedtperiphfunc()
1898 cdm->matches[j].result.periph_result.path_id = in xptedtperiphfunc()
1900 cdm->matches[j].result.periph_result.target_id = in xptedtperiphfunc()
1902 cdm->matches[j].result.periph_result.target_lun = in xptedtperiphfunc()
1904 cdm->matches[j].result.periph_result.unit_number = in xptedtperiphfunc()
1906 l = sizeof(cdm->matches[j].result.periph_result.periph_name); in xptedtperiphfunc()
1907 strlcpy(cdm->matches[j].result.periph_result.periph_name, in xptedtperiphfunc()
1915 xptedtmatch(struct ccb_dev_match *cdm) in xptedtmatch() argument
1920 cdm->num_matches = 0; in xptedtmatch()
1927 if ((cdm->pos.position_type & CAM_DEV_POS_BUS) in xptedtmatch()
1928 && (cdm->pos.cookie.bus != NULL)) { in xptedtmatch()
1929 if (cdm->pos.generations[CAM_BUS_GENERATION] != in xptedtmatch()
1932 cdm->status = CAM_DEV_MATCH_LIST_CHANGED; in xptedtmatch()
1935 bus = (struct cam_eb *)cdm->pos.cookie.bus; in xptedtmatch()
1941 ret = xptbustraverse(bus, xptedtbusfunc, cdm); in xptedtmatch()
1950 cdm->status = CAM_DEV_MATCH_LAST; in xptedtmatch()
1959 struct ccb_dev_match *cdm; in xptplistpdrvfunc() local
1961 cdm = (struct ccb_dev_match *)arg; in xptplistpdrvfunc()
1964 if ((cdm->pos.position_type & CAM_DEV_POS_PDPTR) in xptplistpdrvfunc()
1965 && (cdm->pos.cookie.pdrv == pdrv) in xptplistpdrvfunc()
1966 && (cdm->pos.position_type & CAM_DEV_POS_PERIPH) in xptplistpdrvfunc()
1967 && (cdm->pos.cookie.periph != NULL)) { in xptplistpdrvfunc()
1968 if (cdm->pos.generations[CAM_PERIPH_GENERATION] != in xptplistpdrvfunc()
1971 cdm->status = CAM_DEV_MATCH_LIST_CHANGED; in xptplistpdrvfunc()
1974 periph = (struct cam_periph *)cdm->pos.cookie.periph; in xptplistpdrvfunc()
1986 struct ccb_dev_match *cdm; in xptplistperiphfunc() local
1989 cdm = (struct ccb_dev_match *)arg; in xptplistperiphfunc()
1991 retval = xptperiphmatch(cdm->patterns, cdm->num_patterns, periph); in xptplistperiphfunc()
1994 cdm->status = CAM_DEV_MATCH_ERROR; in xptplistperiphfunc()
2005 spaceleft = cdm->match_buf_len - (cdm->num_matches * in xptplistperiphfunc()
2017 bzero(&cdm->pos, sizeof(cdm->pos)); in xptplistperiphfunc()
2018 cdm->pos.position_type = in xptplistperiphfunc()
2037 cdm->status = CAM_DEV_MATCH_ERROR; in xptplistperiphfunc()
2041 cdm->pos.cookie.pdrv = pdrv; in xptplistperiphfunc()
2047 cdm->pos.cookie.periph = periph; in xptplistperiphfunc()
2048 cdm->pos.generations[CAM_PERIPH_GENERATION] = in xptplistperiphfunc()
2050 cdm->status = CAM_DEV_MATCH_MORE; in xptplistperiphfunc()
2054 j = cdm->num_matches; in xptplistperiphfunc()
2055 cdm->num_matches++; in xptplistperiphfunc()
2056 cdm->matches[j].type = DEV_MATCH_PERIPH; in xptplistperiphfunc()
2057 cdm->matches[j].result.periph_result.path_id = in xptplistperiphfunc()
2065 cdm->matches[j].result.periph_result.target_id = in xptplistperiphfunc()
2068 cdm->matches[j].result.periph_result.target_id = in xptplistperiphfunc()
2072 cdm->matches[j].result.periph_result.target_lun = in xptplistperiphfunc()
2075 cdm->matches[j].result.periph_result.target_lun = in xptplistperiphfunc()
2078 cdm->matches[j].result.periph_result.unit_number = in xptplistperiphfunc()
2080 l = sizeof(cdm->matches[j].result.periph_result.periph_name); in xptplistperiphfunc()
2081 strlcpy(cdm->matches[j].result.periph_result.periph_name, in xptplistperiphfunc()
2089 xptperiphlistmatch(struct ccb_dev_match *cdm) in xptperiphlistmatch() argument
2093 cdm->num_matches = 0; in xptperiphlistmatch()
2105 if ((cdm->pos.position_type & CAM_DEV_POS_PDPTR) in xptperiphlistmatch()
2106 && (cdm->pos.cookie.pdrv != NULL)) in xptperiphlistmatch()
2108 (struct periph_driver **)cdm->pos.cookie.pdrv, in xptperiphlistmatch()
2109 xptplistpdrvfunc, cdm); in xptperiphlistmatch()
2111 ret = xptpdrvtraverse(NULL, xptplistpdrvfunc, cdm); in xptperiphlistmatch()
2121 cdm->status = CAM_DEV_MATCH_LAST; in xptperiphlistmatch()
2812 struct ccb_dev_match *cdm; in xpt_action_default() local
2814 cdm = &start_ccb->cdm; in xpt_action_default()
2830 if (cdm->pos.position_type != CAM_DEV_POS_NONE) in xpt_action_default()
2831 position_type = cdm->pos.position_type; in xpt_action_default()
2837 for (i = 0; i < cdm->num_patterns; i++) { in xpt_action_default()
2838 if ((cdm->patterns[i].type == DEV_MATCH_BUS) in xpt_action_default()
2839 ||(cdm->patterns[i].type == DEV_MATCH_DEVICE)){ in xpt_action_default()
2845 if (cdm->num_patterns == 0) in xpt_action_default()
2853 xptedtmatch(cdm); in xpt_action_default()
2856 xptperiphlistmatch(cdm); in xpt_action_default()
2859 cdm->status = CAM_DEV_MATCH_ERROR; in xpt_action_default()
2863 if (cdm->status == CAM_DEV_MATCH_ERROR) in xpt_action_default()