35 #define GOLAN_PCI_CONFIG_BAR_SIZE 0x100000//HERMON_PCI_CONFIG_BAR_SIZE //TODO: What is the BAR size? 37 #define GOLAN_PAS_SIZE sizeof(uint64_t) 39 #define GOLAN_INVALID_LKEY 0x00000100UL 41 #define GOLAN_MAX_PORTS 2 42 #define GOLAN_PORT_BASE 1 44 #define MELLANOX_VID 0x15b3 45 #define GOLAN_HCA_BAR PCI_BASE_ADDRESS_0 //BAR 0 47 #define GOLAN_HCR_MAX_WAIT_MS 10000 49 #define min(a,b) ((a)<(b)?(a):(b)) 51 #define GOLAN_PAGE_SHIFT 12 52 #define GOLAN_PAGE_SIZE (1 << GOLAN_PAGE_SHIFT) 53 #define GOLAN_PAGE_MASK (GOLAN_PAGE_SIZE - 1) 55 #define MAX_MBOX ( GOLAN_PAGE_SIZE / MAILBOX_STRIDE ) 58 #define NO_MBOX 0xffff 59 #define MEM_MBOX MEM_CMD_IDX 60 #define GEN_MBOX DEF_CMD_IDX 64 #define MAX_PASE_MBOX ((GOLAN_CMD_PAS_CNT) - 2) 66 #define CMD_STATUS( golan , idx ) ((struct golan_outbox_hdr *)(get_cmd( (golan) , (idx) )->out))->status 67 #define CMD_SYND( golan , idx ) ((struct golan_outbox_hdr *)(get_cmd( (golan) , (idx) )->out))->syndrome 68 #define QRY_PAGES_OUT( golan, idx ) ((struct golan_query_pages_outbox *)(get_cmd( (golan) , (idx) )->out)) 70 #define VIRT_2_BE64_BUS( addr ) cpu_to_be64(((unsigned long long )virt_to_bus(addr))) 71 #define BE64_BUS_2_VIRT( addr ) bus_to_virt(be64_to_cpu(addr)) 72 #define USR_2_BE64_BUS( addr ) cpu_to_be64(((unsigned long long )user_to_phys(addr, 0))) 73 #define BE64_BUS_2_USR( addr ) be64_to_cpu(phys_to_user(addr)) 75 #define GET_INBOX(golan, idx) (&(((struct mbox *)(golan->mboxes.inbox))[idx])) 76 #define GET_OUTBOX(golan, idx) (&(((struct mbox *)(golan->mboxes.outbox))[idx])) 78 #define GOLAN_MBOX_IN( cmd_ptr, in_ptr ) ( { \ 81 typeof ( *(in_ptr) ) cooked; \ 82 } *u = container_of ( &(cmd_ptr)->in[0], typeof ( *u ), raw[0] ); \ 85 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 127 #define GOLAN_SEND_WQE_BB_SIZE 64 128 #define GOLAN_SEND_UD_WQE_SIZE sizeof(struct golan_send_wqe_ud) 129 #define GOLAN_RECV_WQE_SIZE sizeof(struct golan_recv_wqe_ud) 130 #define GOLAN_WQEBBS_PER_SEND_UD_WQE DIV_ROUND_UP(GOLAN_SEND_UD_WQE_SIZE, GOLAN_SEND_WQE_BB_SIZE) 131 #define GOLAN_SEND_OPCODE 0x0a 132 #define GOLAN_WQE_CTRL_WQE_IDX_BIT 8 190 #define GOLAN_CQE_OPCODE_NOT_VALID 0x0f 191 #define GOLAN_CQE_OPCODE_BIT 4 192 #define GOLAN_CQ_DB_RECORD_SIZE sizeof(uint64_t) 193 #define GOLAN_CQE_OWNER_MASK 1 195 #define MANAGE_PAGES_PSA_OFFSET 0 196 #define PXE_CMDIF_REF 5 216 #define GOLAN_EQE_SIZE sizeof(struct golan_eqe) 217 #define GOLAN_NUM_EQES 8 218 #define GOLAN_EQ_DOORBELL_OFFSET 0x40 219 #define DB_BUFFER0_EVEN_OFFSET 0x800 220 #define DB_BUFFER0_ODD_OFFSET 0x900 222 #define GOLAN_EQ_MAP_ALL_EVENTS \ 223 ((1 << GOLAN_EVENT_TYPE_PATH_MIG )| \ 224 (1 << GOLAN_EVENT_TYPE_COMM_EST )| \ 225 (1 << GOLAN_EVENT_TYPE_SQ_DRAINED )| \ 226 (1 << GOLAN_EVENT_TYPE_SRQ_LAST_WQE )| \ 227 (1 << GOLAN_EVENT_TYPE_SRQ_RQ_LIMIT )| \ 228 (1 << GOLAN_EVENT_TYPE_CQ_ERROR )| \ 229 (1 << GOLAN_EVENT_TYPE_WQ_CATAS_ERROR )| \ 230 (1 << GOLAN_EVENT_TYPE_PATH_MIG_FAILED )| \ 231 (1 << GOLAN_EVENT_TYPE_WQ_INVAL_REQ_ERROR )| \ 232 (1 << GOLAN_EVENT_TYPE_WQ_ACCESS_ERROR )| \ 233 (1 << GOLAN_EVENT_TYPE_SRQ_CATAS_ERROR )| \ 234 (1 << GOLAN_EVENT_TYPE_INTERNAL_ERROR )| \ 235 (1 << GOLAN_EVENT_TYPE_PORT_CHANGE )| \ 236 (1 << GOLAN_EVENT_TYPE_GPIO_EVENT )| \ 237 (1 << GOLAN_EVENT_TYPE_CLIENT_RE_REGISTER )| \ 238 (1 << GOLAN_EVENT_TYPE_REMOTE_CONFIG )| \ 239 (1 << GOLAN_EVENT_TYPE_DB_BF_CONGESTION )| \ 240 (1 << GOLAN_EVENT_TYPE_STALL_EVENT )| \ 241 (1 << GOLAN_EVENT_TYPE_PACKET_DROPPED )| \ 242 (1 << GOLAN_EVENT_TYPE_CMD )| \ 243 (1 << GOLAN_EVENT_TYPE_PAGE_REQUEST )) 321 #define GOLAN_OPEN 0x1 340 #define GOLAN_FW_AREAS_NUM 2
struct golan_wqe_data_seg data[2]
struct golan_firmware_area fw_areas[GOLAN_FW_AREAS_NUM]
struct golan_wqe_ctrl_seg ctrl
unsigned long long uint64_t
#define GOLAN_WQEBBS_PER_SEND_UD_WQE
struct golan_hca_cap caps
unsigned long long __be64
A doubly-linked list entry (or list head)
#define GOLAN_FW_AREAS_NUM
uint8_t pad[GOLAN_WQEBBS_PER_SEND_UD_WQE *GOLAN_SEND_WQE_BB_SIZE]
uint32_t userptr_t
A pointer to a user buffer.
union golan_send_wqe * wqes
struct golan_port ports[GOLAN_MAX_PORTS]
struct golan_hca_init_seg * iseg
struct golan_wqe_data_seg data
struct golan_mboxes mboxes
struct net_device * netdev
Network device.
size_t grh_size
Size of GRH buffers.
struct ib_device * ibdev
Infiniband device.
struct golan_event_queue eq
struct ib_global_route_header * grh
GRH buffers (if applicable)
struct golan_recv_wqe_ud * wqes
struct golan_cqe64 * cqes
struct golan_send_wqe_ud ud
struct golan_qp_db * doorbell_record
#define GOLAN_SEND_WQE_BB_SIZE
enum golan_ib_qp_state state
FILE_LICENCE(GPL2_OR_LATER)
userptr_t area
Firmware area in external memory.
PCI configuration space backup and restoration.