cam_xpt.c (186184) | cam_xpt.c (186185) |
---|---|
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 186184 2008-12-16 16:54:51Z trasz $"); | 31__FBSDID("$FreeBSD: head/sys/cam/cam_xpt.c 186185 2008-12-16 16:57:33Z trasz $"); |
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> --- 4259 unchanged lines hidden (view full) --- 4299 if (strcmp(sim->sim_name, "xpt") != 0) { 4300 4301 sim->path_id = 4302 xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); 4303 } 4304 4305 TAILQ_INIT(&new_bus->et_entries); 4306 new_bus->path_id = sim->path_id; | 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> --- 4259 unchanged lines hidden (view full) --- 4299 if (strcmp(sim->sim_name, "xpt") != 0) { 4300 4301 sim->path_id = 4302 xptpathid(sim->sim_name, sim->unit_number, sim->bus_id); 4303 } 4304 4305 TAILQ_INIT(&new_bus->et_entries); 4306 new_bus->path_id = sim->path_id; |
4307 cam_sim_hold(sim); |
|
4307 new_bus->sim = sim; 4308 timevalclear(&new_bus->last_reset); 4309 new_bus->flags = 0; 4310 new_bus->refcount = 1; /* Held until a bus_deregister event */ 4311 new_bus->generation = 0; 4312 mtx_lock(&xsoftc.xpt_topo_lock); 4313 old_bus = TAILQ_FIRST(&xsoftc.xpt_busses); 4314 while (old_bus != NULL --- 526 unchanged lines hidden (view full) --- 4841{ 4842 4843 if ((--bus->refcount == 0) 4844 && (TAILQ_FIRST(&bus->et_entries) == NULL)) { 4845 mtx_lock(&xsoftc.xpt_topo_lock); 4846 TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); 4847 xsoftc.bus_generation++; 4848 mtx_unlock(&xsoftc.xpt_topo_lock); | 4308 new_bus->sim = sim; 4309 timevalclear(&new_bus->last_reset); 4310 new_bus->flags = 0; 4311 new_bus->refcount = 1; /* Held until a bus_deregister event */ 4312 new_bus->generation = 0; 4313 mtx_lock(&xsoftc.xpt_topo_lock); 4314 old_bus = TAILQ_FIRST(&xsoftc.xpt_busses); 4315 while (old_bus != NULL --- 526 unchanged lines hidden (view full) --- 4842{ 4843 4844 if ((--bus->refcount == 0) 4845 && (TAILQ_FIRST(&bus->et_entries) == NULL)) { 4846 mtx_lock(&xsoftc.xpt_topo_lock); 4847 TAILQ_REMOVE(&xsoftc.xpt_busses, bus, links); 4848 xsoftc.bus_generation++; 4849 mtx_unlock(&xsoftc.xpt_topo_lock); |
4850 cam_sim_release(bus->sim); |
|
4849 free(bus, M_CAMXPT); 4850 } 4851} 4852 4853static struct cam_et * 4854xpt_alloc_target(struct cam_eb *bus, target_id_t target_id) 4855{ 4856 struct cam_et *target; --- 2380 unchanged lines hidden --- | 4851 free(bus, M_CAMXPT); 4852 } 4853} 4854 4855static struct cam_et * 4856xpt_alloc_target(struct cam_eb *bus, target_id_t target_id) 4857{ 4858 struct cam_et *target; --- 2380 unchanged lines hidden --- |