Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170648
b: refs/heads/master
c: e251306
h: refs/heads/master
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Oct 12, 2009
1 parent 7816d02 commit 159c93a
Show file tree
Hide file tree
Showing 5 changed files with 2,002 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 86b53606ebec06b16be81c30fabdf8decc2be6b2
refs/heads/master: e251306556d30c9c678feca60204acaaa0784cbd
16 changes: 15 additions & 1 deletion trunk/drivers/net/bnx2x_hsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
* the Free Software Foundation.
*/

struct license_key {
u32 reserved[6];

#if defined(__BIG_ENDIAN)
u16 max_iscsi_init_conn;
u16 max_iscsi_trgt_conn;
#elif defined(__LITTLE_ENDIAN)
u16 max_iscsi_trgt_conn;
u16 max_iscsi_init_conn;
#endif

u32 reserved_a[6];
};


#define PORT_0 0
#define PORT_1 1
Expand Down Expand Up @@ -881,7 +895,7 @@ struct shmem_region { /* SharedMem Offset (size) */

struct shm_dev_info dev_info; /* 0x8 (0x438) */

u8 reserved[52*PORT_MAX];
struct license_key drv_lic_key[PORT_MAX]; /* 0x440 (52*2=0x68) */

/* FW information (for internal FW use) */
u32 fw_info_fio_offset; /* 0x4a8 (0x4) */
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/net/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@

#include "cnic_if.h"
#include "bnx2.h"
#include "bnx2x_reg.h"
#include "bnx2x_fw_defs.h"
#include "bnx2x_hsi.h"
#include "../scsi/bnx2i/57xx_iscsi_constants.h"
#include "../scsi/bnx2i/57xx_iscsi_hsi.h"
#include "cnic.h"
#include "cnic_defs.h"

Expand Down
64 changes: 64 additions & 0 deletions trunk/drivers/net/cnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ struct cnic_local {
void *status_blk;
struct status_block_msix *bnx2_status_blk;
struct host_status_block *bnx2x_status_blk;
struct host_def_status_block *bnx2x_def_status_blk;

u32 status_blk_num;
u32 int_num;
Expand Down Expand Up @@ -258,6 +259,7 @@ struct cnic_local {
struct cnic_ctx *ctx_arr;
int ctx_blks;
int ctx_blk_size;
unsigned long ctx_align;
int cids_per_blk;

u32 chip_id;
Expand Down Expand Up @@ -290,11 +292,73 @@ struct bnx2x_bd_chain_next {
u8 reserved[8];
};

#define ISCSI_DEFAULT_MAX_OUTSTANDING_R2T (1)

#define ISCSI_RAMROD_CMD_ID_UPDATE_CONN (ISCSI_KCQE_OPCODE_UPDATE_CONN)
#define ISCSI_RAMROD_CMD_ID_INIT (ISCSI_KCQE_OPCODE_INIT)

#define CDU_REGION_NUMBER_XCM_AG 2
#define CDU_REGION_NUMBER_UCM_AG 4

#define CDU_VALID_DATA(_cid, _region, _type) \
(((_cid) << 8) | (((_region)&0xf)<<4) | (((_type)&0xf)))

#define CDU_CRC8(_cid, _region, _type) \
(calc_crc8(CDU_VALID_DATA(_cid, _region, _type), 0xff))

#define CDU_RSRVD_VALUE_TYPE_A(_cid, _region, _type) \
(0x80 | ((CDU_CRC8(_cid, _region, _type)) & 0x7f))

#define BNX2X_CONTEXT_MEM_SIZE 1024
#define BNX2X_FCOE_CID 16

/* iSCSI client IDs are 17, 19, 21, 23 */
#define BNX2X_ISCSI_BASE_CL_ID 17
#define BNX2X_ISCSI_CL_ID(vn) (BNX2X_ISCSI_BASE_CL_ID + ((vn) << 1))

#define BNX2X_ISCSI_L2_CID 17
#define BNX2X_ISCSI_START_CID 18
#define BNX2X_ISCSI_NUM_CONNECTIONS 128
#define BNX2X_ISCSI_TASK_CONTEXT_SIZE 128
#define BNX2X_ISCSI_MAX_PENDING_R2TS 4
#define BNX2X_ISCSI_R2TQE_SIZE 8
#define BNX2X_ISCSI_HQ_BD_SIZE 64
#define BNX2X_ISCSI_CONN_BUF_SIZE 64
#define BNX2X_ISCSI_GLB_BUF_SIZE 64
#define BNX2X_ISCSI_PBL_NOT_CACHED 0xff
#define BNX2X_ISCSI_PDU_HEADER_NOT_CACHED 0xff
#define BNX2X_HW_CID(x, func) ((x) | (((func) % PORT_MAX) << 23) | \
(((func) >> 1) << 17))
#define BNX2X_SW_CID(x) (x & 0x1ffff)
#define BNX2X_CHIP_NUM_57711 0x164f
#define BNX2X_CHIP_NUM_57711E 0x1650
#define BNX2X_CHIP_NUM(x) (x >> 16)
#define BNX2X_CHIP_IS_57711(x) \
(BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57711)
#define BNX2X_CHIP_IS_57711E(x) \
(BNX2X_CHIP_NUM(x) == BNX2X_CHIP_NUM_57711E)
#define BNX2X_CHIP_IS_E1H(x) \
(BNX2X_CHIP_IS_57711(x) || BNX2X_CHIP_IS_57711E(x))
#define IS_E1H_OFFSET BNX2X_CHIP_IS_E1H(cp->chip_id)

#define BNX2X_RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_bd))
#define BNX2X_MAX_RX_DESC_CNT (BNX2X_RX_DESC_CNT - 2)
#define BNX2X_RCQ_DESC_CNT (BCM_PAGE_SIZE / sizeof(union eth_rx_cqe))
#define BNX2X_MAX_RCQ_DESC_CNT (BNX2X_RCQ_DESC_CNT - 1)

#define BNX2X_DEF_SB_ID 16

#define BNX2X_ISCSI_RX_SB_INDEX_NUM \
((HC_INDEX_DEF_U_ETH_ISCSI_RX_CQ_CONS << \
USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER_SHIFT) & \
USTORM_ETH_ST_CONTEXT_CONFIG_CQE_SB_INDEX_NUMBER)

#define BNX2X_SHMEM_ADDR(base, field) (base + \
offsetof(struct shmem_region, field))

#define CNIC_PORT(cp) ((cp)->func % PORT_MAX)
#define CNIC_FUNC(cp) ((cp)->func)
#define CNIC_E1HVN(cp) ((cp)->func >> 1)

#endif

Loading

0 comments on commit 159c93a

Please sign in to comment.