Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67594
b: refs/heads/master
c: 295b54c
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Oct 12, 2007
1 parent 2482b57 commit 7d5f0a3
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 12 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: d81fec0f97cce4aea36a89340af247523c1263a0
refs/heads/master: 295b54c4902c52cd00d7c837d50a86e39e26caec
4 changes: 2 additions & 2 deletions trunk/arch/powerpc/sysdev/axonram.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
transfered = 0;
bio_for_each_segment(vec, bio, idx) {
if (unlikely(phys_mem + vec->bv_len > phys_end)) {
bio_io_error(bio);
bio_io_error(bio, bio->bi_size);
rc = -ERANGE;
break;
}
Expand All @@ -131,7 +131,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio)
phys_mem += vec->bv_len;
transfered += vec->bv_len;
}
bio_endio(bio, 0);
bio_endio(bio, transfered, 0);

return rc;
}
Expand Down
62 changes: 53 additions & 9 deletions trunk/drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3569,20 +3569,64 @@ static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs,
{
const struct sky2_port *sky2 = netdev_priv(dev);
const void __iomem *io = sky2->hw->regs;
unsigned int b;

regs->version = 1;
memset(p, 0, regs->len);

memcpy_fromio(p, io, B3_RAM_ADDR);

/* skip diagnostic ram region */
memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, 0x2000 - B3_RI_WTO_R1);
for (b = 0; b < 128; b++) {
/* This complicated switch statement is to make sure and
* only access regions that are unreserved.
* Some blocks are only valid on dual port cards.
* and block 3 has some special diagnostic registers that
* are poison.
*/
switch (b) {
case 3:
/* skip diagnostic ram region */
memcpy_fromio(p + 0x10, io + 0x10, 128 - 0x10);
break;

/* copy GMAC registers */
memcpy_fromio(p + BASE_GMAC_1, io + BASE_GMAC_1, 0x1000);
if (sky2->hw->ports > 1)
memcpy_fromio(p + BASE_GMAC_2, io + BASE_GMAC_2, 0x1000);
/* dual port cards only */
case 5: /* Tx Arbiter 2 */
case 9: /* RX2 */
case 14 ... 15: /* TX2 */
case 17: case 19: /* Ram Buffer 2 */
case 22 ... 23: /* Tx Ram Buffer 2 */
case 25: /* Rx MAC Fifo 1 */
case 27: /* Tx MAC Fifo 2 */
case 31: /* GPHY 2 */
case 40 ... 47: /* Pattern Ram 2 */
case 52: case 54: /* TCP Segmentation 2 */
case 112 ... 116: /* GMAC 2 */
if (sky2->hw->ports == 1)
goto reserved;
/* fall through */
case 0: /* Control */
case 2: /* Mac address */
case 4: /* Tx Arbiter 1 */
case 7: /* PCI express reg */
case 8: /* RX1 */
case 12 ... 13: /* TX1 */
case 16: case 18:/* Rx Ram Buffer 1 */
case 20 ... 21: /* Tx Ram Buffer 1 */
case 24: /* Rx MAC Fifo 1 */
case 26: /* Tx MAC Fifo 1 */
case 28 ... 29: /* Descriptor and status unit */
case 30: /* GPHY 1*/
case 32 ... 39: /* Pattern Ram 1 */
case 48: case 50: /* TCP Segmentation 1 */
case 56 ... 60: /* PCI space */
case 80 ... 84: /* GMAC 1 */
memcpy_fromio(p, io, 128);
break;
default:
reserved:
memset(p, 0, 128);
}

p += 128;
io += 128;
}
}

/* In order to do Jumbo packets on these chips, need to turn off the
Expand Down

0 comments on commit 7d5f0a3

Please sign in to comment.