Deleted Added
full compact
si.c (182871) si.c (188266)
1/*-
2 * Device driver for Specialix range (SI/XIO) of serial line multiplexors.
3 *
4 * Copyright (C) 1990, 1992, 1998 Specialix International,
5 * Copyright (C) 1993, Andy Rutter <andy@acronym.co.uk>
6 * Copyright (C) 2000, Peter Wemm <peter@netplex.com.au>
7 *
8 * Originally derived from: SunOS 4.x version

--- 19 unchanged lines hidden (view full) ---

28 * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
31 * NO EVENT SHALL THE AUTHORS BE LIABLE.
32 *
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Device driver for Specialix range (SI/XIO) of serial line multiplexors.
3 *
4 * Copyright (C) 1990, 1992, 1998 Specialix International,
5 * Copyright (C) 1993, Andy Rutter <andy@acronym.co.uk>
6 * Copyright (C) 2000, Peter Wemm <peter@netplex.com.au>
7 *
8 * Originally derived from: SunOS 4.x version

--- 19 unchanged lines hidden (view full) ---

28 * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
29 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
31 * NO EVENT SHALL THE AUTHORS BE LIABLE.
32 *
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/dev/si/si.c 182871 2008-09-08 11:41:20Z peter $");
36__FBSDID("$FreeBSD: head/sys/dev/si/si.c 188266 2009-02-07 02:14:27Z wkoszek $");
37
38#ifndef lint
39static const char si_copyright1[] = "@(#) Copyright (C) Specialix International, 1990,1992,1998",
40 si_copyright2[] = "@(#) Copyright (C) Andy Rutter 1993",
41 si_copyright3[] = "@(#) Copyright (C) Peter Wemm 2000";
42#endif /* not lint */
43
44#include "opt_compat.h"

--- 1499 unchanged lines hidden (view full) ---

1544 DPRINT((pp, DBG_PARAM, "sicmd1 old cmd pending (going to tsleep): hi_stat (%s)\n", si_cmdname(ccbp->hi_stat)));
1545 err = tsleep(&pp->sp_state, (PSOCK+1)|PCATCH, "sicmd1", hz/4);
1546 if (err) {
1547 DPRINT((pp, DBG_PARAM, "sicmd1 timeout: hi_stat (%s)\n",
1548 si_cmdname(ccbp->hi_stat)));
1549 /* This is very very bad. The card has crashed. */
1550 /* XXX the driver breaks at this point */
1551 if (err == ETIMEDOUT)
37
38#ifndef lint
39static const char si_copyright1[] = "@(#) Copyright (C) Specialix International, 1990,1992,1998",
40 si_copyright2[] = "@(#) Copyright (C) Andy Rutter 1993",
41 si_copyright3[] = "@(#) Copyright (C) Peter Wemm 2000";
42#endif /* not lint */
43
44#include "opt_compat.h"

--- 1499 unchanged lines hidden (view full) ---

1544 DPRINT((pp, DBG_PARAM, "sicmd1 old cmd pending (going to tsleep): hi_stat (%s)\n", si_cmdname(ccbp->hi_stat)));
1545 err = tsleep(&pp->sp_state, (PSOCK+1)|PCATCH, "sicmd1", hz/4);
1546 if (err) {
1547 DPRINT((pp, DBG_PARAM, "sicmd1 timeout: hi_stat (%s)\n",
1548 si_cmdname(ccbp->hi_stat)));
1549 /* This is very very bad. The card has crashed. */
1550 /* XXX the driver breaks at this point */
1551 if (err == ETIMEDOUT)
1552 printf("%s: tsleep1 timeout. hi_stat %s, sp_pend %s\n", pp->sp_name, si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend));
1552 DPRINT(("%s: tsleep1 timeout. hi_stat %s, sp_pend %s\n", pp->sp_name, si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1553 splx(oldspl);
1554 return;
1555 }
1556 }
1557 /* it should now be in IDLE_{OPEN|CLOSE|BREAK}, or "cmd" */
1558 DPRINT((pp, DBG_PARAM, "sicmd1 now in: hi_stat (%s) sp_pend (%s)\n", si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1559
1560 /* if there was a pending command, cause a state-change wakeup */

--- 20 unchanged lines hidden (view full) ---

1581 while((x = ccbp->hi_stat) != IDLE_OPEN &&
1582 x != IDLE_CLOSE &&
1583 x != IDLE_BREAK) {
1584 DPRINT((pp, DBG_PARAM, "sicmd2 now waiting: hi_stat (%s) sp_pend (%s) (going to tsleep)\n", si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1585 err = tsleep(&pp->sp_state, (PSOCK+1)|PCATCH, "sicmd2", hz);
1586 if (err) {
1587 DPRINT((pp, DBG_PARAM, "sicmd2 tsleep error: hi_stat (%s) sp_pend (%s)\n", si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1588 if (err == ETIMEDOUT) {
1553 splx(oldspl);
1554 return;
1555 }
1556 }
1557 /* it should now be in IDLE_{OPEN|CLOSE|BREAK}, or "cmd" */
1558 DPRINT((pp, DBG_PARAM, "sicmd1 now in: hi_stat (%s) sp_pend (%s)\n", si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1559
1560 /* if there was a pending command, cause a state-change wakeup */

--- 20 unchanged lines hidden (view full) ---

1581 while((x = ccbp->hi_stat) != IDLE_OPEN &&
1582 x != IDLE_CLOSE &&
1583 x != IDLE_BREAK) {
1584 DPRINT((pp, DBG_PARAM, "sicmd2 now waiting: hi_stat (%s) sp_pend (%s) (going to tsleep)\n", si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1585 err = tsleep(&pp->sp_state, (PSOCK+1)|PCATCH, "sicmd2", hz);
1586 if (err) {
1587 DPRINT((pp, DBG_PARAM, "sicmd2 tsleep error: hi_stat (%s) sp_pend (%s)\n", si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1588 if (err == ETIMEDOUT) {
1589 printf("%s: tsleep2 timeout. hi_stat %s, sp_pend %s\n", pp->sp_name, si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend));
1589 DPRINT(("%s: tsleep2 timeout. hi_stat %s, sp_pend %s\n", pp->sp_name, si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1590 }
1591 break;
1592 }
1593 }
1594 }
1595 DPRINT((pp, DBG_PARAM, "sicmd2 finished: hi_stat (%s) sp_pend (%s)\n", si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1596 splx(oldspl);
1597}

--- 54 unchanged lines hidden ---
1590 }
1591 break;
1592 }
1593 }
1594 }
1595 DPRINT((pp, DBG_PARAM, "sicmd2 finished: hi_stat (%s) sp_pend (%s)\n", si_cmdname(ccbp->hi_stat), si_cmdname(pp->sp_pend)));
1596 splx(oldspl);
1597}

--- 54 unchanged lines hidden ---