*** ata-disk.c.orig     Tue Dec 17 12:46:56 2002
--- ata-disk.c  Sat Mar  8 14:50:01 2003
***************
*** 87,95 ****
--- 87,97 ----
  static int ata_dma = 1;
  static int ata_wc = 1;
  static int ata_tags = 0; 
+ static int ata_suspend = 0;
  TUNABLE_INT("hw.ata.ata_dma", &ata_dma);
  TUNABLE_INT("hw.ata.wc", &ata_wc);
  TUNABLE_INT("hw.ata.tags", &ata_tags);
+ TUNABLE_INT("hw.ata.suspend", &ata_suspend);
  static MALLOC_DEFINE(M_AD, "AD driver", "ATA disk driver");
  
  /* sysctl vars */
***************
*** 100,105 ****
--- 102,110 ----
           "ATA disk write caching");
  SYSCTL_INT(_hw_ata, OID_AUTO, tags, CTLFLAG_RD, &ata_tags, 0,
           "ATA disk tagged queuing support");
+ SYSCTL_INT(_hw_ata, OID_AUTO, suspend, CTLFLAG_RD, &ata_suspend, 0,
+          "ATA disk suspend timer (secs)");
+ 
  
  void
  ad_attach(struct ata_device *atadev)
***************
*** 201,206 ****
--- 206,218 ----
            ata_prtdev(atadev, "disabling service interrupt failed\n");
      }
  
+     if ( ata_suspend > 0 ) {
+         /* attempt suspend mode. The drive uses increments of ten seconds */
+         if (ata_command(atadev, 0xe2,
+           0, ata_suspend/10, 0, ATA_WAIT_INTR))
+     printf("ad%d: suspend mode failed\n", adp->lun);
+     }
+ 
      ATA_UNLOCK_CH(atadev->channel);
  
      devstat_add_entry(&adp->stats, "ad", adp->lun, DEV_BSIZE,
***************
*** 888,893 ****
--- 900,912 ----
                    ata_umode(adp->device->param));
      else
        ata_dmainit(atadev, ata_pmode(adp->device->param), -1, -1);
+     if ( ata_suspend > 0 ) {
+       /* attempt suspend mode. The drive uses increments of ten seconds */
+        if (ata_command(atadev, 0xe2,
+            0, ata_suspend/10, 0, ATA_WAIT_READY))
+       printf("ad%d: suspend mode failed\n", adp->lun);
+     }
+ 
  }
  
  void

=====
--Seunghun Lee

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to