70 extern int aac_return_aif(struct aac_softstate *, struct aac_fib_context *,
71 struct aac_fib **);
72
73 extern ddi_device_acc_attr_t aac_acc_attr;
74 extern int aac_check_dma_handle(ddi_dma_handle_t);
75
76 /*
77 * IOCTL command handling functions
78 */
79 static int aac_check_revision(struct aac_softstate *, intptr_t, int);
80 static int aac_ioctl_send_fib(struct aac_softstate *, intptr_t, int);
81 static int aac_open_getadapter_fib(struct aac_softstate *, intptr_t, int);
82 static int aac_next_getadapter_fib(struct aac_softstate *, intptr_t, int);
83 static int aac_close_getadapter_fib(struct aac_softstate *, intptr_t);
84 static int aac_send_raw_srb(struct aac_softstate *, dev_t, intptr_t, int);
85 static int aac_get_pci_info(struct aac_softstate *, intptr_t, int);
86 static int aac_query_disk(struct aac_softstate *, intptr_t, int);
87 static int aac_delete_disk(struct aac_softstate *, intptr_t, int);
88 static int aac_supported_features(struct aac_softstate *, intptr_t, int);
89
90 /*
91 * Warlock directives
92 */
93 _NOTE(SCHEME_PROTECTS_DATA("unique to each handling function", aac_features
94 aac_pci_info aac_query_disk aac_revision aac_umem_sge))
95
96 int
97 aac_do_ioctl(struct aac_softstate *softs, dev_t dev, int cmd, intptr_t arg,
98 int mode)
99 {
100 int status;
101
102 switch (cmd) {
103 case FSACTL_MINIPORT_REV_CHECK:
104 AACDB_PRINT_IOCTL(softs, "FSACTL_MINIPORT_REV_CHECK");
105 status = aac_check_revision(softs, arg, mode);
106 break;
107 case FSACTL_SENDFIB:
108 AACDB_PRINT_IOCTL(softs, "FSACTL_SEND_LARGE_FIB");
109 goto send_fib;
110 case FSACTL_SEND_LARGE_FIB:
111 AACDB_PRINT_IOCTL(softs, "FSACTL_SEND_LARGE_FIB");
112 send_fib:
113 status = aac_ioctl_send_fib(softs, arg, mode);
114 break;
115 case FSACTL_OPEN_GET_ADAPTER_FIB:
|
70 extern int aac_return_aif(struct aac_softstate *, struct aac_fib_context *,
71 struct aac_fib **);
72
73 extern ddi_device_acc_attr_t aac_acc_attr;
74 extern int aac_check_dma_handle(ddi_dma_handle_t);
75
76 /*
77 * IOCTL command handling functions
78 */
79 static int aac_check_revision(struct aac_softstate *, intptr_t, int);
80 static int aac_ioctl_send_fib(struct aac_softstate *, intptr_t, int);
81 static int aac_open_getadapter_fib(struct aac_softstate *, intptr_t, int);
82 static int aac_next_getadapter_fib(struct aac_softstate *, intptr_t, int);
83 static int aac_close_getadapter_fib(struct aac_softstate *, intptr_t);
84 static int aac_send_raw_srb(struct aac_softstate *, dev_t, intptr_t, int);
85 static int aac_get_pci_info(struct aac_softstate *, intptr_t, int);
86 static int aac_query_disk(struct aac_softstate *, intptr_t, int);
87 static int aac_delete_disk(struct aac_softstate *, intptr_t, int);
88 static int aac_supported_features(struct aac_softstate *, intptr_t, int);
89
90 int
91 aac_do_ioctl(struct aac_softstate *softs, dev_t dev, int cmd, intptr_t arg,
92 int mode)
93 {
94 int status;
95
96 switch (cmd) {
97 case FSACTL_MINIPORT_REV_CHECK:
98 AACDB_PRINT_IOCTL(softs, "FSACTL_MINIPORT_REV_CHECK");
99 status = aac_check_revision(softs, arg, mode);
100 break;
101 case FSACTL_SENDFIB:
102 AACDB_PRINT_IOCTL(softs, "FSACTL_SEND_LARGE_FIB");
103 goto send_fib;
104 case FSACTL_SEND_LARGE_FIB:
105 AACDB_PRINT_IOCTL(softs, "FSACTL_SEND_LARGE_FIB");
106 send_fib:
107 status = aac_ioctl_send_fib(softs, arg, mode);
108 break;
109 case FSACTL_OPEN_GET_ADAPTER_FIB:
|