Linux Kernel
3.7.1
|
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/mutex.h>
#include <linux/list.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/fs.h>
#include <linux/completion.h>
#include <linux/kref.h>
#include <linux/sched.h>
#include "qib_common.h"
#include "qib_verbs.h"
Go to the source code of this file.
Data Structures | |
struct | qlogic_ib_stats |
struct | qib_eep_log_mask |
struct | qib_ctxtdata |
struct | qib_sdma_txreq |
struct | qib_sdma_desc |
struct | qib_verbs_txreq |
struct | qib_msix_entry |
struct | sdma_set_state_action |
struct | qib_sdma_state |
struct | xmit_wait |
struct | xmit_wait::cache |
struct | qib_pportdata |
struct | diag_observer |
struct | qib_devdata |
struct | qib_filedata |
struct | qib_hwerror_msgs |
Typedefs | |
typedef int(* | diag_hook )(struct qib_devdata *dd, const struct diag_observer *op, u32 offs, u64 *data, u64 mask, int only_32) |
Variables | |
struct qlogic_ib_stats | qib_stats |
struct pci_error_handlers | qib_pci_err_handler |
struct pci_driver | qib_driver |
char * | qib_sdma_state_names [] |
char * | qib_sdma_event_names [] |
struct list_head | qib_dev_list |
spinlock_t | qib_devs_lock |
u32 | qib_cpulist_count |
unsigned long * | qib_cpulist |
unsigned | qib_wc_pat |
unsigned | qib_cc_table_size |
const char | ib_qib_version [] |
unsigned | qib_ibmtu |
ushort | qib_cfgctxts |
ushort | qib_num_cfg_vls |
ushort | qib_mini_init |
unsigned | qib_n_krcv_queues |
unsigned | qib_sdma_fetch_arb |
unsigned | qib_compat_ddr_negotiate |
int | qib_special_trigger |
struct mutex | qib_mutex |
#define ctxt_fp | ( | fp | ) | (((struct qib_filedata *)(fp)->private_data)->rcd) |
#define QIB_CHASE_DIS_TIME msecs_to_jiffies(160) |
#define QIB_CHASE_TIME msecs_to_jiffies(145) |
#define QIB_CHIP_SWVERSION QIB_CHIP_VERS_MAJ |
#define QIB_DCA_ENABLED 0x10000 /* Direct Cache Access enabled */ |
#define QIB_DOING_RESET 0x4 /* in the middle of doing chip reset */ |
#define QIB_HAS_HDRSUPP 0x4000 /* Supports header suppression */ |
#define QIB_HAS_LINK_LATENCY 0x1 /* supports link latency (IB 1.2) */ |
#define QIB_HAS_QSFP 0x20000 /* device (card instance) has QSFP */ |
#define QIB_HAS_VLSUPP 0x2000 /* Supports multiple VLs; PBC different */ |
#define QIB_IB_CFG_LINKLATENCY 8 /* Link Latency (IB1.2 only) */ |
#define QIB_IB_CFG_PORT 21 /* switch port we are connected to */ |
#define QIB_NODMA_RTAIL 0x200 /* rcvhdrtail register DMA enabled */ |
#define QIB_PIO_FLUSH_WC 0x10 /* Needs Write combining flush for PIO */ |
#define QIB_RCVCTRL_PKEY_ENB 0x40 /* Note, default is enabled */ |
#define QIB_SENDCTRL_DISARM_BUF | ( | bufn | ) | ((bufn) | QIB_SENDCTRL_DISARM) |
#define QIB_USE_SPCL_TRIG 0x100 /* SpecialTrigger launch enabled */ |
#define QIBL_IB_AUTONEG_FAILED 0x2000 /* non-IBTA DDR/QDR neg failed */ |
#define QIBL_IB_AUTONEG_INPROG 0x1000 /* non-IBTA DDR/QDR neg active */ |
#define QIBL_IB_FORCE_NOTIFY 0x8000 /* force notify on next ib change */ |
#define QIBL_IB_LINK_DISABLED |
#define subctxt_fp | ( | fp | ) | (((struct qib_filedata *)(fp)->private_data)->subctxt) |
#define tidcursor_fp | ( | fp | ) | (((struct qib_filedata *)(fp)->private_data)->tidcursor) |
#define user_sdma_queue_fp | ( | fp | ) | (((struct qib_filedata *)(fp)->private_data)->pq) |
enum qib_sdma_events |
enum qib_sdma_states |
void __qib_sdma_intr | ( | struct qib_pportdata * | ) |
Definition at line 424 of file qib_sdma.c.
void __qib_sdma_process_event | ( | struct qib_pportdata * | , |
enum | qib_sdma_events | ||
) |
Definition at line 726 of file qib_sdma.c.
int init_chip_wc_pat | ( | struct qib_devdata * | dd, |
u32 | |||
) |
Definition at line 1649 of file qib_init.c.
|
read |
Definition at line 1057 of file qib_init.c.
void qib_bad_intrstatus | ( | struct qib_devdata * | ) |
Definition at line 217 of file qib_intr.c.
void qib_cancel_sends | ( | struct qib_pportdata * | ) |
Definition at line 2227 of file qib_file_ops.c.
int qib_cdev_init | ( | int | minor, |
const char * | name, | ||
const struct file_operations * | fops, | ||
struct cdev ** | cdevp, | ||
struct device ** | devp | ||
) |
Definition at line 2183 of file qib_file_ops.c.
void qib_chg_pioavailkernel | ( | struct qib_devdata * | dd, |
unsigned | start, | ||
unsigned | len, | ||
u32 | avail, | ||
struct qib_ctxtdata * | rcd | ||
) |
void qib_chip_cleanup | ( | struct qib_devdata * | ) |
Definition at line 174 of file qib_intr.c.
Definition at line 95 of file qib_driver.c.
Definition at line 124 of file qib_driver.c.
|
read |
Definition at line 164 of file qib_init.c.
int qib_create_ctxts | ( | struct qib_devdata * | dd | ) |
Definition at line 120 of file qib_init.c.
Definition at line 702 of file qib_sysfs.c.
int qib_create_rcvhdrq | ( | struct qib_devdata * | dd, |
struct qib_ctxtdata * | rcd | ||
) |
qib_create_rcvhdrq - create a receive header queue : the qlogic_ib device : the context data
This must be contiguous memory (from an i/o perspective), and must be DMA'able (which means for some systems, it will go through an IOMMU, or be forced into a low address range).
Definition at line 1490 of file qib_init.c.
Definition at line 2266 of file qib_file_ops.c.
Definition at line 2245 of file qib_file_ops.c.
int qib_device_create | ( | struct qib_devdata * | ) |
Definition at line 2310 of file qib_file_ops.c.
void qib_device_remove | ( | struct qib_devdata * | ) |
Definition at line 2325 of file qib_file_ops.c.
int qib_diag_add | ( | struct qib_devdata * | ) |
Definition at line 160 of file qib_diag.c.
void qib_diag_remove | ( | struct qib_devdata * | ) |
Definition at line 183 of file qib_diag.c.
void qib_disable_after_error | ( | struct qib_devdata * | ) |
Definition at line 1108 of file qib_init.c.
void qib_disable_wc | ( | struct qib_devdata * | dd | ) |
qib_disable_wc - disable write combining for MMIO writes to the device : qlogic_ib device
Definition at line 142 of file qib_wc_x86_64.c.
void qib_disarm_piobufs | ( | struct qib_devdata * | dd, |
unsigned | first, | ||
unsigned | cnt | ||
) |
int qib_disarm_piobufs_ifneeded | ( | struct qib_ctxtdata * | ) |
void qib_disarm_piobufs_set | ( | struct qib_devdata * | , |
unsigned long * | , | ||
unsigned | |||
) |
void qib_dump_lookup_output_queue | ( | struct qib_devdata * | ) |
qib_eeprom_read - receives bytes from the eeprom via I2C : the qlogic_ib device : address to read from : where to store result : number of bytes to receive
Definition at line 53 of file qib_eeprom.c.
qib_eeprom_write - writes data to the eeprom via I2C : the qlogic_ib device : where to place data : data to write : number of bytes to write
Definition at line 100 of file qib_eeprom.c.
Definition at line 418 of file qib_pcie.c.
int qib_enable_wc | ( | struct qib_devdata * | dd | ) |
qib_enable_wc - enable write combining for MMIO writes to the device : qlogic_ib device
Nothing to do on PowerPC, so just return without error.
qib_enable_wc - enable write combining for MMIO writes to the device : qlogic_ib device
This routine is x86_64-specific; it twiddles the CPU's MTRRs to enable write combining.
Definition at line 46 of file qib_wc_ppc64.c.
void qib_force_pio_avail_update | ( | struct qib_devdata * | ) |
void qib_format_hwerrors | ( | u64 | hwerrs, |
const struct qib_hwerror_msgs * | hwerrmsgs, | ||
size_t | nhwerrmsgs, | ||
char * | msg, | ||
size_t | msgl | ||
) |
qib_format_hwerrors - format hardware error messages for display hardware errors bit vector hardware error descriptions number of hwerrmsgs message buffer message buffer length
Definition at line 62 of file qib_intr.c.
void qib_free_ctxtdata | ( | struct qib_devdata * | dd, |
struct qib_ctxtdata * | rcd | ||
) |
qib_free_ctxtdata - free a context's allocated data : the qlogic_ib device : the ctxtdata structure
free up any allocated data for a context This should not touch anything that would affect a simultaneous re-allocation of context data, because it is called after qib_mutex is released (and can be called from reinit as well). It should never change any chip state, or global driver state.
Definition at line 909 of file qib_init.c.
void qib_free_data | ( | struct qib_ctxtdata * | dd | ) |
void qib_free_devdata | ( | struct qib_devdata * | ) |
Definition at line 1037 of file qib_init.c.
void qib_get_eeprom_info | ( | struct qib_devdata * | dd | ) |
Definition at line 84 of file qib_driver.c.
qib_get_user_pages - lock user pages into memory : the start page : the number of pages : the output page structures
This function takes a given start page (page aligned user virtual address) and pins it and the following specified number of pages. For now, num_pages is always 1, but that will probably change at some point (because caller is doing expected sends on a single virtually contiguous buffer, so we can do all pages at once).
Definition at line 132 of file qib_user_pages.c.
void qib_handle_e_ibstatuschanged | ( | struct qib_pportdata * | , |
u64 | |||
) |
Definition at line 83 of file qib_intr.c.
void qib_handle_urcv | ( | struct qib_devdata * | , |
u64 | |||
) |
Definition at line 190 of file qib_intr.c.
void qib_hol_down | ( | struct qib_pportdata * | ) |
void qib_hol_init | ( | struct qib_pportdata * | ) |
void qib_hol_up | ( | struct qib_pportdata * | ) |
void qib_inc_eeprom_err | ( | struct qib_devdata * | dd, |
u32 | eidx, | ||
u32 | incr | ||
) |
qib_inc_eeprom_err - increment one of the four error counters that are logged to EEPROM. : the qlogic_ib device : 0..3, the counter to increment : how much to add
Each counter is 8-bits, and saturates at 255 (0xFF). They are copied to the EEPROM (aka flash) whenever qib_update_eeprom_log() is called, but it can only be called in a context that allows sleep. This function can be called even at interrupt level.
Definition at line 445 of file qib_eeprom.c.
int qib_init | ( | struct qib_devdata * | dd, |
int | reinit | ||
) |
qib_init - do the actual initialization sequence on the chip : the qlogic_ib device : reinitializing, so don't allocate new memory
Do the actual initialization sequence on the chip. This is done both from the init routine called from the PCI infrastructure, and when we reset the chip, or detect that it was reset internally, or it's administratively re-enabled.
Memory allocation here and in called routines is only done in the first case (reinit == 0). We have to be careful, because even without memory allocation, we need to re-write all the chip registers TIDs, etc. after the reset or enable has completed.
Definition at line 621 of file qib_init.c.
|
read |
qib_init_iba6120_funcs - set up the chip-specific function pointers : pci_dev of the qlogic_ib device : pci_device_id matching this chip
This is global, and is called directly at init to set up the chip-specific function pointers for later use.
It also allocates/partially-inits the qib_devdata struct for this device.
Definition at line 3483 of file qib_iba6120.c.
|
read |
qib_init_iba7220_funcs - set up the chip-specific function pointers : the pci_dev for qlogic_ib device : pci_device_id struct for this dev
This is global, and is called directly at init to set up the chip-specific function pointers for later use.
Definition at line 4530 of file qib_iba7220.c.
|
read |
qib_init_iba7322_funcs - set up the chip-specific function pointers : the pci_dev for qlogic_ib device : pci_device_id struct for this dev
Also allocates, inits, and returns the devdata struct for this device instance
This is global, and is called directly at init to set up the chip-specific function pointers for later use.
Definition at line 6824 of file qib_iba7322.c.
void qib_init_pportdata | ( | struct qib_pportdata * | , |
struct qib_devdata * | , | ||
u8 | , | ||
u8 | |||
) |
Definition at line 207 of file qib_init.c.
u32 qib_kreceive | ( | struct qib_ctxtdata * | , |
u32 * | , | ||
u32 * | |||
) |
Definition at line 444 of file qib_driver.c.
|
read |
Definition at line 784 of file qib_init.c.
dma_addr_t qib_map_page | ( | struct pci_dev * | hwdev, |
struct page * | page, | ||
unsigned long | offset, | ||
size_t | size, | ||
int | direction | ||
) |
qib_map_page - a safety wrapper around pci_map_page()
A dma_addr of all 0's is interpreted by the chip as "disabled". Unfortunately, it can also be a valid dma_addr returned on some architectures.
The powerpc iommu assigns dma_addrs in ascending order, so we don't have to bother with retries or mapping a dummy page to insure we don't just get the same mapping again.
I'm sure we won't be so lucky with other iommu's, so FIXME.
Definition at line 101 of file qib_user_pages.c.
void qib_nomsi | ( | struct qib_devdata * | ) |
Definition at line 400 of file qib_pcie.c.
void qib_nomsix | ( | struct qib_devdata * | ) |
Definition at line 409 of file qib_pcie.c.
void qib_pcie_ddcleanup | ( | struct qib_devdata * | ) |
Definition at line 177 of file qib_pcie.c.
int qib_pcie_ddinit | ( | struct qib_devdata * | , |
struct pci_dev * | , | ||
const struct pci_device_id * | |||
) |
Definition at line 135 of file qib_pcie.c.
Definition at line 451 of file qib_pcie.c.
Definition at line 63 of file qib_pcie.c.
int qib_pcie_params | ( | struct qib_devdata * | , |
u32 | , | ||
u32 * | , | ||
struct qib_msix_entry * | |||
) |
Definition at line 272 of file qib_pcie.c.
Definition at line 458 of file qib_pcie.c.
qib_pio_copy - copy data to MMIO space, in multiples of 32-bits : destination, in MMIO space (must be 64-bit aligned) : source (must be 64-bit aligned) : number of 32-bit quantities to copy
Copy data from kernel space to MMIO space, in multiples of 32 bits at a time. Order of access is not guaranteed, nor is a memory barrier performed afterwards.
Definition at line 45 of file qib_pio_copy.c.
int qib_qsfp_dump | ( | struct qib_pportdata * | ppd, |
char * | buf, | ||
int | len | ||
) |
Definition at line 496 of file qib_qsfp.c.
int qib_register_observer | ( | struct qib_devdata * | dd, |
const struct diag_observer * | op | ||
) |
Definition at line 688 of file qib_diag.c.
int qib_reinit_intr | ( | struct qib_devdata * | ) |
Definition at line 350 of file qib_pcie.c.
Definition at line 146 of file qib_user_pages.c.
qib_reset_device - reset the chip if possible : the device to reset
Whether or not reset is successful, we attempt to re-initialize the chip (that is, much like a driver unload/reload). We clear the INITTED flag so that the various entry points will fail until we reinitialize. For now, we only allow this if no user contexts are open that use chip resources
Definition at line 752 of file qib_driver.c.
void qib_sdma_intr | ( | struct qib_pportdata * | ) |
Definition at line 413 of file qib_sdma.c.
int qib_sdma_make_progress | ( | struct qib_pportdata * | dd | ) |
Definition at line 348 of file qib_sdma.c.
void qib_sdma_process_event | ( | struct qib_pportdata * | , |
enum | qib_sdma_events | ||
) |
Definition at line 711 of file qib_sdma.c.
int qib_sdma_running | ( | struct qib_pportdata * | ) |
Definition at line 488 of file qib_sdma.c.
void qib_sdma_update_tail | ( | struct qib_pportdata * | , |
u16 | |||
) |
int qib_sdma_verbs_send | ( | struct qib_pportdata * | , |
struct qib_sge_state * | , | ||
u32 | , | ||
struct qib_verbs_txreq * | |||
) |
Definition at line 527 of file qib_sdma.c.
void qib_sendbuf_done | ( | struct qib_devdata * | , |
unsigned | |||
) |
void qib_set_ctxtcnt | ( | struct qib_devdata * | ) |
Definition at line 101 of file qib_init.c.
void qib_set_led_override | ( | struct qib_pportdata * | ppd, |
unsigned int | val | ||
) |
Definition at line 701 of file qib_driver.c.
int qib_set_lid | ( | struct qib_pportdata * | , |
u32 | , | ||
u8 | |||
) |
Definition at line 651 of file qib_driver.c.
int qib_set_linkstate | ( | struct qib_pportdata * | , |
u8 | |||
) |
Definition at line 196 of file qib_driver.c.
int qib_set_mtu | ( | struct qib_pportdata * | ppd, |
u16 | arg | ||
) |
qib_set_mtu - set the MTU : the perport data
We can handle "any" incoming size, the issue here is whether we need to restrict our outgoing size. For now, we don't do any sanity checking on this, and we don't deal with what happens to programs that are already running when the size changes. NOTE: changing the MTU will usually cause the IBC to go back to link INIT state...
Definition at line 612 of file qib_driver.c.
int qib_set_uevent_bits | ( | struct qib_pportdata * | , |
const int | |||
) |
Definition at line 1912 of file qib_file_ops.c.
int qib_setup_eagerbufs | ( | struct qib_ctxtdata * | rcd | ) |
allocate eager buffers, both kernel and user contexts. : the context we are setting up.
Allocate the eager TID buffers and program them into hip. They are no longer completely contiguous, we do multiple allocation calls. Otherwise we get the OOM code involved, by asking for too much per call, with disastrous results on some kernels.
Definition at line 1560 of file qib_init.c.
int qib_setup_sdma | ( | struct qib_pportdata * | ) |
Definition at line 430 of file qib_sdma.c.
void qib_teardown_sdma | ( | struct qib_pportdata * | ) |
Definition at line 474 of file qib_sdma.c.
Definition at line 354 of file qib_twsi.c.
Definition at line 432 of file qib_twsi.c.
int qib_twsi_reset | ( | struct qib_devdata * | dd | ) |
qib_twsi_reset - reset I2C communication : the qlogic_ib device
Definition at line 262 of file qib_twsi.c.
qib_unordered_wc - indicate whether write combining is unordered
Because our performance depends on our ability to do write combining mmio writes in the most efficient way, we need to know if we are on a processor that may reorder stores when write combining.
qib_unordered_wc - indicate whether write combining is ordered
Because our performance depends on our ability to do write combining mmio writes in the most efficient way, we need to know if we are on an Intel or AMD x86_64 processor. AMD x86_64 processors flush WC buffers out in the order completed, and so no special flushing is required to get correct ordering. Intel processors, however, will flush write buffers out in "random" orders, and so explicit ordering is needed at times.
Definition at line 59 of file qib_wc_ppc64.c.
int qib_update_eeprom_log | ( | struct qib_devdata * | dd | ) |
qib_update_eeprom_log - copy active-time and error counters to eeprom : the qlogic_ib device
Although the time is kept as seconds in the qib_devdata struct, it is rounded to hours for re-write, as we have only 16 bits in EEPROM. First-cut code reads whole (expected) struct qib_flash, modifies, re-writes. Future direction: read/write only what we need, assuming that the EEPROM had to have been "good enough" for driver init, and if not, we aren't making it worse.
Definition at line 297 of file qib_eeprom.c.
int qib_verbs_register_sysfs | ( | struct qib_devdata * | ) |
Definition at line 803 of file qib_sysfs.c.
void qib_verbs_unregister_sysfs | ( | struct qib_devdata * | ) |
Definition at line 820 of file qib_sysfs.c.
int qib_wait_linkstate | ( | struct qib_pportdata * | ppd, |
u32 | state, | ||
int | msecs | ||
) |
qib_wait_linkstate - wait for an IB link state change to occur : the qlogic_ib device : the state to wait for : the number of milliseconds to wait
wait up to msecs milliseconds for IB link state change to occur for now, take the easy polling route. Currently used only by qib_set_linkstate. Returns 0 if state reached, otherwise -ETIMEDOUT state can have multiple states set, for any of several transitions.
Definition at line 168 of file qib_driver.c.
int qibfs_add | ( | struct qib_devdata * | ) |
int qibfs_remove | ( | struct qib_devdata * | ) |
Definition at line 49 of file qib_driver.c.
unsigned qib_cc_table_size |
Definition at line 79 of file qib_init.c.
ushort qib_cfgctxts |
Definition at line 63 of file qib_init.c.
unsigned qib_compat_ddr_negotiate |
Definition at line 59 of file qib_driver.c.
unsigned long* qib_cpulist |
Definition at line 98 of file qib_init.c.
u32 qib_cpulist_count |
Definition at line 97 of file qib_init.c.
spinlock_t qib_devs_lock |
struct pci_driver qib_driver |
Definition at line 1153 of file qib_init.c.
unsigned qib_ibmtu |
Definition at line 55 of file qib_driver.c.
ushort qib_mini_init |
Definition at line 71 of file qib_init.c.
unsigned qib_n_krcv_queues |
Definition at line 75 of file qib_init.c.
ushort qib_num_cfg_vls |
Definition at line 106 of file qib_iba7322.c.
struct pci_error_handlers qib_pci_err_handler |
Definition at line 748 of file qib_pcie.c.
char* qib_sdma_event_names[] |
Definition at line 67 of file qib_sdma.c.
char* qib_sdma_state_names[] |
Definition at line 57 of file qib_sdma.c.
int qib_special_trigger |
Definition at line 570 of file qib_iba7220.c.
struct qlogic_ib_stats qib_stats |
Definition at line 82 of file qib_driver.c.
unsigned qib_wc_pat |
Definition at line 88 of file qib_init.c.