summaryrefslogtreecommitdiffstats
path: root/sys/dev/cxgb
diff options
context:
space:
mode:
authorgnn <gnn@FreeBSD.org>2008-11-21 19:22:25 +0000
committergnn <gnn@FreeBSD.org>2008-11-21 19:22:25 +0000
commitfb7f8e0e59cfa5b30a6f0b0d1377402f14c64673 (patch)
treec150731f7b7c58812e3400090c04c9573a980c53 /sys/dev/cxgb
parent4f79df3b3ced40c03cf786528a076dadf312bba9 (diff)
downloadFreeBSD-src-fb7f8e0e59cfa5b30a6f0b0d1377402f14c64673.zip
FreeBSD-src-fb7f8e0e59cfa5b30a6f0b0d1377402f14c64673.tar.gz
Several small additions to the Chelsio 10G driver.
1) Fix a bug in dealing with the Alerus 1006 PHY which prevented the device from ever coming back up once it had been set to down. 2) Add a kernel tunable (hw.cxgb.snd_queue_len) which makes it possible to give the device more than IFQ_MAXLEN entries in its send queue. The default remains 50. 3) Add code to place the card'd identification and serial number into its description (%desc) so that users can tell which card they have installed.
Diffstat (limited to 'sys/dev/cxgb')
-rw-r--r--sys/dev/cxgb/common/cxgb_ael1002.c16
-rw-r--r--sys/dev/cxgb/common/cxgb_common.h2
-rw-r--r--sys/dev/cxgb/common/cxgb_t3_hw.c3
-rw-r--r--sys/dev/cxgb/cxgb_main.c22
4 files changed, 38 insertions, 5 deletions
diff --git a/sys/dev/cxgb/common/cxgb_ael1002.c b/sys/dev/cxgb/common/cxgb_ael1002.c
index b6dacb4..99bfb76 100644
--- a/sys/dev/cxgb/common/cxgb_ael1002.c
+++ b/sys/dev/cxgb/common/cxgb_ael1002.c
@@ -191,7 +191,21 @@ int t3_ael1002_phy_prep(struct cphy *phy, adapter_t *adapter, int phy_addr,
static int ael1006_reset(struct cphy *phy, int wait)
{
- return t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait);
+ u32 gpio_out;
+ t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait);
+ /* Hack to reset the phy correctly */
+ /* Read out the current value */
+ gpio_out = t3_read_reg(phy->adapter, A_T3DBG_GPIO_EN);
+ /* Reset the phy */
+ gpio_out &= ~F_GPIO6_OUT_VAL;
+ t3_write_reg(phy->adapter, A_T3DBG_GPIO_EN, gpio_out);
+ msleep(125);
+ /* Take the phy out of reset */
+ gpio_out |= F_GPIO6_OUT_VAL;
+ t3_write_reg(phy->adapter, A_T3DBG_GPIO_EN, gpio_out);
+ msleep(125);
+ t3_phy_reset(phy, MDIO_DEV_PMA_PMD, wait);
+ return 0;
}
static int ael1006_power_down(struct cphy *phy, int enable)
diff --git a/sys/dev/cxgb/common/cxgb_common.h b/sys/dev/cxgb/common/cxgb_common.h
index a9f6bac..4f233d7 100644
--- a/sys/dev/cxgb/common/cxgb_common.h
+++ b/sys/dev/cxgb/common/cxgb_common.h
@@ -37,6 +37,7 @@ enum {
MAX_FRAME_SIZE = 10240, /* max MAC frame size, includes header + FCS */
EEPROMSIZE = 8192, /* Serial EEPROM size */
SERNUM_LEN = 16, /* Serial # length */
+ ECNUM_LEN = 16, /* EC # length */
RSS_TABLE_SIZE = 64, /* size of RSS lookup and mapping tables */
TCB_SIZE = 128, /* TCB size */
NMTUS = 16, /* size of MTU table */
@@ -338,6 +339,7 @@ struct vpd_params {
unsigned int mdc;
unsigned int mem_timing;
u8 sn[SERNUM_LEN + 1];
+ u8 ec[ECNUM_LEN + 1];
u8 eth_base[6];
u8 port_type[MAX_NPORTS];
unsigned short xauicfg[2];
diff --git a/sys/dev/cxgb/common/cxgb_t3_hw.c b/sys/dev/cxgb/common/cxgb_t3_hw.c
index 813fdb9..63ece94 100644
--- a/sys/dev/cxgb/common/cxgb_t3_hw.c
+++ b/sys/dev/cxgb/common/cxgb_t3_hw.c
@@ -551,7 +551,7 @@ struct t3_vpd {
u8 vpdr_tag;
u8 vpdr_len[2];
VPD_ENTRY(pn, 16); /* part number */
- VPD_ENTRY(ec, 16); /* EC level */
+ VPD_ENTRY(ec, ECNUM_LEN); /* EC level */
VPD_ENTRY(sn, SERNUM_LEN); /* serial number */
VPD_ENTRY(na, 12); /* MAC address base */
VPD_ENTRY(cclk, 6); /* core clock */
@@ -696,6 +696,7 @@ static int get_vpd_params(adapter_t *adapter, struct vpd_params *p)
p->mdc = simple_strtoul(vpd.mdc_data, NULL, 10);
p->mem_timing = simple_strtoul(vpd.mt_data, NULL, 10);
memcpy(p->sn, vpd.sn_data, SERNUM_LEN);
+ memcpy(p->ec, vpd.ec_data, ECNUM_LEN);
/* Old eeproms didn't have port information */
if (adapter->params.rev == 0 && !vpd.port0_data[0]) {
diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c
index cc6b30b..d1203fc 100644
--- a/sys/dev/cxgb/cxgb_main.c
+++ b/sys/dev/cxgb/cxgb_main.c
@@ -228,6 +228,15 @@ TUNABLE_INT("hw.cxgb.use_16k_clusters", &cxgb_use_16k_clusters);
SYSCTL_UINT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN,
&cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue ");
+/*
+ * Tune the size of the output queue.
+ */
+int cxgb_snd_queue_len = IFQ_MAXLEN;
+TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len);
+SYSCTL_UINT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN,
+ &cxgb_snd_queue_len, 0, "send queue size ");
+
+
enum {
MAX_TXQ_ENTRIES = 16384,
MAX_CTRL_TXQ_ENTRIES = 1024,
@@ -359,8 +368,8 @@ cxgb_controller_probe(device_t dev)
ports = "ports";
snprintf(buf, sizeof(buf), "%s %sNIC, rev: %d nports: %d %s",
- ai->desc, is_offload(sc) ? "R" : "",
- sc->params.rev, nports, ports);
+ ai->desc, is_offload(sc) ? "R" : "",
+ sc->params.rev, nports, ports);
device_set_desc_copy(dev, buf);
return (BUS_PROBE_DEFAULT);
}
@@ -406,6 +415,8 @@ cxgb_controller_attach(device_t dev)
int msi_needed, reg;
#endif
int must_load = 0;
+ char buf[80];
+
sc = device_get_softc(dev);
sc->dev = dev;
sc->msi_count = 0;
@@ -618,6 +629,11 @@ cxgb_controller_attach(device_t dev)
G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers),
G_FW_VERSION_MICRO(vers));
+ snprintf(buf, sizeof(buf), "%s\t E/C: %s S/N: %s",
+ ai->desc,
+ sc->params.vpd.ec, sc->params.vpd.sn);
+ device_set_desc_copy(dev, buf);
+
device_printf(sc->dev, "Firmware Version %s\n", &sc->fw_version[0]);
callout_reset(&sc->cxgb_tick_ch, CXGB_TICKS(sc), cxgb_tick, sc);
t3_add_attach_sysctls(sc);
@@ -934,7 +950,7 @@ cxgb_port_attach(device_t dev)
ifp->if_timer = 0; /* Disable ifnet watchdog */
ifp->if_watchdog = NULL;
- ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN;
+ ifp->if_snd.ifq_drv_maxlen = cxgb_snd_queue_len;
IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen);
IFQ_SET_READY(&ifp->if_snd);
OpenPOWER on IntegriCloud