From owner-p4-projects@FreeBSD.ORG Mon Jul 27 21:52:38 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 66FA910656FE; Mon, 27 Jul 2009 21:52:38 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22A8010656FC for ; Mon, 27 Jul 2009 21:52:38 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 110478FC12 for ; Mon, 27 Jul 2009 21:52:38 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n6RLqbiZ047674 for ; Mon, 27 Jul 2009 21:52:37 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n6RLqbnx047672 for perforce@freebsd.org; Mon, 27 Jul 2009 21:52:37 GMT (envelope-from mav@freebsd.org) Date: Mon, 27 Jul 2009 21:52:37 GMT Message-Id: <200907272152.n6RLqbnx047672@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Cc: Subject: PERFORCE change 166655 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jul 2009 21:52:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=166655 Change 166655 by mav@mav_mavbook on 2009/07/27 21:51:51 Add SNTF support. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#47 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#47 (text+ko) ==== @@ -848,6 +848,31 @@ } static void +ahci_notify_events(device_t dev) +{ + struct ahci_channel *ch = device_get_softc(dev); + struct cam_path *dpath; + u_int32_t status; + int i; + + status = ATA_INL(ch->r_mem, AHCI_P_SNTF); + if (status == 0) + return; + ATA_OUTL(ch->r_mem, AHCI_P_SNTF, status); + if (bootverbose) + device_printf(dev, "SNTF 0x%04x\n", status); + for (i = 0; i < 16; i++) { + if ((status & (1 << i)) == 0) + continue; + if (xpt_create_path(&dpath, NULL, + xpt_path_path_id(ch->path), i, 0) == CAM_REQ_CMP) { + xpt_async(AC_SCSI_AEN, dpath, NULL); + xpt_free_path(dpath); + } + } +} + +static void ahci_ch_intr_locked(void *data) { device_t dev = (device_t)data; @@ -936,6 +961,9 @@ if (ncq_err) ahci_issue_read_log(dev); } + /* Process NOTIFY events */ + if ((istatus & AHCI_P_IX_SDB) && (ch->caps & AHCI_CAP_SSNTF)) + ahci_notify_events(dev); } /* Must be called with channel locked. */