Commit bd03d0d5 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

Staging: et131x: kill off the rxmac ctrl type

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fef5ba3a
...@@ -655,31 +655,16 @@ struct txmac_regs { /* Location: */ ...@@ -655,31 +655,16 @@ struct txmac_regs { /* Location: */
/* /*
* structure for rxmac control reg in rxmac address map * structure for rxmac control reg in rxmac address map
* located at address 0x4000 * located at address 0x4000
*
* 31-7: reserved
* 6: rxmac_int_disable
* 5: async_disable
* 4: mif_disable
* 3: wol_disable
* 2: pkt_filter_disable
* 1: mcif_disable
* 0: rxmac_en
*/ */
typedef union _RXMAC_CTRL_t {
u32 value;
struct {
#ifdef _BIT_FIELDS_HTOL
u32 reserved:25; /* bits 7-31 */
u32 rxmac_int_disable:1; /* bit 6 */
u32 async_disable:1; /* bit 5 */
u32 mif_disable:1; /* bit 4 */
u32 wol_disable:1; /* bit 3 */
u32 pkt_filter_disable:1; /* bit 2 */
u32 mcif_disable:1; /* bit 1 */
u32 rxmac_en:1; /* bit 0 */
#else
u32 rxmac_en:1; /* bit 0 */
u32 mcif_disable:1; /* bit 1 */
u32 pkt_filter_disable:1; /* bit 2 */
u32 wol_disable:1; /* bit 3 */
u32 mif_disable:1; /* bit 4 */
u32 async_disable:1; /* bit 5 */
u32 rxmac_int_disable:1; /* bit 6 */
u32 reserved:25; /* bits 7-31 */
#endif
} bits;
} RXMAC_CTRL_t, *PRXMAC_CTRL_t;
/* /*
* structure for Wake On Lan Control and CRC 0 reg in rxmac address map * structure for Wake On Lan Control and CRC 0 reg in rxmac address map
...@@ -904,7 +889,7 @@ typedef union _RXMAC_UNI_PF_ADDR3_t { ...@@ -904,7 +889,7 @@ typedef union _RXMAC_UNI_PF_ADDR3_t {
* Rx MAC Module of JAGCore Address Mapping * Rx MAC Module of JAGCore Address Mapping
*/ */
typedef struct _RXMAC_t { /* Location: */ typedef struct _RXMAC_t { /* Location: */
RXMAC_CTRL_t ctrl; /* 0x4000 */ u32 ctrl; /* 0x4000 */
u32 crc0; /* 0x4004 */ u32 crc0; /* 0x4004 */
u32 crc12; /* 0x4008 */ u32 crc12; /* 0x4008 */
u32 crc34; /* 0x400C */ u32 crc34; /* 0x400C */
......
...@@ -244,7 +244,7 @@ void ConfigRxMacRegs(struct et131x_adapter *etdev) ...@@ -244,7 +244,7 @@ void ConfigRxMacRegs(struct et131x_adapter *etdev)
u32 pf_ctrl = 0; u32 pf_ctrl = 0;
/* Disable the MAC while it is being configured (also disable WOL) */ /* Disable the MAC while it is being configured (also disable WOL) */
writel(0x8, &pRxMac->ctrl.value); writel(0x8, &pRxMac->ctrl);
/* Initialize WOL to disabled. */ /* Initialize WOL to disabled. */
writel(0, &pRxMac->crc0); writel(0, &pRxMac->crc0);
...@@ -363,7 +363,7 @@ void ConfigRxMacRegs(struct et131x_adapter *etdev) ...@@ -363,7 +363,7 @@ void ConfigRxMacRegs(struct et131x_adapter *etdev)
* but we still leave the packet filter on. * but we still leave the packet filter on.
*/ */
writel(pf_ctrl, &pRxMac->pf_ctrl); writel(pf_ctrl, &pRxMac->pf_ctrl);
writel(0x9, &pRxMac->ctrl.value); writel(0x9, &pRxMac->ctrl);
} }
void ConfigTxMacRegs(struct et131x_adapter *etdev) void ConfigTxMacRegs(struct et131x_adapter *etdev)
......
...@@ -445,7 +445,7 @@ void et131x_isr_handler(struct work_struct *work) ...@@ -445,7 +445,7 @@ void et131x_isr_handler(struct work_struct *work)
dev_warn(&etdev->pdev->dev, dev_warn(&etdev->pdev->dev,
"Enable 0x%08x, Diag 0x%08x\n", "Enable 0x%08x, Diag 0x%08x\n",
readl(&iomem->rxmac.ctrl.value), readl(&iomem->rxmac.ctrl),
readl(&iomem->rxmac.rxq_diag)); readl(&iomem->rxmac.rxq_diag));
/* /*
......
...@@ -342,16 +342,16 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter) ...@@ -342,16 +342,16 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter)
{ {
int status = 0; int status = 0;
uint32_t filter = adapter->PacketFilter; uint32_t filter = adapter->PacketFilter;
RXMAC_CTRL_t ctrl; u32 ctrl;
u32 pf_ctrl; u32 pf_ctrl;
ctrl.value = readl(&adapter->regs->rxmac.ctrl.value); ctrl = readl(&adapter->regs->rxmac.ctrl);
pf_ctrl = readl(&adapter->regs->rxmac.pf_ctrl); pf_ctrl = readl(&adapter->regs->rxmac.pf_ctrl);
/* Default to disabled packet filtering. Enable it in the individual /* Default to disabled packet filtering. Enable it in the individual
* case statements that require the device to filter something * case statements that require the device to filter something
*/ */
ctrl.bits.pkt_filter_disable = 1; ctrl |= 0x04;
/* Set us to be in promiscuous mode so we receive everything, this /* Set us to be in promiscuous mode so we receive everything, this
* is also true when we get a packet filter of 0 * is also true when we get a packet filter of 0
...@@ -369,20 +369,20 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter) ...@@ -369,20 +369,20 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter)
else { else {
SetupDeviceForMulticast(adapter); SetupDeviceForMulticast(adapter);
pf_ctrl |= 2; pf_ctrl |= 2;
ctrl.bits.pkt_filter_disable = 0; ctrl &= ~0x04;
} }
/* Set us up with Unicast packet filtering */ /* Set us up with Unicast packet filtering */
if (filter & ET131X_PACKET_TYPE_DIRECTED) { if (filter & ET131X_PACKET_TYPE_DIRECTED) {
SetupDeviceForUnicast(adapter); SetupDeviceForUnicast(adapter);
pf_ctrl |= 4; pf_ctrl |= 4;
ctrl.bits.pkt_filter_disable = 0; ctrl &= ~0x04;
} }
/* Set us up with Broadcast packet filtering */ /* Set us up with Broadcast packet filtering */
if (filter & ET131X_PACKET_TYPE_BROADCAST) { if (filter & ET131X_PACKET_TYPE_BROADCAST) {
pf_ctrl |= 1; /* Broadcast filter bit */ pf_ctrl |= 1; /* Broadcast filter bit */
ctrl.bits.pkt_filter_disable = 0; ctrl &= ~0x04;
} else } else
pf_ctrl &= ~1; pf_ctrl &= ~1;
...@@ -391,7 +391,7 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter) ...@@ -391,7 +391,7 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter)
* in the control reg. * in the control reg.
*/ */
writel(pf_ctrl, &adapter->regs->rxmac.pf_ctrl); writel(pf_ctrl, &adapter->regs->rxmac.pf_ctrl);
writel(ctrl.value, &adapter->regs->rxmac.ctrl.value); writel(ctrl, &adapter->regs->rxmac.ctrl);
} }
return status; return status;
} }
......
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