summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMithlesh Thukral <mithlesh@linsyssoft.com>2009-03-20 17:35:58 +0530
committerGreg Kroah-Hartman <gregkh@suse.de>2009-04-03 14:53:13 -0700
commitb9346e0fc5f0761c63a6e26c6436f0d6d645c826 (patch)
treeb45a2aeb8445c767236227da13101ecdb106572d
parent544ed364f4cac1ed6024711132e059c2746325a5 (diff)
Staging: sxg: Read the correct MAC address from the card for Rev B cards
Read the correct MAC address from EEPROM/Flash. Without this fix, all the interfaces were using the same MAC address. This works on Rev B firmware. Signed-off-by: Christopher Harrer <charrer@alacritech.com> Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/sxg/sxg.c19
-rw-r--r--drivers/staging/sxg/sxghw.h9
2 files changed, 12 insertions, 16 deletions
diff --git a/drivers/staging/sxg/sxg.c b/drivers/staging/sxg/sxg.c
index 59b241e8e288..884e56aa9f0f 100644
--- a/drivers/staging/sxg/sxg.c
+++ b/drivers/staging/sxg/sxg.c
@@ -834,14 +834,15 @@ static void sxg_config_pci(struct pci_dev *pcidev)
static inline int sxg_read_config(struct adapter_t *adapter)
{
/* struct sxg_config data; */
+ struct sxg_config *config;
struct sw_cfg_data *data;
dma_addr_t p_addr;
unsigned long status;
unsigned long i;
+ config = pci_alloc_consistent(adapter->pcidev,
+ sizeof(struct sxg_config), &p_addr);
- data = pci_alloc_consistent(adapter->pcidev,
- sizeof(struct sw_cfg_data), &p_addr);
- if(!data) {
+ if(!config) {
/*
* We cant get even this much memory. Raise a hell
* Get out of here
@@ -851,8 +852,12 @@ static inline int sxg_read_config(struct adapter_t *adapter)
return -ENOMEM;
}
+ data = &config->SwCfg;
+
+ /* Initialize (reflective memory) status register */
WRITE_REG(adapter->UcodeRegs[0].ConfigStat, SXG_CFG_TIMEOUT, TRUE);
+ /* Send request to fetch configuration data */
WRITE_REG64(adapter, adapter->UcodeRegs[0].Config, p_addr, 0);
for(i=0; i<1000; i++) {
READ_REG(adapter->UcodeRegs[0].ConfigStat, status);
@@ -866,12 +871,12 @@ static inline int sxg_read_config(struct adapter_t *adapter)
case SXG_CFG_LOAD_EEPROM:
/* Config read from Flash succeeded */
case SXG_CFG_LOAD_FLASH:
- /* Copy the MAC address to adapter structure */
- /* TODO: We are not doing the remaining part : FRU,
- * etc
+ /*
+ * Copy the MAC address to adapter structure
+ * TODO: We are not doing the remaining part : FRU, etc
*/
memcpy(adapter->macaddr, data->MacAddr[0].MacAddr,
- sizeof(struct sxg_config_mac));
+ sizeof(struct sxg_config_mac));
break;
case SXG_CFG_TIMEOUT:
case SXG_CFG_LOAD_INVALID:
diff --git a/drivers/staging/sxg/sxghw.h b/drivers/staging/sxg/sxghw.h
index f59a86acc1c8..81f81d4b0ad0 100644
--- a/drivers/staging/sxg/sxghw.h
+++ b/drivers/staging/sxg/sxghw.h
@@ -944,15 +944,6 @@ struct sxg_config {
struct sw_cfg_data SwCfg;
};
-/* EEPROM/Flash Format (Sahara rev A) */
-struct sxg_config_a {
- /* H/W Section - Read by Sahara hardware (256 bytes) */
- struct hw_cfg_data HwCfg[NUM_HW_CFG_ENTRIES_A];
-
- /* S/W Section - Other configuration data (128 bytes) */
- struct sw_cfg_data SwCfg;
-};
-
#ifdef WINDOWS_COMPILER
/*
* The following macro is something of a kludge, but it is the only way