cxgb4: collect egress and ingress SGE queue contexts
[linux-2.6-microblaze.git] / drivers / net / ethernet / chelsio / cxgb4 / t4_hw.c
index ccb2798..112963d 100644 (file)
@@ -6530,18 +6530,21 @@ void t4_sge_decode_idma_state(struct adapter *adapter, int state)
  *      t4_sge_ctxt_flush - flush the SGE context cache
  *      @adap: the adapter
  *      @mbox: mailbox to use for the FW command
+ *      @ctx_type: Egress or Ingress
  *
  *      Issues a FW command through the given mailbox to flush the
  *      SGE context cache.
  */
-int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox)
+int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox, int ctxt_type)
 {
        int ret;
        u32 ldst_addrspace;
        struct fw_ldst_cmd c;
 
        memset(&c, 0, sizeof(c));
-       ldst_addrspace = FW_LDST_CMD_ADDRSPACE_V(FW_LDST_ADDRSPC_SGE_EGRC);
+       ldst_addrspace = FW_LDST_CMD_ADDRSPACE_V(ctxt_type == CTXT_EGRESS ?
+                                                FW_LDST_ADDRSPC_SGE_EGRC :
+                                                FW_LDST_ADDRSPC_SGE_INGC);
        c.op_to_addrspace = cpu_to_be32(FW_CMD_OP_V(FW_LDST_CMD) |
                                        FW_CMD_REQUEST_F | FW_CMD_READ_F |
                                        ldst_addrspace);