19 #include "ocs_ini_template.h"
22 static const char ocs_copyright[] =
"Copyright © 2013 Emulex. All rights reserved";
55 printk(KERN_INFO
"No valid devices found, %s not loaded\n",
DRV_NAME);
59 printk(KERN_INFO
"%s loaded\n",
DRV_NAME);
83 printk(KERN_INFO
"%s unloaded\n",
DRV_NAME);
91 return ocs->display_name;
98 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
101 if (in_interrupt()) {
108 return task_pid_vnr(current);
130 void _ocs_log(
void *os,
const char *func_name,
int line,
int level,
const char *
fmt, ...)
141 do_gettimeofday(&tv);
143 p += snprintf(p,
sizeof(buf) - (p - buf),
"%10ld.%06ld: ", tv.tv_sec, tv.tv_usec);
146 p += snprintf(p,
sizeof(buf) - (p - buf),
"[%d]: ",
get_current_tid());
148 p += snprintf(p,
sizeof(buf) - (p - buf),
"%s: ",
DRV_NAME);
149 p += snprintf(p,
sizeof(buf) - (p - buf),
"%s:", func_name);
150 p += snprintf(p,
sizeof(buf) - (p - buf),
"%i:", line);
151 p += snprintf(p,
sizeof(buf) - (p - buf),
"%s:", (os != NULL) ?
ocs_display_name(os) :
"");
152 p += vsnprintf(p,
sizeof(buf) - (p - buf), fmt, ap);
168 const char *fn = strrchr(__FILE__,
'/');
170 ocs_log_err(NULL,
"%s(%d) assertion (%s) failed\n", (fn ? fn + 1 : filename), linenum, cond);
#define OCS_DDUMP_FLAGS_WQES
const char * ocs_display_name(void *os)
ocs_t * ocs_get_instance(uint32_t index)
Returns a pointer to the ocs structure given the instance index.
ocs_scsi_ini_template_t ocs_iscsi_ini_template
int32_t ocs_scsi_ini_driver_init(int32_t initiator)
Initialize initiator client.
static const char ocs_copyright[]
int32_t ocs_ramlog_printf(void *os, const char *fmt,...)
Append formatted printf data to a ramlog buffer.
MODULE_VERSION(DRV_VERSION)
void _ocs_assert(const char *cond, const char *filename, int linenum)
void _ocs_log(void *os, const char *func_name, int line, int level, const char *fmt,...)
void ocs_print_stack(void)
static int get_current_tid(void)
static void __exit ocs_exit(void)
driver unload entry point
int32_t ocs_scsi_ini_del_device(ocs_t *ocs)
Tears down initiator members of ocs structure.
int32_t ocs_save_ddump_all(uint32_t flags, uint32_t qentries, uint32_t alloc_flag)
Capture and save ddump for all OCS instances.
const char const char va_list ap
static const char * log_level_to_klog_level(int level)
int32_t ocs_scsi_ini_driver_exit(int32_t initiator)
initiator client exit
static int __init ocs_init(void)
driver load entry point
int32_t ocs_scsi_ini_new_device(ocs_t *ocs)
Initializes any initiator fields on the ocs structure.
#define ocs_assert(cond,...)
const char const char * fmt
#define OCS_DDUMP_FLAGS_CQES
#define OCS_DDUMP_FLAGS_MQES