]> Pileus Git - ~andy/linux/blobdiff - drivers/net/cxgb3/t3_hw.c
Merge git://git.infradead.org/mtd-2.6
[~andy/linux] / drivers / net / cxgb3 / t3_hw.c
index a99496a431c423f260b41fc6ae06fa4cd3ae1dcf..47d51788a462b668a70325134551bc43dfbf2b52 100644 (file)
@@ -923,7 +923,8 @@ int t3_check_tpsram_version(struct adapter *adapter, int *must_load)
  *     Checks if an adapter's tp sram is compatible with the driver.
  *     Returns 0 if the versions are compatible, a negative error otherwise.
  */
-int t3_check_tpsram(struct adapter *adapter, u8 *tp_sram, unsigned int size)
+int t3_check_tpsram(struct adapter *adapter, const u8 *tp_sram,
+                   unsigned int size)
 {
        u32 csum;
        unsigned int i;
@@ -2875,10 +2876,10 @@ static void ulp_config(struct adapter *adap, const struct tp_params *p)
  *
  *     Write the contents of the protocol SRAM.
  */
-int t3_set_proto_sram(struct adapter *adap, u8 *data)
+int t3_set_proto_sram(struct adapter *adap, const u8 *data)
 {
        int i;
-       __be32 *buf = (__be32 *)data;
+       const __be32 *buf = (const __be32 *)data;
 
        for (i = 0; i < PROTO_SRAM_LINES; i++) {
                t3_write_reg(adap, A_TP_EMBED_OP_FIELD5, be32_to_cpu(*buf++));
@@ -3264,6 +3265,7 @@ static void config_pcie(struct adapter *adap)
 
        t3_write_reg(adap, A_PCIE_PEX_ERR, 0xffffffff);
        t3_set_reg_field(adap, A_PCIE_CFG, 0,
+                        F_ENABLELINKDWNDRST | F_ENABLELINKDOWNRST |
                         F_PCIE_DMASTOPEN | F_PCIE_CLIDECEN);
 }
 
@@ -3655,3 +3657,30 @@ void t3_led_ready(struct adapter *adapter)
        t3_set_reg_field(adapter, A_T3DBG_GPIO_EN, F_GPIO0_OUT_VAL,
                         F_GPIO0_OUT_VAL);
 }
+
+int t3_replay_prep_adapter(struct adapter *adapter)
+{
+       const struct adapter_info *ai = adapter->params.info;
+       unsigned int i, j = 0;
+       int ret;
+
+       early_hw_init(adapter, ai);
+       ret = init_parity(adapter);
+       if (ret)
+               return ret;
+
+       for_each_port(adapter, i) {
+               struct port_info *p = adap2pinfo(adapter, i);
+               while (!adapter->params.vpd.port_type[j])
+                       ++j;
+
+               p->port_type->phy_prep(&p->phy, adapter, ai->phy_base_addr + j,
+                                       ai->mdio_ops);
+
+               p->phy.ops->power_down(&p->phy, 1);
+               ++j;
+       }
+
+return 0;
+}
+