3 * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
5 * Copyright © 2005 Agere Systems Inc.
9 *------------------------------------------------------------------------------
11 * et1310_mac.h - Defines, structs, enums, prototypes, etc. pertaining to the
14 *------------------------------------------------------------------------------
18 * This software is provided subject to the following terms and conditions,
19 * which you should read carefully before using the software. Using this
20 * software indicates your acceptance of these terms and conditions. If you do
21 * not agree with these terms and conditions, do not use the software.
23 * Copyright © 2005 Agere Systems Inc.
24 * All rights reserved.
26 * Redistribution and use in source or binary forms, with or without
27 * modifications, are permitted provided that the following conditions are met:
29 * . Redistributions of source code must retain the above copyright notice, this
30 * list of conditions and the following Disclaimer as comments in the code as
31 * well as in the documentation and/or other materials provided with the
34 * . Redistributions in binary form must reproduce the above copyright notice,
35 * this list of conditions and the following Disclaimer in the documentation
36 * and/or other materials provided with the distribution.
38 * . Neither the name of Agere Systems Inc. nor the names of the contributors
39 * may be used to endorse or promote products derived from this software
40 * without specific prior written permission.
44 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
45 * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
46 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
47 * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
48 * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
49 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
50 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
51 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
52 * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
53 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
54 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
59 #ifndef _ET1310_MAC_H_
60 #define _ET1310_MAC_H_
63 #include "et1310_address_map.h"
66 #define COUNTER_WRAP_28_BIT 0x10000000
67 #define COUNTER_WRAP_22_BIT 0x400000
68 #define COUNTER_WRAP_16_BIT 0x10000
69 #define COUNTER_WRAP_12_BIT 0x1000
71 #define COUNTER_MASK_28_BIT (COUNTER_WRAP_28_BIT - 1)
72 #define COUNTER_MASK_22_BIT (COUNTER_WRAP_22_BIT - 1)
73 #define COUNTER_MASK_16_BIT (COUNTER_WRAP_16_BIT - 1)
74 #define COUNTER_MASK_12_BIT (COUNTER_WRAP_12_BIT - 1)
76 #define UPDATE_COUNTER(HostCnt, DevCnt) \
77 HostCnt = HostCnt + DevCnt;
79 /* Forward declaration of the private adapter structure */
80 struct et131x_adapter
;
82 void ConfigMACRegs1(struct et131x_adapter
*adapter
);
83 void ConfigMACRegs2(struct et131x_adapter
*adapter
);
84 void ConfigRxMacRegs(struct et131x_adapter
*adapter
);
85 void ConfigTxMacRegs(struct et131x_adapter
*adapter
);
86 void ConfigMacStatRegs(struct et131x_adapter
*adapter
);
87 void ConfigFlowControl(struct et131x_adapter
*adapter
);
88 void UpdateMacStatHostCounters(struct et131x_adapter
*adapter
);
89 void HandleMacStatInterrupt(struct et131x_adapter
*adapter
);
90 void SetupDeviceForMulticast(struct et131x_adapter
*adapter
);
91 void SetupDeviceForUnicast(struct et131x_adapter
*adapter
);
93 #endif /* _ET1310_MAC_H_ */