From 02941a530ef736210b4cf8b24dd34c238d5d5a40 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Sun, 25 Jan 2009 16:55:30 +0200 Subject: [SCSI] libosd: OSDv1 preliminary implementation Implementation of the most basic OSD functionality and infrastructure. Mainly Format, Create/Remove Partition, Create/Remove Object, and read/write. - Add Makefile and Kbuild to compile libosd.ko - osd_initiator.c Implementation file for osd_initiator.h and osd_sec.h APIs - osd_debug.h - Some kprintf macro definitions Signed-off-by: Boaz Harrosh Reviewed-by: Benny Halevy Signed-off-by: James Bottomley --- drivers/scsi/osd/Kbuild | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 drivers/scsi/osd/Kbuild (limited to 'drivers/scsi/osd/Kbuild') diff --git a/drivers/scsi/osd/Kbuild b/drivers/scsi/osd/Kbuild new file mode 100644 index 00000000000..a95e0251005 --- /dev/null +++ b/drivers/scsi/osd/Kbuild @@ -0,0 +1,32 @@ +# +# Kbuild for the OSD modules +# +# Copyright (C) 2008 Panasas Inc. All rights reserved. +# +# Authors: +# Boaz Harrosh +# Benny Halevy +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# + +ifneq ($(OSD_INC),) +# we are built out-of-tree Kconfigure everything as on + +CONFIG_SCSI_OSD_INITIATOR=m +ccflags-y += -DCONFIG_SCSI_OSD_INITIATOR -DCONFIG_SCSI_OSD_INITIATOR_MODULE + +# Uncomment to turn debug on +# ccflags-y += -DCONFIG_SCSI_OSD_DEBUG + +# if we are built out-of-tree and the hosting kernel has OSD headers +# then "ccflags-y +=" will not pick the out-off-tree headers. Only by doing +# this it will work. This might break in future kernels +LINUXINCLUDE := -I$(OSD_INC) $(LINUXINCLUDE) + +endif + +# libosd.ko - osd-initiator library +libosd-y := osd_initiator.o +obj-$(CONFIG_SCSI_OSD_INITIATOR) += libosd.o -- cgit v1.2.3 From 95b05a7db5865855c32e0bb8b244c3a7aac1cfeb Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Sun, 25 Jan 2009 16:56:47 +0200 Subject: [SCSI] osd_uld: OSD scsi ULD Add a Linux driver module that registers as a SCSI ULD and probes for OSD type SCSI devices. When an OSD-type SCSI device is found a character device is created in the form of /dev/osdX - where X goes from 0 up to hard coded 64. The Major character device number used is 260. Signed-off-by: Boaz Harrosh Reviewed-by: Benny Halevy Signed-off-by: James Bottomley --- drivers/scsi/osd/Kbuild | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/scsi/osd/Kbuild') diff --git a/drivers/scsi/osd/Kbuild b/drivers/scsi/osd/Kbuild index a95e0251005..9d38248afcb 100644 --- a/drivers/scsi/osd/Kbuild +++ b/drivers/scsi/osd/Kbuild @@ -17,6 +17,9 @@ ifneq ($(OSD_INC),) CONFIG_SCSI_OSD_INITIATOR=m ccflags-y += -DCONFIG_SCSI_OSD_INITIATOR -DCONFIG_SCSI_OSD_INITIATOR_MODULE +CONFIG_SCSI_OSD_ULD=m +ccflags-y += -DCONFIG_SCSI_OSD_ULD -DCONFIG_SCSI_OSD_ULD_MODULE + # Uncomment to turn debug on # ccflags-y += -DCONFIG_SCSI_OSD_DEBUG @@ -30,3 +33,7 @@ endif # libosd.ko - osd-initiator library libosd-y := osd_initiator.o obj-$(CONFIG_SCSI_OSD_INITIATOR) += libosd.o + +# osd.ko - SCSI ULD and char-device +osd-y := osd_uld.o +obj-$(CONFIG_SCSI_OSD_ULD) += osd.o -- cgit v1.2.3 From 98f3aea2bd4b4f9cd7a6a6479ed9410787f756fd Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Sun, 25 Jan 2009 17:15:16 +0200 Subject: [SCSI] libosd: SCSI/OSD Sense decoding support Implementation of the osd_req_decode_sense() API. Can be called by library users to decode what failed in command executions. Add SCSI_OSD_DPRINT_SENSE Kconfig variable. Possible values are: 0 - Do not print any errors to messages file 1 - (Default) Print only decoded errors that are not recoverable. Recoverable errors are those that the target has complied with the request but with a warning. For example read passed end of object will return zeros after the last valid byte. 2- Print all errors. Signed-off-by: Boaz Harrosh Signed-off-by: James Bottomley --- drivers/scsi/osd/Kbuild | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/scsi/osd/Kbuild') diff --git a/drivers/scsi/osd/Kbuild b/drivers/scsi/osd/Kbuild index 9d38248afcb..0e207aa67d1 100644 --- a/drivers/scsi/osd/Kbuild +++ b/drivers/scsi/osd/Kbuild @@ -20,6 +20,12 @@ ccflags-y += -DCONFIG_SCSI_OSD_INITIATOR -DCONFIG_SCSI_OSD_INITIATOR_MODULE CONFIG_SCSI_OSD_ULD=m ccflags-y += -DCONFIG_SCSI_OSD_ULD -DCONFIG_SCSI_OSD_ULD_MODULE +# CONFIG_SCSI_OSD_DPRINT_SENSE = +# 0 - no print of errors +# 1 - print errors +# 2 - errors + warrnings +ccflags-y += -DCONFIG_SCSI_OSD_DPRINT_SENSE=1 + # Uncomment to turn debug on # ccflags-y += -DCONFIG_SCSI_OSD_DEBUG -- cgit v1.2.3