iPXE
|
QLogic QIB7322 Infiniband HCA. More...
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <assert.h>
#include <ipxe/io.h>
#include <ipxe/pci.h>
#include <ipxe/infiniband.h>
#include <ipxe/i2c.h>
#include <ipxe/bitbash.h>
#include <ipxe/malloc.h>
#include <ipxe/iobuf.h>
#include <ipxe/pcibackup.h>
#include "qib7322.h"
Go to the source code of this file.
Data Structures | |
struct | qib7322_send_buffers |
A QIB7322 send buffer set. More... | |
struct | qib7322_send_work_queue |
A QIB7322 send work queue. More... | |
struct | qib7322_recv_work_queue |
A QIB7322 receive work queue. More... | |
struct | qib7322 |
A QIB7322 HCA. More... | |
Macros | |
#define | qib7322_readq(_qib7322, _ptr, _offset) qib7322_readq ( (_qib7322), (_ptr)->u.qwords, (_offset) ) |
#define | qib7322_readq_array8b(_qib7322, _ptr, _offset, _idx) qib7322_readq ( (_qib7322), (_ptr), ( (_offset) + ( (_idx) * 8 ) ) ) |
#define | qib7322_readq_array64k(_qib7322, _ptr, _offset, _idx) qib7322_readq ( (_qib7322), (_ptr), ( (_offset) + ( (_idx) * 65536 ) ) ) |
#define | qib7322_readq_port(_qib7322, _ptr, _offset, _port) qib7322_readq ( (_qib7322), (_ptr), ( (_offset) + ( (_port) * 4096 ) ) ) |
#define | qib7322_writeq(_qib7322, _ptr, _offset) qib7322_writeq ( (_qib7322), (_ptr)->u.qwords, (_offset) ) |
#define | qib7322_writeq_array8b(_qib7322, _ptr, _offset, _idx) qib7322_writeq ( (_qib7322), (_ptr), ( (_offset) + ( (_idx) * 8 ) ) ) |
#define | qib7322_writeq_array64k(_qib7322, _ptr, _offset, _idx) qib7322_writeq ( (_qib7322), (_ptr), ( (_offset) + ( (_idx) * 65536 ) )) |
#define | qib7322_writeq_port(_qib7322, _ptr, _offset, _port) qib7322_writeq ( (_qib7322), (_ptr), ( (_offset) + ( (_port) * 4096 ) )) |
#define | QIB7322_SEND_BUF_TOGGLE 0x8000 |
Send buffer toggle bit. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | qib7322_readq (struct qib7322 *qib7322, uint64_t *qword, unsigned long offset) |
Read QIB7322 qword register. More... | |
static void | qib7322_writeq (struct qib7322 *qib7322, const uint64_t *qword, unsigned long offset) |
Write QIB7322 qword register. More... | |
static void | qib7322_writel (struct qib7322 *qib7322, uint32_t dword, unsigned long offset) |
Write QIB7322 dword register. More... | |
static const char * | qib7322_link_state_text (unsigned int link_state) |
Textual representation of link state. More... | |
static void | qib7322_link_state_changed (struct ib_device *ibdev) |
Handle link state change. More... | |
static int | qib7322_link_state_check (struct ib_device *ibdev, unsigned int new_link_state) |
Wait for link state change to take effect. More... | |
static int | qib7322_set_port_info (struct ib_device *ibdev, union ib_mad *mad) |
Set port information. More... | |
static int | qib7322_set_pkey_table (struct ib_device *ibdev __unused, union ib_mad *mad __unused) |
Set partition key table. More... | |
static int | qib7322_alloc_ctx (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Allocate a context and set queue pair number. More... | |
static unsigned int | qib7322_ctx (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Get queue pair context number. More... | |
static void | qib7322_free_ctx (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Free a context. More... | |
static struct qib7322_send_buffers * | qib7322_create_send_bufs (struct qib7322 *qib7322, unsigned long base, unsigned int size, unsigned int start, unsigned int count) |
Create send buffer set. More... | |
static void | qib7322_destroy_send_bufs (struct qib7322 *qib7322 __unused, struct qib7322_send_buffers *send_bufs) |
Destroy send buffer set. More... | |
static int | qib7322_alloc_send_buf (struct qib7322 *qib7322, struct qib7322_send_buffers *send_bufs) |
Allocate a send buffer. More... | |
static void | qib7322_free_send_buf (struct qib7322 *qib7322 __unused, struct qib7322_send_buffers *send_bufs, unsigned int send_buf) |
Free a send buffer. More... | |
static int | qib7322_send_buf_in_use (struct qib7322 *qib7322, unsigned int send_buf) |
Check to see if send buffer is in use. More... | |
static unsigned long | qib7322_send_buffer_offset (struct qib7322 *qib7322 __unused, struct qib7322_send_buffers *send_bufs, unsigned int send_buf) |
Calculate starting offset for send buffer. More... | |
static int | qib7322_create_send_wq (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Create send work queue. More... | |
static void | qib7322_destroy_send_wq (struct ib_device *ibdev __unused, struct ib_queue_pair *qp) |
Destroy send work queue. More... | |
static int | qib7322_init_send (struct qib7322 *qib7322) |
Initialise send datapath. More... | |
static void | qib7322_fini_send (struct qib7322 *qib7322) |
Shut down send datapath. More... | |
static int | qib7322_create_recv_wq (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Create receive work queue. More... | |
static void | qib7322_destroy_recv_wq (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Destroy receive work queue. More... | |
static int | qib7322_init_recv (struct qib7322 *qib7322) |
Initialise receive datapath. More... | |
static void | qib7322_fini_recv (struct qib7322 *qib7322 __unused) |
Shut down receive datapath. More... | |
static int | qib7322_create_cq (struct ib_device *ibdev, struct ib_completion_queue *cq) |
Create completion queue. More... | |
static void | qib7322_destroy_cq (struct ib_device *ibdev, struct ib_completion_queue *cq) |
Destroy completion queue. More... | |
static int | qib7322_create_qp (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Create queue pair. More... | |
static int | qib7322_modify_qp (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Modify queue pair. More... | |
static void | qib7322_destroy_qp (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Destroy queue pair. More... | |
static int | qib7322_post_send (struct ib_device *ibdev, struct ib_queue_pair *qp, struct ib_address_vector *dest, struct io_buffer *iobuf) |
Post send work queue entry. More... | |
static void | qib7322_complete_send (struct ib_device *ibdev, struct ib_queue_pair *qp, unsigned int wqe_idx) |
Complete send work queue entry. More... | |
static void | qib7322_poll_send_wq (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Poll send work queue. More... | |
static int | qib7322_post_recv (struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf) |
Post receive work queue entry. More... | |
static void | qib7322_complete_recv (struct ib_device *ibdev, struct ib_queue_pair *qp, unsigned int header_offs) |
Complete receive work queue entry. More... | |
static void | qib7322_poll_recv_wq (struct ib_device *ibdev, struct ib_queue_pair *qp) |
Poll receive work queue. More... | |
static void | qib7322_poll_cq (struct ib_device *ibdev, struct ib_completion_queue *cq) |
Poll completion queue. More... | |
static void | qib7322_poll_eq (struct ib_device *ibdev) |
Poll event queue. More... | |
static unsigned int | qib7322_link_speed_supported (struct qib7322 *qib7322, unsigned int port) |
Determine supported link speeds. More... | |
static int | qib7322_open (struct ib_device *ibdev) |
Initialise Infiniband link. More... | |
static void | qib7322_close (struct ib_device *ibdev) |
Close Infiniband link. More... | |
static int | qib7322_mcast_attach (struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid) |
Attach to multicast group. More... | |
static void | qib7322_mcast_detach (struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid) |
Detach from multicast group. More... | |
static int | qib7322_i2c_read_bit (struct bit_basher *basher, unsigned int bit_id) |
Read QIB7322 I2C line status. More... | |
static void | qib7322_i2c_write_bit (struct bit_basher *basher, unsigned int bit_id, unsigned long data) |
Write QIB7322 I2C line status. More... | |
static int | qib7322_init_i2c (struct qib7322 *qib7322) |
Initialise QIB7322 I2C subsystem. More... | |
static int | qib7322_read_eeprom (struct qib7322 *qib7322) |
Read EEPROM parameters. More... | |
static int | qib7322_ahb_wait (struct qib7322 *qib7322) |
Wait for AHB transaction to complete. More... | |
static int | qib7322_ahb_request (struct qib7322 *qib7322, unsigned int location) |
Request ownership of the AHB. More... | |
static void | qib7322_ahb_release (struct qib7322 *qib7322) |
Release ownership of the AHB. More... | |
static int | qib7322_ahb_read (struct qib7322 *qib7322, unsigned int location, uint32_t *data) |
Read data via AHB. More... | |
static int | qib7322_ahb_write (struct qib7322 *qib7322, unsigned int location, uint32_t data) |
Write data via AHB. More... | |
static int | qib7322_ahb_mod_reg (struct qib7322 *qib7322, unsigned int location, uint32_t value, uint32_t mask) |
Read/modify/write AHB register. More... | |
static int | qib7322_ahb_mod_reg_all (struct qib7322 *qib7322, unsigned int reg, uint32_t value, uint32_t mask) |
Read/modify/write AHB register across all ports and channels. More... | |
static int | qib7322_init_ib_serdes (struct qib7322 *qib7322) |
Initialise the IB SerDes. More... | |
static void | qib7322_reset (struct qib7322 *qib7322, struct pci_device *pci) |
Reset QIB7322. More... | |
static int | qib7322_probe (struct pci_device *pci) |
Probe PCI device. More... | |
static void | qib7322_remove (struct pci_device *pci) |
Remove PCI device. More... | |
Variables | |
struct qib7322_send_buffers | __attribute__ |
static struct ib_device_operations | qib7322_ib_operations |
QIB7322 Infiniband operations. More... | |
static unsigned int | qib7322_i2c_bits [] |
QIB7322 I2C bit to GPIO mappings. More... | |
static struct bit_basher_operations | qib7322_i2c_basher_ops |
QIB7322 I2C bit-bashing interface operations. More... | |
static struct pci_device_id | qib7322_nics [] |
struct pci_driver qib7322_driver | __pci_driver |
QLogic QIB7322 Infiniband HCA.
Definition in file qib7322.c.
#define qib7322_readq | ( | _qib7322, | |
_ptr, | |||
_offset | |||
) | qib7322_readq ( (_qib7322), (_ptr)->u.qwords, (_offset) ) |
#define qib7322_readq_array8b | ( | _qib7322, | |
_ptr, | |||
_offset, | |||
_idx | |||
) | qib7322_readq ( (_qib7322), (_ptr), ( (_offset) + ( (_idx) * 8 ) ) ) |
#define qib7322_readq_array64k | ( | _qib7322, | |
_ptr, | |||
_offset, | |||
_idx | |||
) | qib7322_readq ( (_qib7322), (_ptr), ( (_offset) + ( (_idx) * 65536 ) ) ) |
#define qib7322_readq_port | ( | _qib7322, | |
_ptr, | |||
_offset, | |||
_port | |||
) | qib7322_readq ( (_qib7322), (_ptr), ( (_offset) + ( (_port) * 4096 ) ) ) |
#define qib7322_writeq | ( | _qib7322, | |
_ptr, | |||
_offset | |||
) | qib7322_writeq ( (_qib7322), (_ptr)->u.qwords, (_offset) ) |
#define qib7322_writeq_array8b | ( | _qib7322, | |
_ptr, | |||
_offset, | |||
_idx | |||
) | qib7322_writeq ( (_qib7322), (_ptr), ( (_offset) + ( (_idx) * 8 ) ) ) |
#define qib7322_writeq_array64k | ( | _qib7322, | |
_ptr, | |||
_offset, | |||
_idx | |||
) | qib7322_writeq ( (_qib7322), (_ptr), ( (_offset) + ( (_idx) * 65536 ) )) |
#define qib7322_writeq_port | ( | _qib7322, | |
_ptr, | |||
_offset, | |||
_port | |||
) | qib7322_writeq ( (_qib7322), (_ptr), ( (_offset) + ( (_port) * 4096 ) )) |
#define QIB7322_SEND_BUF_TOGGLE 0x8000 |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
|
static |
Write QIB7322 qword register.
qib7322 | QIB7322 device |
qword | Register buffer to write |
offset | Register offset |
Definition at line 169 of file qib7322.c.
References offset, qib7322::regs, and writeq().
|
static |
Write QIB7322 dword register.
qib7322 | QIB7322 device |
dword | Value to write |
offset | Register offset |
Definition at line 189 of file qib7322.c.
References offset, qib7322::regs, and writel().
Referenced by qib7322_post_send().
|
static |
Textual representation of link state.
link_state | Link state |
link_text | Link state text |
Definition at line 207 of file qib7322.c.
References QIB7322_LINK_STATE_ACT_DEFER, QIB7322_LINK_STATE_ACTIVE, QIB7322_LINK_STATE_ARM, QIB7322_LINK_STATE_DOWN, and QIB7322_LINK_STATE_INIT.
Referenced by qib7322_link_state_changed(), qib7322_link_state_check(), and qib7322_set_port_info().
|
static |
Handle link state change.
qib7322 | QIB7322 device |
Definition at line 223 of file qib7322.c.
References BIT_GET, BIT_SET, DBGC, ib_get_drvdata(), IB_LINK_SPEED_DDR, IB_LINK_SPEED_SDR, ib_link_state_changed(), IB_LINK_WIDTH_1X, IB_LINK_WIDTH_4X, qib7322::ibdev, ib_device::link_speed_active, ib_device::link_width_active, port, ib_device::port, ib_device::port_state, QIB7322_LINK_STATE_ACTIVE, QIB7322_LINK_STATE_INIT, qib7322_link_state_text(), QIB7322_PORT_BASE, qib7322_readq, qib7322_readq_port, qib7322_writeq, QIB_7322_EXTCtrl_offset, and QIB_7322_IBCStatusA_0_offset.
Referenced by qib7322_poll_eq(), and qib7322_set_port_info().
|
static |
Wait for link state change to take effect.
ibdev | Infiniband device |
new_link_state | Expected link state |
rc | Return status code |
Definition at line 279 of file qib7322.c.
References BIT_GET, DBGC, ETIMEDOUT, ib_get_drvdata(), qib7322::ibdev, port, ib_device::port, QIB7322_LINK_STATE_MAX_WAIT_US, qib7322_link_state_text(), QIB7322_PORT_BASE, qib7322_readq_port, QIB_7322_IBCStatusA_0_offset, and udelay().
Referenced by qib7322_set_port_info().
Set port information.
ibdev | Infiniband device |
mad | Set port information MAD |
Definition at line 307 of file qib7322.c.
References BIT_SET, DBGC, ib_get_drvdata(), qib7322::ibdev, ib_port_info::link_speed_supported__port_state, mad, port, ib_device::port, ib_smp_data::port_info, port_info, port_state, qib7322_link_state_changed(), qib7322_link_state_check(), qib7322_link_state_text(), QIB7322_PORT_BASE, qib7322_readq_port, qib7322_writeq_port, QIB_7322_IBCCtrlA_0_offset, ib_mad::smp, and ib_mad_smp::smp_data.
|
static |
Allocate a context and set queue pair number.
ibdev | Infiniband device |
qp | Queue pair |
rc | Return status code |
Definition at line 368 of file qib7322.c.
References ctx, DBGC, DBGC2, ENOENT, ib_get_drvdata(), qib7322::ibdev, port, ib_device::port, QIB7322_NUM_CONTEXTS, QIB7322_PORT_BASE, qp, and qib7322::used_ctx.
Referenced by qib7322_create_qp().
|
static |
Get queue pair context number.
ibdev | Infiniband device |
qp | Queue pair |
ctx | Context index |
Definition at line 397 of file qib7322.c.
References qib7322::ibdev, ib_device::port, QIB7322_PORT_BASE, and qp.
Referenced by qib7322_create_qp(), qib7322_create_recv_wq(), qib7322_destroy_recv_wq(), qib7322_free_ctx(), qib7322_poll_recv_wq(), and qib7322_post_recv().
|
static |
Free a context.
qib7322 | QIB7322 device |
ctx | Context index |
Definition at line 408 of file qib7322.c.
References ctx, DBGC2, ib_get_drvdata(), qib7322::ibdev, port, ib_device::port, qib7322_ctx(), QIB7322_PORT_BASE, qp, and qib7322::used_ctx.
Referenced by qib7322_create_qp(), and qib7322_destroy_qp().
|
static |
Create send buffer set.
qib7322 | QIB7322 device |
base | Send buffer base offset |
size | Send buffer size |
start | Index of first send buffer |
count | Number of send buffers |
send_bufs | Send buffer set |
Definition at line 445 of file qib7322.c.
References qib7322_send_buffers::avail, qib7322_send_buffers::base, base, count, qib7322_send_buffers::count, DBGC2, NULL, size, qib7322_send_buffers::size, start, qib7322_send_buffers::start, and zalloc().
Referenced by qib7322_init_send().
|
static |
Destroy send buffer set.
qib7322 | QIB7322 device |
send_bufs | Send buffer set |
Definition at line 479 of file qib7322.c.
References free.
Referenced by qib7322_fini_send(), and qib7322_init_send().
|
static |
Allocate a send buffer.
qib7322 | QIB7322 device |
send_bufs | Send buffer set |
send_buf | Send buffer, or negative error |
Definition at line 491 of file qib7322.c.
References qib7322_send_buffers::avail, qib7322_send_buffers::cons, qib7322_send_buffers::count, DBGC, ENOBUFS, qib7322_send_buffers::prod, and QIB7322_SEND_BUF_TOGGLE.
Referenced by qib7322_post_send().
|
static |
Free a send buffer.
qib7322 | QIB7322 device |
send_bufs | Send buffer set |
send_buf | Send buffer |
Definition at line 517 of file qib7322.c.
References qib7322_send_buffers::avail, qib7322_send_buffers::count, and qib7322_send_buffers::prod.
Referenced by qib7322_complete_send().
|
static |
Check to see if send buffer is in use.
qib7322 | QIB7322 device |
send_buf | Send buffer |
in_use | Send buffer is in use |
Definition at line 533 of file qib7322.c.
References BIT_GET, QIB7322_SEND_BUF_TOGGLE, and qib7322::sendbufavail.
Referenced by qib7322_poll_send_wq().
|
static |
Calculate starting offset for send buffer.
qib7322 | QIB7322 device |
send_buf | Send buffer |
offset | Starting offset |
Definition at line 557 of file qib7322.c.
References qib7322_send_buffers::base, index, QIB7322_SEND_BUF_TOGGLE, qib7322_send_buffers::size, and qib7322_send_buffers::start.
Referenced by qib7322_post_send().
|
static |
Create send work queue.
ibdev | Infiniband device |
qp | Queue pair |
Definition at line 572 of file qib7322.c.
References qib7322_send_work_queue::cons, ENOMEM, ib_get_drvdata(), IB_QPT_SMI, ib_wq_get_drvdata(), qib7322::ibdev, port, ib_device::port, qib7322_send_work_queue::prod, QIB7322_PORT_BASE, qp, qib7322_send_work_queue::send_bufs, qib7322::send_bufs_small, qib7322::send_bufs_vl15_port0, qib7322::send_bufs_vl15_port1, qib7322_send_work_queue::used, and zalloc().
Referenced by qib7322_create_qp().
|
static |
Destroy send work queue.
ibdev | Infiniband device |
qp | Queue pair |
Definition at line 609 of file qib7322.c.
References free, ib_wq_get_drvdata(), qp, and qib7322_send_work_queue::used.
Referenced by qib7322_create_qp(), and qib7322_destroy_qp().
|
static |
Initialise send datapath.
qib7322 | QIB7322 device |
rc | Return status code |
Definition at line 623 of file qib7322.c.
References BIT_FILL_1, BIT_GET, ENOMEM, free_phys(), malloc_phys(), memset(), qib7322_create_send_bufs(), qib7322_destroy_send_bufs(), QIB7322_LARGE_SEND_BUF_COUNT, QIB7322_LARGE_SEND_BUF_SIZE, qib7322_readq, QIB7322_SENDBUFAVAIL_ALIGN, QIB7322_SMALL_SEND_BUF_SIZE, QIB7322_SMALL_SEND_BUF_START, QIB7322_SMALL_SEND_BUF_USED, QIB7322_VL15_PORT0_SEND_BUF_COUNT, QIB7322_VL15_PORT0_SEND_BUF_SIZE, QIB7322_VL15_PORT0_SEND_BUF_START, QIB7322_VL15_PORT1_SEND_BUF_COUNT, QIB7322_VL15_PORT1_SEND_BUF_SIZE, QIB7322_VL15_PORT1_SEND_BUF_START, qib7322_writeq, QIB_7322_SendBufAvailAddr_offset, QIB_7322_SendBufBase_offset, QIB_7322_SendCtrl_0_offset, QIB_7322_SendCtrl_1_offset, QIB_7322_SendCtrl_offset, rc, qib7322::send_bufs_small, qib7322::send_bufs_vl15_port0, qib7322::send_bufs_vl15_port1, qib7322::sendbufavail, and virt_to_bus().
Referenced by qib7322_probe().
|
static |
Shut down send datapath.
qib7322 | QIB7322 device |
Definition at line 716 of file qib7322.c.
References free_phys(), mb(), memset(), qib7322_destroy_send_bufs(), qib7322_readq, qib7322_writeq, QIB_7322_SendCtrl_offset, qib7322::send_bufs_small, qib7322::send_bufs_vl15_port0, qib7322::send_bufs_vl15_port1, and qib7322::sendbufavail.
Referenced by qib7322_probe(), and qib7322_remove().
|
static |
Create receive work queue.
ibdev | Infiniband device |
qp | Queue pair |
rc | Return status code |
Definition at line 747 of file qib7322.c.
References BIT_FILL_1, BIT_SET, ctx, DBGC, qib7322_recv_work_queue::eager_cons, qib7322_recv_work_queue::eager_prod, ENOMEM, free_phys(), qib7322_recv_work_queue::header, qib7322_recv_work_queue::header_cons, qib7322_recv_work_queue::header_prod, ib_get_drvdata(), ib_wq_get_drvdata(), qib7322::ibdev, malloc_phys(), memset(), port, ib_device::port, qib7322_ctx(), QIB7322_PORT_BASE, qib7322_readq, qib7322_readq_port, QIB7322_RECV_HEADERS_ALIGN, QIB7322_RECV_HEADERS_SIZE, qib7322_writeq, qib7322_writeq_array64k, qib7322_writeq_array8b, qib7322_writeq_port, QIB_7322_RcvCtrl_0_offset, QIB_7322_RcvCtrl_offset, QIB_7322_RcvEgrIndexHead0_offset, QIB_7322_RcvHdrAddr0_offset, QIB_7322_RcvHdrHead0_offset, QIB_7322_RcvHdrTailAddr0_offset, qp, rc, and virt_to_bus().
Referenced by qib7322_create_qp().
|
static |
Destroy receive work queue.
ibdev | Infiniband device |
qp | Queue pair |
Definition at line 824 of file qib7322.c.
References BIT_SET, ctx, free_phys(), qib7322_recv_work_queue::header, ib_get_drvdata(), ib_wq_get_drvdata(), qib7322::ibdev, mb(), port, ib_device::port, qib7322_ctx(), QIB7322_PORT_BASE, qib7322_readq, qib7322_readq_port, QIB7322_RECV_HEADERS_SIZE, qib7322_writeq, qib7322_writeq_port, QIB_7322_RcvCtrl_0_offset, QIB_7322_RcvCtrl_offset, and qp.
Referenced by qib7322_create_qp(), and qib7322_destroy_qp().
|
static |
Initialise receive datapath.
qib7322 | QIB7322 device |
rc | Return status code |
Definition at line 858 of file qib7322.c.
References BIT_FILL_1, BIT_FILL_2, BIT_FILL_3, BIT_FILL_6, BIT_GET, build_assert, ctx, DBGC, qib7322_recv_work_queue::eager_array, qib7322_recv_work_queue::eager_entries, EINVAL, memset(), QIB7322_CONTEXTCFG_10CTX, QIB7322_CONTEXTCFG_18CTX, QIB7322_CONTEXTCFG_6CTX, QIB7322_EAGER_ARRAY_SIZE_10CTX_KERNEL, QIB7322_EAGER_ARRAY_SIZE_10CTX_USER, QIB7322_EAGER_ARRAY_SIZE_18CTX_KERNEL, QIB7322_EAGER_ARRAY_SIZE_18CTX_USER, QIB7322_EAGER_ARRAY_SIZE_6CTX_KERNEL, QIB7322_EAGER_ARRAY_SIZE_6CTX_USER, QIB7322_MAX_CREDITS_VL0, QIB7322_MAX_CREDITS_VL15, QIB7322_MAX_PORTS, QIB7322_NUM_CONTEXTS, QIB7322_QP_IDETH, qib7322_readq, QIB7322_RECV_HEADER_COUNT, QIB7322_RECV_HEADER_SIZE, qib7322_writeq, qib7322_writeq_array8b, QIB_7322_RcvBTHQP_0_offset, QIB_7322_RcvBTHQP_1_offset, QIB_7322_RcvCtrl_0_offset, QIB_7322_RcvCtrl_1_offset, QIB_7322_RcvCtrl_offset, QIB_7322_RcvEgrBase_offset, QIB_7322_RcvHdrCnt_offset, QIB_7322_RcvHdrEntSize_offset, QIB_7322_RcvQPMapTableA_0_offset, QIB_7322_RcvQPMapTableA_1_offset, QIB_7322_RcvQPMapTableB_0_offset, QIB_7322_RcvQPMapTableB_1_offset, QIB_7322_RcvQPMulticastContext_0_offset, QIB_7322_RcvQPMulticastContext_1_offset, QIB_7322_RxCreditVL0_0_offset, QIB_7322_RxCreditVL0_1_offset, and qib7322::recv_wq.
Referenced by qib7322_probe().
Shut down receive datapath.
qib7322 | QIB7322 device |
Definition at line 1018 of file qib7322.c.
Referenced by qib7322_probe(), and qib7322_remove().
|
static |
Create completion queue.
ibdev | Infiniband device |
cq | Completion queue |
rc | Return status code |
Definition at line 1038 of file qib7322.c.
References cqn, ib_completion_queue::cqn, DBGC, ib_get_drvdata(), and qib7322::ibdev.
|
static |
Destroy completion queue.
ibdev | Infiniband device |
cq | Completion queue |
Definition at line 1062 of file qib7322.c.
References ib_completion_queue::cqn, DBGC, ib_get_drvdata(), and qib7322::ibdev.
|
static |
Create queue pair.
ibdev | Infiniband device |
qp | Queue pair |
rc | Return status code |
Definition at line 1084 of file qib7322.c.
References ctx, ib_get_drvdata(), ib_wq_set_drvdata(), qib7322::ibdev, qib7322_alloc_ctx(), qib7322_create_recv_wq(), qib7322_create_send_wq(), qib7322_ctx(), qib7322_destroy_recv_wq(), qib7322_destroy_send_wq(), qib7322_free_ctx(), qp, rc, qib7322::recv_wq, and qib7322::send_wq.
|
static |
Modify queue pair.
ibdev | Infiniband device |
qp | Queue pair |
rc | Return status code |
Definition at line 1125 of file qib7322.c.
References DBGC2, ib_get_drvdata(), qib7322::ibdev, and qp.
|
static |
Destroy queue pair.
ibdev | Infiniband device |
qp | Queue pair |
Definition at line 1142 of file qib7322.c.
References qib7322::ibdev, qib7322_destroy_recv_wq(), qib7322_destroy_send_wq(), qib7322_free_ctx(), and qp.
|
static |
Post send work queue entry.
ibdev | Infiniband device |
qp | Queue pair |
dest | Destination address vector |
iobuf | I/O buffer |
rc | Return status code |
Definition at line 1166 of file qib7322.c.
References assert(), BIT_FILL_3, data, io_buffer::data, DBG_DISABLE, DBG_ENABLE, DBGC2, DBGLVL_IO, dest, headers, ib_get_drvdata(), IB_MAX_HEADER_SIZE, ib_push(), IB_QPT_SMI, ib_wq_get_drvdata(), qib7322::ibdev, iob_len(), iob_populate(), iob_reserve, ib_work_queue::iobufs, len, memset(), NULL, ib_work_queue::num_wqes, offset, port, ib_device::port, qib7322_send_work_queue::prod, qib7322_alloc_send_buf(), QIB7322_PORT_BASE, qib7322_send_buffer_offset(), qib7322_writel(), qib7322_writeq, qp, qib7322_send_work_queue::send_bufs, and qib7322_send_work_queue::used.
|
static |
Complete send work queue entry.
ibdev | Infiniband device |
qp | Queue pair |
wqe_idx | Work queue entry index |
Definition at line 1249 of file qib7322.c.
References assert(), DBGC2, ib_complete_send(), ib_get_drvdata(), ib_wq_get_drvdata(), qib7322::ibdev, ib_work_queue::iobufs, NULL, qib7322_free_send_buf(), qp, qib7322_send_work_queue::send_bufs, and qib7322_send_work_queue::used.
Referenced by qib7322_poll_send_wq().
|
static |
Poll send work queue.
ibdev | Infiniband device |
qp | Queue pair |
Definition at line 1279 of file qib7322.c.
References qib7322_send_work_queue::cons, ib_work_queue::fill, ib_get_drvdata(), ib_wq_get_drvdata(), qib7322::ibdev, ib_work_queue::num_wqes, qib7322_complete_send(), qib7322_send_buf_in_use(), qp, and qib7322_send_work_queue::used.
Referenced by qib7322_poll_cq().
|
static |
Post receive work queue entry.
ibdev | Infiniband device |
qp | Queue pair |
iobuf | I/O buffer |
rc | Return status code |
Definition at line 1311 of file qib7322.c.
References addr, assert(), BIT_FILL_1, BIT_FILL_2, bufsize, build_assert, ctx, io_buffer::data, DBGC, DBGC2, qib7322_recv_work_queue::eager_array, qib7322_recv_work_queue::eager_entries, qib7322_recv_work_queue::eager_prod, EINVAL, ib_get_drvdata(), ib_wq_get_drvdata(), qib7322::ibdev, iob_tailroom(), ib_work_queue::iobufs, len, memset(), NULL, ib_work_queue::num_wqes, qib7322_ctx(), QIB7322_EAGER_BUFFER_16K, QIB7322_EAGER_BUFFER_2K, QIB7322_EAGER_BUFFER_32K, QIB7322_EAGER_BUFFER_4K, QIB7322_EAGER_BUFFER_64K, QIB7322_EAGER_BUFFER_8K, QIB7322_EAGER_BUFFER_ALIGN, QIB7322_EAGER_BUFFER_NONE, QIB7322_RECV_PAYLOAD_SIZE, qib7322_writeq_array64k, qib7322_writeq_array8b, QIB_7322_RcvEgrIndexHead0_offset, qp, and virt_to_bus().
|
static |
Complete receive work queue entry.
ibdev | Infiniband device |
qp | Queue pair |
header_offs | Header offset |
Definition at line 1391 of file qib7322.c.
References assert(), BIT_GET, DBGC, DBGC2, DBGCP_HDA, dest, qib7322_recv_work_queue::eager_array, qib7322_recv_work_queue::eager_cons, qib7322_recv_work_queue::eager_entries, qib7322_recv_work_queue::eager_prod, ECANCELED, EIO, EPROTO, ib_work_queue::fill, qib7322_recv_work_queue::header, headers, ib_complete_recv(), ib_get_drvdata(), ib_pull(), ib_wq_get_drvdata(), qib7322::ibdev, iob_populate(), iob_put, iob_tailroom(), ib_work_queue::iobufs, memset(), NULL, ib_work_queue::num_wqes, QIB7322_RECV_HEADER_SIZE, qib7322_writeq_array8b, qp, ib_queue_pair::qpn, rc, ib_queue_pair::recv, and strerror().
Referenced by qib7322_poll_recv_wq().
|
static |
Poll receive work queue.
ibdev | Infiniband device |
qp | Queue pair |
Definition at line 1554 of file qib7322.c.
References BIT_FILL_2, BIT_GET, ctx, qib7322_recv_work_queue::header_cons, qib7322_recv_work_queue::header_prod, ib_get_drvdata(), IB_QPT_SMI, ib_wq_get_drvdata(), qib7322::ibdev, memset(), qib7322_complete_recv(), qib7322_ctx(), QIB7322_RECV_HEADER_SIZE, QIB7322_RECV_HEADERS_SIZE, qib7322_writeq_array64k, QIB_7322_RcvHdrHead0_offset, and qp.
Referenced by qib7322_poll_cq().
|
static |
Poll completion queue.
ibdev | Infiniband device |
cq | Completion queue |
Definition at line 1603 of file qib7322.c.
References ib_work_queue::cq, ib_work_queue::is_send, ib_work_queue::list, list_for_each_entry, qib7322_poll_recv_wq(), qib7322_poll_send_wq(), ib_work_queue::qp, and ib_completion_queue::work_queues.
|
static |
Poll event queue.
ibdev | Infiniband device |
Definition at line 1629 of file qib7322.c.
References BIT_GET, DBG_DISABLE, DBG_ENABLE, DBGC, DBGLVL_IO, ib_get_drvdata(), qib7322::ibdev, port, ib_device::port, qib7322_link_state_changed(), QIB7322_PORT_BASE, qib7322_readq_port, qib7322_writeq_port, QIB_7322_ErrClear_0_offset, and QIB_7322_ErrStatus_0_offset.
|
static |
Determine supported link speeds.
qib7322 | QIB7322 device |
supported | Supported link speeds |
Definition at line 1664 of file qib7322.c.
References BIT_GET, DBGC, DBGC2, features, IB_LINK_SPEED_DDR, IB_LINK_SPEED_QDR, IB_LINK_SPEED_SDR, port, QIB7322_BOARD_QMH7342, qib7322_readq, QIB_7322_active_feature_mask_offset, QIB_7322_Revision_offset, revision, and supported.
Referenced by qib7322_probe().
|
static |
Initialise Infiniband link.
ibdev | Infiniband device |
rc | Return status code |
Definition at line 1716 of file qib7322.c.
References BIT_SET, ib_get_drvdata(), qib7322::ibdev, port, ib_device::port, QIB7322_PORT_BASE, qib7322_readq_port, qib7322_writeq_port, and QIB_7322_IBCCtrlA_0_offset.
|
static |
Close Infiniband link.
ibdev | Infiniband device |
Definition at line 1736 of file qib7322.c.
References BIT_SET, ib_get_drvdata(), qib7322::ibdev, port, ib_device::port, QIB7322_PORT_BASE, qib7322_readq_port, qib7322_writeq_port, and QIB_7322_IBCCtrlA_0_offset.
|
static |
Attach to multicast group.
ibdev | Infiniband device |
qp | Queue pair |
gid | Multicast GID |
rc | Return status code |
Definition at line 1764 of file qib7322.c.
References gid, ib_get_drvdata(), qib7322::ibdev, and qp.
|
static |
Detach from multicast group.
ibdev | Infiniband device |
qp | Queue pair |
gid | Multicast GID |
Definition at line 1782 of file qib7322.c.
References gid, ib_get_drvdata(), qib7322::ibdev, and qp.
|
static |
Read QIB7322 I2C line status.
basher | Bit-bashing interface |
bit_id | Bit number |
zero | Input is a logic 0 |
non-zero | Input is a logic 1 |
Definition at line 1832 of file qib7322.c.
References i2c_bit_basher::basher, BIT_GET, container_of, DBG_DISABLE, DBG_ENABLE, DBGLVL_IO, qib7322::i2c, qib7322_i2c_bits, qib7322_readq, QIB_7322_EXTStatus_offset, and status.
|
static |
Write QIB7322 I2C line status.
basher | Bit-bashing interface |
bit_id | Bit number |
data | Value to write |
Definition at line 1856 of file qib7322.c.
References i2c_bit_basher::basher, bit, BIT_GET, BIT_SET, container_of, data, DBG_DISABLE, DBG_ENABLE, DBGLVL_IO, qib7322::i2c, mb(), qib7322_i2c_bits, qib7322_readq, qib7322_writeq, QIB_7322_EXTCtrl_offset, and QIB_7322_GPIOOut_offset.
|
static |
Initialise QIB7322 I2C subsystem.
qib7322 | QIB7322 device |
rc | Return status code |
Definition at line 1905 of file qib7322.c.
References DBGC, DBGC2, qib7322::eeprom, ENODEV, i2c_bit_basher::i2c, qib7322::i2c, i2c_check_presence(), init_i2c_bit_basher(), init_i2c_eeprom(), qib7322_i2c_basher_ops, rc, and strerror().
Referenced by qib7322_probe().
|
static |
Read EEPROM parameters.
qib7322 | QIB7322 device |
rc | Return status code |
Definition at line 1940 of file qib7322.c.
References DBG_LOG, DBGC, DBGC2, qib7322::eeprom, guid, qib7322::guid, i2c_bit_basher::i2c, qib7322::i2c, IB_GUID_ARGS, IB_GUID_FMT, QIB7322_EEPROM_GUID_OFFSET, QIB7322_EEPROM_SERIAL_OFFSET, QIB7322_EEPROM_SERIAL_SIZE, rc, i2c_interface::read, serial, and strerror().
Referenced by qib7322_probe().
|
static |
Wait for AHB transaction to complete.
qib7322 | QIB7322 device |
rc | Return status code |
Definition at line 1988 of file qib7322.c.
References BIT_GET, DBGC, ETIMEDOUT, QIB7322_AHB_MAX_WAIT_US, qib7322_readq, QIB_7322_ahb_transaction_reg_offset, and udelay().
Referenced by qib7322_ahb_read(), qib7322_ahb_request(), and qib7322_ahb_write().
|
static |
Request ownership of the AHB.
qib7322 | QIB7322 device |
location | AHB location |
rc | Return status code |
Definition at line 2013 of file qib7322.c.
References BIT_FILL_2, DBGC, memset(), QIB7322_AHB_LOC_TARGET, qib7322_ahb_wait(), qib7322_writeq, QIB_7322_ahb_access_ctrl_offset, rc, and strerror().
Referenced by qib7322_ahb_mod_reg().
|
static |
Release ownership of the AHB.
qib7322 | QIB7322 device |
Definition at line 2040 of file qib7322.c.
References memset(), qib7322_writeq, and QIB_7322_ahb_access_ctrl_offset.
Referenced by qib7322_ahb_mod_reg().
|
static |
Read data via AHB.
qib7322 | QIB7322 device |
location | AHB location |
data | Data to read |
rc | Return status code |
You must have already acquired ownership of the AHB.
Definition at line 2057 of file qib7322.c.
References BIT_FILL_2, BIT_GET, data, memset(), QIB7322_AHB_LOC_ADDRESS, qib7322_ahb_wait(), qib7322_readq, qib7322_writeq, QIB_7322_ahb_transaction_reg_offset, rc, and xact.
Referenced by qib7322_ahb_mod_reg().
|
static |
Write data via AHB.
qib7322 | QIB7322 device |
location | AHB location |
data | Data to write |
rc | Return status code |
You must have already acquired ownership of the AHB.
Definition at line 2092 of file qib7322.c.
References BIT_FILL_3, data, memset(), QIB7322_AHB_LOC_ADDRESS, qib7322_ahb_wait(), qib7322_writeq, QIB_7322_ahb_transaction_reg_offset, rc, and xact.
Referenced by qib7322_ahb_mod_reg().
|
static |
Read/modify/write AHB register.
qib7322 | QIB7322 device |
location | AHB location |
value | Value to set |
mask | Mask to apply to old value |
rc | Return status code |
Definition at line 2121 of file qib7322.c.
References assert(), DBG_DISABLE, DBG_ENABLE, DBGCP, DBGLVL_IO, out, qib7322_ahb_read(), qib7322_ahb_release(), qib7322_ahb_request(), qib7322_ahb_write(), rc, and value.
Referenced by qib7322_ahb_mod_reg_all().
|
static |
Read/modify/write AHB register across all ports and channels.
qib7322 | QIB7322 device |
reg | AHB register |
value | Value to set |
mask | Mask to apply to old value |
rc | Return status code |
Definition at line 2164 of file qib7322.c.
References channel, port, QIB7322_AHB_LOCATION, qib7322_ahb_mod_reg(), QIB7322_MAX_PORTS, QIB7322_MAX_WIDTH, rc, reg, and value.
Referenced by qib7322_init_ib_serdes().
|
static |
Initialise the IB SerDes.
qib7322 | QIB7322 device |
rc | Return status code |
Definition at line 2195 of file qib7322.c.
References BIT_FILL_5, BIT_SET, memset(), qib7322_ahb_mod_reg_all(), qib7322_readq, QIB7322_RECV_HEADER_SIZE, QIB7322_RECV_PAYLOAD_SIZE, qib7322_writeq, QIB_7322_IBCCtrlA_0_offset, QIB_7322_IBCCtrlA_1_offset, QIB_7322_IBCCtrlB_0_offset, QIB_7322_IBCCtrlB_1_offset, QIB_7322_IBPCSConfig_0_offset, and QIB_7322_IBPCSConfig_1_offset.
Referenced by qib7322_probe().
|
static |
Reset QIB7322.
qib7322 | QIB7322 device |
pci | PCI device |
rc | Return status code |
Definition at line 2254 of file qib7322.c.
References BIT_FILL_1, control, mdelay(), memset(), NULL, pci_backup(), PCI_CONFIG_BACKUP_ALL, pci_restore(), qib7322_writeq, and QIB_7322_Control_offset.
Referenced by qib7322_probe().
|
static |
Probe PCI device.
pci | PCI device |
id | PCI ID |
rc | Return status code |
Definition at line 2280 of file qib7322.c.
References adjust_pci_device(), alloc_ibdev(), assert(), BIT_GET, ib_guid::bytes, DBGC, DBGC2, pci_device::dev, ib_device::dev, ENOMEM, free, ib_device::gid, ib_gid::guid, qib7322::guid, IB_LINK_SPEED_SDR, IB_LINK_WIDTH_4X, ib_set_drvdata(), qib7322::ibdev, ibdev_put(), iounmap(), ib_device::link_speed_enabled, ib_device::link_speed_supported, ib_device::link_width_enabled, ib_device::link_width_supported, pci_device::membase, memcpy(), ib_device::node_guid, ib_device::op, pci_ioremap(), pci_set_drvdata(), ib_device::port, ib_device::ports, QIB7322_BAR0_SIZE, qib7322_fini_recv(), qib7322_fini_send(), qib7322_ib_operations, qib7322_init_i2c(), qib7322_init_ib_serdes(), qib7322_init_recv(), qib7322_init_send(), qib7322_link_speed_supported(), QIB7322_MAX_PORTS, QIB7322_PORT_BASE, qib7322_read_eeprom(), qib7322_readq, qib7322_reset(), QIB_7322_Revision_offset, rc, register_ibdev(), qib7322::regs, revision, ib_gid::s, strerror(), unregister_ibdev(), and zalloc().
|
static |
Remove PCI device.
pci | PCI device |
Definition at line 2406 of file qib7322.c.
References free, qib7322::ibdev, ibdev_put(), iounmap(), pci_get_drvdata(), qib7322_fini_recv(), qib7322_fini_send(), QIB7322_MAX_PORTS, qib7322::regs, and unregister_ibdev().
|
static |
QIB7322 Infiniband operations.
Definition at line 1793 of file qib7322.c.
Referenced by qib7322_probe().
|
static |
QIB7322 I2C bit to GPIO mappings.
Definition at line 1819 of file qib7322.c.
Referenced by qib7322_i2c_read_bit(), and qib7322_i2c_write_bit().
|
static |
QIB7322 I2C bit-bashing interface operations.
Definition at line 1894 of file qib7322.c.
Referenced by qib7322_init_i2c().
|
static |
struct pci_driver qib7322_driver __pci_driver |