|
iPXE
|
QLogic Linda Infiniband HCA. More...
#include <stdint.h>#include <stdlib.h>#include <string.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 "linda.h"Go to the source code of this file.
Data Structures | |
| struct | linda_send_work_queue |
| A Linda send work queue. More... | |
| struct | linda_recv_work_queue |
| A Linda receive work queue. More... | |
| struct | linda |
| A Linda HCA. More... | |
| struct | linda_serdes_param |
| A Linda SerDes parameter. More... | |
Macros | |
| #define | linda_readq(_linda, _ptr, _offset) linda_readq ( (_linda), (_ptr)->u.qwords, (_offset) ) |
| #define | linda_readq_array8b(_linda, _ptr, _offset, _idx) linda_readq ( (_linda), (_ptr), ( (_offset) + ( (_idx) * 8 ) ) ) |
| #define | linda_readq_array64k(_linda, _ptr, _offset, _idx) linda_readq ( (_linda), (_ptr), ( (_offset) + ( (_idx) * 65536 ) ) ) |
| #define | linda_writeq(_linda, _ptr, _offset) linda_writeq ( (_linda), (_ptr)->u.qwords, (_offset) ) |
| #define | linda_writeq_array8b(_linda, _ptr, _offset, _idx) linda_writeq ( (_linda), (_ptr), ( (_offset) + ( (_idx) * 8 ) ) ) |
| #define | linda_writeq_array64k(_linda, _ptr, _offset, _idx) linda_writeq ( (_linda), (_ptr), ( (_offset) + ( (_idx) * 65536 ) ) ) |
| #define | LINDA_SEND_BUF_TOGGLE 0x80 |
| Send buffer toggle bit. More... | |
| #define | LINDA_EPB_ALL_CHANNELS 31 |
| Magic "all channels" channel number. More... | |
| #define | LINDA_SERDES_PARAM_END { 0, 0, 0 } |
| End of SerDes parameter list marker. More... | |
| #define | LINDA_DDS_VAL(amp_d, main_d, ipst_d, ipre_d, amp_s, main_s, ipst_s, ipre_s) |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static void | linda_readq (struct linda *linda, uint64_t *qword, unsigned long offset) |
| Read Linda qword register. More... | |
| static void | linda_writeq (struct linda *linda, const uint64_t *qword, unsigned long offset) |
| Write Linda qword register. More... | |
| static void | linda_writel (struct linda *linda, uint32_t dword, unsigned long offset) |
| Write Linda dword register. More... | |
| static const char * | linda_link_state_text (unsigned int link_state) |
| Textual representation of link state. More... | |
| static void | linda_link_state_changed (struct ib_device *ibdev) |
| Handle link state change. More... | |
| static int | linda_link_state_check (struct linda *linda, unsigned int new_link_state) |
| Wait for link state change to take effect. More... | |
| static int | linda_set_port_info (struct ib_device *ibdev, union ib_mad *mad) |
| Set port information. More... | |
| static int | linda_set_pkey_table (struct ib_device *ibdev __unused, union ib_mad *mad __unused) |
| Set partition key table. More... | |
| static int | linda_ctx_to_qpn (unsigned int ctx) |
| Map context number to QPN. More... | |
| static int | linda_qpn_to_ctx (unsigned int qpn) |
| Map QPN to context number. More... | |
| static int | linda_alloc_ctx (struct linda *linda) |
| Allocate a context. More... | |
| static void | linda_free_ctx (struct linda *linda, unsigned int ctx) |
| Free a context. More... | |
| static unsigned int | linda_alloc_send_buf (struct linda *linda) |
| Allocate a send buffer. More... | |
| static void | linda_free_send_buf (struct linda *linda, unsigned int send_buf) |
| Free a send buffer. More... | |
| static int | linda_send_buf_in_use (struct linda *linda, unsigned int send_buf) |
| Check to see if send buffer is in use. More... | |
| static unsigned long | linda_send_buffer_offset (struct linda *linda, unsigned int send_buf) |
| Calculate starting offset for send buffer. More... | |
| static int | linda_create_send_wq (struct linda *linda, struct ib_queue_pair *qp) |
| Create send work queue. More... | |
| static void | linda_destroy_send_wq (struct linda *linda, struct ib_queue_pair *qp) |
| Destroy send work queue. More... | |
| static int | linda_init_send (struct linda *linda) |
| Initialise send datapath. More... | |
| static void | linda_fini_send (struct linda *linda) |
| Shut down send datapath. More... | |
| static int | linda_create_recv_wq (struct linda *linda, struct ib_queue_pair *qp) |
| Create receive work queue. More... | |
| static void | linda_destroy_recv_wq (struct linda *linda, struct ib_queue_pair *qp) |
| Destroy receive work queue. More... | |
| static int | linda_init_recv (struct linda *linda) |
| Initialise receive datapath. More... | |
| static void | linda_fini_recv (struct linda *linda __unused) |
| Shut down receive datapath. More... | |
| static int | linda_create_cq (struct ib_device *ibdev, struct ib_completion_queue *cq) |
| Create completion queue. More... | |
| static void | linda_destroy_cq (struct ib_device *ibdev, struct ib_completion_queue *cq) |
| Destroy completion queue. More... | |
| static int | linda_create_qp (struct ib_device *ibdev, struct ib_queue_pair *qp) |
| Create queue pair. More... | |
| static int | linda_modify_qp (struct ib_device *ibdev, struct ib_queue_pair *qp) |
| Modify queue pair. More... | |
| static void | linda_destroy_qp (struct ib_device *ibdev, struct ib_queue_pair *qp) |
| Destroy queue pair. More... | |
| static int | linda_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 | linda_complete_send (struct ib_device *ibdev, struct ib_queue_pair *qp, unsigned int wqe_idx) |
| Complete send work queue entry. More... | |
| static void | linda_poll_send_wq (struct ib_device *ibdev, struct ib_queue_pair *qp) |
| Poll send work queue. More... | |
| static int | linda_post_recv (struct ib_device *ibdev, struct ib_queue_pair *qp, struct io_buffer *iobuf) |
| Post receive work queue entry. More... | |
| static void | linda_complete_recv (struct ib_device *ibdev, struct ib_queue_pair *qp, unsigned int header_offs) |
| Complete receive work queue entry. More... | |
| static void | linda_poll_recv_wq (struct ib_device *ibdev, struct ib_queue_pair *qp) |
| Poll receive work queue. More... | |
| static void | linda_poll_cq (struct ib_device *ibdev, struct ib_completion_queue *cq) |
| Poll completion queue. More... | |
| static void | linda_poll_eq (struct ib_device *ibdev) |
| Poll event queue. More... | |
| static int | linda_open (struct ib_device *ibdev) |
| Initialise Infiniband link. More... | |
| static void | linda_close (struct ib_device *ibdev) |
| Close Infiniband link. More... | |
| static int | linda_mcast_attach (struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid) |
| Attach to multicast group. More... | |
| static void | linda_mcast_detach (struct ib_device *ibdev, struct ib_queue_pair *qp, union ib_gid *gid) |
| Detach from multicast group. More... | |
| static int | linda_i2c_read_bit (struct bit_basher *basher, unsigned int bit_id) |
| Read Linda I2C line status. More... | |
| static void | linda_i2c_write_bit (struct bit_basher *basher, unsigned int bit_id, unsigned long data) |
| Write Linda I2C line status. More... | |
| static int | linda_init_i2c (struct linda *linda) |
| Initialise Linda I2C subsystem. More... | |
| static int | linda_read_eeprom (struct linda *linda, union ib_guid *guid) |
| Read EEPROM parameters. More... | |
| static int | linda_ib_epb_request (struct linda *linda) |
| Request ownership of the IB external parallel bus. More... | |
| static int | linda_ib_epb_wait (struct linda *linda, struct QIB_7220_ibsd_epb_transaction_reg *xact) |
| Wait for IB external parallel bus transaction to complete. More... | |
| static void | linda_ib_epb_release (struct linda *linda) |
| Release ownership of the IB external parallel bus. More... | |
| static int | linda_ib_epb_read (struct linda *linda, unsigned int location) |
| Read data via IB external parallel bus. More... | |
| static int | linda_ib_epb_write (struct linda *linda, unsigned int location, unsigned int data) |
| Write data via IB external parallel bus. More... | |
| static int | linda_ib_epb_mod_reg (struct linda *linda, unsigned int cs, unsigned int channel, unsigned int element, unsigned int reg, unsigned int value, unsigned int mask) |
| Read/modify/write EPB register. More... | |
| static int | linda_ib_epb_ram_xfer (struct linda *linda, unsigned int address, const void *write, void *read, size_t len) |
| Transfer data to/from microcontroller RAM. More... | |
| static int | linda_set_serdes_param (struct linda *linda, struct linda_serdes_param *param) |
| Program IB SerDes register(s) More... | |
| static int | linda_set_serdes_params (struct linda *linda, struct linda_serdes_param *params) |
| Program IB SerDes registers. More... | |
| static int | linda_program_uc_ram (struct linda *linda) |
| Program the microcontroller RAM. More... | |
| static int | linda_verify_uc_ram (struct linda *linda) |
| Verify the microcontroller RAM. More... | |
| static int | linda_trim_ib (struct linda *linda) |
| Use the microcontroller to trim the IB link. More... | |
| static int | linda_init_ib_serdes (struct linda *linda) |
| Initialise the IB SerDes. More... | |
| static int | linda_probe (struct pci_device *pci) |
| Probe PCI device. More... | |
| static void | linda_remove (struct pci_device *pci) |
| Remove PCI device. More... | |
Variables | |
| static struct ib_device_operations | linda_ib_operations |
| Linda Infiniband operations. More... | |
| static unsigned int | linda_i2c_bits [] |
| Linda I2C bit to GPIO mappings. More... | |
| static struct bit_basher_operations | linda_i2c_basher_ops |
| Linda I2C bit-bashing interface operations. More... | |
| struct linda_serdes_param | __packed |
| static struct linda_serdes_param | linda_serdes_defaults1 [] |
| Linda SerDes default parameters. More... | |
| static struct linda_serdes_param | linda_serdes_defaults2 [] |
| static struct linda_serdes_param | linda_serdes_defaults3 [] |
| static struct pci_device_id | linda_nics [] |
| struct pci_driver linda_driver | __pci_driver |
QLogic Linda Infiniband HCA.
Definition in file linda.c.
| #define linda_readq | ( | _linda, | |
| _ptr, | |||
| _offset | |||
| ) | linda_readq ( (_linda), (_ptr)->u.qwords, (_offset) ) |
| #define linda_readq_array8b | ( | _linda, | |
| _ptr, | |||
| _offset, | |||
| _idx | |||
| ) | linda_readq ( (_linda), (_ptr), ( (_offset) + ( (_idx) * 8 ) ) ) |
| #define linda_readq_array64k | ( | _linda, | |
| _ptr, | |||
| _offset, | |||
| _idx | |||
| ) | linda_readq ( (_linda), (_ptr), ( (_offset) + ( (_idx) * 65536 ) ) ) |
| #define linda_writeq | ( | _linda, | |
| _ptr, | |||
| _offset | |||
| ) | linda_writeq ( (_linda), (_ptr)->u.qwords, (_offset) ) |
| #define linda_writeq_array8b | ( | _linda, | |
| _ptr, | |||
| _offset, | |||
| _idx | |||
| ) | linda_writeq ( (_linda), (_ptr), ( (_offset) + ( (_idx) * 8 ) ) ) |
| #define linda_writeq_array64k | ( | _linda, | |
| _ptr, | |||
| _offset, | |||
| _idx | |||
| ) | linda_writeq ( (_linda), (_ptr), ( (_offset) + ( (_idx) * 65536 ) ) ) |
| #define LINDA_SEND_BUF_TOGGLE 0x80 |
| #define LINDA_EPB_ALL_CHANNELS 31 |
| #define LINDA_SERDES_PARAM_END { 0, 0, 0 } |
| #define LINDA_DDS_VAL | ( | amp_d, | |
| main_d, | |||
| ipst_d, | |||
| ipre_d, | |||
| amp_s, | |||
| main_s, | |||
| ipst_s, | |||
| ipre_s | |||
| ) |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Read Linda qword register.
| linda | Linda device |
| qword | Register buffer to read into |
| offset | Register offset |
Definition at line 125 of file linda.c.
References offset, readq(), and linda::regs.
|
static |
Write Linda qword register.
| linda | Linda device |
| qword | Register buffer to write |
| offset | Register offset |
Definition at line 143 of file linda.c.
References offset, linda::regs, and writeq().
Write Linda dword register.
| linda | Linda device |
| dword | Value to write |
| offset | Register offset |
Definition at line 161 of file linda.c.
References offset, linda::regs, and writel().
Referenced by linda_post_send().
|
static |
Textual representation of link state.
| link_state | Link state |
| link_text | Link state text |
Definition at line 179 of file linda.c.
References LINDA_LINK_STATE_ACT_DEFER, LINDA_LINK_STATE_ACTIVE, LINDA_LINK_STATE_ARM, LINDA_LINK_STATE_DOWN, and LINDA_LINK_STATE_INIT.
Referenced by linda_link_state_changed(), linda_link_state_check(), and linda_set_port_info().
|
static |
Handle link state change.
| linda | Linda device |
Definition at line 195 of file linda.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, LINDA_LINK_STATE_ACTIVE, LINDA_LINK_STATE_INIT, linda_link_state_text(), linda_readq, linda_writeq, ib_device::link_speed_active, ib_device::link_width_active, ib_device::port_state, QIB_7220_EXTCtrl_offset, and QIB_7220_IBCStatus_offset.
Referenced by linda_poll_eq(), and linda_set_port_info().
|
static |
Wait for link state change to take effect.
| linda | Linda device |
| new_link_state | Expected link state |
| rc | Return status code |
Definition at line 236 of file linda.c.
References BIT_GET, DBGC, ETIMEDOUT, LINDA_LINK_STATE_MAX_WAIT_US, linda_link_state_text(), linda_readq, QIB_7220_IBCStatus_offset, and udelay().
Referenced by linda_set_port_info().
Set port information.
| ibdev | Infiniband device |
| mad | Set port information MAD |
Definition at line 261 of file linda.c.
References BIT_SET, DBGC, ib_get_drvdata(), linda_link_state_changed(), linda_link_state_check(), linda_link_state_text(), linda_readq, linda_writeq, ib_port_info::link_speed_supported__port_state, mad, ib_smp_data::port_info, port_info, port_state, QIB_7220_IBCCtrl_offset, ib_mad::smp, and ib_mad_smp::smp_data.
|
static |
Map context number to QPN.
| ctx | Context index |
| qpn | Queue pair number |
Definition at line 316 of file linda.c.
References ctx.
Referenced by linda_create_qp().
|
static |
Map QPN to context number.
| qpn | Queue pair number |
| ctx | Context index |
Definition at line 327 of file linda.c.
References qpn.
Referenced by linda_create_recv_wq(), linda_destroy_recv_wq(), linda_poll_recv_wq(), and linda_post_recv().
|
static |
Allocate a context.
| linda | Linda device |
| ctx | Context index, or negative error |
Definition at line 338 of file linda.c.
References ctx, DBGC, DBGC2, ENOENT, LINDA_NUM_CONTEXTS, and linda::used_ctx.
Referenced by linda_create_qp().
|
static |
Free a context.
| linda | Linda device |
| ctx | Context index |
Definition at line 361 of file linda.c.
References ctx, DBGC2, and linda::used_ctx.
Referenced by linda_create_qp(), and linda_destroy_recv_wq().
|
static |
Allocate a send buffer.
| linda | Linda device |
| send_buf | Send buffer |
You must guarantee that a send buffer is available. This is done by refusing to allocate more TX WQEs in total than the number of available send buffers.
Definition at line 391 of file linda.c.
References LINDA_MAX_SEND_BUFS, LINDA_SEND_BUF_TOGGLE, linda::send_buf, and linda::send_buf_cons.
Referenced by linda_post_send().
|
static |
Free a send buffer.
| linda | Linda device |
| send_buf | Send buffer |
Definition at line 407 of file linda.c.
References LINDA_MAX_SEND_BUFS, linda::send_buf, and linda::send_buf_prod.
Referenced by linda_complete_send().
|
static |
Check to see if send buffer is in use.
| linda | Linda device |
| send_buf | Send buffer |
| in_use | Send buffer is in use |
Definition at line 421 of file linda.c.
References BIT_GET, LINDA_SEND_BUF_TOGGLE, and linda::sendbufavail.
Referenced by linda_poll_send_wq().
|
static |
Calculate starting offset for send buffer.
| linda | Linda device |
| send_buf | Send buffer |
| offset | Starting offset |
Definition at line 444 of file linda.c.
References LINDA_SEND_BUF_SIZE, LINDA_SEND_BUF_TOGGLE, and linda::send_buffer_base.
Referenced by linda_post_send().
|
static |
Create send work queue.
| linda | Linda device |
| qp | Queue pair |
Definition at line 457 of file linda.c.
References linda_send_work_queue::cons, DBGC, ENOBUFS, free, ib_wq_get_drvdata(), LINDA_MAX_SEND_BUFS, linda_send_work_queue::prod, qp, rc, linda::reserved_send_bufs, linda_send_work_queue::send_buf, and zalloc().
Referenced by linda_create_qp().
|
static |
Destroy send work queue.
| linda | Linda device |
| qp | Queue pair |
Definition at line 501 of file linda.c.
References free, ib_wq_get_drvdata(), qp, linda::reserved_send_bufs, and linda_send_work_queue::send_buf.
Referenced by linda_create_qp(), and linda_destroy_qp().
|
static |
Initialise send datapath.
| linda | Linda device |
| rc | Return status code |
Definition at line 516 of file linda.c.
References BIT_FILL_1, BIT_FILL_2, BIT_GET, DBGC, ENOMEM, free_phys(), LINDA_MAX_SEND_BUFS, linda_readq, LINDA_SENDBUFAVAIL_ALIGN, linda_writeq, malloc_phys(), memset(), QIB_7220_SendBufAvailAddr_offset, QIB_7220_SendBufBase_offset, QIB_7220_SendCtrl_offset, rc, linda::send_buf, linda::send_buffer_base, linda::sendbufavail, and virt_to_bus().
Referenced by linda_probe().
|
static |
Shut down send datapath.
| linda | Linda device |
Definition at line 569 of file linda.c.
References free_phys(), linda_readq, linda_writeq, mb(), memset(), QIB_7220_SendCtrl_offset, and linda::sendbufavail.
Referenced by linda_probe(), and linda_remove().
|
static |
Create receive work queue.
| linda | Linda device |
| qp | Queue pair |
| rc | Return status code |
Definition at line 597 of file linda.c.
References BIT_FILL_1, BIT_SET, ctx, DBGC, linda_recv_work_queue::eager_cons, linda_recv_work_queue::eager_prod, ENOMEM, free_phys(), linda_recv_work_queue::header, linda_recv_work_queue::header_cons, linda_recv_work_queue::header_prod, ib_wq_get_drvdata(), linda_qpn_to_ctx(), linda_readq, LINDA_RECV_HEADERS_ALIGN, LINDA_RECV_HEADERS_SIZE, linda_writeq, linda_writeq_array64k, linda_writeq_array8b, malloc_phys(), memset(), QIB_7220_RcvCtrl_offset, QIB_7220_RcvEgrIndexHead0_offset, QIB_7220_RcvHdrAddr0_offset, QIB_7220_RcvHdrHead0_offset, QIB_7220_RcvHdrTailAddr0_offset, qp, rc, and virt_to_bus().
Referenced by linda_create_qp().
|
static |
Destroy receive work queue.
| linda | Linda device |
| qp | Queue pair |
Definition at line 665 of file linda.c.
References BIT_SET, ctx, free_phys(), linda_recv_work_queue::header, ib_wq_get_drvdata(), linda_free_ctx(), linda_qpn_to_ctx(), linda_readq, LINDA_RECV_HEADERS_SIZE, linda_writeq, mb(), QIB_7220_RcvCtrl_offset, and qp.
Referenced by linda_create_qp(), and linda_destroy_qp().
|
static |
Initialise receive datapath.
| linda | Linda device |
| rc | Return status code |
Definition at line 695 of file linda.c.
References BIT_FILL_1, BIT_FILL_3, BIT_GET, build_assert, ctx, DBGC, linda_recv_work_queue::eager_array, linda_recv_work_queue::eager_entries, EINVAL, LINDA_EAGER_ARRAY_SIZE_17CTX_0, LINDA_EAGER_ARRAY_SIZE_17CTX_OTHER, LINDA_EAGER_ARRAY_SIZE_5CTX_0, LINDA_EAGER_ARRAY_SIZE_5CTX_OTHER, LINDA_EAGER_ARRAY_SIZE_9CTX_0, LINDA_EAGER_ARRAY_SIZE_9CTX_OTHER, LINDA_NUM_CONTEXTS, LINDA_PORTCFG_17CTX, LINDA_PORTCFG_5CTX, LINDA_PORTCFG_9CTX, LINDA_QP_IDETH, linda_readq, LINDA_RECV_HEADER_COUNT, LINDA_RECV_HEADER_SIZE, linda_writeq, memset(), QIB_7220_RcvBTHQP_offset, QIB_7220_RcvCtrl_offset, QIB_7220_RcvEgrBase_offset, QIB_7220_RcvHdrCnt_offset, QIB_7220_RcvHdrEntSize_offset, and linda::recv_wq.
Referenced by linda_probe().
Shut down receive datapath.
| linda | Linda device |
Definition at line 777 of file linda.c.
Referenced by linda_probe(), and linda_remove().
|
static |
Create completion queue.
| ibdev | Infiniband device |
| cq | Completion queue |
| rc | Return status code |
Definition at line 797 of file linda.c.
References cqn, ib_completion_queue::cqn, DBGC, and ib_get_drvdata().
|
static |
Destroy completion queue.
| ibdev | Infiniband device |
| cq | Completion queue |
Definition at line 821 of file linda.c.
References ib_completion_queue::cqn, DBGC, and ib_get_drvdata().
|
static |
Create queue pair.
| ibdev | Infiniband device |
| qp | Queue pair |
| rc | Return status code |
Definition at line 843 of file linda.c.
References ctx, ib_get_drvdata(), ib_wq_set_drvdata(), linda_alloc_ctx(), linda_create_recv_wq(), linda_create_send_wq(), linda_ctx_to_qpn(), linda_destroy_recv_wq(), linda_destroy_send_wq(), linda_free_ctx(), qp, rc, linda::recv_wq, and linda::send_wq.
|
static |
Modify queue pair.
| ibdev | Infiniband device |
| qp | Queue pair |
| rc | Return status code |
Definition at line 889 of file linda.c.
References DBGC, ib_get_drvdata(), and qp.
|
static |
Destroy queue pair.
| ibdev | Infiniband device |
| qp | Queue pair |
Definition at line 906 of file linda.c.
References ib_get_drvdata(), linda_destroy_recv_wq(), linda_destroy_send_wq(), 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 930 of file linda.c.
References assert(), BIT_FILL_2, data, io_buffer::data, DBG_DISABLE, DBG_ENABLE, DBGC2, DBGLVL_IO, dest, headers, ib_get_drvdata(), IB_MAX_HEADER_SIZE, ib_push(), ib_wq_get_drvdata(), iob_len(), iob_populate(), iob_reserve, ib_work_queue::iobufs, len, linda_alloc_send_buf(), linda_send_buffer_offset(), linda_writel(), linda_writeq, memset(), NULL, ib_work_queue::num_wqes, offset, linda_send_work_queue::prod, qp, and linda_send_work_queue::send_buf.
|
static |
Complete send work queue entry.
| ibdev | Infiniband device |
| qp | Queue pair |
| wqe_idx | Work queue entry index |
Definition at line 1007 of file linda.c.
References assert(), DBGC2, ib_complete_send(), ib_get_drvdata(), ib_wq_get_drvdata(), ib_work_queue::iobufs, linda_free_send_buf(), NULL, qp, and linda_send_work_queue::send_buf.
Referenced by linda_poll_send_wq().
|
static |
Poll send work queue.
| ibdev | Infiniband device |
| qp | Queue pair |
Definition at line 1037 of file linda.c.
References linda_send_work_queue::cons, ib_work_queue::fill, ib_get_drvdata(), ib_wq_get_drvdata(), linda_complete_send(), linda_send_buf_in_use(), ib_work_queue::num_wqes, qp, and linda_send_work_queue::send_buf.
Referenced by linda_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 1069 of file linda.c.
References addr, assert(), BIT_FILL_1, BIT_FILL_2, bufsize, build_assert, ctx, io_buffer::data, DBGC, DBGC2, linda_recv_work_queue::eager_array, linda_recv_work_queue::eager_entries, linda_recv_work_queue::eager_prod, EINVAL, ib_get_drvdata(), ib_wq_get_drvdata(), iob_tailroom(), ib_work_queue::iobufs, len, LINDA_EAGER_BUFFER_16K, LINDA_EAGER_BUFFER_2K, LINDA_EAGER_BUFFER_32K, LINDA_EAGER_BUFFER_4K, LINDA_EAGER_BUFFER_64K, LINDA_EAGER_BUFFER_8K, LINDA_EAGER_BUFFER_ALIGN, LINDA_EAGER_BUFFER_NONE, linda_qpn_to_ctx(), LINDA_RECV_PAYLOAD_SIZE, linda_writeq_array64k, linda_writeq_array8b, memset(), NULL, ib_work_queue::num_wqes, QIB_7220_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 1149 of file linda.c.
References assert(), BIT_GET, DBGC, DBGC2, DBGCP_HDA, dest, linda_recv_work_queue::eager_array, linda_recv_work_queue::eager_cons, linda_recv_work_queue::eager_entries, linda_recv_work_queue::eager_prod, ECANCELED, EIO, EPROTO, ib_work_queue::fill, linda_recv_work_queue::header, headers, ib_complete_recv(), ib_get_drvdata(), ib_pull(), ib_wq_get_drvdata(), iob_populate(), iob_put, iob_tailroom(), ib_work_queue::iobufs, LINDA_RECV_HEADER_SIZE, linda_writeq_array8b, memset(), NULL, ib_work_queue::num_wqes, qp, ib_queue_pair::qpn, rc, ib_queue_pair::recv, and strerror().
Referenced by linda_poll_recv_wq().
|
static |
Poll receive work queue.
| ibdev | Infiniband device |
| qp | Queue pair |
Definition at line 1318 of file linda.c.
References BIT_FILL_2, BIT_GET, ctx, linda_recv_work_queue::header_cons, linda_recv_work_queue::header_prod, ib_get_drvdata(), ib_wq_get_drvdata(), linda_complete_recv(), linda_qpn_to_ctx(), LINDA_RECV_HEADER_SIZE, LINDA_RECV_HEADERS_SIZE, linda_writeq_array64k, memset(), QIB_7220_RcvHdrHead0_offset, and qp.
Referenced by linda_poll_cq().
|
static |
Poll completion queue.
| ibdev | Infiniband device |
| cq | Completion queue |
Definition at line 1358 of file linda.c.
References ib_work_queue::cq, ib_work_queue::is_send, linda_poll_recv_wq(), linda_poll_send_wq(), ib_work_queue::list, list_for_each_entry, ib_work_queue::qp, and ib_completion_queue::work_queues.
|
static |
Poll event queue.
| ibdev | Infiniband device |
Definition at line 1384 of file linda.c.
References BIT_FILL_1, BIT_GET, DBG_DISABLE, DBG_ENABLE, DBGLVL_IO, ib_get_drvdata(), linda_link_state_changed(), linda_readq, linda_writeq, memset(), QIB_7220_ErrClear_offset, and QIB_7220_ErrStatus_offset.
|
static |
Initialise Infiniband link.
| ibdev | Infiniband device |
| rc | Return status code |
Definition at line 1414 of file linda.c.
References BIT_SET, control, ib_get_drvdata(), linda_readq, linda_writeq, and QIB_7220_Control_offset.
|
static |
Close Infiniband link.
| ibdev | Infiniband device |
Definition at line 1430 of file linda.c.
References BIT_SET, control, ib_get_drvdata(), linda_readq, linda_writeq, and QIB_7220_Control_offset.
|
static |
Attach to multicast group.
| ibdev | Infiniband device |
| qp | Queue pair |
| gid | Multicast GID |
| rc | Return status code |
Definition at line 1455 of file linda.c.
References gid, ib_get_drvdata(), and qp.
|
static |
Detach from multicast group.
| ibdev | Infiniband device |
| qp | Queue pair |
| gid | Multicast GID |
Definition at line 1473 of file linda.c.
References gid, ib_get_drvdata(), and qp.
|
static |
Read Linda 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 1523 of file linda.c.
References i2c_bit_basher::basher, BIT_GET, container_of, DBG_DISABLE, DBG_ENABLE, DBGLVL_IO, linda::i2c, linda_i2c_bits, linda_readq, QIB_7220_EXTStatus_offset, and status.
|
static |
Write Linda I2C line status.
| basher | Bit-bashing interface |
| bit_id | Bit number |
| data | Value to write |
Definition at line 1547 of file linda.c.
References i2c_bit_basher::basher, bit, BIT_GET, BIT_SET, container_of, data, DBG_DISABLE, DBG_ENABLE, DBGLVL_IO, linda::i2c, linda_i2c_bits, linda_readq, linda_writeq, mb(), QIB_7220_EXTCtrl_offset, and QIB_7220_GPIOOut_offset.
|
static |
Initialise Linda I2C subsystem.
| linda | Linda device |
| rc | Return status code |
Definition at line 1596 of file linda.c.
References DBGC, DBGC2, linda::eeprom, ENODEV, i2c_bit_basher::i2c, linda::i2c, i2c_check_presence(), init_i2c_bit_basher(), init_i2c_eeprom(), linda_i2c_basher_ops, rc, and strerror().
Referenced by linda_probe().
Read EEPROM parameters.
| linda | Linda device |
| guid | GUID to fill in |
| rc | Return status code |
Definition at line 1632 of file linda.c.
References DBG_LOG, DBGC, DBGC2, linda::eeprom, guid, i2c_bit_basher::i2c, linda::i2c, IB_GUID_ARGS, IB_GUID_FMT, LINDA_EEPROM_GUID_OFFSET, LINDA_EEPROM_SERIAL_OFFSET, LINDA_EEPROM_SERIAL_SIZE, rc, i2c_interface::read, serial, and strerror().
Referenced by linda_probe().
|
static |
Request ownership of the IB external parallel bus.
| linda | Linda device |
| rc | Return status code |
Definition at line 1678 of file linda.c.
References BIT_FILL_1, BIT_GET, DBGC, ETIMEDOUT, LINDA_EPB_REQUEST_MAX_WAIT_US, linda_readq, linda_writeq, memset(), QIB_7220_ibsd_epb_access_ctrl_offset, and udelay().
Referenced by linda_ib_epb_mod_reg(), and linda_ib_epb_ram_xfer().
|
static |
Wait for IB external parallel bus transaction to complete.
| linda | Linda device |
| xact | Buffer to hold transaction result |
| rc | Return status code |
Definition at line 1708 of file linda.c.
References BIT_GET, DBGC, EIO, ETIMEDOUT, LINDA_EPB_XACT_MAX_WAIT_US, linda_readq, QIB_7220_ibsd_epb_transaction_reg_offset, udelay(), and xact.
Referenced by linda_ib_epb_read(), and linda_ib_epb_write().
|
static |
Release ownership of the IB external parallel bus.
| linda | Linda device |
Definition at line 1740 of file linda.c.
References BIT_FILL_1, linda_writeq, memset(), and QIB_7220_ibsd_epb_access_ctrl_offset.
Referenced by linda_ib_epb_mod_reg(), and linda_ib_epb_ram_xfer().
|
static |
Read data via IB external parallel bus.
| linda | Linda device |
| location | EPB location |
| data | Data read, or negative error |
You must have already acquired ownership of the IB external parallel bus.
Definition at line 1758 of file linda.c.
References BIT_FILL_3, BIT_GET, data, LINDA_EPB_LOC_ADDRESS, LINDA_EPB_LOC_CS, LINDA_EPB_READ, linda_ib_epb_wait(), linda_writeq, memset(), QIB_7220_ibsd_epb_transaction_reg_offset, rc, and xact.
Referenced by linda_ib_epb_mod_reg(), and linda_ib_epb_ram_xfer().
|
static |
Write data via IB external parallel bus.
| linda | Linda device |
| location | EPB location |
| data | Data to write |
| rc | Return status code |
You must have already acquired ownership of the IB external parallel bus.
Definition at line 1795 of file linda.c.
References BIT_FILL_4, data, LINDA_EPB_LOC_ADDRESS, LINDA_EPB_LOC_CS, LINDA_EPB_WRITE, linda_ib_epb_wait(), linda_writeq, memset(), QIB_7220_ibsd_epb_transaction_reg_offset, rc, and xact.
Referenced by linda_ib_epb_mod_reg(), and linda_ib_epb_ram_xfer().
|
static |
Read/modify/write EPB register.
| linda | Linda device |
| cs | Chip select |
| channel | Channel |
| element | Element |
| reg | Register |
| value | Value to set |
| mask | Mask to apply to old value |
| rc | Return status code |
Definition at line 1833 of file linda.c.
References assert(), channel, cs, DBG_DISABLE, DBG_ENABLE, DBGCP, DBGLVL_IO, element, LINDA_EPB_LOC, linda_ib_epb_read(), linda_ib_epb_release(), linda_ib_epb_request(), linda_ib_epb_write(), out, rc, reg, and value.
Referenced by linda_set_serdes_param().
|
static |
Transfer data to/from microcontroller RAM.
| linda | Linda device |
| address | Starting address |
| write | Data to write, or NULL |
| read | Data to read, or NULL |
| len | Length of data |
| rc | Return status code |
Definition at line 1887 of file linda.c.
References address, assert(), control, data, DBG_DISABLE, DBG_ENABLE, DBGLVL_IO, len, LINDA_EPB_UC_ADDR_HI, LINDA_EPB_UC_ADDR_LO, LINDA_EPB_UC_CHUNK_SIZE, LINDA_EPB_UC_CTL, LINDA_EPB_UC_CTL_READ, LINDA_EPB_UC_CTL_WRITE, LINDA_EPB_UC_DATA, linda_ib_epb_read(), linda_ib_epb_release(), linda_ib_epb_request(), linda_ib_epb_write(), out, rc, read, and write.
Referenced by linda_program_uc_ram(), and linda_verify_uc_ram().
|
static |
Program IB SerDes register(s)
| linda | Linda device |
| param | SerDes parameter |
| rc | Return status code |
Definition at line 1998 of file linda.c.
References channel, element, LINDA_EPB_ADDRESS_CHANNEL, LINDA_EPB_ADDRESS_ELEMENT, LINDA_EPB_ADDRESS_REG, LINDA_EPB_ALL_CHANNELS, LINDA_EPB_CS_SERDES, linda_ib_epb_mod_reg(), param, rc, and reg.
Referenced by linda_set_serdes_params().
|
static |
Program IB SerDes registers.
| linda | Linda device |
| param | SerDes parameters |
| count | Number of parameters |
| rc | Return status code |
Definition at line 2038 of file linda.c.
References linda_set_serdes_param(), linda_serdes_param::mask, and rc.
Referenced by linda_init_ib_serdes().
|
static |
Program the microcontroller RAM.
| linda | Linda device |
| rc | Return status code |
Definition at line 2137 of file linda.c.
References DBGC, linda_ib_epb_ram_xfer(), linda_ib_fw, NULL, rc, and strerror().
Referenced by linda_init_ib_serdes().
|
static |
Verify the microcontroller RAM.
| linda | Linda device |
| rc | Return status code |
Definition at line 2156 of file linda.c.
References DBGC, DBGC2, DBGC_HDA, EIO, LINDA_EPB_UC_CHUNK_SIZE, linda_ib_epb_ram_xfer(), linda_ib_fw, memcmp(), NULL, offset, rc, and strerror().
Referenced by linda_init_ib_serdes().
|
static |
Use the microcontroller to trim the IB link.
| linda | Linda device |
| rc | Return status code |
Definition at line 2191 of file linda.c.
References BIT_GET, BIT_SET, ctrl, DBGC, ETIMEDOUT, linda_readq, LINDA_TRIM_DONE_MAX_WAIT_MS, linda_writeq, mdelay(), QIB_7220_IBSerDesCtrl_offset, QIB_7220_IntStatus_offset, and rc.
Referenced by linda_init_ib_serdes().
|
static |
Initialise the IB SerDes.
| linda | Linda device |
| rc | Return status code |
Definition at line 2228 of file linda.c.
References BIT_FILL_6, BIT_SET, control, DBGLVL_LOG, linda_program_uc_ram(), linda_readq, LINDA_RECV_HEADER_SIZE, LINDA_RECV_PAYLOAD_SIZE, linda_serdes_defaults1, linda_serdes_defaults2, linda_serdes_defaults3, linda_set_serdes_params(), linda_trim_ib(), linda_verify_uc_ram(), linda_writeq, memset(), QIB_7220_Control_offset, QIB_7220_IBCCtrl_offset, QIB_7220_IBCDDRCtrl_offset, QIB_7220_XGXSCfg_offset, rc, and udelay().
Referenced by linda_probe().
|
static |
Probe PCI device.
| pci | PCI device |
| id | PCI ID |
| rc | Return status code |
Definition at line 2317 of file linda.c.
References adjust_pci_device(), alloc_ibdev(), BIT_GET, DBGC, DBGC2, pci_device::dev, ib_device::dev, ENOMEM, ib_device::gid, ib_gid::guid, ib_get_drvdata(), IB_LINK_SPEED_SDR, IB_LINK_WIDTH_1X, IB_LINK_WIDTH_4X, ibdev_put(), iounmap(), LINDA_BAR0_SIZE, linda_fini_recv(), linda_fini_send(), linda_ib_operations, linda_init_i2c(), linda_init_ib_serdes(), linda_init_recv(), linda_init_send(), linda_read_eeprom(), linda_readq, 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, QIB_7220_Revision_offset, rc, register_ibdev(), linda::regs, revision, ib_gid::s, strerror(), and unregister_ibdev().
|
static |
Remove PCI device.
| pci | PCI device |
Definition at line 2411 of file linda.c.
References ib_get_drvdata(), ibdev_put(), iounmap(), linda_fini_recv(), linda_fini_send(), pci_get_drvdata(), linda::regs, and unregister_ibdev().
|
static |
Linda Infiniband operations.
Definition at line 1484 of file linda.c.
Referenced by linda_probe().
|
static |
Linda I2C bit to GPIO mappings.
Definition at line 1510 of file linda.c.
Referenced by linda_i2c_read_bit(), and linda_i2c_write_bit().
|
static |
Linda I2C bit-bashing interface operations.
Definition at line 1585 of file linda.c.
Referenced by linda_init_i2c().
| struct linda_serdes_param __packed |
|
static |
Linda SerDes default parameters.
These magic start-of-day values are taken from the Linux driver.
Definition at line 2073 of file linda.c.
Referenced by linda_init_ib_serdes().
|
static |
Definition at line 2093 of file linda.c.
Referenced by linda_init_ib_serdes().
|
static |
Definition at line 2124 of file linda.c.
Referenced by linda_init_ib_serdes().
|
static |
| struct pci_driver linda_driver __pci_driver |
1.8.15