Deleted Added
full compact
scsi_ctl.c (246713) scsi_ctl.c (249009)
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 246713 2013-02-12 16:57:20Z kib $");
39__FBSDID("$FreeBSD: head/sys/cam/ctl/scsi_ctl.c 249009 2013-04-02 09:42:42Z trasz $");
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>

--- 172 unchanged lines hidden (view full) ---

220static void ctlfe_datamove_done(union ctl_io *io);
221static void ctlfe_dump(void);
222
223static struct periph_driver ctlfe_driver =
224{
225 ctlfeinit, "ctl",
226 TAILQ_HEAD_INITIALIZER(ctlfe_driver.units), /*generation*/ 0
227};
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>

--- 172 unchanged lines hidden (view full) ---

220static void ctlfe_datamove_done(union ctl_io *io);
221static void ctlfe_dump(void);
222
223static struct periph_driver ctlfe_driver =
224{
225 ctlfeinit, "ctl",
226 TAILQ_HEAD_INITIALIZER(ctlfe_driver.units), /*generation*/ 0
227};
228PERIPHDRIVER_DECLARE(ctl, ctlfe_driver);
229
228
229static int ctlfe_module_event_handler(module_t, int /*modeventtype_t*/, void *);
230
231/*
232 * We're not using PERIPHDRIVER_DECLARE(), because it runs at SI_SUB_DRIVERS,
233 * and that happens before CTL gets initialised.
234 */
235static moduledata_t ctlfe_moduledata = {
236 "ctlfe",
237 ctlfe_module_event_handler,
238 NULL
239};
240
241DECLARE_MODULE(ctlfe, ctlfe_moduledata, SI_SUB_CONFIGURE, SI_ORDER_FOURTH);
242MODULE_VERSION(ctlfe, 1);
243MODULE_DEPEND(ctlfe, ctl, 1, 1, 1);
244MODULE_DEPEND(ctlfe, cam, 1, 1, 1);
245
230extern struct ctl_softc *control_softc;
231extern int ctl_disable;
232
246extern struct ctl_softc *control_softc;
247extern int ctl_disable;
248
249#ifdef seems_unused
233int
234ctlfeinitialize(void)
235{
236 cam_status status;
237
238 /* Don't initialize if we're disabled */
239 if (ctl_disable != 0)
240 return (0);

--- 11 unchanged lines hidden (view full) ---

252
253 if (status != CAM_REQ_CMP) {
254 printf("ctl: Failed to attach async callback due to CAM "
255 "status 0x%x!\n", status);
256 }
257
258 return (0);
259}
250int
251ctlfeinitialize(void)
252{
253 cam_status status;
254
255 /* Don't initialize if we're disabled */
256 if (ctl_disable != 0)
257 return (0);

--- 11 unchanged lines hidden (view full) ---

269
270 if (status != CAM_REQ_CMP) {
271 printf("ctl: Failed to attach async callback due to CAM "
272 "status 0x%x!\n", status);
273 }
274
275 return (0);
276}
277#endif
260
261void
262ctlfeshutdown(void)
263{
264 return;
265}
266
267void

--- 15 unchanged lines hidden (view full) ---

283 AC_CONTRACT, ctlfeasync, NULL, NULL);
284
285 if (status != CAM_REQ_CMP) {
286 printf("ctl: Failed to attach async callback due to CAM "
287 "status 0x%x!\n", status);
288 }
289}
290
278
279void
280ctlfeshutdown(void)
281{
282 return;
283}
284
285void

--- 15 unchanged lines hidden (view full) ---

301 AC_CONTRACT, ctlfeasync, NULL, NULL);
302
303 if (status != CAM_REQ_CMP) {
304 printf("ctl: Failed to attach async callback due to CAM "
305 "status 0x%x!\n", status);
306 }
307}
308
309static int
310ctlfe_module_event_handler(module_t mod, int what, void *arg)
311{
312
313 switch (what) {
314 case MOD_LOAD:
315 periphdriver_register(&ctlfe_driver);
316 return (0);
317 case MOD_UNLOAD:
318 return (EBUSY);
319 default:
320 return (EOPNOTSUPP);
321 }
322}
323
291static void
292ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
293{
294
295#ifdef CTLFEDEBUG
296 printf("%s: entered\n", __func__);
297#endif
298

--- 1667 unchanged lines hidden (view full) ---

1966{
1967 struct ctlfe_softc *bus_softc;
1968 struct ctlfe_lun_softc *softc;
1969 struct cam_path *path;
1970 struct cam_periph *periph;
1971 struct cam_sim *sim;
1972 cam_status status;
1973
324static void
325ctlfeasync(void *callback_arg, uint32_t code, struct cam_path *path, void *arg)
326{
327
328#ifdef CTLFEDEBUG
329 printf("%s: entered\n", __func__);
330#endif
331

--- 1667 unchanged lines hidden (view full) ---

1999{
2000 struct ctlfe_softc *bus_softc;
2001 struct ctlfe_lun_softc *softc;
2002 struct cam_path *path;
2003 struct cam_periph *periph;
2004 struct cam_sim *sim;
2005 cam_status status;
2006
1974
1975 bus_softc = (struct ctlfe_softc *)arg;
1976 sim = bus_softc->sim;
1977
1978 status = xpt_create_path_unlocked(&path, /*periph*/ NULL,
1979 bus_softc->path_id,
1980 targ_id.id, lun_id);
1981 /* XXX KDM need some way to return status to CTL here? */
1982 if (status != CAM_REQ_CMP) {

--- 301 unchanged lines hidden ---
2007 bus_softc = (struct ctlfe_softc *)arg;
2008 sim = bus_softc->sim;
2009
2010 status = xpt_create_path_unlocked(&path, /*periph*/ NULL,
2011 bus_softc->path_id,
2012 targ_id.id, lun_id);
2013 /* XXX KDM need some way to return status to CTL here? */
2014 if (status != CAM_REQ_CMP) {

--- 301 unchanged lines hidden ---