Print this page
NEX-3508 CLONE - Port NEX-2946 Add UNMAP/TRIM functionality to ZFS and illumos
Reviewed by: Josef Sipek <josef.sipek@nexenta.com>
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Conflicts:
usr/src/uts/common/io/scsi/targets/sd.c
usr/src/uts/common/sys/scsi/targets/sddef.h
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/dkio.h
+++ new/usr/src/uts/common/sys/dkio.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 1982, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 *
25 - * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
25 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
26 26 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
27 27 */
28 28
29 29 #ifndef _SYS_DKIO_H
30 30 #define _SYS_DKIO_H
31 31
32 32 #include <sys/dklabel.h> /* Needed for NDKMAP define */
33 +#include <sys/int_limits.h> /* Needed for UINT16_MAX */
33 34
34 35 #ifdef __cplusplus
35 36 extern "C" {
36 37 #endif
37 38
38 39 /*
39 40 * Structures and definitions for disk io control commands
40 41 */
41 42
42 43 /*
43 44 * Structures used as data by ioctl calls.
44 45 */
45 46
46 47 #define DK_DEVLEN 16 /* device name max length, including */
47 48 /* unit # & NULL (ie - "xyc1") */
48 49
49 50 /*
50 51 * Used for controller info
51 52 */
52 53 struct dk_cinfo {
53 54 char dki_cname[DK_DEVLEN]; /* controller name (no unit #) */
54 55 ushort_t dki_ctype; /* controller type */
55 56 ushort_t dki_flags; /* flags */
56 57 ushort_t dki_cnum; /* controller number */
57 58 uint_t dki_addr; /* controller address */
58 59 uint_t dki_space; /* controller bus type */
59 60 uint_t dki_prio; /* interrupt priority */
60 61 uint_t dki_vec; /* interrupt vector */
61 62 char dki_dname[DK_DEVLEN]; /* drive name (no unit #) */
62 63 uint_t dki_unit; /* unit number */
63 64 uint_t dki_slave; /* slave number */
64 65 ushort_t dki_partition; /* partition number */
65 66 ushort_t dki_maxtransfer; /* max. transfer size in DEV_BSIZE */
66 67 };
67 68
68 69 /*
69 70 * Controller types
70 71 */
71 72 #define DKC_UNKNOWN 0
72 73 #define DKC_CDROM 1 /* CD-ROM, SCSI or otherwise */
73 74 #define DKC_WDC2880 2
74 75 #define DKC_XXX_0 3 /* unassigned */
75 76 #define DKC_XXX_1 4 /* unassigned */
76 77 #define DKC_DSD5215 5
77 78 #define DKC_ACB4000 7
78 79 #define DKC_MD21 8
79 80 #define DKC_XXX_2 9 /* unassigned */
80 81 #define DKC_NCRFLOPPY 10
81 82 #define DKC_SMSFLOPPY 12
82 83 #define DKC_SCSI_CCS 13 /* SCSI CCS compatible */
83 84 #define DKC_INTEL82072 14 /* native floppy chip */
84 85 #define DKC_MD 16 /* meta-disk (virtual-disk) driver (obsolete) */
85 86 #define DKC_INTEL82077 19 /* 82077 floppy disk controller */
86 87 #define DKC_DIRECT 20 /* Intel direct attached device i.e. IDE */
87 88 #define DKC_PCMCIA_MEM 21 /* PCMCIA memory disk-like type (Obsolete) */
88 89 #define DKC_PCMCIA_ATA 22 /* PCMCIA AT Attached type */
89 90 #define DKC_VBD 23 /* virtual block device */
90 91 #define DKC_BLKDEV 24 /* generic block device (see blkdev(7d)) */
91 92
92 93 /*
93 94 * Sun reserves up through 1023
94 95 */
95 96
96 97 #define DKC_CUSTOMER_BASE 1024
97 98
98 99 /*
99 100 * Flags
100 101 */
101 102 #define DKI_BAD144 0x01 /* use DEC std 144 bad sector fwding */
102 103 #define DKI_MAPTRK 0x02 /* controller does track mapping */
103 104 #define DKI_FMTTRK 0x04 /* formats only full track at a time */
104 105 #define DKI_FMTVOL 0x08 /* formats only full volume at a time */
105 106 #define DKI_FMTCYL 0x10 /* formats only full cylinders at a time */
106 107 #define DKI_HEXUNIT 0x20 /* unit number is printed as 3 hex digits */
107 108 #define DKI_PCMCIA_PFD 0x40 /* PCMCIA pseudo-floppy memory card */
108 109
109 110 /*
110 111 * Used for all partitions
111 112 */
112 113 struct dk_allmap {
113 114 struct dk_map dka_map[NDKMAP];
114 115 };
115 116
116 117 #if defined(_SYSCALL32)
117 118 struct dk_allmap32 {
118 119 struct dk_map32 dka_map[NDKMAP];
119 120 };
120 121 #endif /* _SYSCALL32 */
121 122
122 123 /*
123 124 * Definition of a disk's geometry
124 125 */
125 126 struct dk_geom {
126 127 unsigned short dkg_ncyl; /* # of data cylinders */
127 128 unsigned short dkg_acyl; /* # of alternate cylinders */
128 129 unsigned short dkg_bcyl; /* cyl offset (for fixed head area) */
129 130 unsigned short dkg_nhead; /* # of heads */
130 131 unsigned short dkg_obs1; /* obsolete */
131 132 unsigned short dkg_nsect; /* # of data sectors per track */
132 133 unsigned short dkg_intrlv; /* interleave factor */
133 134 unsigned short dkg_obs2; /* obsolete */
134 135 unsigned short dkg_obs3; /* obsolete */
135 136 unsigned short dkg_apc; /* alternates per cyl (SCSI only) */
136 137 unsigned short dkg_rpm; /* revolutions per minute */
137 138 unsigned short dkg_pcyl; /* # of physical cylinders */
138 139 unsigned short dkg_write_reinstruct; /* # sectors to skip, writes */
139 140 unsigned short dkg_read_reinstruct; /* # sectors to skip, reads */
140 141 unsigned short dkg_extra[7]; /* for compatible expansion */
141 142 };
142 143
143 144 /*
144 145 * These defines are for historic compatibility with old drivers.
145 146 */
146 147 #define dkg_bhead dkg_obs1 /* used to be head offset */
147 148 #define dkg_gap1 dkg_obs2 /* used to be gap1 */
148 149 #define dkg_gap2 dkg_obs3 /* used to be gap2 */
149 150
150 151 /*
151 152 * Disk io control commands
152 153 * Warning: some other ioctls with the DIOC prefix exist elsewhere.
153 154 * The Generic DKIOC numbers are from 0 - 50.
154 155 * The Floppy Driver uses 51 - 100.
155 156 * The Hard Disk (except SCSI) 101 - 106. (these are obsolete)
156 157 * The CDROM Driver 151 - 200.
157 158 * The USCSI ioctl 201 - 250.
158 159 */
159 160 #define DKIOC (0x04 << 8)
160 161
161 162 /*
162 163 * The following ioctls are generic in nature and need to be
163 164 * suported as appropriate by all disk drivers
164 165 */
165 166 #define DKIOCGGEOM (DKIOC|1) /* Get geometry */
166 167 #define DKIOCINFO (DKIOC|3) /* Get info */
167 168 #define DKIOCEJECT (DKIOC|6) /* Generic 'eject' */
168 169 #define DKIOCGVTOC (DKIOC|11) /* Get VTOC */
169 170 #define DKIOCSVTOC (DKIOC|12) /* Set VTOC & Write to Disk */
170 171
171 172 #define DKIOCGEXTVTOC (DKIOC|23) /* Get extended VTOC */
172 173 #define DKIOCSEXTVTOC (DKIOC|24) /* Set extended VTOC, Write to Disk */
173 174
174 175 /*
175 176 * Disk Cache Controls. These ioctls should be supported by
176 177 * all disk drivers.
177 178 *
178 179 * DKIOCFLUSHWRITECACHE when used from user-mode ignores the ioctl
179 180 * argument, but it should be passed as NULL to allow for future
180 181 * reinterpretation. From user-mode, this ioctl request is synchronous.
181 182 *
182 183 * When invoked from within the kernel, the arg can be NULL to indicate
183 184 * a synchronous request or can be the address of a struct dk_callback
184 185 * to request an asynchronous callback when the flush request is complete.
185 186 * In this case, the flag to the ioctl must include FKIOCTL and the
186 187 * dkc_callback field of the pointed to struct must be non-null or the
187 188 * request is made synchronously.
188 189 *
189 190 * In the callback case: if the ioctl returns 0, a callback WILL be performed.
190 191 * If the ioctl returns non-zero, a callback will NOT be performed.
191 192 * NOTE: In some cases, the callback may be done BEFORE the ioctl call
192 193 * returns. The caller's locking strategy should be prepared for this case.
193 194 */
194 195 #define DKIOCFLUSHWRITECACHE (DKIOC|34) /* flush cache to phys medium */
195 196
196 197 struct dk_callback {
197 198 void (*dkc_callback)(void *dkc_cookie, int error);
198 199 void *dkc_cookie;
199 200 int dkc_flag;
200 201 };
201 202
202 203 /* bit flag definitions for dkc_flag */
203 204 #define FLUSH_VOLATILE 0x1 /* Bit 0: if set, only flush */
204 205 /* volatile cache; otherwise, flush */
205 206 /* volatile and non-volatile cache */
206 207
207 208 #define DKIOCGETWCE (DKIOC|36) /* Get current write cache */
208 209 /* enablement status */
209 210 #define DKIOCSETWCE (DKIOC|37) /* Enable/Disable write cache */
210 211
211 212 /*
212 213 * The following ioctls are used by Sun drivers to communicate
213 214 * with their associated format routines. Support of these ioctls
214 215 * is not required of foreign drivers
215 216 */
216 217 #define DKIOCSGEOM (DKIOC|2) /* Set geometry */
217 218 #define DKIOCSAPART (DKIOC|4) /* Set all partitions */
218 219 #define DKIOCGAPART (DKIOC|5) /* Get all partitions */
219 220 #define DKIOCG_PHYGEOM (DKIOC|32) /* get physical geometry */
220 221 #define DKIOCG_VIRTGEOM (DKIOC|33) /* get virtual geometry */
221 222
222 223 /*
223 224 * The following ioctl's are removable media support
224 225 */
225 226 #define DKIOCLOCK (DKIOC|7) /* Generic 'lock' */
226 227 #define DKIOCUNLOCK (DKIOC|8) /* Generic 'unlock' */
227 228 #define DKIOCSTATE (DKIOC|13) /* Inquire insert/eject state */
228 229 #define DKIOCREMOVABLE (DKIOC|16) /* is media removable */
229 230
230 231
231 232 /*
232 233 * ioctl for hotpluggable devices
233 234 */
234 235 #define DKIOCHOTPLUGGABLE (DKIOC|35) /* is hotpluggable */
235 236
236 237 #if defined(__i386) || defined(__amd64)
237 238 /* ioctl to write extended partition structure into the disk */
238 239 #define DKIOCSETEXTPART (DKIOC|46)
239 240 #endif
240 241
241 242 /* ioctl to report whether the disk is solid state or not - used for ZFS */
242 243 #define DKIOCSOLIDSTATE (DKIOC|38)
243 244
244 245 /*
245 246 * Ioctl to force driver to re-read the alternate partition and rebuild
246 247 * the internal defect map.
247 248 */
248 249 #define DKIOCADDBAD (DKIOC|20) /* Re-read the alternate map (IDE) */
249 250 #define DKIOCGETDEF (DKIOC|21) /* read defect list (IDE) */
250 251
251 252 /*
252 253 * Used by applications to get disk defect information from IDE
253 254 * drives.
254 255 */
255 256 #ifdef _SYSCALL32
256 257 struct defect_header32 {
257 258 int head;
258 259 caddr32_t buffer;
259 260 };
260 261 #endif /* _SYSCALL32 */
261 262
262 263 struct defect_header {
263 264 int head;
264 265 caddr_t buffer;
265 266 };
266 267
267 268 #define DKIOCPARTINFO (DKIOC|22) /* Get partition or slice parameters */
268 269 #define DKIOCEXTPARTINFO (DKIOC|19) /* Get extended partition or slice */
269 270 /* parameters */
270 271
271 272
272 273 /*
273 274 * Used by applications to get partition or slice information
274 275 */
275 276 #ifdef _SYSCALL32
276 277 struct part_info32 {
277 278 daddr32_t p_start;
278 279 int p_length;
279 280 };
280 281 #endif /* _SYSCALL32 */
281 282
282 283 struct part_info {
283 284 daddr_t p_start;
284 285 int p_length;
285 286 };
286 287
287 288 struct extpart_info {
288 289 diskaddr_t p_start;
289 290 diskaddr_t p_length;
290 291 };
291 292
292 293 /* The following ioctls are for Optical Memory Device */
293 294 #define DKIOC_EBP_ENABLE (DKIOC|40) /* enable by pass erase on write */
294 295 #define DKIOC_EBP_DISABLE (DKIOC|41) /* disable by pass erase on write */
295 296
296 297 /*
297 298 * This state enum is the argument passed to the DKIOCSTATE ioctl.
298 299 */
299 300 enum dkio_state { DKIO_NONE, DKIO_EJECTED, DKIO_INSERTED, DKIO_DEV_GONE };
300 301
301 302 #define DKIOCGMEDIAINFO (DKIOC|42) /* get information about the media */
302 303
303 304 /*
304 305 * ioctls to read/write mboot info.
305 306 */
306 307 #define DKIOCGMBOOT (DKIOC|43) /* get mboot info */
307 308 #define DKIOCSMBOOT (DKIOC|44) /* set mboot info */
308 309
309 310 /*
310 311 * ioctl to get the device temperature.
311 312 */
312 313 #define DKIOCGTEMPERATURE (DKIOC|45) /* get temperature */
313 314
314 315 /*
315 316 * ioctl to get the media info including physical block size
316 317 */
317 318 #define DKIOCGMEDIAINFOEXT (DKIOC|48)
318 319
319 320 /*
320 321 * ioctl to determine whether media is write-protected
321 322 */
322 323 #define DKIOCREADONLY (DKIOC|49)
323 324
324 325 /*
325 326 * Used for providing the temperature.
326 327 */
327 328
328 329 struct dk_temperature {
329 330 uint_t dkt_flags; /* Flags */
330 331 short dkt_cur_temp; /* Current disk temperature */
331 332 short dkt_ref_temp; /* reference disk temperature */
332 333 };
333 334
334 335 #define DKT_BYPASS_PM 0x1
335 336 #define DKT_INVALID_TEMP 0xFFFF
336 337
337 338
338 339 /*
339 340 * Used for Media info or the current profile info
340 341 */
341 342 struct dk_minfo {
342 343 uint_t dki_media_type; /* Media type or profile info */
343 344 uint_t dki_lbsize; /* Logical blocksize of media */
344 345 diskaddr_t dki_capacity; /* Capacity as # of dki_lbsize blks */
345 346 };
346 347
347 348 /*
348 349 * Used for Media info or the current profile info
349 350 * including physical block size if supported.
350 351 */
351 352 struct dk_minfo_ext {
352 353 uint_t dki_media_type; /* Media type or profile info */
353 354 uint_t dki_lbsize; /* Logical blocksize of media */
354 355 diskaddr_t dki_capacity; /* Capacity as # of dki_lbsize blks */
355 356 uint_t dki_pbsize; /* Physical blocksize of media */
356 357 };
357 358
358 359 /*
359 360 * Media types or profiles known
360 361 */
361 362 #define DK_UNKNOWN 0x00 /* Media inserted - type unknown */
362 363
363 364
364 365 /*
365 366 * SFF 8090 Specification Version 3, media types 0x01 - 0xfffe are retained to
366 367 * maintain compatibility with SFF8090. The following define the
367 368 * optical media type.
368 369 */
369 370 #define DK_REMOVABLE_DISK 0x02 /* Removable Disk */
370 371 #define DK_MO_ERASABLE 0x03 /* MO Erasable */
371 372 #define DK_MO_WRITEONCE 0x04 /* MO Write once */
372 373 #define DK_AS_MO 0x05 /* AS MO */
373 374 #define DK_CDROM 0x08 /* CDROM */
374 375 #define DK_CDR 0x09 /* CD-R */
375 376 #define DK_CDRW 0x0A /* CD-RW */
376 377 #define DK_DVDROM 0x10 /* DVD-ROM */
377 378 #define DK_DVDR 0x11 /* DVD-R */
378 379 #define DK_DVDRAM 0x12 /* DVD_RAM or DVD-RW */
379 380
380 381 /*
381 382 * Media types for other rewritable magnetic media
382 383 */
383 384 #define DK_FIXED_DISK 0x10001 /* Fixed disk SCSI or otherwise */
384 385 #define DK_FLOPPY 0x10002 /* Floppy media */
385 386 #define DK_ZIP 0x10003 /* IOMEGA ZIP media */
386 387 #define DK_JAZ 0x10004 /* IOMEGA JAZ media */
387 388
388 389 #define DKIOCSETEFI (DKIOC|17) /* Set EFI info */
389 390 #define DKIOCGETEFI (DKIOC|18) /* Get EFI info */
390 391
391 392 #define DKIOCPARTITION (DKIOC|9) /* Get partition info */
392 393
393 394 /*
394 395 * Ioctls to get/set volume capabilities related to Logical Volume Managers.
395 396 * They include the ability to get/set capabilities and to issue a read to a
396 397 * specific underlying device of a replicated device.
397 398 */
398 399
399 400 #define DKIOCGETVOLCAP (DKIOC | 25) /* Get volume capabilities */
400 401 #define DKIOCSETVOLCAP (DKIOC | 26) /* Set volume capabilities */
401 402 #define DKIOCDMR (DKIOC | 27) /* Issue a directed read */
402 403
403 404 #define DKIOCDUMPINIT (DKIOC | 28) /* Dumpify a zvol */
404 405 #define DKIOCDUMPFINI (DKIOC | 29) /* Un-Dumpify a zvol */
405 406
406 407 typedef uint_t volcapinfo_t;
407 408
408 409 typedef uint_t volcapset_t;
409 410
410 411 #define DKV_ABR_CAP 0x00000001 /* Support Appl.Based Recovery */
411 412 #define DKV_DMR_CAP 0x00000002 /* Support Directed Mirror Read */
412 413
413 414 typedef struct volcap {
414 415 volcapinfo_t vc_info; /* Capabilities available */
415 416 volcapset_t vc_set; /* Capabilities set */
416 417 } volcap_t;
417 418
418 419 #define VOL_SIDENAME 256
419 420
420 421 typedef struct vol_directed_rd {
421 422 int vdr_flags;
422 423 offset_t vdr_offset;
423 424 size_t vdr_nbytes;
424 425 size_t vdr_bytesread;
425 426 void *vdr_data;
426 427 int vdr_side;
427 428 char vdr_side_name[VOL_SIDENAME];
428 429 } vol_directed_rd_t;
429 430
430 431 #define DKV_SIDE_INIT (-1)
431 432 #define DKV_DMR_NEXT_SIDE 0x00000001
432 433 #define DKV_DMR_DONE 0x00000002
433 434 #define DKV_DMR_ERROR 0x00000004
434 435 #define DKV_DMR_SUCCESS 0x00000008
435 436 #define DKV_DMR_SHORT 0x00000010
436 437
437 438 #ifdef _MULTI_DATAMODEL
438 439 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
439 440 #pragma pack(4)
440 441 #endif
441 442 typedef struct vol_directed_rd32 {
442 443 int32_t vdr_flags;
443 444 offset_t vdr_offset; /* 64-bit element on 32-bit alignment */
444 445 size32_t vdr_nbytes;
445 446 size32_t vdr_bytesread;
446 447 caddr32_t vdr_data;
447 448 int32_t vdr_side;
448 449 char vdr_side_name[VOL_SIDENAME];
449 450 } vol_directed_rd32_t;
450 451 #if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
451 452 #pragma pack()
452 453 #endif
453 454 #endif /* _MULTI_DATAMODEL */
454 455
455 456 /*
456 457 * The ioctl is used to fetch disk's device type, vendor ID,
457 458 * model number/product ID, firmware revision and serial number together.
458 459 *
459 460 * Currently there are two device types - DKD_ATA_TYPE which means the
460 461 * disk is driven by cmdk/ata or dad/uata driver, and DKD_SCSI_TYPE
461 462 * which means the disk is driven by sd/scsi hba driver.
462 463 */
463 464 #define DKIOC_GETDISKID (DKIOC|46)
464 465
465 466 /* These two labels are for dkd_dtype of dk_disk_id_t */
466 467 #define DKD_ATA_TYPE 0x01 /* ATA disk or legacy mode SATA disk */
467 468 #define DKD_SCSI_TYPE 0x02 /* SCSI disk or native mode SATA disk */
468 469
469 470 #define DKD_ATA_MODEL 40 /* model number length */
470 471 #define DKD_ATA_FWVER 8 /* firmware revision length */
471 472 #define DKD_ATA_SERIAL 20 /* serial number length */
472 473
473 474 #define DKD_SCSI_VENDOR 8 /* vendor ID length */
474 475 #define DKD_SCSI_PRODUCT 16 /* product ID length */
475 476 #define DKD_SCSI_REVLEVEL 4 /* revision level length */
476 477 #define DKD_SCSI_SERIAL 12 /* serial number length */
477 478
478 479 /*
479 480 * The argument type for DKIOC_GETDISKID ioctl.
480 481 */
481 482 typedef struct dk_disk_id {
482 483 uint_t dkd_dtype;
483 484 union {
484 485 struct {
485 486 char dkd_amodel[DKD_ATA_MODEL]; /* 40 bytes */
486 487 char dkd_afwver[DKD_ATA_FWVER]; /* 8 bytes */
487 488 char dkd_aserial[DKD_ATA_SERIAL]; /* 20 bytes */
488 489 } ata_disk_id;
489 490 struct {
490 491 char dkd_svendor[DKD_SCSI_VENDOR]; /* 8 bytes */
491 492 char dkd_sproduct[DKD_SCSI_PRODUCT]; /* 16 bytes */
492 493 char dkd_sfwver[DKD_SCSI_REVLEVEL]; /* 4 bytes */
493 494 char dkd_sserial[DKD_SCSI_SERIAL]; /* 12 bytes */
494 495 } scsi_disk_id;
495 496 } disk_id;
496 497 } dk_disk_id_t;
497 498
498 499 /*
499 500 * The ioctl is used to update the firmware of device.
500 501 */
501 502 #define DKIOC_UPDATEFW (DKIOC|47)
502 503
503 504 /* The argument type for DKIOC_UPDATEFW ioctl */
504 505 typedef struct dk_updatefw {
505 506 caddr_t dku_ptrbuf; /* pointer to firmware buf */
506 507 uint_t dku_size; /* firmware buf length */
507 508 uint8_t dku_type; /* firmware update type */
508 509 } dk_updatefw_t;
509 510
510 511 #ifdef _SYSCALL32
511 512 typedef struct dk_updatefw_32 {
512 513 caddr32_t dku_ptrbuf; /* pointer to firmware buf */
513 514 uint_t dku_size; /* firmware buf length */
514 515 uint8_t dku_type; /* firmware update type */
515 516 } dk_updatefw_32_t;
|
↓ open down ↓ |
473 lines elided |
↑ open up ↑ |
516 517 #endif /* _SYSCALL32 */
517 518
518 519 /*
519 520 * firmware update type - temporary or permanent use
520 521 */
521 522 #define FW_TYPE_TEMP 0x0 /* temporary use */
522 523 #define FW_TYPE_PERM 0x1 /* permanent use */
523 524
524 525 /*
525 526 * ioctl to free space (e.g. SCSI UNMAP) off a disk.
527 + * Pass a dkioc_free_list_t containing a list of extents to be freed.
526 528 */
527 529 #define DKIOCFREE (DKIOC|50)
528 530
529 -typedef struct dkioc_free_s {
530 - uint32_t df_flags;
531 - uint32_t df_reserved; /* For easy 64-bit alignment below... */
532 - diskaddr_t df_start;
533 - diskaddr_t df_length;
534 -} dkioc_free_t;
535 -
536 531 #define DF_WAIT_SYNC 0x00000001 /* Wait for full write-out of free. */
532 +typedef struct dkioc_free_list_ext_s {
533 + uint64_t dfle_start;
534 + uint64_t dfle_length;
535 +} dkioc_free_list_ext_t;
537 536
537 +typedef struct dkioc_free_list_s {
538 + uint64_t dfl_flags;
539 + uint64_t dfl_num_exts;
540 + int64_t dfl_offset;
541 +
542 + /*
543 + * N.B. this is only an internal debugging API! This is only called
544 + * from debug builds of sd for pre-release checking. Remove before GA!
545 + */
546 + void (*dfl_ck_func)(uint64_t, uint64_t, void *);
547 + void *dfl_ck_arg;
548 +
549 + dkioc_free_list_ext_t dfl_exts[1];
550 +} dkioc_free_list_t;
551 +#define DFL_SZ(num_exts) \
552 + (sizeof (dkioc_free_list_t) + (num_exts - 1) * 16)
553 +
538 554 #ifdef __cplusplus
539 555 }
540 556 #endif
541 557
542 558 #endif /* _SYS_DKIO_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX