Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96580
b: refs/heads/master
c: fa0a90d
h: refs/heads/master
v: v3
  • Loading branch information
Brice Goglin authored and Jeff Garzik committed May 13, 2008
1 parent bf91fd6 commit 81c2d3b
Show file tree
Hide file tree
Showing 2 changed files with 32 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: b53bef84c27e68efac9b608392acd1fc14cb6ce7
refs/heads/master: fa0a90d96b08856203435b051dd1c155b58ccd0f
42 changes: 31 additions & 11 deletions trunk/drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ struct myri10ge_priv {
int csum_flag; /* rx_csums? */
int small_bytes;
int big_bytes;
int max_intr_slots;
struct net_device *dev;
struct net_device_stats stats;
spinlock_t stats_lock;
Expand Down Expand Up @@ -634,13 +635,38 @@ static int myri10ge_adopt_running_firmware(struct myri10ge_priv *mgp)
return status;
}

int myri10ge_get_firmware_capabilities(struct myri10ge_priv *mgp)
{
struct myri10ge_cmd cmd;
int status;

/* probe for IPv6 TSO support */
mgp->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO;
status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE,
&cmd, 0);
if (status == 0) {
mgp->max_tso6 = cmd.data0;
mgp->features |= NETIF_F_TSO6;
}

status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0);
if (status != 0) {
dev_err(&mgp->pdev->dev,
"failed MXGEFW_CMD_GET_RX_RING_SIZE\n");
return -ENXIO;
}

mgp->max_intr_slots = 2 * (cmd.data0 / sizeof(struct mcp_dma_addr));

return 0;
}

static int myri10ge_load_firmware(struct myri10ge_priv *mgp)
{
char __iomem *submit;
__be32 buf[16] __attribute__ ((__aligned__(8)));
u32 dma_low, dma_high, size;
int status, i;
struct myri10ge_cmd cmd;

size = 0;
status = myri10ge_load_hotplug_firmware(mgp, &size);
Expand Down Expand Up @@ -672,6 +698,8 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp)

mgp->fw_name = "adopted";
mgp->tx_boundary = 2048;
myri10ge_dummy_rdma(mgp, 1);
status = myri10ge_get_firmware_capabilities(mgp);
return status;
}

Expand Down Expand Up @@ -714,18 +742,10 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp)
dev_err(&mgp->pdev->dev, "handoff failed\n");
return -ENXIO;
}
dev_info(&mgp->pdev->dev, "handoff confirmed\n");
myri10ge_dummy_rdma(mgp, 1);
status = myri10ge_get_firmware_capabilities(mgp);

/* probe for IPv6 TSO support */
mgp->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO;
status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_MAX_TSO6_HDR_SIZE,
&cmd, 0);
if (status == 0) {
mgp->max_tso6 = cmd.data0;
mgp->features |= NETIF_F_TSO6;
}
return 0;
return status;
}

static int myri10ge_update_mac_address(struct myri10ge_priv *mgp, u8 * addr)
Expand Down

0 comments on commit 81c2d3b

Please sign in to comment.