Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186715
b: refs/heads/master
c: bd03d0d
h: refs/heads/master
i:
  186713: 887516a
  186711: a33c365
v: v3
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Mar 4, 2010
1 parent 7af3f41 commit 0fdb368
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fef5ba3ae9760fdc2688b7160fa056e7ef2700bb
refs/heads/master: bd03d0d5bc253533a6d169a82f56626d552d9471
35 changes: 10 additions & 25 deletions trunk/drivers/staging/et131x/et1310_address_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -655,31 +655,16 @@ struct txmac_regs { /* Location: */
/*
* structure for rxmac control reg in rxmac address map
* 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
Expand Down Expand Up @@ -904,7 +889,7 @@ typedef union _RXMAC_UNI_PF_ADDR3_t {
* Rx MAC Module of JAGCore Address Mapping
*/
typedef struct _RXMAC_t { /* Location: */
RXMAC_CTRL_t ctrl; /* 0x4000 */
u32 ctrl; /* 0x4000 */
u32 crc0; /* 0x4004 */
u32 crc12; /* 0x4008 */
u32 crc34; /* 0x400C */
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/et131x/et1310_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ void ConfigRxMacRegs(struct et131x_adapter *etdev)
u32 pf_ctrl = 0;

/* Disable the MAC while it is being configured (also disable WOL) */
writel(0x8, &pRxMac->ctrl.value);
writel(0x8, &pRxMac->ctrl);

/* Initialize WOL to disabled. */
writel(0, &pRxMac->crc0);
Expand Down Expand Up @@ -363,7 +363,7 @@ void ConfigRxMacRegs(struct et131x_adapter *etdev)
* but we still leave the packet filter on.
*/
writel(pf_ctrl, &pRxMac->pf_ctrl);
writel(0x9, &pRxMac->ctrl.value);
writel(0x9, &pRxMac->ctrl);
}

void ConfigTxMacRegs(struct et131x_adapter *etdev)
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/et131x/et131x_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ void et131x_isr_handler(struct work_struct *work)

dev_warn(&etdev->pdev->dev,
"Enable 0x%08x, Diag 0x%08x\n",
readl(&iomem->rxmac.ctrl.value),
readl(&iomem->rxmac.ctrl),
readl(&iomem->rxmac.rxq_diag));

/*
Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/staging/et131x/et131x_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,16 +342,16 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter)
{
int status = 0;
uint32_t filter = adapter->PacketFilter;
RXMAC_CTRL_t ctrl;
u32 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);

/* Default to disabled packet filtering. Enable it in the individual
* 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
* is also true when we get a packet filter of 0
Expand All @@ -369,20 +369,20 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter)
else {
SetupDeviceForMulticast(adapter);
pf_ctrl |= 2;
ctrl.bits.pkt_filter_disable = 0;
ctrl &= ~0x04;
}

/* Set us up with Unicast packet filtering */
if (filter & ET131X_PACKET_TYPE_DIRECTED) {
SetupDeviceForUnicast(adapter);
pf_ctrl |= 4;
ctrl.bits.pkt_filter_disable = 0;
ctrl &= ~0x04;
}

/* Set us up with Broadcast packet filtering */
if (filter & ET131X_PACKET_TYPE_BROADCAST) {
pf_ctrl |= 1; /* Broadcast filter bit */
ctrl.bits.pkt_filter_disable = 0;
ctrl &= ~0x04;
} else
pf_ctrl &= ~1;

Expand All @@ -391,7 +391,7 @@ int et131x_set_packet_filter(struct et131x_adapter *adapter)
* in the control reg.
*/
writel(pf_ctrl, &adapter->regs->rxmac.pf_ctrl);
writel(ctrl.value, &adapter->regs->rxmac.ctrl.value);
writel(ctrl, &adapter->regs->rxmac.ctrl);
}
return status;
}
Expand Down

0 comments on commit 0fdb368

Please sign in to comment.