diff options
author | Alan Cox <alan@linux.intel.com> | 2009-10-06 10:50:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 15:23:08 -0500 |
commit | 308e93e0a36676f22060b3a4cf0135497b32e9f2 (patch) | |
tree | 5e51248ecd30737ccee10d3cf035086525223c65 /drivers/staging | |
parent | d8fd9d7ecf3d7fa46567088125a011587802921d (diff) |
Staging: et131x: Clean the IPG types up
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/et131x/et1310_address_map.h | 31 | ||||
-rw-r--r-- | drivers/staging/et131x/et1310_mac.c | 10 |
2 files changed, 12 insertions, 29 deletions
diff --git a/drivers/staging/et131x/et1310_address_map.h b/drivers/staging/et131x/et1310_address_map.h index 2c3d65a622a..885b90b3c6e 100644 --- a/drivers/staging/et131x/et1310_address_map.h +++ b/drivers/staging/et131x/et1310_address_map.h | |||
@@ -1388,29 +1388,14 @@ typedef union _MAC_CFG2_t { | |||
1388 | /* | 1388 | /* |
1389 | * structure for Interpacket gap reg in mac address map. | 1389 | * structure for Interpacket gap reg in mac address map. |
1390 | * located at address 0x5008 | 1390 | * located at address 0x5008 |
1391 | * | ||
1392 | * 31: reserved | ||
1393 | * 30-24: non B2B ipg 1 | ||
1394 | * 23: undefined | ||
1395 | * 22-16: non B2B ipg 2 | ||
1396 | * 15-8: Min ifg enforce | ||
1397 | * 7-0: B2B ipg | ||
1391 | */ | 1398 | */ |
1392 | typedef union _MAC_IPG_t { | ||
1393 | u32 value; | ||
1394 | struct { | ||
1395 | #ifdef _BIT_FIELDS_HTOL | ||
1396 | u32 reserved:1; /* bit 31 */ | ||
1397 | u32 non_B2B_ipg_1:7; /* bits 24-30 */ | ||
1398 | u32 undefined2:1; /* bit 23 */ | ||
1399 | u32 non_B2B_ipg_2:7; /* bits 16-22 */ | ||
1400 | u32 min_ifg_enforce:8; /* bits 8-15 */ | ||
1401 | u32 undefined1:1; /* bit 7 */ | ||
1402 | u32 B2B_ipg:7; /* bits 0-6 */ | ||
1403 | #else | ||
1404 | u32 B2B_ipg:7; /* bits 0-6 */ | ||
1405 | u32 undefined1:1; /* bit 7 */ | ||
1406 | u32 min_ifg_enforce:8; /* bits 8-15 */ | ||
1407 | u32 non_B2B_ipg_2:7; /* bits 16-22 */ | ||
1408 | u32 undefined2:1; /* bit 23 */ | ||
1409 | u32 non_B2B_ipg_1:7; /* bits 24-30 */ | ||
1410 | u32 reserved:1; /* bit 31 */ | ||
1411 | #endif | ||
1412 | } bits; | ||
1413 | } MAC_IPG_t, *PMAC_IPG_t; | ||
1414 | 1399 | ||
1415 | /* | 1400 | /* |
1416 | * structure for half duplex reg in mac address map. | 1401 | * structure for half duplex reg in mac address map. |
@@ -1731,7 +1716,7 @@ typedef union _MAC_STATION_ADDR2_t { | |||
1731 | typedef struct _MAC_t { /* Location: */ | 1716 | typedef struct _MAC_t { /* Location: */ |
1732 | MAC_CFG1_t cfg1; /* 0x5000 */ | 1717 | MAC_CFG1_t cfg1; /* 0x5000 */ |
1733 | MAC_CFG2_t cfg2; /* 0x5004 */ | 1718 | MAC_CFG2_t cfg2; /* 0x5004 */ |
1734 | MAC_IPG_t ipg; /* 0x5008 */ | 1719 | u32 ipg; /* 0x5008 */ |
1735 | MAC_HFDP_t hfdp; /* 0x500C */ | 1720 | MAC_HFDP_t hfdp; /* 0x500C */ |
1736 | MAC_MAX_FM_LEN_t max_fm_len; /* 0x5010 */ | 1721 | MAC_MAX_FM_LEN_t max_fm_len; /* 0x5010 */ |
1737 | u32 rsv1; /* 0x5014 */ | 1722 | u32 rsv1; /* 0x5014 */ |
diff --git a/drivers/staging/et131x/et1310_mac.c b/drivers/staging/et131x/et1310_mac.c index 35e1bcf961b..1176bc6c592 100644 --- a/drivers/staging/et131x/et1310_mac.c +++ b/drivers/staging/et131x/et1310_mac.c | |||
@@ -101,7 +101,7 @@ void ConfigMACRegs1(struct et131x_adapter *etdev) | |||
101 | struct _MAC_t __iomem *pMac = &etdev->regs->mac; | 101 | struct _MAC_t __iomem *pMac = &etdev->regs->mac; |
102 | MAC_STATION_ADDR1_t station1; | 102 | MAC_STATION_ADDR1_t station1; |
103 | MAC_STATION_ADDR2_t station2; | 103 | MAC_STATION_ADDR2_t station2; |
104 | MAC_IPG_t ipg; | 104 | u32 ipg; |
105 | MAC_HFDP_t hfdp; | 105 | MAC_HFDP_t hfdp; |
106 | MII_MGMT_CFG_t mii_mgmt_cfg; | 106 | MII_MGMT_CFG_t mii_mgmt_cfg; |
107 | 107 | ||
@@ -111,11 +111,9 @@ void ConfigMACRegs1(struct et131x_adapter *etdev) | |||
111 | writel(0xC00F0000, &pMac->cfg1.value); | 111 | writel(0xC00F0000, &pMac->cfg1.value); |
112 | 112 | ||
113 | /* Next lets configure the MAC Inter-packet gap register */ | 113 | /* Next lets configure the MAC Inter-packet gap register */ |
114 | ipg.bits.non_B2B_ipg_1 = 0x38; /* 58d */ | 114 | ipg = 0x38005860; /* IPG1 0x38 IPG2 0x58 B2B 0x60 */ |
115 | ipg.bits.non_B2B_ipg_2 = 0x58; /* 88d */ | 115 | ipg |= 0x50 << 8; /* ifg enforce 0x50 */ |
116 | ipg.bits.min_ifg_enforce = 0x50; /* 80d */ | 116 | writel(ipg, &pMac->ipg); |
117 | ipg.bits.B2B_ipg = 0x60; /* 96d */ | ||
118 | writel(ipg.value, &pMac->ipg.value); | ||
119 | 117 | ||
120 | /* Next lets configure the MAC Half Duplex register */ | 118 | /* Next lets configure the MAC Half Duplex register */ |
121 | hfdp.bits.alt_beb_trunc = 0xA; | 119 | hfdp.bits.alt_beb_trunc = 0xA; |