summaryrefslogtreecommitdiff
path: root/sys-block/mpt-status/files/mpt-status-1.2.0-stdint.patch
blob: 8478be7b3761977e0e536578f13ce6374ce23dd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
Use C99/stdint.h types over non-portable (deprecated) glibc types
Bug: https://bugs.gentoo.org/713400

--- a/linux-sources/drivers/message/fusion/lsi/mpi_type.h
+++ b/linux-sources/drivers/message/fusion/lsi/mpi_type.h
@@ -26,6 +26,7 @@
 #ifndef MPI_TYPE_H
 #define MPI_TYPE_H
 
+#include <stdint.h>
 
 /*******************************************************************************
  * Define MPI_POINTER if it hasn't already been defined. By default MPI_POINTER
@@ -50,7 +51,7 @@
 
 
 typedef int32_t   S32;
-typedef u_int32_t U32;
+typedef uint32_t U32;
 
 typedef struct _S64
 {
--- a/linux-sources/drivers/message/fusion/mptctl.h
+++ b/linux-sources/drivers/message/fusion/mptctl.h
@@ -267,9 +267,9 @@
 
 #ifndef __KERNEL__
 typedef struct {
-	uint	event;
-	uint	eventContext;
-	uint	data[2];
+	unsigned	event;
+	unsigned	eventContext;
+	unsigned	data[2];
 } MPT_IOCTL_EVENTS;
 #endif
 
@@ -390,7 +390,7 @@
 	u16		 subsystem_id;
 	u8		 devfn;
 	u8		 bus;
-	ushort		 host_no;		/* SCSI Host number, if scsi driver not loaded*/
+	unsigned short		 host_no;		/* SCSI Host number, if scsi driver not loaded*/
 	u8		 fw_version[16];	/* string */
 	u8		 serial_number[24];	/* string */
 	u32		 ioc_status;
@@ -413,7 +413,7 @@
 	u16		 subsystem_id;
 	u8		 devfn;
 	u8		 bus;
-	ushort		 host_no;		/* SCSI Host number, if scsi driver not loaded*/
+	unsigned short		 host_no;		/* SCSI Host number, if scsi driver not loaded*/
 	u8		 fw_version[16];	/* string */
 	u8		 serial_number[24];	/* string */
 	u32		 ioc_status;
--- a/mpt-status-1.2.0/incl/pci.h
+++ b/mpt-status-1.2.0/incl/pci.h
@@ -31,31 +31,31 @@
 #ifdef OS_FREEBSD
 #include <sys/types.h>
 
-typedef u_int8_t byte;
-typedef u_int8_t u8;
-typedef u_int16_t word;
-typedef u_int16_t u16;
-typedef u_int32_t u32;
+typedef uint8_t byte;
+typedef uint8_t u8;
+typedef uint16_t word;
+typedef uint16_t u16;
+typedef uint32_t u32;
 #endif
 
 #ifdef OS_NETBSD
 #include <sys/types.h>
 
-typedef u_int8_t byte;
-typedef u_int8_t u8;
-typedef u_int16_t word;
-typedef u_int16_t u16;
-typedef u_int32_t u32;
+typedef uint8_t byte;
+typedef uint8_t u8;
+typedef uint16_t word;
+typedef uint16_t u16;
+typedef uint32_t u32;
 #endif
 
 #ifdef OS_AIX
 #include <sys/param.h>
 
-typedef u_int8_t byte;
-typedef u_int8_t u8;
-typedef u_int16_t word;
-typedef u_int16_t u16;
-typedef u_int32_t u32;
+typedef uint8_t byte;
+typedef uint8_t u8;
+typedef uint16_t word;
+typedef uint16_t u16;
+typedef uint32_t u32;
 #endif
 
 #ifdef HAVE_LONG_ADDRESS
--- a/mpt-status-1.2.0/mpt-status.c
+++ b/mpt-status-1.2.0/mpt-status.c
@@ -117,7 +117,7 @@
 static int mpt_fprintf(FILE *, const char *, ...);
 static void print_usage(const char *);
 static void print_version(void);
-static int read_page2(uint);
+static int read_page2(unsigned);
 //static int hasVolume(void);
 static void GetVolumeInfo(void);
 static void GetPhysDiskInfo(RaidVol0PhysDisk_t *, int);
@@ -193,7 +193,7 @@
 	return 0;
 }
 
-mpiIoctlBlk_t *allocIoctlBlk(uint numBytes) {
+mpiIoctlBlk_t *allocIoctlBlk(unsigned numBytes) {
 	int blksize = sizeof(mpiIoctlBlk_t) + numBytes;
 
 	if (blksize >= BIG) {
@@ -274,7 +274,7 @@
 	Config_t 		*ConfigRequest;
 	ConfigReply_t 		*pReply = NULL;
 	RaidVolumePage0_t 	*pRVP0 = NULL;
-	uint numBytes;
+	unsigned numBytes;
 	int status;
 	int id;
 	int scsi_id;
@@ -330,7 +330,7 @@
 	return -1;
 }
 
-static int read_page2(uint flags) {
+static int read_page2(unsigned flags) {
 	MPIDefaultReply_t *pReply = NULL;
 	int CmdBlkSize;
 	int status = -1;
@@ -361,8 +361,8 @@
 	Config_t *ConfigRequest;
 	ConfigReply_t *pReply = NULL;
 	IOCPage2_t *pIOC2 = NULL;
-	uint numBytes;
-	uint numVolumes = 0;
+	unsigned numBytes;
+	unsigned numVolumes = 0;
 	int status;
 	unsigned bus = id_of_primary_device;
 
@@ -419,7 +419,7 @@
 	RaidVolumePage0_t 	*pRVP0 = NULL;
 	RaidVol0PhysDisk_t	disk_num[16];
 	unsigned char		pdisk_vol[16];
-	uint numBytes;
+	unsigned numBytes;
 	int status;
 	int i, id;
 	int pdisk_cnt = 0;
@@ -515,7 +515,7 @@
 static void GetPhysDiskInfo(RaidVol0PhysDisk_t *pDisk, int count) {
 	Config_t *ConfigRequest;
 	ConfigReply_t *pReply = NULL;
-	uint numBytes;
+	unsigned numBytes;
 	int  status;
 	int  i;
 
@@ -534,7 +534,7 @@
 	ConfigRequest->MsgContext   = -1;
 	ConfigRequest->Header.PageType = MPI_CONFIG_PAGETYPE_RAID_PHYSDISK;
 	ConfigRequest->Header.PageNumber = ioc_unit;
-	ConfigRequest->PageAddress = cpu_to_le32((uint)pDisk[0].PhysDiskNum);
+	ConfigRequest->PageAddress = cpu_to_le32((unsigned)pDisk[0].PhysDiskNum);
 
 	status = read_page2(MPT_FLAGS_KEEP_MEM);
 	if ((status == 0) && (pReply->Header.PageLength > 0)) {
@@ -550,7 +550,7 @@
 	ConfigRequest->Header.PageVersion = pReply->Header.PageVersion;
 	ConfigRequest->Header.PageLength = pReply->Header.PageLength;
 	for (i = 0; i < count; i++){
-		ConfigRequest->PageAddress = cpu_to_le32((uint)pDisk[i].PhysDiskNum);
+		ConfigRequest->PageAddress = cpu_to_le32((unsigned)pDisk[i].PhysDiskNum);
 
 		status = read_page2(MPT_FLAGS_KEEP_MEM);
 		if (status == 0) {
@@ -573,9 +573,9 @@
 	Config_t *ConfigRequest;
 	ConfigReply_t *pReply = NULL;
 	IOCPage5_t *pPg5 = NULL;
-	uint numBytes;
+	unsigned numBytes;
 	int  status;
-	uint num_spares = 0;
+	unsigned num_spares = 0;
 
 	numBytes = (sizeof(Config_t) - sizeof(SGE_IO_UNION)) + sizeof (SGESimple64_t);
 	if ((mpiBlkPtr = allocIoctlBlk(numBytes)) == NULL)
@@ -639,7 +639,7 @@
 			ConfigRequest->Function     = MPI_FUNCTION_CONFIG;
 			ConfigRequest->MsgContext   = -1;
 			ConfigRequest->Header.PageType = MPI_CONFIG_PAGETYPE_RAID_PHYSDISK;
-			ConfigRequest->PageAddress = cpu_to_le32((uint)disk_num[0].PhysDiskNum);
+			ConfigRequest->PageAddress = cpu_to_le32((unsigned)disk_num[0].PhysDiskNum);
 
 			status = read_page2(MPT_FLAGS_KEEP_MEM);
 			if ((status == 0) && (pReply->Header.PageLength > 0)) {
@@ -655,7 +655,7 @@
 			ConfigRequest->Header.PageVersion = pReply->Header.PageVersion;
 			ConfigRequest->Header.PageLength = pReply->Header.PageLength;
 			for (i = 0; i < num_spares; i++){
-				ConfigRequest->PageAddress = cpu_to_le32((uint)disk_num[i].PhysDiskNum);
+				ConfigRequest->PageAddress = cpu_to_le32((unsigned)disk_num[i].PhysDiskNum);
 
 				status = read_page2(MPT_FLAGS_KEEP_MEM);
 				if (status == 0) {
@@ -671,10 +671,10 @@
 
 static void GetResyncPercentageSilent(RaidVol0PhysDisk_t *pDisk, unsigned char *pVol, int count) {
 	MpiRaidActionRequest_t	*pRequest;
-	uint			blks_done;
-	uint 			numBytes;
+	unsigned			blks_done;
+	unsigned 			numBytes;
 	int			i;
-	uint			tot_blks, blks_left;
+	unsigned			tot_blks, blks_left;
 	int  			status;
 
 	numBytes = (sizeof(MpiRaidActionRequest_t) - sizeof(SGE_IO_UNION))
@@ -695,7 +695,7 @@
 		status = read_page2(MPT_FLAGS_KEEP_MEM);
 		if (status == 0) {
 			// pDisk[i].PhysDiskNum == scsi_id
-			uint *pdata = (uint *) mpiBlkPtr->replyFrameBufPtr;
+			unsigned *pdata = (unsigned *) mpiBlkPtr->replyFrameBufPtr;
 			pdata += 6;
 			tot_blks = *pdata;
 			pdata++;
@@ -718,10 +718,10 @@
 
 static void GetResyncPercentage(RaidVol0PhysDisk_t *pDisk, unsigned char *pVol, int count) {
 	MpiRaidActionRequest_t	*pRequest;
-	uint			blks_done;
-	uint 			numBytes;
+	unsigned			blks_done;
+	unsigned 			numBytes;
 	int			i;
-	uint			tot_blks, blks_left;
+	unsigned			tot_blks, blks_left;
 	int  			status;
 
 	numBytes = (sizeof(MpiRaidActionRequest_t) - sizeof(SGE_IO_UNION))
@@ -746,7 +746,7 @@
 		status = read_page2(MPT_FLAGS_KEEP_MEM);
 		if (status == 0) {
 			// pDisk[i].PhysDiskNum == scsi_id
-			uint *pdata = (uint *) mpiBlkPtr->replyFrameBufPtr;
+			unsigned *pdata = (unsigned *) mpiBlkPtr->replyFrameBufPtr;
 			mpt_debug("DEBUG: *pdata=%d\n", *pdata);
 			pdata += 6;
 			tot_blks = *pdata;