Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90215
b: refs/heads/master
c: c67c9a2
h: refs/heads/master
i:
  90213: 779bd06
  90211: 7364cf5
  90207: 4e8c7c0
v: v3
  • Loading branch information
Jay Cliburn authored and Jeff Garzik committed Mar 17, 2008
1 parent c573c75 commit a4d1117
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d90fb1ac9d97da86e24d9ea947bf2a2f333829a
refs/heads/master: c67c9a2f11d97a545c0e8f56b2ca3e5e36566a94
53 changes: 53 additions & 0 deletions trunk/drivers/net/atlx/atl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2513,6 +2513,57 @@ static int atl1_set_wol(struct net_device *netdev,
return 0;
}

static int atl1_get_regs_len(struct net_device *netdev)
{
return ATL1_REG_COUNT * sizeof(u32);
}

static void atl1_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
void *p)
{
struct atl1_adapter *adapter = netdev_priv(netdev);
struct atl1_hw *hw = &adapter->hw;
unsigned int i;
u32 *regbuf = p;

for (i = 0; i < ATL1_REG_COUNT; i++) {
/*
* This switch statement avoids reserved regions
* of register space.
*/
switch (i) {
case 6 ... 9:
case 14:
case 29 ... 31:
case 34 ... 63:
case 75 ... 127:
case 136 ... 1023:
case 1027 ... 1087:
case 1091 ... 1151:
case 1194 ... 1195:
case 1200 ... 1201:
case 1206 ... 1213:
case 1216 ... 1279:
case 1290 ... 1311:
case 1323 ... 1343:
case 1358 ... 1359:
case 1368 ... 1375:
case 1378 ... 1383:
case 1388 ... 1391:
case 1393 ... 1395:
case 1402 ... 1403:
case 1410 ... 1471:
case 1522 ... 1535:
/* reserved region; don't read it */
regbuf[i] = 0;
break;
default:
/* unreserved region */
regbuf[i] = ioread32(hw->hw_addr + (i * sizeof(u32)));
}
}
}

static void atl1_get_ringparam(struct net_device *netdev,
struct ethtool_ringparam *ring)
{
Expand Down Expand Up @@ -2703,6 +2754,8 @@ const struct ethtool_ops atl1_ethtool_ops = {
.get_drvinfo = atl1_get_drvinfo,
.get_wol = atl1_get_wol,
.set_wol = atl1_set_wol,
.get_regs_len = atl1_get_regs_len,
.get_regs = atl1_get_regs,
.get_ringparam = atl1_get_ringparam,
.set_ringparam = atl1_set_ringparam,
.get_pauseparam = atl1_get_pauseparam,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/atlx/atl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ enum atl1_dma_req_block {
#define ATL1_DEFAULT_RFD 512
#define ATL1_MIN_RFD 128
#define ATL1_MAX_RFD 2048
#define ATL1_REG_COUNT 1538

#define ATL1_GET_DESC(R, i, type) (&(((type *)((R)->desc))[i]))
#define ATL1_RFD_DESC(R, i) ATL1_GET_DESC(R, i, struct rx_free_desc)
Expand Down

0 comments on commit a4d1117

Please sign in to comment.