FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 01-23-2012, 05:43 PM
"Moger, Babu"
 
Default scsi : Correctly setting the scsi host/msg/status bytes

This patch changes the function to*
set_msg_byte, set_host_byte and
set_driver_byte to correctly

set the corresponding bytes appropriately.


*

It will reset the original setting and correctly set it to the new value.
*The previous OR operation does

not always
*set it back to new value. Look at patch 2/2 for an example.

*

Signed-off-by: Babu Moger <babu.moger@netapp.com>

---

--- linux-3.3-rc1-new/include/scsi/scsi_cmnd.h.orig**
2012-01-23 11:30:46.000000000 -0600

+++ linux-3.3-rc1-new/include/scsi/scsi_cmnd.h*
2012-01-23 11:38:30.000000000 -0600

@@ -289,17 +289,17 @@ static inline struct
scsi_data_buffer *s

*

*static inline void set_msg_byte(struct
scsi_cmnd *cmd, char status)

*{

-**** cmd->result |= status << 8;

+**** cmd->result = (cmd->result & 0xffff00ff) | (status << 8);

*}

*

*static inline void set_host_byte(struct
scsi_cmnd *cmd, char status)

*{

-**** cmd->result |= status << 16;

+**** cmd->result = (cmd->result & 0xff00ffff) | (status << 16);

*}

*

*static inline void set_driver_byte(struct
scsi_cmnd *cmd, char status)

*{

-**** cmd->result |= status << 24;

+**** cmd->result = (cmd->result & 0x00ffffff) | (status << 24);

*}

*

*#endif /* _SCSI_SCSI_CMND_H */

*

*




--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 01-24-2012, 07:38 PM
"Moger, Babu"
 
Default scsi : Correctly setting the scsi host/msg/status bytes

Resubmitting as my previous post had format issues and did not go llinux-scsi.
This patch changes the function to set_msg_byte, set_host_byte and set_driver_byte to correctly
set the corresponding bytes appropriately.

It will reset the original setting and correctly set it to the new value. The previous OR operation does
not always set it back to new value. Look at patch 2/2 for an example.

Signed-off-by: Babu Moger <babu.moger@netapp.com>
---
--- linux-3.3-rc1-new/include/scsi/scsi_cmnd.h.orig 2012-01-23 11:30:46.000000000 -0600
+++ linux-3.3-rc1-new/include/scsi/scsi_cmnd.h 2012-01-23 11:38:30.000000000 -0600
@@ -289,17 +289,17 @@ static inline struct scsi_data_buffer *s

static inline void set_msg_byte(struct scsi_cmnd *cmd, char status)
{
- cmd->result |= status << 8;
+ cmd->result = (cmd->result & 0xffff00ff) | (status << 8);
}

static inline void set_host_byte(struct scsi_cmnd *cmd, char status)
{
- cmd->result |= status << 16;
+ cmd->result = (cmd->result & 0xff00ffff) | (status << 16);
}

static inline void set_driver_byte(struct scsi_cmnd *cmd, char status)
{
- cmd->result |= status << 24;
+ cmd->result = (cmd->result & 0x00ffffff) | (status << 24);
}

#endif /* _SCSI_SCSI_CMND_H */



--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 02:11 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org