Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96575
b: refs/heads/master
c: c0bf880
h: refs/heads/master
i:
  96573: c1c05df
  96571: 255399d
  96567: 9f10da0
  96559: 969b151
  96543: 86f23c7
  96511: 38867d6
v: v3
  • Loading branch information
Brice Goglin authored and Jeff Garzik committed May 13, 2008
1 parent 60dd16f commit 9b59b3c
Show file tree
Hide file tree
Showing 2 changed files with 36 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: f8fd57c11159d89d0d9cd624eafad41c680e8f6e
refs/heads/master: c0bf8801535d45df3597839edf864e24f60a4188
35 changes: 35 additions & 0 deletions trunk/drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ struct myri10ge_priv {
int pause;
char *fw_name;
char eeprom_strings[MYRI10GE_EEPROM_STRINGS_SIZE];
char *product_code_string;
char fw_version[128];
int fw_ver_major;
int fw_ver_minor;
Expand Down Expand Up @@ -421,6 +422,10 @@ static int myri10ge_read_mac_addr(struct myri10ge_priv *mgp)
ptr += 1;
}
}
if (memcmp(ptr, "PC=", 3) == 0) {
ptr += 3;
mgp->product_code_string = ptr;
}
if (memcmp((const void *)ptr, "SN=", 3) == 0) {
ptr += 3;
mgp->serial_number = simple_strtoul(ptr, &ptr, 10);
Expand Down Expand Up @@ -1304,9 +1309,39 @@ static irqreturn_t myri10ge_intr(int irq, void *arg)
static int
myri10ge_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
{
struct myri10ge_priv *mgp = netdev_priv(netdev);
char *ptr;
int i;

cmd->autoneg = AUTONEG_DISABLE;
cmd->speed = SPEED_10000;
cmd->duplex = DUPLEX_FULL;

/*
* parse the product code to deterimine the interface type
* (CX4, XFP, Quad Ribbon Fiber) by looking at the character
* after the 3rd dash in the driver's cached copy of the
* EEPROM's product code string.
*/
ptr = mgp->product_code_string;
if (ptr == NULL) {
printk(KERN_ERR "myri10ge: %s: Missing product code\n",
netdev->name);
return 0;
}
for (i = 0; i < 3; i++, ptr++) {
ptr = strchr(ptr, '-');
if (ptr == NULL) {
printk(KERN_ERR "myri10ge: %s: Invalid product "
"code %s\n", netdev->name,
mgp->product_code_string);
return 0;
}
}
if (*ptr == 'R' || *ptr == 'Q') {
/* We've found either an XFP or quad ribbon fiber */
cmd->port = PORT_FIBRE;
}
return 0;
}

Expand Down

0 comments on commit 9b59b3c

Please sign in to comment.