Staging: et131x: eeprom remove features

We only read eeprom id 0, in byte mode - so the rest can go away

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Alan Cox 2009-08-27 11:01:04 +01:00 committed by Greg Kroah-Hartman
parent c6c9f8cb38
commit 13071fded6
3 changed files with 7 additions and 36 deletions

View File

@ -146,14 +146,10 @@
* @etdev: pointer to our private adapter structure * @etdev: pointer to our private adapter structure
* @addr: the address to write * @addr: the address to write
* @data: the value to write * @data: the value to write
* @eeprom_id: the ID of the EEPROM
* @addrmode: how the EEPROM is to be accessed
* *
* Returns SUCCESS or FAILURE * Returns SUCCESS or FAILURE
*/ */
int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
u8 data, u32 eeprom_id,
u32 addrmode)
{ {
struct pci_dev *pdev = etdev->pdev; struct pci_dev *pdev = etdev->pdev;
int index; int index;
@ -238,9 +234,6 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr,
control = 0; control = 0;
control |= LBCIF_CONTROL_LBCIF_ENABLE | LBCIF_CONTROL_I2C_WRITE; control |= LBCIF_CONTROL_LBCIF_ENABLE | LBCIF_CONTROL_I2C_WRITE;
if (addrmode == DUAL_BYTE)
control |= LBCIF_CONTROL_TWO_BYTE_ADDR;
if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET, if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
control)) { control)) {
return FAILURE; return FAILURE;
@ -249,8 +242,6 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr,
i2c_wack = 1; i2c_wack = 1;
/* Prepare EEPROM address for Step 3 */ /* Prepare EEPROM address for Step 3 */
addr |= (addrmode == DUAL_BYTE) ?
(eeprom_id << 16) : (eeprom_id << 8);
for (retries = 0; retries < MAX_NUM_WRITE_RETRIES; retries++) { for (retries = 0; retries < MAX_NUM_WRITE_RETRIES; retries++) {
/* Step 3:*/ /* Step 3:*/
@ -357,9 +348,7 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr,
* *
* Returns SUCCESS or FAILURE * Returns SUCCESS or FAILURE
*/ */
int EepromReadByte(struct et131x_adapter *etdev, u32 addr, int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
u8 *pdata, u32 eeprom_id,
u32 addrmode)
{ {
struct pci_dev *pdev = etdev->pdev; struct pci_dev *pdev = etdev->pdev;
int index; int index;
@ -427,17 +416,12 @@ int EepromReadByte(struct et131x_adapter *etdev, u32 addr,
control = 0; control = 0;
control |= LBCIF_CONTROL_LBCIF_ENABLE; control |= LBCIF_CONTROL_LBCIF_ENABLE;
if (addrmode == DUAL_BYTE)
control |= LBCIF_CONTROL_TWO_BYTE_ADDR;
if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET, if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
control)) { control)) {
return FAILURE; return FAILURE;
} }
/* Step 3: */ /* Step 3: */
addr |= (addrmode == DUAL_BYTE) ?
(eeprom_id << 16) : (eeprom_id << 8);
if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER_OFFSET, if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER_OFFSET,
addr)) { addr)) {

View File

@ -66,24 +66,12 @@
#define FAILURE 1 #define FAILURE 1
#endif #endif
#ifndef READ
#define READ 0
#define WRITE 1
#endif
#ifndef SINGLE_BYTE
#define SINGLE_BYTE 0
#define DUAL_BYTE 1
#endif
/* Forward declaration of the private adapter structure */ /* Forward declaration of the private adapter structure */
struct et131x_adapter; struct et131x_adapter;
int32_t EepromWriteByte(struct et131x_adapter *adapter, u32 unAddress, int32_t EepromWriteByte(struct et131x_adapter *adapter, u32 unAddress,
u8 bData, u32 unEepromId, u8 bData);
u32 unAddressingMode);
int32_t EepromReadByte(struct et131x_adapter *adapter, u32 unAddress, int32_t EepromReadByte(struct et131x_adapter *adapter, u32 unAddress,
u8 *pbData, u32 unEepromId, u8 *pbData);
u32 unAddressingMode);
#endif /* _ET1310_EEPROM_H_ */ #endif /* _ET1310_EEPROM_H_ */

View File

@ -337,8 +337,7 @@ int et131x_find_adapter(struct et131x_adapter *adapter, struct pci_dev *pdev)
* corruption seen with 1310 B Silicon * corruption seen with 1310 B Silicon
*/ */
for (nLoop = 0; nLoop < 3; nLoop++) { for (nLoop = 0; nLoop < 3; nLoop++) {
EepromWriteByte(adapter, nLoop, temp[nLoop], EepromWriteByte(adapter, nLoop, temp[nLoop]);
0, SINGLE_BYTE);
} }
} }
@ -364,8 +363,8 @@ int et131x_find_adapter(struct et131x_adapter *adapter, struct pci_dev *pdev)
/* Read the EEPROM for information regarding LED behavior. Refer to /* Read the EEPROM for information regarding LED behavior. Refer to
* ET1310_phy.c, et131x_xcvr_init(), for its use. * ET1310_phy.c, et131x_xcvr_init(), for its use.
*/ */
EepromReadByte(adapter, 0x70, &adapter->eepromData[0], 0, SINGLE_BYTE); EepromReadByte(adapter, 0x70, &adapter->eepromData[0]);
EepromReadByte(adapter, 0x71, &adapter->eepromData[1], 0, SINGLE_BYTE); EepromReadByte(adapter, 0x71, &adapter->eepromData[1]);
if (adapter->eepromData[0] != 0xcd) if (adapter->eepromData[0] != 0xcd)
/* Disable all optional features */ /* Disable all optional features */