]> bbs.cooldavid.org Git - net-next-2.6.git/blob - drivers/staging/et131x/et1310_eeprom.h
Staging: et131x: Kill unused error defines
[net-next-2.6.git] / drivers / staging / et131x / et1310_eeprom.h
1 /*
2  * Agere Systems Inc.
3  * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
4  *
5  * Copyright © 2005 Agere Systems Inc.
6  * All rights reserved.
7  *   http://www.agere.com
8  *
9  *------------------------------------------------------------------------------
10  *
11  * et1310_eeprom.h - Defines, structs, enums, prototypes, etc. used for EEPROM
12  *                   access routines
13  *
14  *------------------------------------------------------------------------------
15  *
16  * SOFTWARE LICENSE
17  *
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.
22  *
23  * Copyright © 2005 Agere Systems Inc.
24  * All rights reserved.
25  *
26  * Redistribution and use in source or binary forms, with or without
27  * modifications, are permitted provided that the following conditions are met:
28  *
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
32  *    distribution.
33  *
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.
37  *
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.
41  *
42  * Disclaimer
43  *
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
55  * DAMAGE.
56  *
57  */
58
59 #ifndef __ET1310_EEPROM_H__
60 #define __ET1310_EEPROM_H__
61
62 #include "et1310_address_map.h"
63
64 /*
65  * EEPROM Defines
66  */
67
68 /* LBCIF Register Groups (addressed via 32-bit offsets) */
69 #define LBCIF_DWORD0_GROUP       0xAC
70 #define LBCIF_DWORD1_GROUP       0xB0
71
72 /* LBCIF Registers (addressed via 8-bit offsets) */
73 #define LBCIF_ADDRESS_REGISTER   0xAC
74 #define LBCIF_DATA_REGISTER      0xB0
75 #define LBCIF_CONTROL_REGISTER   0xB1
76 #define LBCIF_STATUS_REGISTER    0xB2
77
78 /* LBCIF Control Register Bits */
79 #define LBCIF_CONTROL_SEQUENTIAL_READ   0x01
80 #define LBCIF_CONTROL_PAGE_WRITE        0x02
81 #define LBCIF_CONTROL_EEPROM_RELOAD     0x08
82 #define LBCIF_CONTROL_TWO_BYTE_ADDR     0x20
83 #define LBCIF_CONTROL_I2C_WRITE         0x40
84 #define LBCIF_CONTROL_LBCIF_ENABLE      0x80
85
86 /* LBCIF Status Register Bits */
87 #define LBCIF_STATUS_PHY_QUEUE_AVAIL    0x01
88 #define LBCIF_STATUS_I2C_IDLE           0x02
89 #define LBCIF_STATUS_ACK_ERROR          0x04
90 #define LBCIF_STATUS_GENERAL_ERROR      0x08
91 #define LBCIF_STATUS_CHECKSUM_ERROR     0x40
92 #define LBCIF_STATUS_EEPROM_PRESENT     0x80
93
94 /* Miscellaneous Constraints */
95 #define MAX_NUM_REGISTER_POLLS          1000
96 #define MAX_NUM_WRITE_RETRIES           2
97
98 /* Forward declaration of the private adapter structure */
99 struct et131x_adapter;
100
101 int et131x_init_eeprom(struct et131x_adapter *etdev);
102
103 #endif /* _ET1310_EEPROM_H_ */