aboutsummaryrefslogtreecommitdiff
path: root/src/sg_rdac.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2015-12-10 18:29:41 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2015-12-10 18:29:41 +0000
commite359da1369caf436878cd05386b83b54359ecce1 (patch)
tree9120d5671d4cc911a7eba7e4dadbefc6fe389a6d /src/sg_rdac.c
parent7f926639212e5ce0069c65b8827455f7a265cf33 (diff)
downloadsg3_utils-e359da1369caf436878cd05386b83b54359ecce1.tar.gz
unaligned cleanups for C++; misc work
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@653 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_rdac.c')
-rw-r--r--src/sg_rdac.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/sg_rdac.c b/src/sg_rdac.c
index 71fe8714..fce39b94 100644
--- a/src/sg_rdac.c
+++ b/src/sg_rdac.c
@@ -23,9 +23,10 @@
#endif
#include "sg_lib.h"
#include "sg_cmds_basic.h"
+#include "sg_unaligned.h"
-static const char * version_str = "1.08 20150407";
+static const char * version_str = "1.09 20151207";
unsigned char mode6_hdr[] = {
0x75, /* Length */
@@ -134,10 +135,8 @@ static int fail_all_paths(int fd, int use_6_byte)
(fail_paths_pg + 8);
rdac_page_exp->page_code = RDAC_CONTROLLER_PAGE | 0x40;
rdac_page_exp->subpage_code = 0x1;
- rdac_page_exp->page_length[0] =
- EXPANDED_LUN_SPACE_PAGE_LEN >> 8;
- rdac_page_exp->page_length[1] =
- EXPANDED_LUN_SPACE_PAGE_LEN & 0xFF;
+ sg_put_unaligned_be16(EXPANDED_LUN_SPACE_PAGE_LEN,
+ rdac_page_exp->page_length + 0);
rdac_common = &rdac_page_exp->attr;
}
@@ -199,10 +198,8 @@ static int fail_this_path(int fd, int lun, int use_6_byte)
(fail_paths_pg + 8);
rdac_page_exp->page_code = RDAC_CONTROLLER_PAGE | 0x40;
rdac_page_exp->subpage_code = 0x1;
- rdac_page_exp->page_length[0] =
- EXPANDED_LUN_SPACE_PAGE_LEN >> 8;
- rdac_page_exp->page_length[1] =
- EXPANDED_LUN_SPACE_PAGE_LEN & 0xFF;
+ sg_put_unaligned_be16(EXPANDED_LUN_SPACE_PAGE_LEN,
+ rdac_page_exp->page_length + 0);
rdac_common = &rdac_page_exp->attr;
memset(rdac_page_exp->lun_table, 0x0, 256);
rdac_page_exp->lun_table[lun] = 0x81;