Commit 38651683 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Kalle Valo

rt2x00: convert rt2x00_eeprom_read return type

This is a semi-automated conversion to change rt2x00_eeprom_read()
to return the register contents instead of passing them by value,
resulting in much better object code. The majority of the patch
was done using:

sed -i 's:\(\<rt2x00_eeprom_read\>(.*, .*\), &\(.*\));:\2 = \1);:' \
   -i 's:= _\(rt2x00_eeprom_read\):= \1:' drivers/net/wireless/ralink/rt2x00/*
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 5fbbe378
...@@ -178,7 +178,7 @@ static const struct rt2x00debug rt2400pci_rt2x00debug = { ...@@ -178,7 +178,7 @@ static const struct rt2x00debug rt2400pci_rt2x00debug = {
.word_count = CSR_REG_SIZE / sizeof(u32), .word_count = CSR_REG_SIZE / sizeof(u32),
}, },
.eeprom = { .eeprom = {
.read = _rt2x00_eeprom_read, .read = rt2x00_eeprom_read,
.write = rt2x00_eeprom_write, .write = rt2x00_eeprom_write,
.word_base = EEPROM_BASE, .word_base = EEPROM_BASE,
.word_size = sizeof(u16), .word_size = sizeof(u16),
...@@ -950,7 +950,7 @@ static int rt2400pci_init_bbp(struct rt2x00_dev *rt2x00dev) ...@@ -950,7 +950,7 @@ static int rt2400pci_init_bbp(struct rt2x00_dev *rt2x00dev)
rt2400pci_bbp_write(rt2x00dev, 31, 0x00); rt2400pci_bbp_write(rt2x00dev, 31, 0x00);
for (i = 0; i < EEPROM_BBP_SIZE; i++) { for (i = 0; i < EEPROM_BBP_SIZE; i++) {
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i);
if (eeprom != 0xffff && eeprom != 0x0000) { if (eeprom != 0xffff && eeprom != 0x0000) {
reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID); reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID);
...@@ -1464,7 +1464,7 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1464,7 +1464,7 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
rt2x00lib_set_mac_address(rt2x00dev, mac); rt2x00lib_set_mac_address(rt2x00dev, mac);
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_err(rt2x00dev, "Invalid EEPROM data detected\n"); rt2x00_err(rt2x00dev, "Invalid EEPROM data detected\n");
return -EINVAL; return -EINVAL;
...@@ -1482,7 +1482,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1482,7 +1482,7 @@ static int rt2400pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read EEPROM word for configuration. * Read EEPROM word for configuration.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
/* /*
* Identify RF chipset. * Identify RF chipset.
......
...@@ -178,7 +178,7 @@ static const struct rt2x00debug rt2500pci_rt2x00debug = { ...@@ -178,7 +178,7 @@ static const struct rt2x00debug rt2500pci_rt2x00debug = {
.word_count = CSR_REG_SIZE / sizeof(u32), .word_count = CSR_REG_SIZE / sizeof(u32),
}, },
.eeprom = { .eeprom = {
.read = _rt2x00_eeprom_read, .read = rt2x00_eeprom_read,
.write = rt2x00_eeprom_write, .write = rt2x00_eeprom_write,
.word_base = EEPROM_BASE, .word_base = EEPROM_BASE,
.word_size = sizeof(u16), .word_size = sizeof(u16),
...@@ -1104,7 +1104,7 @@ static int rt2500pci_init_bbp(struct rt2x00_dev *rt2x00dev) ...@@ -1104,7 +1104,7 @@ static int rt2500pci_init_bbp(struct rt2x00_dev *rt2x00dev)
rt2500pci_bbp_write(rt2x00dev, 62, 0x10); rt2500pci_bbp_write(rt2x00dev, 62, 0x10);
for (i = 0; i < EEPROM_BBP_SIZE; i++) { for (i = 0; i < EEPROM_BBP_SIZE; i++) {
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i);
if (eeprom != 0xffff && eeprom != 0x0000) { if (eeprom != 0xffff && eeprom != 0x0000) {
reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID); reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID);
...@@ -1590,7 +1590,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1590,7 +1590,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
rt2x00lib_set_mac_address(rt2x00dev, mac); rt2x00lib_set_mac_address(rt2x00dev, mac);
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2); rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2);
rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT, rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT,
...@@ -1606,7 +1606,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1606,7 +1606,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0); rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0);
rt2x00_set_field16(&word, EEPROM_NIC_DYN_BBP_TUNE, 0); rt2x00_set_field16(&word, EEPROM_NIC_DYN_BBP_TUNE, 0);
...@@ -1615,7 +1615,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1615,7 +1615,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "NIC: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "NIC: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_CALIBRATE_OFFSET_RSSI, rt2x00_set_field16(&word, EEPROM_CALIBRATE_OFFSET_RSSI,
DEFAULT_RSSI_OFFSET); DEFAULT_RSSI_OFFSET);
...@@ -1636,7 +1636,7 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1636,7 +1636,7 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read EEPROM word for configuration. * Read EEPROM word for configuration.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
/* /*
* Identify RF chipset. * Identify RF chipset.
...@@ -1692,14 +1692,14 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1692,14 +1692,14 @@ static int rt2500pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Check if the BBP tuning should be enabled. * Check if the BBP tuning should be enabled.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC);
if (!rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE)) if (!rt2x00_get_field16(eeprom, EEPROM_NIC_DYN_BBP_TUNE))
__set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags); __set_bit(CAPABILITY_LINK_TUNING, &rt2x00dev->cap_flags);
/* /*
* Read the RSSI <-> dBm offset information. * Read the RSSI <-> dBm offset information.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET);
rt2x00dev->rssi_offset = rt2x00dev->rssi_offset =
rt2x00_get_field16(eeprom, EEPROM_CALIBRATE_OFFSET_RSSI); rt2x00_get_field16(eeprom, EEPROM_CALIBRATE_OFFSET_RSSI);
......
...@@ -241,7 +241,7 @@ static const struct rt2x00debug rt2500usb_rt2x00debug = { ...@@ -241,7 +241,7 @@ static const struct rt2x00debug rt2500usb_rt2x00debug = {
.word_count = CSR_REG_SIZE / sizeof(u16), .word_count = CSR_REG_SIZE / sizeof(u16),
}, },
.eeprom = { .eeprom = {
.read = _rt2x00_eeprom_read, .read = rt2x00_eeprom_read,
.write = rt2x00_eeprom_write, .write = rt2x00_eeprom_write,
.word_base = EEPROM_BASE, .word_base = EEPROM_BASE,
.word_size = sizeof(u16), .word_size = sizeof(u16),
...@@ -703,19 +703,19 @@ static void rt2500usb_reset_tuner(struct rt2x00_dev *rt2x00dev, ...@@ -703,19 +703,19 @@ static void rt2500usb_reset_tuner(struct rt2x00_dev *rt2x00dev,
u16 eeprom; u16 eeprom;
u16 value; u16 value;
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R24, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R24);
value = rt2x00_get_field16(eeprom, EEPROM_BBPTUNE_R24_LOW); value = rt2x00_get_field16(eeprom, EEPROM_BBPTUNE_R24_LOW);
rt2500usb_bbp_write(rt2x00dev, 24, value); rt2500usb_bbp_write(rt2x00dev, 24, value);
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R25, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R25);
value = rt2x00_get_field16(eeprom, EEPROM_BBPTUNE_R25_LOW); value = rt2x00_get_field16(eeprom, EEPROM_BBPTUNE_R25_LOW);
rt2500usb_bbp_write(rt2x00dev, 25, value); rt2500usb_bbp_write(rt2x00dev, 25, value);
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R61, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R61);
value = rt2x00_get_field16(eeprom, EEPROM_BBPTUNE_R61_LOW); value = rt2x00_get_field16(eeprom, EEPROM_BBPTUNE_R61_LOW);
rt2500usb_bbp_write(rt2x00dev, 61, value); rt2500usb_bbp_write(rt2x00dev, 61, value);
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_VGC, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_VGC);
value = rt2x00_get_field16(eeprom, EEPROM_BBPTUNE_VGCUPPER); value = rt2x00_get_field16(eeprom, EEPROM_BBPTUNE_VGCUPPER);
rt2500usb_bbp_write(rt2x00dev, 17, value); rt2500usb_bbp_write(rt2x00dev, 17, value);
...@@ -949,7 +949,7 @@ static int rt2500usb_init_bbp(struct rt2x00_dev *rt2x00dev) ...@@ -949,7 +949,7 @@ static int rt2500usb_init_bbp(struct rt2x00_dev *rt2x00dev)
rt2500usb_bbp_write(rt2x00dev, 75, 0xff); rt2500usb_bbp_write(rt2x00dev, 75, 0xff);
for (i = 0; i < EEPROM_BBP_SIZE; i++) { for (i = 0; i < EEPROM_BBP_SIZE; i++) {
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i);
if (eeprom != 0xffff && eeprom != 0x0000) { if (eeprom != 0xffff && eeprom != 0x0000) {
reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID); reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID);
...@@ -1339,7 +1339,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1339,7 +1339,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
rt2x00lib_set_mac_address(rt2x00dev, mac); rt2x00lib_set_mac_address(rt2x00dev, mac);
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2); rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2);
rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT, rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT,
...@@ -1355,7 +1355,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1355,7 +1355,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0); rt2x00_set_field16(&word, EEPROM_NIC_CARDBUS_ACCEL, 0);
rt2x00_set_field16(&word, EEPROM_NIC_DYN_BBP_TUNE, 0); rt2x00_set_field16(&word, EEPROM_NIC_DYN_BBP_TUNE, 0);
...@@ -1364,7 +1364,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1364,7 +1364,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "NIC: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "NIC: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_CALIBRATE_OFFSET_RSSI, rt2x00_set_field16(&word, EEPROM_CALIBRATE_OFFSET_RSSI,
DEFAULT_RSSI_OFFSET); DEFAULT_RSSI_OFFSET);
...@@ -1373,7 +1373,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1373,7 +1373,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
word); word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_BBPTUNE_THRESHOLD, 45); rt2x00_set_field16(&word, EEPROM_BBPTUNE_THRESHOLD, 45);
rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE, word); rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE, word);
...@@ -1387,7 +1387,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1387,7 +1387,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
bbp = rt2500usb_bbp_read(rt2x00dev, 17); bbp = rt2500usb_bbp_read(rt2x00dev, 17);
bbp -= 6; bbp -= 6;
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_VGC, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_VGC);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCUPPER, 0x40); rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCUPPER, 0x40);
rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp); rt2x00_set_field16(&word, EEPROM_BBPTUNE_VGCLOWER, bbp);
...@@ -1398,7 +1398,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1398,7 +1398,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word); rt2x00_eeprom_write(rt2x00dev, EEPROM_BBPTUNE_VGC, word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R17, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R17);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_BBPTUNE_R17_LOW, 0x48); rt2x00_set_field16(&word, EEPROM_BBPTUNE_R17_LOW, 0x48);
rt2x00_set_field16(&word, EEPROM_BBPTUNE_R17_HIGH, 0x41); rt2x00_set_field16(&word, EEPROM_BBPTUNE_R17_HIGH, 0x41);
...@@ -1406,7 +1406,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1406,7 +1406,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "BBPtune r17: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "BBPtune r17: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R24, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R24);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_BBPTUNE_R24_LOW, 0x40); rt2x00_set_field16(&word, EEPROM_BBPTUNE_R24_LOW, 0x40);
rt2x00_set_field16(&word, EEPROM_BBPTUNE_R24_HIGH, 0x80); rt2x00_set_field16(&word, EEPROM_BBPTUNE_R24_HIGH, 0x80);
...@@ -1414,7 +1414,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1414,7 +1414,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "BBPtune r24: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "BBPtune r24: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R25, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R25);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_BBPTUNE_R25_LOW, 0x40); rt2x00_set_field16(&word, EEPROM_BBPTUNE_R25_LOW, 0x40);
rt2x00_set_field16(&word, EEPROM_BBPTUNE_R25_HIGH, 0x50); rt2x00_set_field16(&word, EEPROM_BBPTUNE_R25_HIGH, 0x50);
...@@ -1422,7 +1422,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1422,7 +1422,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "BBPtune r25: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "BBPtune r25: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R61, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBPTUNE_R61);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_BBPTUNE_R61_LOW, 0x60); rt2x00_set_field16(&word, EEPROM_BBPTUNE_R61_LOW, 0x60);
rt2x00_set_field16(&word, EEPROM_BBPTUNE_R61_HIGH, 0x6d); rt2x00_set_field16(&word, EEPROM_BBPTUNE_R61_HIGH, 0x6d);
...@@ -1442,7 +1442,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1442,7 +1442,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read EEPROM word for configuration. * Read EEPROM word for configuration.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
/* /*
* Identify RF chipset. * Identify RF chipset.
...@@ -1508,7 +1508,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1508,7 +1508,7 @@ static int rt2500usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read the RSSI <-> dBm offset information. * Read the RSSI <-> dBm offset information.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_CALIBRATE_OFFSET);
rt2x00dev->rssi_offset = rt2x00dev->rssi_offset =
rt2x00_get_field16(eeprom, EEPROM_CALIBRATE_OFFSET_RSSI); rt2x00_get_field16(eeprom, EEPROM_CALIBRATE_OFFSET_RSSI);
......
...@@ -416,7 +416,7 @@ static void rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev, ...@@ -416,7 +416,7 @@ static void rt2800_eeprom_read(struct rt2x00_dev *rt2x00dev,
unsigned int index; unsigned int index;
index = rt2800_eeprom_word_index(rt2x00dev, word); index = rt2800_eeprom_word_index(rt2x00dev, word);
rt2x00_eeprom_read(rt2x00dev, index, data); *data = rt2x00_eeprom_read(rt2x00dev, index);
} }
static void rt2800_eeprom_write(struct rt2x00_dev *rt2x00dev, static void rt2800_eeprom_write(struct rt2x00_dev *rt2x00dev,
...@@ -436,7 +436,7 @@ static void rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev, ...@@ -436,7 +436,7 @@ static void rt2800_eeprom_read_from_array(struct rt2x00_dev *rt2x00dev,
unsigned int index; unsigned int index;
index = rt2800_eeprom_word_index(rt2x00dev, array); index = rt2800_eeprom_word_index(rt2x00dev, array);
rt2x00_eeprom_read(rt2x00dev, index + offset, data); *data = rt2x00_eeprom_read(rt2x00dev, index + offset);
} }
static int rt2800_enable_wlan_rt3290(struct rt2x00_dev *rt2x00dev) static int rt2800_enable_wlan_rt3290(struct rt2x00_dev *rt2x00dev)
...@@ -1244,7 +1244,7 @@ const struct rt2x00debug rt2800_rt2x00debug = { ...@@ -1244,7 +1244,7 @@ const struct rt2x00debug rt2800_rt2x00debug = {
/* NOTE: The local EEPROM access functions can't /* NOTE: The local EEPROM access functions can't
* be used here, use the generic versions instead. * be used here, use the generic versions instead.
*/ */
.read = _rt2x00_eeprom_read, .read = rt2x00_eeprom_read,
.write = rt2x00_eeprom_write, .write = rt2x00_eeprom_write,
.word_base = EEPROM_BASE, .word_base = EEPROM_BASE,
.word_size = sizeof(u16), .word_size = sizeof(u16),
......
...@@ -1072,13 +1072,7 @@ static inline void *rt2x00_eeprom_addr(struct rt2x00_dev *rt2x00dev, ...@@ -1072,13 +1072,7 @@ static inline void *rt2x00_eeprom_addr(struct rt2x00_dev *rt2x00dev,
return (void *)&rt2x00dev->eeprom[word]; return (void *)&rt2x00dev->eeprom[word];
} }
static inline void rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev, static inline u16 rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev,
const unsigned int word, u16 *data)
{
*data = le16_to_cpu(rt2x00dev->eeprom[word]);
}
static inline u16 _rt2x00_eeprom_read(struct rt2x00_dev *rt2x00dev,
const unsigned int word) const unsigned int word)
{ {
return le16_to_cpu(rt2x00dev->eeprom[word]); return le16_to_cpu(rt2x00dev->eeprom[word]);
......
...@@ -216,7 +216,7 @@ static const struct rt2x00debug rt61pci_rt2x00debug = { ...@@ -216,7 +216,7 @@ static const struct rt2x00debug rt61pci_rt2x00debug = {
.word_count = CSR_REG_SIZE / sizeof(u32), .word_count = CSR_REG_SIZE / sizeof(u32),
}, },
.eeprom = { .eeprom = {
.read = _rt2x00_eeprom_read, .read = rt2x00_eeprom_read,
.write = rt2x00_eeprom_write, .write = rt2x00_eeprom_write,
.word_base = EEPROM_BASE, .word_base = EEPROM_BASE,
.word_size = sizeof(u16), .word_size = sizeof(u16),
...@@ -853,13 +853,13 @@ static void rt61pci_config_lna_gain(struct rt2x00_dev *rt2x00dev, ...@@ -853,13 +853,13 @@ static void rt61pci_config_lna_gain(struct rt2x00_dev *rt2x00dev,
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) if (rt2x00_has_cap_external_lna_bg(rt2x00dev))
lna_gain += 14; lna_gain += 14;
rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG);
lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_BG_1); lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_BG_1);
} else { } else {
if (rt2x00_has_cap_external_lna_a(rt2x00dev)) if (rt2x00_has_cap_external_lna_a(rt2x00dev))
lna_gain += 14; lna_gain += 14;
rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A);
lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_A_1); lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_A_1);
} }
...@@ -1698,7 +1698,7 @@ static int rt61pci_init_bbp(struct rt2x00_dev *rt2x00dev) ...@@ -1698,7 +1698,7 @@ static int rt61pci_init_bbp(struct rt2x00_dev *rt2x00dev)
rt61pci_bbp_write(rt2x00dev, 107, 0x04); rt61pci_bbp_write(rt2x00dev, 107, 0x04);
for (i = 0; i < EEPROM_BBP_SIZE; i++) { for (i = 0; i < EEPROM_BBP_SIZE; i++) {
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i);
if (eeprom != 0xffff && eeprom != 0x0000) { if (eeprom != 0xffff && eeprom != 0x0000) {
reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID); reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID);
...@@ -2417,7 +2417,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2417,7 +2417,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
rt2x00lib_set_mac_address(rt2x00dev, mac); rt2x00lib_set_mac_address(rt2x00dev, mac);
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2); rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2);
rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT, rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT,
...@@ -2432,7 +2432,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2432,7 +2432,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_NIC_ENABLE_DIVERSITY, 0); rt2x00_set_field16(&word, EEPROM_NIC_ENABLE_DIVERSITY, 0);
rt2x00_set_field16(&word, EEPROM_NIC_TX_DIVERSITY, 0); rt2x00_set_field16(&word, EEPROM_NIC_TX_DIVERSITY, 0);
...@@ -2445,7 +2445,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2445,7 +2445,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "NIC: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "NIC: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_LED, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_LED);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_LED_LED_MODE, rt2x00_set_field16(&word, EEPROM_LED_LED_MODE,
LED_MODE_DEFAULT); LED_MODE_DEFAULT);
...@@ -2453,7 +2453,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2453,7 +2453,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "Led: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "Led: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_FREQ_OFFSET, 0); rt2x00_set_field16(&word, EEPROM_FREQ_OFFSET, 0);
rt2x00_set_field16(&word, EEPROM_FREQ_SEQ, 0); rt2x00_set_field16(&word, EEPROM_FREQ_SEQ, 0);
...@@ -2461,7 +2461,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2461,7 +2461,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "Freq: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "Freq: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_BG_1, 0); rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_BG_1, 0);
rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_BG_2, 0); rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_BG_2, 0);
...@@ -2477,7 +2477,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2477,7 +2477,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_write(rt2x00dev, EEPROM_RSSI_OFFSET_BG, word); rt2x00_eeprom_write(rt2x00dev, EEPROM_RSSI_OFFSET_BG, word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_A_1, 0); rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_A_1, 0);
rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_A_2, 0); rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_A_2, 0);
...@@ -2505,7 +2505,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2505,7 +2505,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read EEPROM word for configuration. * Read EEPROM word for configuration.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
/* /*
* Identify RF chipset. * Identify RF chipset.
...@@ -2552,7 +2552,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2552,7 +2552,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read frequency offset and RF programming sequence. * Read frequency offset and RF programming sequence.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ);
if (rt2x00_get_field16(eeprom, EEPROM_FREQ_SEQ)) if (rt2x00_get_field16(eeprom, EEPROM_FREQ_SEQ))
__set_bit(CAPABILITY_RF_SEQUENCE, &rt2x00dev->cap_flags); __set_bit(CAPABILITY_RF_SEQUENCE, &rt2x00dev->cap_flags);
...@@ -2561,7 +2561,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2561,7 +2561,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read external LNA informations. * Read external LNA informations.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC);
if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA_A)) if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA_A))
__set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags); __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags);
...@@ -2592,7 +2592,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -2592,7 +2592,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
* switch to default led mode. * switch to default led mode.
*/ */
#ifdef CONFIG_RT2X00_LIB_LEDS #ifdef CONFIG_RT2X00_LIB_LEDS
rt2x00_eeprom_read(rt2x00dev, EEPROM_LED, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_LED);
value = rt2x00_get_field16(eeprom, EEPROM_LED_LED_MODE); value = rt2x00_get_field16(eeprom, EEPROM_LED_LED_MODE);
rt61pci_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO); rt61pci_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO);
......
...@@ -161,7 +161,7 @@ static const struct rt2x00debug rt73usb_rt2x00debug = { ...@@ -161,7 +161,7 @@ static const struct rt2x00debug rt73usb_rt2x00debug = {
.word_count = CSR_REG_SIZE / sizeof(u32), .word_count = CSR_REG_SIZE / sizeof(u32),
}, },
.eeprom = { .eeprom = {
.read = _rt2x00_eeprom_read, .read = rt2x00_eeprom_read,
.write = rt2x00_eeprom_write, .write = rt2x00_eeprom_write,
.word_base = EEPROM_BASE, .word_base = EEPROM_BASE,
.word_size = sizeof(u16), .word_size = sizeof(u16),
...@@ -743,10 +743,10 @@ static void rt73usb_config_lna_gain(struct rt2x00_dev *rt2x00dev, ...@@ -743,10 +743,10 @@ static void rt73usb_config_lna_gain(struct rt2x00_dev *rt2x00dev,
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) if (rt2x00_has_cap_external_lna_bg(rt2x00dev))
lna_gain += 14; lna_gain += 14;
rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG);
lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_BG_1); lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_BG_1);
} else { } else {
rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A);
lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_A_1); lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_A_1);
} }
...@@ -1346,7 +1346,7 @@ static int rt73usb_init_bbp(struct rt2x00_dev *rt2x00dev) ...@@ -1346,7 +1346,7 @@ static int rt73usb_init_bbp(struct rt2x00_dev *rt2x00dev)
rt73usb_bbp_write(rt2x00dev, 107, 0x04); rt73usb_bbp_write(rt2x00dev, 107, 0x04);
for (i = 0; i < EEPROM_BBP_SIZE; i++) { for (i = 0; i < EEPROM_BBP_SIZE; i++) {
rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_BBP_START + i);
if (eeprom != 0xffff && eeprom != 0x0000) { if (eeprom != 0xffff && eeprom != 0x0000) {
reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID); reg_id = rt2x00_get_field16(eeprom, EEPROM_BBP_REG_ID);
...@@ -1771,7 +1771,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1771,7 +1771,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
rt2x00lib_set_mac_address(rt2x00dev, mac); rt2x00lib_set_mac_address(rt2x00dev, mac);
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2); rt2x00_set_field16(&word, EEPROM_ANTENNA_NUM, 2);
rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT, rt2x00_set_field16(&word, EEPROM_ANTENNA_TX_DEFAULT,
...@@ -1786,14 +1786,14 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1786,14 +1786,14 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "Antenna: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA, 0); rt2x00_set_field16(&word, EEPROM_NIC_EXTERNAL_LNA, 0);
rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC, word); rt2x00_eeprom_write(rt2x00dev, EEPROM_NIC, word);
rt2x00_eeprom_dbg(rt2x00dev, "NIC: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "NIC: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_LED, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_LED);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_LED_POLARITY_RDY_G, 0); rt2x00_set_field16(&word, EEPROM_LED_POLARITY_RDY_G, 0);
rt2x00_set_field16(&word, EEPROM_LED_POLARITY_RDY_A, 0); rt2x00_set_field16(&word, EEPROM_LED_POLARITY_RDY_A, 0);
...@@ -1809,7 +1809,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1809,7 +1809,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "Led: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "Led: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_FREQ_OFFSET, 0); rt2x00_set_field16(&word, EEPROM_FREQ_OFFSET, 0);
rt2x00_set_field16(&word, EEPROM_FREQ_SEQ, 0); rt2x00_set_field16(&word, EEPROM_FREQ_SEQ, 0);
...@@ -1817,7 +1817,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1817,7 +1817,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_dbg(rt2x00dev, "Freq: 0x%04x\n", word); rt2x00_eeprom_dbg(rt2x00dev, "Freq: 0x%04x\n", word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_BG_1, 0); rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_BG_1, 0);
rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_BG_2, 0); rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_BG_2, 0);
...@@ -1833,7 +1833,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1833,7 +1833,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_write(rt2x00dev, EEPROM_RSSI_OFFSET_BG, word); rt2x00_eeprom_write(rt2x00dev, EEPROM_RSSI_OFFSET_BG, word);
} }
rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A, &word); word = rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A);
if (word == 0xffff) { if (word == 0xffff) {
rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_A_1, 0); rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_A_1, 0);
rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_A_2, 0); rt2x00_set_field16(&word, EEPROM_RSSI_OFFSET_A_2, 0);
...@@ -1861,7 +1861,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1861,7 +1861,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read EEPROM word for configuration. * Read EEPROM word for configuration.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA);
/* /*
* Identify RF chipset. * Identify RF chipset.
...@@ -1907,13 +1907,13 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1907,13 +1907,13 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
/* /*
* Read frequency offset. * Read frequency offset.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_FREQ);
rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET); rt2x00dev->freq_offset = rt2x00_get_field16(eeprom, EEPROM_FREQ_OFFSET);
/* /*
* Read external LNA informations. * Read external LNA informations.
*/ */
rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_NIC);
if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA)) { if (rt2x00_get_field16(eeprom, EEPROM_NIC_EXTERNAL_LNA)) {
__set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags); __set_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags);
...@@ -1924,7 +1924,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev) ...@@ -1924,7 +1924,7 @@ static int rt73usb_init_eeprom(struct rt2x00_dev *rt2x00dev)
* Store led settings, for correct led behaviour. * Store led settings, for correct led behaviour.
*/ */
#ifdef CONFIG_RT2X00_LIB_LEDS #ifdef CONFIG_RT2X00_LIB_LEDS
rt2x00_eeprom_read(rt2x00dev, EEPROM_LED, &eeprom); eeprom = rt2x00_eeprom_read(rt2x00dev, EEPROM_LED);
rt73usb_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO); rt73usb_init_led(rt2x00dev, &rt2x00dev->led_radio, LED_TYPE_RADIO);
rt73usb_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); rt73usb_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment