cxgb4/cxgb4vf: Code cleanup to enable T4 Configuration File support
[pandora-kernel.git] / drivers / net / ethernet / chelsio / cxgb4 / cxgb4.h
index ec2dafe..ae040cf 100644 (file)
@@ -67,12 +67,12 @@ enum {
 };
 
 enum {
-       MEMWIN0_APERTURE = 65536,
-       MEMWIN0_BASE     = 0x30000,
+       MEMWIN0_APERTURE = 2048,
+       MEMWIN0_BASE     = 0x1b800,
        MEMWIN1_APERTURE = 32768,
        MEMWIN1_BASE     = 0x28000,
-       MEMWIN2_APERTURE = 2048,
-       MEMWIN2_BASE     = 0x1b800,
+       MEMWIN2_APERTURE = 65536,
+       MEMWIN2_BASE     = 0x30000,
 };
 
 enum dev_master {
@@ -315,6 +315,9 @@ enum {                                 /* adapter flags */
        USING_MSI          = (1 << 1),
        USING_MSIX         = (1 << 2),
        FW_OK              = (1 << 4),
+       USING_SOFT_PARAMS  = (1 << 6),
+       MASTER_PF          = (1 << 7),
+       FW_OFLD_CONN       = (1 << 9),
 };
 
 struct rx_sw_desc;
@@ -467,6 +470,11 @@ struct sge {
        u16 rdma_rxq[NCHAN];
        u16 timer_val[SGE_NTIMERS];
        u8 counter_val[SGE_NCOUNTERS];
+       u32 fl_pg_order;            /* large page allocation size */
+       u32 stat_len;               /* length of status page at ring end */
+       u32 pktshift;               /* padding between CPL & packet data */
+       u32 fl_align;               /* response queue message alignment */
+       u32 fl_starve_thres;        /* Free List starvation threshold */
        unsigned int starve_thres;
        u8 idma_state[2];
        unsigned int egr_start;
@@ -619,7 +627,7 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
 int t4_sge_alloc_ofld_txq(struct adapter *adap, struct sge_ofld_txq *txq,
                          struct net_device *dev, unsigned int iqid);
 irqreturn_t t4_sge_intr_msix(int irq, void *cookie);
-void t4_sge_init(struct adapter *adap);
+int t4_sge_init(struct adapter *adap);
 void t4_sge_start(struct adapter *adap);
 void t4_sge_stop(struct adapter *adap);
 extern int dbfifo_int_thresh;
@@ -638,6 +646,14 @@ static inline unsigned int us_to_core_ticks(const struct adapter *adap,
        return (us * adap->params.vpd.cclk) / 1000;
 }
 
+static inline unsigned int core_ticks_to_us(const struct adapter *adapter,
+                                           unsigned int ticks)
+{
+       /* add Core Clock / 2 to round ticks to nearest uS */
+       return ((ticks * 1000 + adapter->params.vpd.cclk/2) /
+               adapter->params.vpd.cclk);
+}
+
 void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask,
                      u32 val);
 
@@ -664,6 +680,8 @@ int t4_wait_dev_ready(struct adapter *adap);
 int t4_link_start(struct adapter *adap, unsigned int mbox, unsigned int port,
                  struct link_config *lc);
 int t4_restart_aneg(struct adapter *adap, unsigned int mbox, unsigned int port);
+int t4_memory_write(struct adapter *adap, int mtype, u32 addr, u32 len,
+                   __be32 *buf);
 int t4_seeprom_wp(struct adapter *adapter, bool enable);
 int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size);
 int t4_check_fw_version(struct adapter *adapter);