|
@@ -1296,14 +1296,14 @@ void atl1e_hw_set_mac_addr(struct atl1e_hw *hw)
|
1296
|
1296
|
*/
|
1297
|
1297
|
static int atl1e_get_permanent_address(struct atl1e_hw *hw)
|
1298
|
1298
|
{
|
1299
|
|
- u32 addr[2];
|
|
1299
|
+ union {
|
|
1300
|
+ u32 dword[2];
|
|
1301
|
+ u8 byte[8];
|
|
1302
|
+ } hw_addr;
|
1300
|
1303
|
u32 i;
|
1301
|
1304
|
u32 twsi_ctrl_data;
|
1302
|
1305
|
u8 eth_addr[ETH_ALEN];
|
1303
|
1306
|
|
1304
|
|
- /* init */
|
1305
|
|
- addr[0] = addr[1] = 0;
|
1306
|
|
-
|
1307
|
1307
|
if (!atl1e_check_eeprom_exist(hw)) {
|
1308
|
1308
|
/* eeprom exist */
|
1309
|
1309
|
twsi_ctrl_data = AT_READ_REG(hw, REG_TWSI_CTRL);
|
|
@@ -1320,10 +1320,11 @@ static int atl1e_get_permanent_address(struct atl1e_hw *hw)
|
1320
|
1320
|
}
|
1321
|
1321
|
|
1322
|
1322
|
/* maybe MAC-address is from BIOS */
|
1323
|
|
- addr[0] = AT_READ_REG(hw, REG_MAC_STA_ADDR);
|
1324
|
|
- addr[1] = AT_READ_REG(hw, REG_MAC_STA_ADDR + 4);
|
1325
|
|
- *(u32 *) ð_addr[2] = swap32(addr[0]);
|
1326
|
|
- *(u16 *) ð_addr[0] = swap16(*(u16 *)&addr[1]);
|
|
1323
|
+ hw_addr.dword[0] = AT_READ_REG(hw, REG_MAC_STA_ADDR);
|
|
1324
|
+ hw_addr.dword[1] = AT_READ_REG(hw, REG_MAC_STA_ADDR + 4);
|
|
1325
|
+ for (i = 0; i < ETH_ALEN; i++) {
|
|
1326
|
+ eth_addr[ETH_ALEN - i - 1] = hw_addr.byte[i];
|
|
1327
|
+ }
|
1327
|
1328
|
|
1328
|
1329
|
memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
|
1329
|
1330
|
return 0;
|