scsi_ctl.c (237601) | scsi_ctl.c (237726) |
---|---|
1/*- 2 * Copyright (c) 2008, 2009 Silicon Graphics International Corp. 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 --- 22 unchanged lines hidden (view full) --- 31 */ 32/* 33 * Peripheral driver interface between CAM and CTL (CAM Target Layer). 34 * 35 * Author: Ken Merry <ken@FreeBSD.org> 36 */ 37 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008, 2009 Silicon Graphics International Corp. 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 --- 22 unchanged lines hidden (view full) --- 31 */ 32/* 33 * Peripheral driver interface between CAM and CTL (CAM Target Layer). 34 * 35 * Author: Ken Merry <ken@FreeBSD.org> 36 */ 37 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/sys/cam/ctl/scsi_ctl.c 237601 2012-06-26 14:51:35Z ken $"); | 39__FBSDID("$FreeBSD: head/sys/cam/ctl/scsi_ctl.c 237726 2012-06-28 19:39:30Z ken $"); |
40 41#include <sys/param.h> 42#include <sys/queue.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> 45#include <sys/lock.h> 46#include <sys/mutex.h> 47#include <sys/condvar.h> --- 174 unchanged lines hidden (view full) --- 222static struct periph_driver ctlfe_driver = 223{ 224 ctlfeinit, "ctl", 225 TAILQ_HEAD_INITIALIZER(ctlfe_driver.units), /*generation*/ 0 226}; 227PERIPHDRIVER_DECLARE(ctl, ctlfe_driver); 228 229extern struct ctl_softc *control_softc; | 40 41#include <sys/param.h> 42#include <sys/queue.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> 45#include <sys/lock.h> 46#include <sys/mutex.h> 47#include <sys/condvar.h> --- 174 unchanged lines hidden (view full) --- 222static struct periph_driver ctlfe_driver = 223{ 224 ctlfeinit, "ctl", 225 TAILQ_HEAD_INITIALIZER(ctlfe_driver.units), /*generation*/ 0 226}; 227PERIPHDRIVER_DECLARE(ctl, ctlfe_driver); 228 229extern struct ctl_softc *control_softc; |
230extern int ctl_disable; |
|
230 231int 232ctlfeinitialize(void) 233{ 234 cam_status status; 235 | 231 232int 233ctlfeinitialize(void) 234{ 235 cam_status status; 236 |
237 /* Don't initialize if we're disabled */ 238 if (ctl_disable != 0) 239 return (0); 240 |
|
236 STAILQ_INIT(&ctlfe_softc_list); 237 238 mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); 239 240 xpt_lock_buses(); 241 periphdriver_register(&ctlfe_driver); 242 xpt_unlock_buses(); 243 --- 14 unchanged lines hidden (view full) --- 258 return; 259} 260 261void 262ctlfeinit(void) 263{ 264 cam_status status; 265 | 241 STAILQ_INIT(&ctlfe_softc_list); 242 243 mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); 244 245 xpt_lock_buses(); 246 periphdriver_register(&ctlfe_driver); 247 xpt_unlock_buses(); 248 --- 14 unchanged lines hidden (view full) --- 263 return; 264} 265 266void 267ctlfeinit(void) 268{ 269 cam_status status; 270 |
271 /* Don't initialize if we're disabled */ 272 if (ctl_disable != 0) 273 return; 274 |
|
266 STAILQ_INIT(&ctlfe_softc_list); 267 268 mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); 269 270 KASSERT(control_softc != NULL, ("CTL is not initialized!")); 271 272 status = xpt_register_async(AC_PATH_REGISTERED | AC_PATH_DEREGISTERED | 273 AC_CONTRACT, ctlfeasync, NULL, NULL); --- 1806 unchanged lines hidden --- | 275 STAILQ_INIT(&ctlfe_softc_list); 276 277 mtx_init(&ctlfe_list_mtx, ctlfe_mtx_desc, NULL, MTX_DEF); 278 279 KASSERT(control_softc != NULL, ("CTL is not initialized!")); 280 281 status = xpt_register_async(AC_PATH_REGISTERED | AC_PATH_DEREGISTERED | 282 AC_CONTRACT, ctlfeasync, NULL, NULL); --- 1806 unchanged lines hidden --- |