* [PATCHv2 1/4] scsi: consistent use of __u8 in scsi/scsi.h
[not found] <cover.1254220284.git.mst@redhat.com>
@ 2009-09-29 10:34 ` Michael S. Tsirkin
2009-09-29 10:34 ` [PATCHv2 2/4] scsi: make scsi/scsi.h headers_check clean Michael S. Tsirkin
` (2 subsequent siblings)
3 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2009-09-29 10:34 UTC (permalink / raw)
To: James Bottomley, linux-scsi, linux-kernel, Boaz Harrosh,
Sam Ravnborg
scsi/scsi.h is exported to userspace, so it should
use __u8 instead of u8 as other userspace-visible headers do.
This fixes the following errors when application includes scsi/scsi.h
generated with make headers_install:
include/scsi/scsi.h:145: error: expected specifier-qualifier-list before ‘u8’
include/scsi/scsi.h: In function ‘scsi_varlen_cdb_length’:
include/scsi/scsi.h:156: error: ‘struct scsi_varlen_cdb_hdr’ has no member named ‘additional_cdb_length’
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/scsi/scsi.h | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 084478e..dfcfaab 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -142,10 +142,10 @@ struct scsi_cmnd;
/* defined in T10 SCSI Primary Commands-2 (SPC2) */
struct scsi_varlen_cdb_hdr {
- u8 opcode; /* opcode always == VARIABLE_LENGTH_CMD */
- u8 control;
- u8 misc[5];
- u8 additional_cdb_length; /* total cdb length - 8 */
+ __u8 opcode; /* opcode always == VARIABLE_LENGTH_CMD */
+ __u8 control;
+ __u8 misc[5];
+ __u8 additional_cdb_length; /* total cdb length - 8 */
__be16 service_action;
/* service specific data follows */
};
--
1.6.5.rc2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCHv2 2/4] scsi: make scsi/scsi.h headers_check clean
[not found] <cover.1254220284.git.mst@redhat.com>
2009-09-29 10:34 ` [PATCHv2 1/4] scsi: consistent use of __u8 in scsi/scsi.h Michael S. Tsirkin
@ 2009-09-29 10:34 ` Michael S. Tsirkin
2009-09-29 10:34 ` [PATCHv2 3/4] scsi: export scsi_ioctl.h and sg.h headers Michael S. Tsirkin
2009-09-29 10:34 ` [PATCHv2 4/4] scsi: export scsi_tgt_if.h Michael S. Tsirkin
3 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2009-09-29 10:34 UTC (permalink / raw)
To: James Bottomley, linux-scsi, linux-kernel, Boaz Harrosh,
Sam Ravnborg
place extern declarations in scsi/scsi.h within ifdef __KERNEL__
so that make headers_install strips them out.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/scsi/scsi.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index dfcfaab..418465a 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -150,6 +150,7 @@ struct scsi_varlen_cdb_hdr {
/* service specific data follows */
};
+#ifdef __KERNEL__
static inline unsigned
scsi_varlen_cdb_length(const void *hdr)
{
@@ -165,6 +166,7 @@ scsi_command_size(const unsigned char *cmnd)
return (cmnd[0] == VARIABLE_LENGTH_CMD) ?
scsi_varlen_cdb_length(cmnd) : COMMAND_SIZE(cmnd[0]);
}
+#endif
/*
* SCSI Architecture Model (SAM) Status codes. Taken from SAM-3 draft
@@ -281,8 +283,10 @@ enum scsi_protocol {
SCSI_PROTOCOL_UNSPEC = 0xf, /* No specific protocol */
};
+#ifdef __KERNEL__
/* Returns a human-readable name for the device */
extern const char * scsi_device_type(unsigned type);
+#endif
/*
* standard mode-select header prepended to all mode-select commands
--
1.6.5.rc2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCHv2 3/4] scsi: export scsi_ioctl.h and sg.h headers
[not found] <cover.1254220284.git.mst@redhat.com>
2009-09-29 10:34 ` [PATCHv2 1/4] scsi: consistent use of __u8 in scsi/scsi.h Michael S. Tsirkin
2009-09-29 10:34 ` [PATCHv2 2/4] scsi: make scsi/scsi.h headers_check clean Michael S. Tsirkin
@ 2009-09-29 10:34 ` Michael S. Tsirkin
2009-09-29 10:34 ` [PATCHv2 4/4] scsi: export scsi_tgt_if.h Michael S. Tsirkin
3 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2009-09-29 10:34 UTC (permalink / raw)
To: James Bottomley, linux-scsi, linux-kernel, Boaz Harrosh,
Sam Ravnborg
glibc uses scsi/sg.h and scsi/scsi_ioctl.h, so we need to
export these headers.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/scsi/Kbuild | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild
index 33b2750..a61932c 100644
--- a/include/scsi/Kbuild
+++ b/include/scsi/Kbuild
@@ -1,3 +1,5 @@
+header-y += sg.h
+header-y += scsi_ioctl.h
header-y += scsi.h
header-y += scsi_netlink.h
header-y += scsi_netlink_fc.h
--
1.6.5.rc2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCHv2 4/4] scsi: export scsi_tgt_if.h
[not found] <cover.1254220284.git.mst@redhat.com>
` (2 preceding siblings ...)
2009-09-29 10:34 ` [PATCHv2 3/4] scsi: export scsi_ioctl.h and sg.h headers Michael S. Tsirkin
@ 2009-09-29 10:34 ` Michael S. Tsirkin
3 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2009-09-29 10:34 UTC (permalink / raw)
To: James Bottomley, linux-scsi, linux-kernel, Boaz Harrosh,
Sam Ravnborg
The header scsi_tgt_if.h is used by the SCSI target
framework (tgt) (http://stgt.berlios.de/).
Export it from kernel.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/scsi/Kbuild | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild
index a61932c..d798db8 100644
--- a/include/scsi/Kbuild
+++ b/include/scsi/Kbuild
@@ -4,3 +4,4 @@ header-y += scsi.h
header-y += scsi_netlink.h
header-y += scsi_netlink_fc.h
header-y += scsi_bsg_fc.h
+header-y += scsi_tgt_if.h
--
1.6.5.rc2
^ permalink raw reply related [flat|nested] 4+ messages in thread