4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #pragma ident "%Z%%M% %I% %E% SMI"
29 #include <sys/mdb_modapi.h>
30 #include <sys/scsi/scsi.h>
32 #include <sys/taskq.h>
33 #include <sys/scsi/targets/sddef.h>
35 /* Represents global soft state data in walk_step, walk_init */
36 #define SD_DATA(param) ((sd_str_p)wsp->walk_data)->param
38 /* Represents global soft state data in callback and related routines */
39 #define SD_DATA_IN_CBACK(param) ((sd_str_p)walk_data)->param
41 #define SUCCESS WALK_NEXT
45 * Primary attribute struct for buf extensions.
47 struct __ddi_xbuf_attr
{
50 uint32_t xa_pending
; /* call to xbuf_iostart() is iminent */
51 uint32_t xa_active_limit
;
52 uint32_t xa_active_count
;
53 uint32_t xa_active_lowater
;
54 struct buf
*xa_headp
; /* FIFO buf queue head ptr */
55 struct buf
*xa_tailp
; /* FIFO buf queue tail ptr */
56 kmutex_t xa_reserve_mutex
;
57 uint32_t xa_reserve_limit
;
58 uint32_t xa_reserve_count
;
59 void *xa_reserve_headp
;
60 void (*xa_strategy
)(struct buf
*, void *, void *);
62 timeout_id_t xa_timeid
;
67 * Provides soft state information like the number of elements, pointer
68 * to soft state elements etc
70 typedef struct i_ddi_soft_state sd_state_str_t
, *sd_state_str_ptr
;
72 /* structure to store soft state statistics */
73 typedef struct sd_str
{
75 uintptr_t current_root
;
76 int current_list_count
;
79 sd_state_str_t sd_state_data
;
80 } sd_str_t
, *sd_str_p
;
84 * Function: buf_avforw_walk_init
86 * Description: MDB calls the init function to initiate the walk,
87 * in response to mdb_walk() function called by the
88 * dcmd 'buf_avforw' or when the user executes the
89 * walk dcmd 'address::walk buf_avforw'.
91 * Arguments: new mdb_walk_state_t structure. A new structure is
92 * created for each walk, so that multiple instances of
93 * the walker can be active simultaneously.
96 buf_avforw_walk_init(mdb_walk_state_t
*wsp
)
98 if (wsp
->walk_addr
== NULL
) {
99 mdb_warn("buffer address required with the command\n");
103 wsp
->walk_data
= mdb_alloc(sizeof (buf_t
), UM_SLEEP
);
109 * Function: buf_avforw_walk_step
111 * Description: The step function is invoked by the walker during each
112 * iteration. Its primary job is to determine the address
113 * of the next 'buf_avforw' object, read in the local copy
114 * of this object, call the callback 'buf_callback' function,
115 * and return its status. The iteration is terminated when
116 * the walker encounters a null queue pointer which signifies
119 * Arguments: mdb_walk_state_t structure
122 buf_avforw_walk_step(mdb_walk_state_t
*wsp
)
127 * if walk_addr is null then it effectively means an end of all
128 * buf structures, hence end the iterations.
130 if (wsp
->walk_addr
== NULL
) {
135 * Read the contents of the current object, invoke the callback
136 * and assign the next objects address to mdb_walk_state_t structure.
138 if (mdb_vread(wsp
->walk_data
, sizeof (buf_t
), wsp
->walk_addr
) == -1) {
139 mdb_warn("failed to read buf at %p", wsp
->walk_addr
);
143 status
= wsp
->walk_callback(wsp
->walk_addr
, wsp
->walk_data
,
145 wsp
->walk_addr
= (uintptr_t)(((buf_t
*)wsp
->walk_data
)->av_forw
);
151 * Function: buf_callback
153 * Description: This is the callback function called by the 'buf_avforw'
154 * walker when 'buf_avforw' dcmd is invoked.
155 * It is called during each walk step. It displays the contents
156 * of the current object (addr) passed to it by the step
157 * function. It also prints the header and footer during the
158 * first and the last iteration of the walker.
160 * Arguments: addr -> current buf_avforw objects address.
161 * walk_data -> private storage for the walker.
162 * buf_entries -> private data for the callback. It represents
163 * the count of objects processed so far.
166 buf_callback(uintptr_t addr
, const void *walk_data
, void *buf_entries
)
168 int *count
= (int *)buf_entries
;
171 * If this is the first invocation of the command, print a
172 * header line for the output that will follow.
175 mdb_printf("============================\n");
176 mdb_printf("Walking buf list via av_forw\n");
177 mdb_printf("============================\n");
181 * read the object and print the contents.
189 /* if this is the last entry and print the footer */
190 if (((buf_t
*)walk_data
)->av_forw
== NULL
) {
191 mdb_printf("---------------------------\n");
192 mdb_printf("Processed %d Buf entries\n", *count
);
193 mdb_printf("---------------------------\n");
201 * Function: buf_avforw_walk_fini
203 * Description: The buf_avforw_walk_fini is called when the walk is terminated
204 * in response to WALK_DONE in buf_avforw_walk_step. It frees
205 * the walk_data structure.
207 * Arguments: mdb_walk_state_t structure
210 buf_avforw_walk_fini(mdb_walk_state_t
*wsp
)
212 mdb_free(wsp
->walk_data
, sizeof (buf_t
));
216 * Function: dump_xbuf_attr
218 * Description: Prints the contents of Xbuf queue.
220 * Arguments: object contents pointer and address.
223 dump_xbuf_attr(struct __ddi_xbuf_attr
*xba_ptr
, uintptr_t mem_addr
)
225 mdb_printf("0x%8lx:\tmutex\t\tallocsize\tpending\n",
226 mem_addr
+ offsetof(struct __ddi_xbuf_attr
, xa_mutex
));
228 mdb_printf(" \t%lx\t\t%d\t\t%d\n",
229 xba_ptr
->xa_mutex
._opaque
[0], xba_ptr
->xa_allocsize
,
230 xba_ptr
->xa_pending
);
231 mdb_printf("0x%8lx:\tactive_limit\tactive_count\tactive_lowater\n",
232 mem_addr
+ offsetof(struct __ddi_xbuf_attr
, xa_active_limit
));
234 mdb_printf(" \t%lx\t\t%lx\t\t%lx\n",
235 xba_ptr
->xa_active_limit
, xba_ptr
->xa_active_count
,
236 xba_ptr
->xa_active_lowater
);
237 mdb_printf("0x%8lx:\theadp\t\ttailp\n",
238 mem_addr
+ offsetof(struct __ddi_xbuf_attr
, xa_headp
));
240 mdb_printf(" \t%lx%c\t%lx\n",
241 xba_ptr
->xa_headp
, (xba_ptr
->xa_headp
== 0?'\t':' '),
244 "0x%8lx:\treserve_mutex\treserve_limit\treserve_count\treserve_headp\n",
245 mem_addr
+ offsetof(struct __ddi_xbuf_attr
, xa_reserve_mutex
));
247 mdb_printf(" \t%lx\t\t%lx\t\t%lx\t\t%lx\n",
248 xba_ptr
->xa_reserve_mutex
._opaque
[0], xba_ptr
->xa_reserve_limit
,
249 xba_ptr
->xa_reserve_count
, xba_ptr
->xa_reserve_headp
);
251 mdb_printf("0x%8lx:\ttimeid\t\ttq\n",
252 mem_addr
+ offsetof(struct __ddi_xbuf_attr
, xa_timeid
));
254 mdb_printf(" \t%lx%c\t%lx\n",
255 xba_ptr
->xa_timeid
, (xba_ptr
->xa_timeid
== 0?'\t':' '),
260 * Function: init_softstate_members
262 * Description: Initialize mdb_walk_state_t structure with either 'sd' or
263 * 'ssd' related information.
265 * Arguments: new mdb_walk_state_t structure
268 init_softstate_members(mdb_walk_state_t
*wsp
)
270 wsp
->walk_data
= mdb_alloc(sizeof (sd_str_t
), UM_SLEEP
);
273 * store the soft state statistics variables like non-zero
274 * soft state entries, base address, actual count of soft state
277 SD_DATA(sd_state
) = (sd_state_str_ptr
)wsp
->walk_addr
;
279 SD_DATA(current_list_count
) = 0;
280 SD_DATA(valid_root_count
) = 0;
282 if (mdb_vread((void *)&SD_DATA(sd_state_data
),
283 sizeof (sd_state_str_t
), wsp
->walk_addr
) == -1) {
284 mdb_warn("failed to sd_state at %p", wsp
->walk_addr
);
288 wsp
->walk_addr
= (uintptr_t)(SD_DATA(sd_state_data
.array
));
290 SD_DATA(current_root
) = wsp
->walk_addr
;
294 #if (!defined(__fibre))
296 * Function: sd_state_walk_init
298 * Description: MDB calls the init function to initiate the walk,
299 * in response to mdb_walk() function called by the
300 * dcmd 'sd_state' or when the user executes the
301 * walk dcmd '::walk sd_state'.
302 * The init function initializes the walker to either
303 * the user specified address or the default kernel
304 * 'sd_state' pointer.
306 * Arguments: new mdb_walk_state_t structure
309 sd_state_walk_init(mdb_walk_state_t
*wsp
)
311 if (wsp
->walk_addr
== NULL
&&
312 mdb_readvar(&wsp
->walk_addr
, "sd_state") == -1) {
313 mdb_warn("failed to read 'sd_state'");
317 return (init_softstate_members(wsp
));
323 * Function: ssd_state_walk_init
325 * Description: MDB calls the init function to initiate the walk,
326 * in response to mdb_walk() function called by the
327 * dcmd 'ssd_state' or when the user executes the
328 * walk dcmd '::walk ssd_state'.
329 * The init function initializes the walker to either
330 * the user specified address or the default kernel
331 * 'ssd_state' pointer.
333 * Arguments: new mdb_walk_state_t structure
336 ssd_state_walk_init(mdb_walk_state_t
*wsp
)
338 if (wsp
->walk_addr
== NULL
&&
339 mdb_readvar(&wsp
->walk_addr
, "ssd_state") == -1) {
340 mdb_warn("failed to read 'ssd_state'");
344 return (init_softstate_members(wsp
));
350 * Function: sd_state_walk_step
352 * Description: The step function is invoked by the walker during each
353 * iteration. Its primary job is to determine the address
354 * of the next 'soft state' object, read in the local copy
355 * of this object, call the callback 'sd_callback' function,
356 * and return its status. The iteration is terminated when
357 * the soft state counter equals the total soft state count
358 * obtained initially.
360 * Arguments: mdb_walk_state_t structure
363 sd_state_walk_step(mdb_walk_state_t
*wsp
)
369 * If all the soft state entries have been processed then stop
372 if (SD_DATA(current_list_count
) >= SD_DATA(sd_state_data
.n_items
)) {
377 * read the object contents, invoke the callback and set the
378 * mdb_walk_state_t structure to the next object.
380 if (mdb_vread(&tp
, sizeof (void *), wsp
->walk_addr
) == -1) {
381 mdb_warn("failed to read at %p", wsp
->walk_addr
);
385 status
= wsp
->walk_callback((uintptr_t)tp
, wsp
->walk_data
,
388 /* Count the number of non-zero un entries. */
389 SD_DATA(valid_root_count
++);
392 wsp
->walk_addr
+= sizeof (void *);
393 SD_DATA(current_list_count
++);
399 * Function: sd_state_walk_fini
401 * Description: The sd_state_walk_fini is called when the walk is terminated
402 * in response to WALK_DONE in sd_state_walk_step. It frees
403 * the walk_data structure.
405 * Arguments: mdb_walk_state_t structure
408 sd_state_walk_fini(mdb_walk_state_t
*wsp
)
410 mdb_free(wsp
->walk_data
, sizeof (sd_str_t
));
414 * Function: process_semo_sleepq
416 * Description: Iterate over the semoclose wait Q members of the soft state.
417 * Print the contents of each member. In case of silent mode
418 * the contents are avoided and only the address is printed.
420 * Arguments: starting queue address, print mode.
423 process_semo_sleepq(uintptr_t walk_addr
, int silent
)
427 int semo_sleepq_count
= 0;
429 /* Set up to process the device's semoclose wait Q */
433 mdb_printf("\nSEMOCLOSE SLEEP Q:\n");
434 mdb_printf("----------\n");
437 mdb_printf("SEMOCLOSE sleep Q head: %lx\n", rootBuf
);
440 /* Process the device's cmd. wait Q */
442 mdb_printf("SEMOCLOSE SLEEP Q list entry:\n");
443 mdb_printf("------------------\n");
446 if (mdb_vread((void *)¤tBuf
, sizeof (buf_t
),
448 mdb_warn("failed to read buf at %p", rootBuf
);
453 mdb_set_dot(rootBuf
);
458 rootBuf
= (uintptr_t)currentBuf
.av_forw
;
461 if (rootBuf
== NULL
) {
462 mdb_printf("------------------------------\n");
463 mdb_printf("Processed %d SEMOCLOSE SLEEP Q entries\n",
465 mdb_printf("------------------------------\n");
472 * Function: process_sdlun_waitq
474 * Description: Iterate over the wait Q members of the soft state.
475 * Print the contents of each member. In case of silent mode
476 * the contents are avoided and only the address is printed.
478 * Arguments: starting queue address, print mode.
481 process_sdlun_waitq(uintptr_t walk_addr
, int silent
)
485 int sdLunQ_count
= 0;
490 mdb_printf("\nUN WAIT Q:\n");
491 mdb_printf("----------\n");
493 mdb_printf("UN wait Q head: %lx\n", rootBuf
);
496 /* Process the device's cmd. wait Q */
498 mdb_printf("UN WAIT Q list entry:\n");
499 mdb_printf("------------------\n");
502 if (mdb_vread(¤tBuf
, sizeof (buf_t
),
503 (uintptr_t)rootBuf
) == -1) {
504 mdb_warn("failed to read buf at %p",
510 mdb_set_dot(rootBuf
);
515 rootBuf
= (uintptr_t)currentBuf
.av_forw
;
519 if (rootBuf
== NULL
) {
520 mdb_printf("------------------------------\n");
521 mdb_printf("Processed %d UN WAIT Q entries\n", sdLunQ_count
);
522 mdb_printf("------------------------------\n");
529 * Function: process_xbuf
531 * Description: Iterate over the Xbuf Attr and Xbuf Attr wait Q of the soft
533 * Print the contents of each member. In case of silent mode
534 * the contents are avoided and only the address is printed.
536 * Arguments: starting xbuf address, print mode.
539 process_xbuf(uintptr_t xbuf_attr
, int silent
)
541 struct __ddi_xbuf_attr xba
;
544 int xbuf_q_count
= 0;
546 if (xbuf_attr
== NULL
) {
547 mdb_printf("---------------------------\n");
548 mdb_printf("No XBUF ATTR entry\n");
549 mdb_printf("---------------------------\n");
553 /* Process the Xbuf Attr struct for a device. */
554 if (mdb_vread((void *)&xba
, sizeof (struct __ddi_xbuf_attr
),
556 mdb_warn("failed to read xbuf_attr at %p", xbuf_attr
);
561 mdb_printf("\nXBUF ATTR:\n");
562 mdb_printf("----------\n");
564 dump_xbuf_attr(&xba
, xbuf_attr
);
567 mdb_printf("\nXBUF Q:\n");
568 mdb_printf("-------\n");
571 mdb_printf("xbuf Q head: %lx\n", xba
.xa_headp
);
573 xba_root
= (void *) xba
.xa_headp
;
575 /* Process the Xbuf Attr wait Q, if there are any entries. */
576 while ((uintptr_t)xba_root
) {
578 mdb_printf("XBUF_Q list entry:\n");
579 mdb_printf("------------------\n");
582 if (mdb_vread((void *)&xba_current
, sizeof (buf_t
),
583 (uintptr_t)xba_root
) == -1) {
584 mdb_warn("failed to read buf at %p",
585 (uintptr_t)xba_root
);
589 mdb_set_dot((uintptr_t)xba_root
);
595 xba_root
= (void *)xba_current
.av_forw
;
598 if (xba_root
== NULL
) {
599 mdb_printf("---------------------------\n");
600 mdb_printf("Processed %d XBUF Q entries\n", xbuf_q_count
);
601 mdb_printf("---------------------------\n");
607 * Function: print_footer
609 * Description: Prints the footer if all the soft state entries are processed.
611 * Arguments: private storage of the walker.
614 print_footer(const void *walk_data
)
616 if (SD_DATA_IN_CBACK(current_list_count
) >=
617 (SD_DATA_IN_CBACK(sd_state_data
.n_items
) - 1)) {
618 mdb_printf("---------------------------\n");
619 mdb_printf("Processed %d UN softstate entries\n",
620 SD_DATA_IN_CBACK(valid_root_count
));
621 mdb_printf("---------------------------\n");
626 * Function: sd_callback
628 * Description: This is the callback function called by the
629 * 'sd_state/ssd_state' walker when 'sd_state/ssd_state' dcmd
630 * invokes the walker.
631 * It is called during each walk step. It displays the contents
632 * of the current soft state object (addr) passed to it by the
633 * step function. It also prints the header and footer during the
634 * first and the last step of the walker.
635 * The contents of the soft state also includes various queues
636 * it includes like Xbuf, semo_close, sdlun_waitq.
638 * Arguments: addr -> current soft state objects address.
639 * walk_data -> private storage for the walker.
640 * flg_silent -> private data for the callback. It represents
641 * the silent mode of operation.
644 sd_callback(uintptr_t addr
, const void *walk_data
, void *flg_silent
)
647 int silent
= *(int *)flg_silent
;
650 * If this is the first invocation of the command, print a
651 * header line for the output that will follow.
653 if (SD_DATA_IN_CBACK(current_list_count
) == 0) {
654 mdb_printf("walk_addr = %lx\n", SD_DATA_IN_CBACK(sd_state
));
655 mdb_printf("walking sd_state units via ptr: %lx\n",
656 SD_DATA_IN_CBACK(current_root
));
657 mdb_printf("%d entries in sd_state table\n",
658 SD_DATA_IN_CBACK(sd_state_data
.n_items
));
661 mdb_printf("\nun %d: %lx\n", SD_DATA_IN_CBACK(current_list_count
),
664 mdb_printf("--------------\n");
666 /* if null soft state iterate over to next one */
668 print_footer(walk_data
);
672 * For each buf, we need to read the sd_lun struct,
673 * and then print out its contents, and get the next.
675 else if (mdb_vread(&sdLun
, sizeof (struct sd_lun
), (uintptr_t)addr
) ==
679 mdb_eval("$<sd_lun");
683 mdb_warn("failed to read softstate at %p", addr
);
687 /* process device Xbuf Attr struct and wait Q */
688 process_xbuf((uintptr_t)sdLun
.un_xbuf_attr
, silent
);
690 /* process device cmd wait Q */
691 process_sdlun_waitq((uintptr_t)sdLun
.un_waitq_headp
, silent
);
693 /* process device semoclose wait Q */
694 if (sdLun
.un_semoclose
._opaque
[1] == 0) {
695 process_semo_sleepq((uintptr_t)sdLun
.un_semoclose
._opaque
[0],
699 /* print the actual number of soft state processed */
700 print_footer(walk_data
);
704 #if (!defined(__fibre))
706 * Function: dcmd_sd_state
708 * Description: Scans through the sd soft state entries and prints their
709 * contents including of various queues it contains. It uses
710 * 'sd_state' walker to perform a global walk. If a particular
711 * soft state address is specified than it performs the above job
712 * itself (local walk).
714 * Arguments: addr -> user specified address or NULL if no address is
716 * flags -> integer reflecting whether an address was specified,
717 * or if it was invoked by the walker in a loop etc.
718 * argc -> the number of arguments supplied to the dcmd.
719 * argv -> the actual arguments supplied by the user.
723 dcmd_sd_state(uintptr_t addr
, uint_t flags
, int argc
, const mdb_arg_t
*argv
)
728 /* Enable the silent mode if '-s' option specified the user */
729 if (mdb_getopts(argc
, argv
, 's', MDB_OPT_SETBITS
, TRUE
, &silent
, NULL
)
735 * If no address is specified on the command line, perform
736 * a global walk invoking 'sd_state' walker. If a particular address
737 * is specified then print the soft state and its queues.
739 if (!(flags
& DCMD_ADDRSPEC
)) {
740 mdb_walk("sd_state", sd_callback
, (void *)&silent
);
743 mdb_printf("\nun: %lx\n", addr
);
744 mdb_printf("--------------\n");
746 /* read the sd_lun struct and print the contents */
747 if (mdb_vread(&sdLun
, sizeof (struct sd_lun
),
748 (uintptr_t)addr
) == sizeof (sdLun
)) {
752 mdb_eval("$<sd_lun");
756 mdb_warn("failed to read softstate at %p", addr
);
760 /* process Xbuf Attr struct and wait Q for the soft state */
761 process_xbuf((uintptr_t)sdLun
.un_xbuf_attr
, silent
);
763 /* process device' cmd wait Q */
764 process_sdlun_waitq((uintptr_t)sdLun
.un_waitq_headp
, silent
);
766 /* process device's semoclose wait Q */
767 if (sdLun
.un_semoclose
._opaque
[1] == 0) {
769 (uintptr_t)sdLun
.un_semoclose
._opaque
[0], silent
);
778 * Function: dcmd_ssd_state
780 * Description: Scans through the ssd soft state entries and prints their
781 * contents including of various queues it contains. It uses
782 * 'ssd_state' walker to perform a global walk. If a particular
783 * soft state address is specified than it performs the above job
784 * itself (local walk).
786 * Arguments: addr -> user specified address or NULL if no address is
788 * flags -> integer reflecting whether an address was specified,
789 * or if it was invoked by the walker in a loop etc.
790 * argc -> the number of arguments supplied to the dcmd.
791 * argv -> the actual arguments supplied by the user.
795 dcmd_ssd_state(uintptr_t addr
, uint_t flags
, int argc
, const mdb_arg_t
*argv
)
800 /* Enable the silent mode if '-s' option specified the user */
801 if (mdb_getopts(argc
, argv
, 's', MDB_OPT_SETBITS
, TRUE
, &silent
, NULL
)
807 * If no address is specified on the command line, perform
808 * a global walk invoking 'sd_state' walker. If a particular address
809 * is specified then print the soft state and its queues.
811 if (!(flags
& DCMD_ADDRSPEC
)) {
812 mdb_walk("ssd_state", sd_callback
, (void *)&silent
);
815 mdb_printf("\nun: %lx\n", addr
);
816 mdb_printf("--------------\n");
818 /* read the sd_lun struct and print the contents */
819 if (mdb_vread(&sdLun
, sizeof (struct sd_lun
),
820 (uintptr_t)addr
) == sizeof (sdLun
)) {
823 mdb_eval("$<sd_lun");
827 mdb_warn("failed to read softstate at %p", addr
);
831 /* process Xbuf Attr struct and wait Q for the soft state */
832 process_xbuf((uintptr_t)sdLun
.un_xbuf_attr
, silent
);
834 /* process device' cmd wait Q */
835 process_sdlun_waitq((uintptr_t)sdLun
.un_waitq_headp
, silent
);
837 /* process device's semoclose wait Q */
838 if (sdLun
.un_semoclose
._opaque
[1] == 0) {
840 (uintptr_t)sdLun
.un_semoclose
._opaque
[0], silent
);
848 * Function: dcmd_buf_avforw
850 * Description: Scans through the buf list via av_forw and prints
852 * It uses the 'buf_avforw' walker to perform the walk.
854 * Arguments: addr -> user specified address.
855 * flags -> integer reflecting whether an address was specified,
856 * or if it was invoked by the walker in a loop etc.
857 * argc -> the number of arguments supplied to the dcmd.
858 * argv -> the actual arguments supplied by the user.
862 dcmd_buf_avforw(uintptr_t addr
, uint_t flags
, int argc
, const mdb_arg_t
*argv
)
866 /* it does not take any arguments */
871 * If no address was specified on the command line, print the
872 * error msg, else scan and
873 * print out all the buffers available by invoking buf_avforw walker.
875 if ((flags
& DCMD_ADDRSPEC
)) {
876 mdb_pwalk("buf_avforw", buf_callback
, (void *)&buf_entries
,
880 mdb_printf("buffer address required with the command\n");
887 * MDB module linkage information:
889 * List of structures describing our dcmds, a list of structures
890 * describing our walkers, and a function named _mdb_init to return a pointer
891 * to our module information.
894 static const mdb_dcmd_t dcmds
[] = {
895 { "buf_avforw", ":", "buf_t list via av_forw", dcmd_buf_avforw
},
896 #if (!defined(__fibre))
897 { "sd_state", "[-s]", "sd soft state list", dcmd_sd_state
},
899 { "ssd_state", "[-s]", "ssd soft state list", dcmd_ssd_state
},
904 static const mdb_walker_t walkers
[] = {
905 { "buf_avforw", "walk list of buf_t structures via av_forw",
906 buf_avforw_walk_init
, buf_avforw_walk_step
, buf_avforw_walk_fini
},
907 #if (!defined(__fibre))
908 { "sd_state", "walk all sd soft state queues",
909 sd_state_walk_init
, sd_state_walk_step
, sd_state_walk_fini
},
911 { "ssd_state", "walk all ssd soft state queues",
912 ssd_state_walk_init
, sd_state_walk_step
, sd_state_walk_fini
},
917 static const mdb_modinfo_t modinfo
= {
918 MDB_API_VERSION
, dcmds
, walkers
922 * Function: _mdb_init
924 * Description: Returns mdb_modinfo_t structure which provides linkage and
925 * module identification information to the debugger.
929 const mdb_modinfo_t
*