Browse Source

Staging: et131x: Clean up the half duplex control reg types

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Alan Cox 15 years ago
parent
commit
c2f6118a30
2 changed files with 13 additions and 39 deletions
  1. 11 30
      drivers/staging/et131x/et1310_address_map.h
  2. 2 9
      drivers/staging/et131x/et1310_mac.c

+ 11 - 30
drivers/staging/et131x/et1310_address_map.h

@@ -1395,38 +1395,19 @@ typedef union _MAC_CFG2_t {
  * 22-16: non B2B ipg 2
  * 22-16: non B2B ipg 2
  * 15-8: Min ifg enforce
  * 15-8: Min ifg enforce
  * 7-0: B2B ipg
  * 7-0: B2B ipg
- */
-
-/*
+ *
  * structure for half duplex reg in mac address map.
  * structure for half duplex reg in mac address map.
  * located at address 0x500C
  * located at address 0x500C
+ * 31-24: reserved
+ * 23-20: Alt BEB trunc
+ * 19: Alt BEB enable
+ * 18: BP no backoff
+ * 17: no backoff
+ * 16: excess defer
+ * 15-12: re-xmit max
+ * 11-10: reserved
+ * 9-0: collision window
  */
  */
-typedef union _MAC_HFDP_t {
-	u32 value;
-	struct {
-#ifdef _BIT_FIELDS_HTOL
-		u32 reserved2:8;		/* bits 24-31 */
-		u32 alt_beb_trunc:4;	/* bits 23-20 */
-		u32 alt_beb_enable:1;	/* bit 19 */
-		u32 bp_no_backoff:1;	/* bit 18 */
-		u32 no_backoff:1;		/* bit 17 */
-		u32 excess_defer:1;	/* bit 16 */
-		u32 rexmit_max:4;		/* bits 12-15 */
-		u32 reserved1:2;		/* bits 10-11 */
-		u32 coll_window:10;	/* bits 0-9 */
-#else
-		u32 coll_window:10;	/* bits 0-9 */
-		u32 reserved1:2;		/* bits 10-11 */
-		u32 rexmit_max:4;		/* bits 12-15 */
-		u32 excess_defer:1;	/* bit 16 */
-		u32 no_backoff:1;		/* bit 17 */
-		u32 bp_no_backoff:1;	/* bit 18 */
-		u32 alt_beb_enable:1;	/* bit 19 */
-		u32 alt_beb_trunc:4;	/* bits 23-20 */
-		u32 reserved2:8;		/* bits 24-31 */
-#endif
-	} bits;
-} MAC_HFDP_t, *PMAC_HFDP_t;
 
 
 /*
 /*
  * structure for Maximum Frame Length reg in mac address map.
  * structure for Maximum Frame Length reg in mac address map.
@@ -1717,7 +1698,7 @@ typedef struct _MAC_t {					/* Location: */
 	MAC_CFG1_t cfg1;				/*  0x5000 */
 	MAC_CFG1_t cfg1;				/*  0x5000 */
 	MAC_CFG2_t cfg2;				/*  0x5004 */
 	MAC_CFG2_t cfg2;				/*  0x5004 */
 	u32 ipg;					/*  0x5008 */
 	u32 ipg;					/*  0x5008 */
-	MAC_HFDP_t hfdp;				/*  0x500C */
+	u32 hfdp;					/*  0x500C */
 	MAC_MAX_FM_LEN_t max_fm_len;			/*  0x5010 */
 	MAC_MAX_FM_LEN_t max_fm_len;			/*  0x5010 */
 	u32 rsv1;					/*  0x5014 */
 	u32 rsv1;					/*  0x5014 */
 	u32 rsv2;					/*  0x5018 */
 	u32 rsv2;					/*  0x5018 */

+ 2 - 9
drivers/staging/et131x/et1310_mac.c

@@ -102,7 +102,6 @@ void ConfigMACRegs1(struct et131x_adapter *etdev)
 	MAC_STATION_ADDR1_t station1;
 	MAC_STATION_ADDR1_t station1;
 	MAC_STATION_ADDR2_t station2;
 	MAC_STATION_ADDR2_t station2;
 	u32 ipg;
 	u32 ipg;
-	MAC_HFDP_t hfdp;
 	MII_MGMT_CFG_t mii_mgmt_cfg;
 	MII_MGMT_CFG_t mii_mgmt_cfg;
 
 
 	/* First we need to reset everything.  Write to MAC configuration
 	/* First we need to reset everything.  Write to MAC configuration
@@ -116,14 +115,8 @@ void ConfigMACRegs1(struct et131x_adapter *etdev)
 	writel(ipg, &pMac->ipg);
 	writel(ipg, &pMac->ipg);
 
 
 	/* Next lets configure the MAC Half Duplex register */
 	/* Next lets configure the MAC Half Duplex register */
-	hfdp.bits.alt_beb_trunc = 0xA;
-	hfdp.bits.alt_beb_enable = 0x0;
-	hfdp.bits.bp_no_backoff = 0x0;
-	hfdp.bits.no_backoff = 0x0;
-	hfdp.bits.excess_defer = 0x1;
-	hfdp.bits.rexmit_max = 0xF;
-	hfdp.bits.coll_window = 0x37;		/* 55d */
-	writel(hfdp.value, &pMac->hfdp.value);
+	/* BEB trunc 0xA, Ex Defer, Rexmit 0xF Coll 0x37 */
+	writel(0x00A1F037, &pMac->hfdp);
 
 
 	/* Next lets configure the MAC Interface Control register */
 	/* Next lets configure the MAC Interface Control register */
 	writel(0, &pMac->if_ctrl.value);
 	writel(0, &pMac->if_ctrl.value);