From owner-freebsd-hardware Mon Apr 1 13:11:39 1996 Return-Path: owner-hardware Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA29139 for hardware-outgoing; Mon, 1 Apr 1996 13:11:39 -0800 (PST) Received: from lserver.infoworld.com (lserver.infoworld.com [192.216.48.4]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id NAA29107 for ; Mon, 1 Apr 1996 13:11:33 -0800 (PST) Received: from ccgate.infoworld.com by lserver.infoworld.com with smtp (Smail3.1.29.1 #12) id m0u3rEv-000wu6C; Mon, 1 Apr 96 13:34 PST Received: from cc:Mail by ccgate.infoworld.com id AA828393031; Mon, 01 Apr 96 13:44:39 PST Date: Mon, 01 Apr 96 13:44:39 PST From: "Brett Glass" Message-Id: <9603018283.AA828393031@ccgate.infoworld.com> To: freebsd-hardware@freebsd.org Subject: Diffs, created using -c option this time Sender: owner-hardware@freebsd.org X-Loop: FreeBSD.org Precedence: bulk At the request of Garrett Wollman, I'm sending the diffs again -- this time, using diff -c. Note that x.y.orig is the original source, and x.y is the new source. --Brett *** wd.c.orig Sun Mar 31 21:21:00 1996 --- wd.c Mon Apr 1 00:36:01 1996 *************** *** 103,108 **** --- 103,114 ---- #define WDOPT_SLEEPHACK 0x4000 #define WDOPT_MULTIMASK 0x00ff + #define WDOPT_NO_IDLE_0 0x0100 /* Flags added by Brett Glass to shut off */ + #define WDOPT_NO_IDLE_1 0x0200 /* inactivity timeout on some IDE drives, */ + /* such as ST5660A. On each interface, */ + /* 0x0100 and 0x0200 are for master and */ + /* slave, respectively. */ + static int wd_goaway(struct kern_devconf *, int); static int wdc_goaway(struct kern_devconf *, int); static int wd_externalize(struct proc *, struct kern_devconf *, void *, size_t); *************** *** 227,232 **** --- 233,240 ---- #define DKFL_32BIT 0x00100 /* use 32-bit i/o mode */ #define DKFL_MULTI 0x00200 /* use multi-i/o mode */ #define DKFL_BADSCAN 0x00400 /* report all errors */ + #define DKFL_NO_IDLE 0x00800 /* disk has had inactivity timer + turned off -BG */ struct wdparams dk_params; /* ESDI/IDE drive/controller parameters */ int dk_dkunit; /* disk stats unit number */ int dk_multi; /* multi transfers */ *************** *** 441,446 **** --- 449,456 ---- printf(", multi-block-%d", du->dk_multi); if (du->cfg_flags & WDOPT_SLEEPHACK) printf(", sleep-hack"); + if (du->dk_flags & DKFL_NO_IDLE) + printf(", inactivity timer disabled"); printf("\n"); if (du->dk_params.wdp_heads == 0) printf("wd%d: size unknown, using %s values\n", *************** *** 1608,1613 **** --- 1618,1636 ---- } } else { du->dk_multi = 1; + } + + /* If this drive should have its inactivity timer turned off, issue + the command to do it. If the command succeeds, then set a flag + in the disk's struct so that this can be displayed. -BG */ + + du->dk_flags &= ~DKFL_NO_IDLE; /* Assume command will fail */ + + /* Shift WDOPT_NO_IDLE_0 left if unit 1 to get WDOPT_NO_IDLE_1*/ + if (flags & (WDOPT_NO_IDLE_0 << (du->dk_unit))) { + if (wdcommand(du, 0, 0, 0, 0, WDCC_IDLEMODE) == 0) { + du->dk_flags |= DKFL_NO_IDLE; + } } #ifdef NOTYET ------------------ Cut here ---------------- *** wdreg.h.orig Sun Mar 31 21:20:52 1996 --- wdreg.h Sun Mar 31 21:24:42 1996 *************** *** 97,102 **** --- 97,105 ---- #define WDCC_EXTDCMD 0xE0 /* send extended command */ #define WDCC_READP 0xEC /* read parameters from controller */ #define WDCC_FEATURES 0xEF /* features control */ + /* Following constant added by Brett Glass for the command that + disables/enables "green" mode on drives such as the Seagate ST5660A */ + #define WDCC_IDLEMODE 0xFB /* configure active/idle mode -BG*/ #define WDFEA_RCACHE 0xAA /* read cache enable */ #define WDFEA_WCACHE 0x02 /* write cache enable */