ctl_frontend_internal.c (268677) | ctl_frontend_internal.c (275493) |
---|---|
1/*- 2 * Copyright (c) 2004, 2005 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 --- 34 unchanged lines hidden (view full) --- 43 * To be able to fulfill the role of a full initiator layer, it would need 44 * a whole lot more functionality. 45 * 46 * Author: Ken Merry <ken@FreeBSD.org> 47 * 48 */ 49 50#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004, 2005 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 --- 34 unchanged lines hidden (view full) --- 43 * To be able to fulfill the role of a full initiator layer, it would need 44 * a whole lot more functionality. 45 * 46 * Author: Ken Merry <ken@FreeBSD.org> 47 * 48 */ 49 50#include <sys/cdefs.h> |
51__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_internal.c 268677 2014-07-15 16:57:30Z mav $"); | 51__FBSDID("$FreeBSD: stable/10/sys/cam/ctl/ctl_frontend_internal.c 275493 2014-12-05 07:23:25Z mav $"); |
52 53#include <sys/param.h> 54#include <sys/systm.h> 55#include <sys/kernel.h> 56#include <sys/types.h> 57#include <sys/malloc.h> 58#include <sys/module.h> 59#include <sys/lock.h> --- 179 unchanged lines hidden (view full) --- 239 printf("%s: size of struct cfi_lun_io %zd > " 240 "CTL_PORT_PRIV_SIZE %d\n", __func__, 241 sizeof(struct cfi_lun_io), 242 CTL_PORT_PRIV_SIZE); 243 } 244 memset(softc, 0, sizeof(*softc)); 245 246 mtx_init(&softc->lock, "CTL frontend mutex", NULL, MTX_DEF); | 52 53#include <sys/param.h> 54#include <sys/systm.h> 55#include <sys/kernel.h> 56#include <sys/types.h> 57#include <sys/malloc.h> 58#include <sys/module.h> 59#include <sys/lock.h> --- 179 unchanged lines hidden (view full) --- 239 printf("%s: size of struct cfi_lun_io %zd > " 240 "CTL_PORT_PRIV_SIZE %d\n", __func__, 241 sizeof(struct cfi_lun_io), 242 CTL_PORT_PRIV_SIZE); 243 } 244 memset(softc, 0, sizeof(*softc)); 245 246 mtx_init(&softc->lock, "CTL frontend mutex", NULL, MTX_DEF); |
247 softc->flags |= CTL_FLAG_MASTER_SHELF; 248 | |
249 STAILQ_INIT(&softc->lun_list); 250 STAILQ_INIT(&softc->metatask_list); 251 sprintf(softc->fe_name, "kernel"); 252 port->frontend = &cfi_frontend; 253 port->port_type = CTL_PORT_INTERNAL; 254 port->num_requested_ctl_io = 100; 255 port->port_name = softc->fe_name; 256 port->port_online = cfi_online; 257 port->port_offline = cfi_offline; 258 port->onoff_arg = softc; 259 port->lun_enable = cfi_lun_enable; 260 port->lun_disable = cfi_lun_disable; 261 port->targ_lun_arg = softc; 262 port->fe_datamove = cfi_datamove; 263 port->fe_done = cfi_done; 264 port->max_targets = 15; 265 port->max_target_id = 15; 266 | 247 STAILQ_INIT(&softc->lun_list); 248 STAILQ_INIT(&softc->metatask_list); 249 sprintf(softc->fe_name, "kernel"); 250 port->frontend = &cfi_frontend; 251 port->port_type = CTL_PORT_INTERNAL; 252 port->num_requested_ctl_io = 100; 253 port->port_name = softc->fe_name; 254 port->port_online = cfi_online; 255 port->port_offline = cfi_offline; 256 port->onoff_arg = softc; 257 port->lun_enable = cfi_lun_enable; 258 port->lun_disable = cfi_lun_disable; 259 port->targ_lun_arg = softc; 260 port->fe_datamove = cfi_datamove; 261 port->fe_done = cfi_done; 262 port->max_targets = 15; 263 port->max_target_id = 15; 264 |
267 if (ctl_port_register(port, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) | 265 if (ctl_port_register(port) != 0) |
268 { 269 printf("%s: internal frontend registration failed\n", __func__); 270 return (0); 271 } 272 273 cfi_lun_zone = uma_zcreate("cfi_lun", sizeof(struct cfi_lun), 274 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); 275 cfi_metatask_zone = uma_zcreate("cfi_metatask", sizeof(struct cfi_metatask), --- 1362 unchanged lines hidden --- | 266 { 267 printf("%s: internal frontend registration failed\n", __func__); 268 return (0); 269 } 270 271 cfi_lun_zone = uma_zcreate("cfi_lun", sizeof(struct cfi_lun), 272 NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); 273 cfi_metatask_zone = uma_zcreate("cfi_metatask", sizeof(struct cfi_metatask), --- 1362 unchanged lines hidden --- |