#endif
#include "cnic_drv.h"
#include "bnx2.h"
+#ifdef BCM_BNX2X
#include "bnx2x_reg.h"
#include "bnx2x_fw_defs.h"
#include "bnx2x_hsi.h"
+#endif
#include "cnic_if.h"
#include "cnic.h"
#include "cnic_defs.h"
+#ifdef BCM_BNX2X
#include "5710_hsi_cnic.h"
+#endif
#include "57xx_iscsi_constants.h"
#define DRV_MODULE_NAME "cnic"
struct cnic_ulp_ops *cnic_ulp_tbl[MAX_CNIC_ULP_TYPE];
static int cnic_service_bnx2(void *, void *);
+#ifdef BCM_BNX2X
static int cnic_service_bnx2x(void *, void *);
+#endif
static int cnic_ctl(void *, struct cnic_ctl_info *);
static struct cnic_ops cnic_bnx2_ops = {
.cnic_ctl = cnic_ctl,
};
+#ifdef BCM_BNX2X
static struct cnic_ops cnic_bnx2x_ops = {
.cnic_owner = THIS_MODULE,
.cnic_handler = cnic_service_bnx2x,
.cnic_ctl = cnic_ctl,
};
+#endif
static inline void cnic_hold(struct cnic_dev *dev)
{
ethdev->drv_ctl(dev->netdev, &info);
}
+#ifdef BCM_BNX2X
static void cnic_ctx_tbl_wr(struct cnic_dev *dev, u32 off, dma_addr_t addr)
{
struct cnic_local *cp = dev->cnic_priv;
io->dma_addr = addr;
ethdev->drv_ctl(dev->netdev, &info);
}
+#endif
static void cnic_reg_wr_ind(struct cnic_dev *dev, u32 off, u32 val)
{
ethdev->drv_ctl(dev->netdev, &info);
}
+#ifdef BCM_BNX2X
static int cnic_get_l5_cid(struct cnic_local *cp, u32 cid, u32 *l5_cid)
{
u32 i;
}
return -EINVAL;
}
+#endif
static int cnic_in_use(struct cnic_sock *csk)
return 0;
}
+#ifdef BCM_BNX2X
static int cnic_init_id_tbl(struct cnic_id_tbl *id_tbl, u32 max, u32 reserved)
{
int i;
return 0;
}
+#endif
static void cnic_free_id_tbl(struct cnic_id_tbl *id_tbl)
{
id_tbl->table = NULL;
}
+#ifdef BCM_BNX2X
/* Returns -1 if not successful */
static u32 cnic_alloc_cid(struct cnic_id_tbl *id_tbl)
{
return cid;
}
+#endif
void cnic_free_cid(struct cnic_id_tbl *id_tbl, u32 cid)
{
}
}
+#ifdef BCM_BNX2X
static void cnic_setup_page_tbl_le(struct cnic_dev *dev, struct cnic_dma *dma)
{
int i;
page_table++;
}
}
+#endif
static int cnic_alloc_dma(struct cnic_dev *dev, struct cnic_dma *dma,
int pages, int use_pg_tbl)
return ret;
}
+#ifdef BCM_BNX2X
static int cnic_alloc_bnx2x_context(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
cnic_free_resc(dev);
return -ENOMEM;
}
+#endif
static inline u32 cnic_kwq_avail(struct cnic_local *cp)
{
prod = cp->kwq_prod_idx;
sw_prod = prod & MAX_KWQ_IDX;
for (i = 0; i < num_wqes; i++) {
- prod_qe = &cp->kwq[KWQ_PG(sw_prod)][KWQ_IDX(sw_prod)];
+ prod_qe = &cp->kwq[KWQ_PG(sw_prod)][KWQ_IDX(sw_prod)];
memcpy(prod_qe, wqes[i], sizeof(struct kwqe));
prod++;
sw_prod = prod & MAX_KWQ_IDX;
return 0;
}
+#ifdef BCM_BNX2X
static void *cnic_get_kwqe_16_data(struct cnic_local *cp, u32 l5_cid,
union l5cm_specific_data *l5_data)
{
}
return 0;
}
+#endif
static void service_kcqes(struct cnic_dev *dev, int num_cqes)
{
return;
}
+#ifdef BCM_BNX2X
static void cnic_bnx2x_kcqe_hook(struct cnic_local *cp, struct kcqe *kcqe)
{
u32 opcode = KCQE_OPCODE(kcqe->kcqe_op_flag);
BUG();
}
}
+#endif
static u16 cnic_bnx2_next_idx(u16 idx)
{
return idx;
}
+#ifdef BCM_BNX2X
static u16 cnic_bnx2x_next_idx(u16 idx)
{
idx++;
idx++;
return idx;
}
+#endif
static int cnic_get_kcqes(struct cnic_dev *dev, u16 hw_prod, u16 *sw_prod)
{
return IRQ_HANDLED;
}
+#ifdef BCM_BNX2X
static inline void cnic_ack_bnx2x_int(struct cnic_dev *dev, u8 id, u8 storm,
u16 index, u8 op, u8 update)
{
tasklet_schedule(&cp->cnic_irq_task);
return 0;
}
+#endif
static void cnic_ulp_stop(struct cnic_dev *dev)
{
mutex_unlock(&cnic_lock);
cnic_put(dev);
break;
+#ifdef BCM_BNX2X
case CNIC_CTL_COMPLETION_CMD: {
u32 cid = BNX2X_SW_CID(info->data.comp.cid);
u32 l5_cid;
}
break;
}
+#endif
default:
return -EINVAL;
}
return 0;
}
+#ifdef BCM_BNX2X
static void cnic_close_bnx2x_conn(struct cnic_sock *csk, u32 opcode)
{
struct cnic_dev *dev = csk->dev;
DEF_MAX_CWND);
return 0;
}
+#endif
static int cnic_cm_open(struct cnic_dev *dev)
{
return 0;
}
+#ifdef BCM_BNX2X
static void cnic_setup_bnx2x_context(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
return 0;
}
+#endif
static int cnic_start_hw(struct cnic_dev *dev)
{
cnic_free_resc(dev);
}
+#ifdef BCM_BNX2X
static void cnic_stop_bnx2x_hw(struct cnic_dev *dev)
{
struct cnic_local *cp = dev->cnic_priv;
0);
cnic_free_resc(dev);
}
+#endif
static void cnic_stop_hw(struct cnic_dev *dev)
{
return NULL;
}
+#ifdef BCM_BNX2X
static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev)
{
struct pci_dev *pdev;
cp->hw_idx = cnic_bnx2x_hw_idx;
return cdev;
}
+#endif
static struct cnic_dev *is_cnic_dev(struct net_device *dev)
{
if (!strcmp(drvinfo.driver, "bnx2"))
cdev = init_bnx2_cnic(dev);
+#ifdef BCM_BNX2X
if (!strcmp(drvinfo.driver, "bnx2x"))
cdev = init_bnx2x_cnic(dev);
+#endif
if (cdev) {
#ifndef __VMKLNX__
write_lock(&cnic_dev_lock);