2 -- Copyright (C) 2016-2017 secunet Security Networks AG
4 -- This program is free software; you can redistribute it and/or modify
5 -- it under the terms of the GNU General Public License as published by
6 -- the Free Software Foundation; either version 2 of the License, or
7 -- (at your option) any later version.
9 -- This program is distributed in the hope that it will be useful,
10 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
11 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 -- GNU General Public License for more details.
15 package body HW.DbC.Intel_Quirk
22 Temp8, Op_Offset : Word8;
23 Port_Count, Port_Offset : Natural;
25 Cap_Regs.Read (Op_Offset, Capability_Registers_Length);
26 xCap_Regs.Byte_Offset := 0;
28 Find_Next_xCap (2, Success);
29 exit when not Success;
31 Sup_Protocol_Regs.Byte_Offset := xCap_Regs.Byte_Offset;
32 Sup_Protocol_Regs.Read (Temp8, Revision_Major);
33 if Temp8 = 16#03# then
34 Sup_Protocol_Regs.Read (Temp8, Compatible_Port_Offset);
35 if Temp8 /= 16#00# then
36 Port_Offset := Natural (Temp8 - 1);
38 Sup_Protocol_Regs.Read (Temp8, Compatible_Port_Count);
39 Port_Count := Natural (Temp8);
41 for Idx in Port_Offset .. Port_Offset + Port_Count - 1 loop
42 Port_Regs.Byte_Offset :=
43 Natural (Op_Offset) + 16#400# + Idx * 16#10#;
44 Port_Regs.Read (Temp8, Current_Connect_Status);
45 if Temp8 = 16#00# then
46 Port_Regs.Write (Port_Reset, Word8'(1));
54 end HW.DbC.Intel_Quirk;
56 -- vim: set ts=8 sts=3 sw=3 et: