From patchwork Thu Aug 30 14:52:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shane Huang X-Patchwork-Id: 180805 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0B2D82C0136 for ; Thu, 30 Aug 2012 16:52:55 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752423Ab2H3Gwx (ORCPT ); Thu, 30 Aug 2012 02:52:53 -0400 Received: from va3ehsobe002.messaging.microsoft.com ([216.32.180.12]:54042 "EHLO va3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751526Ab2H3Gwx (ORCPT ); Thu, 30 Aug 2012 02:52:53 -0400 Received: from mail204-va3-R.bigfish.com (10.7.14.243) by VA3EHSOBE003.bigfish.com (10.7.40.23) with Microsoft SMTP Server id 14.1.225.23; Thu, 30 Aug 2012 06:52:52 +0000 Received: from mail204-va3 (localhost [127.0.0.1]) by mail204-va3-R.bigfish.com (Postfix) with ESMTP id 27378B8028E; Thu, 30 Aug 2012 06:52:52 +0000 (UTC) X-Forefront-Antispam-Report: CIP:163.181.249.109; KIP:(null); UIP:(null); IPV:NLI; H:ausb3twp02.amd.com; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VPS0(zzzz1202hzz8275bhz2dh668h839hd24he5bhf0ah107ah) Received: from mail204-va3 (localhost.localdomain [127.0.0.1]) by mail204-va3 (MessageSwitch) id 1346309570166933_31565; Thu, 30 Aug 2012 06:52:50 +0000 (UTC) Received: from VA3EHSMHS036.bigfish.com (unknown [10.7.14.253]) by mail204-va3.bigfish.com (Postfix) with ESMTP id 1C7F2DC0047; Thu, 30 Aug 2012 06:52:50 +0000 (UTC) Received: from ausb3twp02.amd.com (163.181.249.109) by VA3EHSMHS036.bigfish.com (10.7.99.46) with Microsoft SMTP Server id 14.1.225.23; Thu, 30 Aug 2012 06:52:49 +0000 X-WSS-ID: 0M9K33Y-02-6PB-02 X-M-MSG: Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com [163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp02.amd.com (Axway MailGate 3.8.1) with ESMTP id 2CBBCFCC003; Thu, 30 Aug 2012 01:52:45 -0500 (CDT) Received: from sausexhtp02.amd.com (163.181.3.152) by sausexedgep02.amd.com (163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 30 Aug 2012 01:53:03 -0500 Received: from sausexmb1.amd.com (163.181.3.156) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server id 8.3.213.0; Thu, 30 Aug 2012 01:52:47 -0500 Received: from sshaexmb1.amd.com ([10.237.2.11]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 30 Aug 2012 01:52:47 -0500 Received: from shane-PUMORI.amd.com ([10.237.72.220]) by sshaexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 30 Aug 2012 14:52:43 +0800 From: Shane Huang To: Jeff Garzik CC: , Aaron Lu , Shane Huang Subject: [PATCH v3 1/2] ata: define enum constants for IDENTIFY DEVICE Date: Thu, 30 Aug 2012 22:52:42 +0800 Message-ID: <1346338362-2266-1-git-send-email-shane.huang@amd.com> X-Mailer: git-send-email 1.7.9.5 X-OriginalArrivalTime: 30 Aug 2012 06:52:43.0555 (UTC) FILETIME=[0E2D9F30:01CD867C] MIME-Version: 1.0 X-OriginatorOrg: amd.com Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org Define enumeration constants for IDENTIFY DEVICE words. Signed-off-by: Shane Huang --- include/linux/ata.h | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/include/linux/ata.h b/include/linux/ata.h index 5713d3a..47a9dbf 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h @@ -77,6 +77,9 @@ enum { ATA_ID_EIDE_PIO_IORDY = 68, ATA_ID_ADDITIONAL_SUPP = 69, ATA_ID_QUEUE_DEPTH = 75, + ATA_ID_SATA_CAPABILITY = 76, + ATA_ID_SATA_CAPABILITY_2 = 77, + ATA_ID_FEATURE_SUPP = 78, ATA_ID_MAJOR_VER = 80, ATA_ID_COMMAND_SET_1 = 82, ATA_ID_COMMAND_SET_2 = 83, @@ -558,15 +561,17 @@ static inline int ata_is_data(u8 prot) #define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0) #define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9)) #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) -#define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) +#define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8)) #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) #define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) #define ata_id_has_atapi_AN(id) \ - ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ - ((id)[78] & (1 << 5)) ) + ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ + ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ + ((id)[ATA_ID_FEATURE_SUPP] & (1 << 5))) #define ata_id_has_fpdma_aa(id) \ - ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ - ((id)[78] & (1 << 2)) ) + ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ + ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \ + ((id)[ATA_ID_FEATURE_SUPP] & (1 << 2))) #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) #define ata_id_u32(id,n) \ @@ -578,11 +583,11 @@ static inline int ata_is_data(u8 prot) ((u64) (id)[(n) + 0]) ) #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) -#define ata_id_has_da(id) ((id)[77] & (1 << 4)) +#define ata_id_has_da(id) ((id)[ATA_ID_SATA_CAPABILITY_2] & (1 << 4)) static inline bool ata_id_has_hipm(const u16 *id) { - u16 val = id[76]; + u16 val = id[ATA_ID_SATA_CAPABILITY]; if (val == 0 || val == 0xffff) return false; @@ -592,7 +597,7 @@ static inline bool ata_id_has_hipm(const u16 *id) static inline bool ata_id_has_dipm(const u16 *id) { - u16 val = id[78]; + u16 val = id[ATA_ID_FEATURE_SUPP]; if (val == 0 || val == 0xffff) return false;