Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/srn.c
+++ new/usr/src/uts/common/io/srn.c
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.
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 2009 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 27
28 28 /*
29 29 * srn Provide apm-like interfaces to Xorg
30 30 */
31 31
32 32 #include <sys/types.h>
33 33 #include <sys/errno.h>
34 34 #include <sys/modctl.h>
35 35 #include <sys/conf.h> /* driver flags and functions */
36 36 #include <sys/open.h> /* OTYP_CHR definition */
37 37 #include <sys/stat.h> /* S_IFCHR definition */
38 38 #include <sys/pathname.h> /* name -> dev_info xlation */
39 39 #include <sys/kmem.h> /* memory alloc stuff */
40 40 #include <sys/debug.h>
41 41 #include <sys/pm.h>
42 42 #include <sys/ddi.h>
43 43 #include <sys/sunddi.h>
44 44 #include <sys/epm.h>
45 45 #include <sys/vfs.h>
46 46 #include <sys/mode.h>
47 47 #include <sys/mkdev.h>
48 48 #include <sys/promif.h>
49 49 #include <sys/consdev.h>
50 50 #include <sys/ddi_impldefs.h>
51 51 #include <sys/poll.h>
52 52 #include <sys/note.h>
53 53 #include <sys/taskq.h>
54 54 #include <sys/policy.h>
55 55 #include <sys/srn.h>
56 56
57 57 /*
58 58 * Minor number is instance<<8 + clone minor from range 1-255;
59 59 * But only one will be allocated
60 60 */
61 61 #define SRN_MINOR_TO_CLONE(minor) ((minor) & (SRN_MAX_CLONE - 1))
62 62 #define SU 0x002
63 63 #define SG 0x004
64 64
65 65 extern kmutex_t srn_clone_lock; /* protects srn_clones array */
66 66 extern kcondvar_t srn_clones_cv[SRN_MAX_CLONE];
67 67 extern uint_t srn_poll_cnt[SRN_MAX_CLONE];
68 68
69 69 /*
70 70 * The soft state of the srn driver. Since there will only be
71 71 * one of these, just reference it through a static struct.
72 72 */
73 73 static struct srnstate {
74 74 dev_info_t *srn_dip; /* ptr to our dev_info node */
75 75 int srn_instance; /* for ddi_get_instance() */
76 76 uchar_t srn_clones[SRN_MAX_CLONE]; /* unique opens */
77 77 struct cred *srn_cred[SRN_MAX_CLONE]; /* cred for each open */
78 78 int srn_type[SRN_MAX_CLONE]; /* type of handshake */
79 79 int srn_delivered[SRN_MAX_CLONE];
80 80 srn_event_info_t srn_pending[SRN_MAX_CLONE];
81 81 int srn_fault[SRN_MAX_CLONE];
82 82 } srn = { NULL, -1};
83 83 typedef struct srnstate *srn_state_t;
84 84
85 85 kcondvar_t srn_clones_cv[SRN_MAX_CLONE];
86 86 uint_t srn_poll_cnt[SRN_MAX_CLONE]; /* count of events for poll */
87 87 int srn_apm_count;
88 88 int srn_autosx_count;
89 89 /* Number of seconds to wait for clients to ack a poll */
90 90 int srn_timeout = 10;
91 91
92 92 struct pollhead srn_pollhead[SRN_MAX_CLONE];
93 93
94 94 static int srn_open(dev_t *, int, int, cred_t *);
95 95 static int srn_close(dev_t, int, int, cred_t *);
96 96 static int srn_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
97 97 static int srn_chpoll(dev_t, short, int, short *, struct pollhead **);
98 98
99 99 static struct cb_ops srn_cb_ops = {
100 100 srn_open, /* open */
101 101 srn_close, /* close */
102 102 nodev, /* strategy */
103 103 nodev, /* print */
104 104 nodev, /* dump */
105 105 nodev, /* read */
106 106 nodev, /* write */
107 107 srn_ioctl, /* ioctl */
108 108 nodev, /* devmap */
109 109 nodev, /* mmap */
110 110 nodev, /* segmap */
111 111 srn_chpoll, /* poll */
112 112 ddi_prop_op, /* prop_op */
113 113 NULL, /* streamtab */
114 114 D_NEW | D_MP /* driver compatibility flag */
115 115 };
116 116
117 117 static int srn_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg,
118 118 void **result);
119 119 static int srn_attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
120 120 static int srn_detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
121 121 static void srn_notify(int type, int event);
122 122
123 123 static struct dev_ops srn_ops = {
124 124 DEVO_REV, /* devo_rev */
125 125 0, /* refcnt */
126 126 srn_getinfo, /* info */
127 127 nulldev, /* identify */
128 128 nulldev, /* probe */
129 129 srn_attach, /* attach */
130 130 srn_detach, /* detach */
131 131 nodev, /* reset */
132 132 &srn_cb_ops, /* driver operations */
133 133 NULL, /* bus operations */
134 134 NULL, /* power */
↓ open down ↓ |
134 lines elided |
↑ open up ↑ |
135 135 ddi_quiesce_not_needed, /* quiesce */
136 136 };
137 137
138 138 static struct modldrv modldrv = {
139 139 &mod_driverops,
140 140 "srn driver",
141 141 &srn_ops
142 142 };
143 143
144 144 static struct modlinkage modlinkage = {
145 - MODREV_1, &modldrv, 0
145 + MODREV_1, { &modldrv, NULL }
146 146 };
147 147
148 148 /* Local functions */
149 149
150 150 int
151 151 _init(void)
152 152 {
153 153 return (mod_install(&modlinkage));
154 154 }
155 155
156 156 int
157 157 _fini(void)
158 158 {
159 159 return (mod_remove(&modlinkage));
160 160 }
161 161
162 162 int
163 163 _info(struct modinfo *modinfop)
164 164 {
165 165 return (mod_info(&modlinkage, modinfop));
166 166 }
167 167
168 168 static int
169 169 srn_attach(dev_info_t *dip, ddi_attach_cmd_t cmd)
170 170 {
171 171 int i;
172 172 extern void (*srn_signal)(int, int);
173 173
174 174 switch (cmd) {
175 175
176 176 case DDI_ATTACH:
177 177 if (srn.srn_instance != -1) /* Only allow one instance */
178 178 return (DDI_FAILURE);
179 179 srn.srn_instance = ddi_get_instance(dip);
180 180 if (ddi_create_minor_node(dip, "srn", S_IFCHR,
181 181 (srn.srn_instance << 8) + 0, DDI_PSEUDO, 0)
182 182 != DDI_SUCCESS) {
183 183 return (DDI_FAILURE);
184 184 }
185 185 srn.srn_dip = dip; /* srn_init and getinfo depend on it */
186 186
187 187 for (i = 0; i < SRN_MAX_CLONE; i++)
188 188 cv_init(&srn_clones_cv[i], NULL, CV_DEFAULT, NULL);
189 189
190 190 srn.srn_instance = ddi_get_instance(dip);
191 191 mutex_enter(&srn_clone_lock);
192 192 srn_signal = srn_notify;
193 193 mutex_exit(&srn_clone_lock);
194 194 ddi_report_dev(dip);
195 195 return (DDI_SUCCESS);
196 196
197 197 default:
198 198 return (DDI_FAILURE);
199 199 }
200 200 }
201 201
202 202 /* ARGSUSED */
203 203 static int
204 204 srn_detach(dev_info_t *dip, ddi_detach_cmd_t cmd)
205 205 {
206 206 int i;
207 207 extern int srn_inuse;
208 208 extern void (*srn_signal)(int, int);
209 209
210 210 switch (cmd) {
211 211 case DDI_DETACH:
212 212
213 213 mutex_enter(&srn_clone_lock);
214 214 while (srn_inuse) {
215 215 mutex_exit(&srn_clone_lock);
216 216 delay(1);
217 217 mutex_enter(&srn_clone_lock);
218 218 }
219 219 srn_signal = NULL;
220 220 mutex_exit(&srn_clone_lock);
221 221
222 222 for (i = 0; i < SRN_MAX_CLONE; i++)
223 223 cv_destroy(&srn_clones_cv[i]);
224 224
225 225 ddi_remove_minor_node(dip, NULL);
226 226 srn.srn_instance = -1;
227 227 return (DDI_SUCCESS);
228 228
229 229 default:
230 230 return (DDI_FAILURE);
231 231 }
232 232 }
233 233
234 234
235 235 #ifdef DEBUG
236 236 char *srn_cmd_string;
237 237 int srn_cmd;
238 238 #endif
239 239
240 240 /*
241 241 * Returns true if permission granted by credentials
242 242 * XXX
243 243 */
244 244 static int
245 245 srn_perms(int perm, cred_t *cr)
246 246 {
247 247 if ((perm & SU) && secpolicy_power_mgmt(cr) == 0) /* privileged? */
248 248 return (1);
249 249 if ((perm & SG) && (crgetgid(cr) == 0)) /* group 0 is ok */
250 250 return (1);
251 251 return (0);
252 252 }
253 253
254 254 static int
255 255 srn_chpoll(dev_t dev, short events, int anyyet, short *reventsp,
256 256 struct pollhead **phpp)
257 257 {
258 258 extern struct pollhead srn_pollhead[];
259 259 int clone;
260 260
261 261 clone = SRN_MINOR_TO_CLONE(getminor(dev));
262 262 if ((events & (POLLIN | POLLRDNORM)) && srn_poll_cnt[clone]) {
263 263 *reventsp |= (POLLIN | POLLRDNORM);
264 264 } else {
265 265 *reventsp = 0;
266 266 if (!anyyet) {
267 267 *phpp = &srn_pollhead[clone];
268 268 }
269 269 }
270 270 return (0);
271 271 }
272 272
273 273 /*ARGSUSED*/
274 274 static int
275 275 srn_getinfo(dev_info_t *dip, ddi_info_cmd_t infocmd, void *arg, void **result)
276 276 {
277 277 dev_t dev;
278 278 int instance;
279 279
280 280 switch (infocmd) {
281 281 case DDI_INFO_DEVT2DEVINFO:
282 282 if (srn.srn_instance == -1)
283 283 return (DDI_FAILURE);
284 284 *result = srn.srn_dip;
285 285 return (DDI_SUCCESS);
286 286
287 287 case DDI_INFO_DEVT2INSTANCE:
288 288 dev = (dev_t)arg;
289 289 instance = getminor(dev) >> 8;
290 290 *result = (void *)(uintptr_t)instance;
291 291 return (DDI_SUCCESS);
292 292
293 293 default:
294 294 return (DDI_FAILURE);
295 295 }
296 296 }
297 297
298 298
299 299 /*ARGSUSED1*/
300 300 static int
301 301 srn_open(dev_t *devp, int flag, int otyp, cred_t *cr)
302 302 {
303 303 int clone;
304 304
305 305 if (otyp != OTYP_CHR)
306 306 return (EINVAL);
307 307
308 308 mutex_enter(&srn_clone_lock);
309 309 for (clone = 1; clone < SRN_MAX_CLONE - 1; clone++)
310 310 if (!srn.srn_clones[clone])
311 311 break;
312 312
313 313 if (clone == SRN_MAX_CLONE) {
314 314 mutex_exit(&srn_clone_lock);
315 315 return (ENXIO);
316 316 }
317 317 srn.srn_cred[clone] = cr;
318 318 ASSERT(srn_apm_count >= 0);
319 319 srn_apm_count++;
320 320 srn.srn_type[clone] = SRN_TYPE_APM;
321 321 crhold(cr);
322 322
323 323 *devp = makedevice(getmajor(*devp), (srn.srn_instance << 8) +
324 324 clone);
325 325 srn.srn_clones[clone] = 1;
326 326 srn.srn_cred[clone] = cr;
327 327 crhold(cr);
328 328 mutex_exit(&srn_clone_lock);
329 329 PMD(PMD_SX, ("srn open OK\n"))
330 330 return (0);
331 331 }
332 332
333 333 /*ARGSUSED1*/
334 334 static int
335 335 srn_close(dev_t dev, int flag, int otyp, cred_t *cr)
336 336 {
337 337 int clone;
338 338
339 339 if (otyp != OTYP_CHR)
340 340 return (EINVAL);
341 341
342 342 clone = SRN_MINOR_TO_CLONE(getminor(dev));
343 343 PMD(PMD_SX, ("srn_close: minor %x, clone %x\n", getminor(dev),
344 344 clone))
345 345 mutex_enter(&srn_clone_lock);
346 346 crfree(srn.srn_cred[clone]);
347 347 srn.srn_cred[clone] = 0;
348 348 srn_poll_cnt[clone] = 0;
349 349 srn.srn_fault[clone] = 0;
350 350 if (srn.srn_pending[clone].ae_type || srn.srn_delivered[clone]) {
351 351 srn.srn_pending[clone].ae_type = 0;
352 352 srn.srn_delivered[clone] = 0;
353 353 cv_signal(&srn_clones_cv[clone]);
354 354 }
355 355 switch (srn.srn_type[clone]) {
356 356 case SRN_TYPE_AUTOSX:
357 357 ASSERT(srn_autosx_count);
358 358 srn_autosx_count--;
359 359 break;
360 360 case SRN_TYPE_APM:
361 361 ASSERT(srn_apm_count);
362 362 srn_apm_count--;
363 363 break;
364 364 default:
365 365 ASSERT(0);
366 366 return (EINVAL);
367 367 }
368 368 srn.srn_clones[clone] = 0;
369 369 mutex_exit(&srn_clone_lock);
370 370 return (0);
371 371 }
372 372
373 373 /*ARGSUSED*/
374 374 static int
375 375 srn_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *cr, int *rval_p)
376 376 {
377 377 int clone = SRN_MINOR_TO_CLONE(getminor(dev));
378 378
379 379 PMD(PMD_SX, ("ioctl: %x: begin\n", cmd))
380 380
381 381 switch (cmd) {
382 382 case SRN_IOC_NEXTEVENT:
383 383 case SRN_IOC_SUSPEND:
384 384 case SRN_IOC_RESUME:
385 385 case SRN_IOC_AUTOSX:
386 386 break;
387 387 default:
388 388 return (ENOTTY);
389 389 }
390 390
391 391 if (!srn_perms(SU | SG, srn.srn_cred[clone])) {
392 392 return (EPERM);
393 393 }
394 394 switch (cmd) {
395 395 case SRN_IOC_AUTOSX:
396 396 PMD(PMD_SX, ("SRN_IOC_AUTOSX entered\n"))
397 397 mutex_enter(&srn_clone_lock);
398 398 if (!srn.srn_clones[clone]) {
399 399 PMD(PMD_SX, (" ioctl !srn_clones--EINVAL\n"))
400 400 mutex_exit(&srn_clone_lock);
401 401 return (EINVAL);
402 402 }
403 403 if (srn.srn_pending[clone].ae_type) {
404 404 PMD(PMD_SX, ("AUTOSX while pending--EBUSY\n"))
405 405 mutex_exit(&srn_clone_lock);
406 406 return (EBUSY);
407 407 }
408 408 if (srn.srn_type[clone] == SRN_TYPE_AUTOSX) {
409 409 PMD(PMD_SX, ("AUTOSX already--EBUSY\n"))
410 410 mutex_exit(&srn_clone_lock);
411 411 return (EBUSY);
412 412 }
413 413 ASSERT(srn.srn_type[clone] == SRN_TYPE_APM);
414 414 srn.srn_type[clone] = SRN_TYPE_AUTOSX;
415 415 srn.srn_fault[clone] = 0;
416 416 srn_apm_count--;
417 417 ASSERT(srn_apm_count >= 0);
418 418 ASSERT(srn_autosx_count >= 0);
419 419 srn_autosx_count++;
420 420 mutex_exit(&srn_clone_lock);
421 421 PMD(PMD_SX, ("SRN_IOC_AUTOSX returns success\n"))
422 422 return (0);
423 423
424 424 case SRN_IOC_NEXTEVENT:
425 425 /*
426 426 * return the next suspend or resume event; there should
427 427 * be one, cause we only get called if we've signalled a
428 428 * poll data completion
429 429 * then wake up the kernel thread sleeping for the delivery
430 430 */
431 431 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT entered\n"))
432 432 if (srn.srn_fault[clone]) {
433 433 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT clone %d fault "
434 434 "cleared\n", clone))
435 435 srn.srn_fault[clone] = 0;
436 436 }
437 437 mutex_enter(&srn_clone_lock);
438 438 if (srn_poll_cnt[clone] == 0) {
439 439 mutex_exit(&srn_clone_lock);
440 440 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT clone %d "
441 441 "EWOULDBLOCK\n", clone))
442 442 return (EWOULDBLOCK);
443 443 }
444 444 ASSERT(srn.srn_pending[clone].ae_type);
445 445 if (ddi_copyout(&srn.srn_pending[clone], (void *)arg,
446 446 sizeof (srn_event_info_t), mode) != 0) {
447 447 mutex_exit(&srn_clone_lock);
448 448 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT clone %d EFAULT\n",
449 449 clone))
450 450 return (EFAULT);
451 451 }
452 452 if (srn.srn_type[clone] == SRN_TYPE_APM)
453 453 srn.srn_delivered[clone] =
454 454 srn.srn_pending[clone].ae_type;
455 455 PMD(PMD_SX, ("SRN_IOC_NEXTEVENT clone %d delivered %x\n",
456 456 clone, srn.srn_pending[clone].ae_type))
457 457 srn_poll_cnt[clone] = 0;
458 458 mutex_exit(&srn_clone_lock);
459 459 return (0);
460 460
461 461 case SRN_IOC_SUSPEND:
462 462 /* ack suspend */
463 463 PMD(PMD_SX, ("SRN_IOC_SUSPEND entered clone %d\n", clone))
464 464 if (srn.srn_fault[clone]) {
465 465 PMD(PMD_SX, ("SRN_IOC_SUSPEND clone %d fault "
466 466 "cleared\n", clone))
467 467 srn.srn_fault[clone] = 0;
468 468 }
469 469 mutex_enter(&srn_clone_lock);
470 470 if (srn.srn_delivered[clone] != SRN_SUSPEND_REQ) {
471 471 mutex_exit(&srn_clone_lock);
472 472 PMD(PMD_SX, ("SRN_IOC_SUSPEND EINVAL\n"))
473 473 return (EINVAL);
474 474 }
475 475 srn.srn_delivered[clone] = 0;
476 476 srn.srn_pending[clone].ae_type = 0;
477 477 /* notify the kernel suspend thread to continue */
478 478 PMD(PMD_SX, ("SRN_IOC_SUSPEND clone %d ok\n", clone))
479 479 cv_signal(&srn_clones_cv[clone]);
480 480 mutex_exit(&srn_clone_lock);
481 481 return (0);
482 482
483 483 case SRN_IOC_RESUME:
484 484 /* ack resume */
485 485 PMD(PMD_SX, ("SRN_IOC_RESUME entered clone %d\n", clone))
486 486 if (srn.srn_fault[clone]) {
487 487 PMD(PMD_SX, ("SRN_IOC_RESUME clone %d fault "
488 488 "cleared\n", clone))
489 489 srn.srn_fault[clone] = 0;
490 490 }
491 491 mutex_enter(&srn_clone_lock);
492 492 if (srn.srn_delivered[clone] != SRN_NORMAL_RESUME) {
493 493 mutex_exit(&srn_clone_lock);
494 494 PMD(PMD_SX, ("SRN_IOC_RESUME EINVAL\n"))
495 495 return (EINVAL);
496 496 }
497 497 srn.srn_delivered[clone] = 0;
498 498 srn.srn_pending[clone].ae_type = 0;
499 499 /* notify the kernel resume thread to continue */
500 500 PMD(PMD_SX, ("SRN_IOC_RESUME ok for clone %d\n", clone))
501 501 cv_signal(&srn_clones_cv[clone]);
502 502 mutex_exit(&srn_clone_lock);
503 503 return (0);
504 504
505 505 default:
506 506 PMD(PMD_SX, ("srn_ioctl unknown cmd EINVAL\n"))
507 507 return (EINVAL);
508 508 }
509 509 }
510 510 /*
511 511 * A very simple handshake with the srn driver,
512 512 * only one outstanding event at a time.
513 513 * The OS delivers the event and depending on type,
514 514 * either blocks waiting for the ack, or drives on
515 515 */
516 516 void
517 517 srn_notify(int type, int event)
518 518 {
519 519 int clone, count;
520 520 PMD(PMD_SX, ("srn_notify entered with type %d, event 0x%x\n",
521 521 type, event));
522 522 ASSERT(mutex_owned(&srn_clone_lock));
523 523 switch (type) {
524 524 case SRN_TYPE_APM:
525 525 if (srn_apm_count == 0) {
526 526 PMD(PMD_SX, ("no apm types\n"))
527 527 return;
528 528 }
529 529 count = srn_apm_count;
530 530 break;
531 531 case SRN_TYPE_AUTOSX:
532 532 if (srn_autosx_count == 0) {
533 533 PMD(PMD_SX, ("no autosx types\n"))
534 534 return;
535 535 }
536 536 count = srn_autosx_count;
537 537 break;
538 538 default:
539 539 ASSERT(0);
540 540 break;
541 541 }
542 542 ASSERT(count > 0);
543 543 PMD(PMD_SX, ("count %d\n", count))
544 544 for (clone = 0; clone < SRN_MAX_CLONE; clone++) {
545 545 if (srn.srn_type[clone] == type) {
546 546 #ifdef DEBUG
547 547 if (type == SRN_TYPE_APM && !srn.srn_fault[clone]) {
548 548 ASSERT(srn.srn_pending[clone].ae_type == 0);
549 549 ASSERT(srn_poll_cnt[clone] == 0);
550 550 ASSERT(srn.srn_delivered[clone] == 0);
551 551 }
552 552 #endif
553 553 srn.srn_pending[clone].ae_type = event;
554 554 srn_poll_cnt[clone] = 1;
555 555 PMD(PMD_SX, ("pollwake %d\n", clone))
556 556 pollwakeup(&srn_pollhead[clone], (POLLRDNORM | POLLIN));
557 557 count--;
558 558 if (count == 0)
559 559 break;
560 560 }
561 561 }
562 562 if (type == SRN_TYPE_AUTOSX) { /* we don't wait */
563 563 PMD(PMD_SX, ("Not waiting for AUTOSX ack\n"))
564 564 return;
565 565 }
566 566 ASSERT(type == SRN_TYPE_APM);
567 567 /* otherwise wait for acks */
568 568 restart:
569 569 /*
570 570 * We wait until all of the pending events are cleared.
571 571 * We have to start over every time we do a cv_wait because
572 572 * we give up the mutex and can be re-entered
573 573 */
574 574 for (clone = 1; clone < SRN_MAX_CLONE; clone++) {
575 575 if (srn.srn_clones[clone] == 0 ||
576 576 srn.srn_type[clone] != SRN_TYPE_APM)
577 577 continue;
578 578 if (srn.srn_pending[clone].ae_type && !srn.srn_fault[clone]) {
579 579 PMD(PMD_SX, ("srn_notify waiting for ack for clone %d, "
580 580 "event %x\n", clone, event))
581 581 if (cv_timedwait(&srn_clones_cv[clone],
582 582 &srn_clone_lock, ddi_get_lbolt() +
583 583 drv_usectohz(srn_timeout * 1000000)) == -1) {
584 584 /*
585 585 * Client didn't respond, mark it as faulted
586 586 * and continue as if a regular signal.
587 587 */
588 588 PMD(PMD_SX, ("srn_notify: clone %d did not "
589 589 "ack event %x\n", clone, event))
590 590 cmn_err(CE_WARN, "srn_notify: clone %d did "
591 591 "not ack event %x\n", clone, event);
592 592 srn.srn_fault[clone] = 1;
593 593 }
594 594 goto restart;
595 595 }
596 596 }
597 597 PMD(PMD_SX, ("srn_notify done with %x\n", event))
598 598 }
↓ open down ↓ |
443 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX