2 * Device driver for the SYMBIOS/LSILOGIC 53C8XX and 53C1010 family
3 * of PCI-SCSI IO processors.
5 * Copyright (C) 1999-2001 Gerard Roudier <groudier@free.fr>
7 * This driver is derived from the Linux sym53c8xx driver.
8 * Copyright (C) 1998-2000 Gerard Roudier
10 * The sym53c8xx driver is derived from the ncr53c8xx driver that had been
11 * a port of the FreeBSD ncr driver to Linux-1.2.13.
13 * The original ncr driver has been written for 386bsd and FreeBSD by
14 * Wolfgang Stanglmeier <wolf@cologne.de>
15 * Stefan Esser <se@mi.Uni-Koeln.de>
16 * Copyright (C) 1994 Wolfgang Stanglmeier
18 * Other major contributions:
20 * NVRAM detection and reading.
21 * Copyright (C) 1997 Richard Waltham <dormouse@farsrobt.demon.co.uk>
23 *-----------------------------------------------------------------------------
25 * This program is free software; you can redistribute it and/or modify
26 * it under the terms of the GNU General Public License as published by
27 * the Free Software Foundation; either version 2 of the License, or
28 * (at your option) any later version.
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
35 * You should have received a copy of the GNU General Public License
36 * along with this program; if not, write to the Free Software
37 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
42 #ifdef SYM_OPT_ANNOUNCE_TRANSFER_RATE
44 * Announce transfer rate if anything changed since last announcement.
46 void sym_announce_transfer_rate(struct sym_hcb *np, int target)
48 tcb_p tp = &np->target[target];
50 #define __tprev tp->tinfo.prev
51 #define __tcurr tp->tinfo.curr
53 if (__tprev.options == __tcurr.options &&
54 __tprev.width == __tcurr.width &&
55 __tprev.offset == __tcurr.offset &&
56 !(__tprev.offset && __tprev.period != __tcurr.period))
59 __tprev.options = __tcurr.options;
60 __tprev.width = __tcurr.width;
61 __tprev.offset = __tcurr.offset;
62 __tprev.period = __tcurr.period;
64 if (__tcurr.offset && __tcurr.period) {
65 u_int period, f10, mb10;
68 period = f10 = mb10 = 0;
71 if (__tcurr.period <= 9) {
77 if (__tcurr.period <= 11) {
80 if (__tcurr.period == 11)
83 else if (__tcurr.period < 25) {
85 if (__tcurr.period == 12)
88 else if (__tcurr.period <= 50) {
92 period = 40 * __tcurr.period;
93 f10 = 100000 << (__tcurr.width ? 1 : 0);
94 mb10 = (f10 + period/2) / period;
97 "%s:%d: %s %sSCSI %d.%d MB/s %s%s%s (%d.%d ns, offset %d)\n",
98 sym_name(np), target, scsi, __tcurr.width? "WIDE " : "",
100 (__tcurr.options & PPR_OPT_DT) ? "DT" : "ST",
101 (__tcurr.options & PPR_OPT_IU) ? " IU" : "",
102 (__tcurr.options & PPR_OPT_QAS) ? " QAS" : "",
103 period/10, period%10, __tcurr.offset);
106 printf_info ("%s:%d: %sasynchronous.\n",
107 sym_name(np), target, __tcurr.width? "wide " : "");
111 #endif /* SYM_OPT_ANNOUNCE_TRANSFER_RATE */