Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
ipath_kernel.h File Reference
#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 <asm/io.h>
#include <rdma/ib_verbs.h>
#include "ipath_common.h"
#include "ipath_debug.h"
#include "ipath_registers.h"

Go to the source code of this file.

Data Structures

struct  ipath_eep_log_mask
struct  ipath_portdata
struct  _ipath_layer
struct  ipath_skbinfo
struct  ipath_sdma_txreq
struct  ipath_sdma_desc
struct  ipath_devdata
struct  ipath_devdata::ipath_relock
struct  ipath_filedata
struct  ipath_hwerror_msgs


#define IPATH_EEP_LOG_CNT   (4)
#define IPATH_SDMA_TXREQ_F_VL15   0x20
#define IPATH_SDMA_STATUS_ABORT_IN_PROG   (1ull << 62)
#define IPATH_SDMA_STATUS_SCB_EMPTY   (1ull << 30)
#define IPATH_SMALLBUF_DWORDS   (dd->ipath_piosize2k >> 2)
#define IPATH_IB_CFG_LIDLMC   0 /* Get/set LID (LS16b) and Mask (MS16b) */
#define IPATH_IB_CFG_HRTBT   1 /* Get/set Heartbeat off/enable/auto */
#define IPATH_IB_HRTBT_ON   3 /* Heartbeat enabled, sent every 100msec */
#define IPATH_IB_HRTBT_OFF   0 /* Heartbeat off */
#define IPATH_IB_CFG_LWID_ENB   2 /* Get/set allowed Link-width */
#define IPATH_IB_CFG_LWID   3 /* Get currently active Link-width */
#define IPATH_IB_CFG_SPD_ENB   4 /* Get/set allowed Link speeds */
#define IPATH_IB_CFG_SPD   5 /* Get current Link spd */
#define IPATH_IB_CFG_RXPOL_ENB   6 /* Get/set Auto-RX-polarity enable */
#define IPATH_IB_CFG_LREV_ENB   7 /* Get/set Auto-Lane-reversal enable */
#define IPATH_IB_CFG_LINKLATENCY   8 /* Get Auto-Lane-reversal enable */
#define IPATH_HOL_UP   0
#define IPATH_HOL_DOWN   1
#define port_fp(fp)   ((struct ipath_filedata *)(fp)->private_data)->pd
#define subport_fp(fp)   ((struct ipath_filedata *)(fp)->private_data)->subport
#define tidcursor_fp(fp)   ((struct ipath_filedata *)(fp)->private_data)->tidcursor
#define user_sdma_queue_fp(fp)   ((struct ipath_filedata *)(fp)->private_data)->pq
#define IPATH_INITTED   0x2
#define IPATH_RCVHDRSZ_SET   0x4
#define IPATH_PRESENT   0x8
#define IPATH_8BIT_IN_HT0   0x10
#define IPATH_8BIT_IN_HT1   0x20
#define IPATH_LINKDOWN   0x40
#define IPATH_LINKINIT   0x80
#define IPATH_LINKARMED   0x100
#define IPATH_LINKACTIVE   0x200
#define IPATH_LINKUNK   0x400
#define IPATH_PIO_FLUSH_WC   0x1000
#define IPATH_NODMA_RTAIL   0x2000
#define IPATH_NOCABLE   0x4000
#define IPATH_GPIO_INTR   0x8000
#define IPATH_4BYTE_TID   0x10000
#define IPATH_32BITCOUNTERS   0x20000
#define IPATH_INTREG_64   0x40000
#define IPATH_DISABLED   0x80000 /* administratively disabled */
#define IPATH_GPIO_ERRINTRS   0x100000
#define IPATH_SWAP_PIOBUFS   0x200000
#define IPATH_HAS_SEND_DMA   0x400000
#define IPATH_HAS_PBC_CNT   0x800000
#define IPATH_NO_HRTBT   0x1000000
#define IPATH_HAS_THRESH_UPDATE   0x4000000
#define IPATH_HAS_MULT_IB_SPEED   0x8000000
#define IPATH_IB_AUTONEG_INPROG   0x10000000
#define IPATH_IB_AUTONEG_FAILED   0x20000000
#define IPATH_IB_LINK_DISABLED   0x40000000
#define IPATH_IB_FORCE_NOTIFY   0x80000000 /* force notify on next ib change */
#define IPATH_GPIO_PORT0_BIT   2
#define IPATH_GPIO_LLI_BIT   5
#define IPATH_LED_PHYS   1 /* Physical (linktraining) GREEN LED */
#define IPATH_LED_LOG   2 /* Logical (link) YELLOW LED */
#define ipath_flush_wc()   wmb()
#define IPATH_DRV_NAME   "ib_ipath"
#define IPATH_MAJOR   233
#define IPATH_NMINORS   255
#define ipath_dev_err(dd, fmt,...)
#define __IPATH_DBG_WHICH(which, fmt,...)
#define ipath_dbg(fmt,...)   __IPATH_DBG_WHICH(__IPATH_DBG,fmt,##__VA_ARGS__)
#define ipath_cdbg(which, fmt,...)   __IPATH_DBG_WHICH(__IPATH_##which##DBG,fmt,##__VA_ARGS__)
#define INFINIPATH_HWE_MSG(a, b)   { .mask = INFINIPATH_HWE_##a, .msg = b }


struct ipath_devdataipath_lookup (int unit)
int ipath_init_chip (struct ipath_devdata *, int)
int ipath_enable_wc (struct ipath_devdata *dd)
void ipath_disable_wc (struct ipath_devdata *dd)
int ipath_count_units (int *npresentp, int *nupp, int *maxportsp)
void ipath_shutdown_device (struct ipath_devdata *)
void ipath_clear_freeze (struct ipath_devdata *)
int ipath_cdev_init (int minor, char *name, const struct file_operations *fops, struct cdev **cdevp, struct device **devp)
void ipath_cdev_cleanup (struct cdev **cdevp, struct device **devp)
int ipath_diag_add (struct ipath_devdata *)
void ipath_diag_remove (struct ipath_devdata *)
int ipath_user_add (struct ipath_devdata *dd)
void ipath_user_remove (struct ipath_devdata *dd)
struct sk_buffipath_alloc_skb (struct ipath_devdata *dd, gfp_t)
irqreturn_t ipath_intr (int irq, void *devid)
int ipath_decode_err (struct ipath_devdata *dd, char *buf, size_t blen, ipath_err_t err)
void ipath_chip_cleanup (struct ipath_devdata *)
void ipath_chip_done (void)
int ipath_unordered_wc (void)
void ipath_disarm_piobufs (struct ipath_devdata *, unsigned first, unsigned cnt)
void ipath_cancel_sends (struct ipath_devdata *, int)
int ipath_create_rcvhdrq (struct ipath_devdata *, struct ipath_portdata *)
void ipath_free_pddata (struct ipath_devdata *, struct ipath_portdata *)
int ipath_parse_ushort (const char *str, unsigned short *valp)
void ipath_kreceive (struct ipath_portdata *)
int ipath_setrcvhdrsize (struct ipath_devdata *, unsigned)
int ipath_reset_device (int)
void ipath_get_faststats (unsigned long)
int ipath_wait_linkstate (struct ipath_devdata *, u32, int)
int ipath_set_linkstate (struct ipath_devdata *, u8)
int ipath_set_mtu (struct ipath_devdata *, u16)
int ipath_set_lid (struct ipath_devdata *, u32, u8)
int ipath_set_rx_pol_inv (struct ipath_devdata *dd, u8 new_pol_inv)
void ipath_enable_armlaunch (struct ipath_devdata *)
void ipath_disable_armlaunch (struct ipath_devdata *)
void ipath_hol_down (struct ipath_devdata *)
void ipath_hol_up (struct ipath_devdata *)
void ipath_hol_event (unsigned long)
void ipath_toggle_rclkrls (struct ipath_devdata *)
void ipath_sd7220_clr_ibpar (struct ipath_devdata *)
void ipath_set_relock_poll (struct ipath_devdata *, int)
void ipath_shutdown_relock_poll (struct ipath_devdata *)
void ipath_free_data (struct ipath_portdata *dd)
u32 __iomemipath_getpiobuf (struct ipath_devdata *, u32, u32 *)
void ipath_chg_pioavailkernel (struct ipath_devdata *dd, unsigned start, unsigned len, int avail)
void ipath_init_iba6110_funcs (struct ipath_devdata *)
void ipath_get_eeprom_info (struct ipath_devdata *)
int ipath_update_eeprom_log (struct ipath_devdata *dd)
void ipath_inc_eeprom_err (struct ipath_devdata *dd, u32 eidx, u32 incr)
u64 ipath_snap_cntr (struct ipath_devdata *, ipath_creg)
void ipath_disarm_senderrbufs (struct ipath_devdata *)
void ipath_force_pio_avail_update (struct ipath_devdata *)
void signal_ib_event (struct ipath_devdata *dd, enum ib_event_type ev)
void ipath_set_led_override (struct ipath_devdata *dd, unsigned int val)
int setup_sdma (struct ipath_devdata *)
void teardown_sdma (struct ipath_devdata *)
void ipath_restart_sdma (struct ipath_devdata *)
void ipath_sdma_intr (struct ipath_devdata *)
int ipath_sdma_verbs_send (struct ipath_devdata *, struct ipath_sge_state *, u32, struct ipath_verbs_txreq *)
int ipath_sdma_make_progress (struct ipath_devdata *dd)
int ipath_get_user_pages (unsigned long, size_t, struct page **)
void ipath_release_user_pages (struct page **, size_t)
void ipath_release_user_pages_on_close (struct page **, size_t)
int ipath_eeprom_read (struct ipath_devdata *, u8, void *, int)
int ipath_eeprom_write (struct ipath_devdata *, u8, const void *, int)
int ipath_tempsense_read (struct ipath_devdata *, u8 regnum)
int ipath_tempsense_write (struct ipath_devdata *, u8 regnum, u8 data)
void ipath_write_kreg_port (const struct ipath_devdata *, ipath_kreg, unsigned, u64)
int ipath_device_create_group (struct device *, struct ipath_devdata *)
void ipath_device_remove_group (struct device *, struct ipath_devdata *)
int ipath_expose_reset (struct device *)
int ipath_init_ipathfs (void)
void ipath_exit_ipathfs (void)
int ipathfs_add_device (struct ipath_devdata *)
int ipathfs_remove_device (struct ipath_devdata *)
dma_addr_t ipath_map_page (struct pci_dev *, struct page *, unsigned long, size_t, int)
dma_addr_t ipath_map_single (struct pci_dev *, void *, size_t, int)
const charipath_get_unit_name (int unit)
void ipath_format_hwerrors (u64 hwerrs, const struct ipath_hwerror_msgs *hwerrmsgs, size_t nhwerrmsgs, char *msg, size_t lmsg)


struct infinipath_stats ipath_stats
struct list_head ipath_dev_list
spinlock_t ipath_devs_lock
wait_queue_head_t ipath_state_wait
int ipath_diag_inuse
const charipath_ibcstatus_str []
const char ib_ipath_version []
struct attribute_groupipath_driver_attr_groups []
unsigned ipath_debug
unsigned ipath_linkrecovery
unsigned ipath_mtu4096
struct mutex ipath_mutex

Macro Definition Documentation

#define __IPATH_DBG_WHICH (   which,
do { \
if (unlikely(ipath_debug & (which))) \
printk(KERN_DEBUG IPATH_DRV_NAME ": %s: " fmt, \
__func__,##__VA_ARGS__); \
} while(0)

Definition at line 1343 of file ipath_kernel.h.

#define INFINIPATH_HWE_MSG (   a,
)    { .mask = INFINIPATH_HWE_##a, .msg = b }

Definition at line 1370 of file ipath_kernel.h.

#define IPATH_32BITCOUNTERS   0x20000

Definition at line 991 of file ipath_kernel.h.

#define IPATH_4BYTE_TID   0x10000

Definition at line 988 of file ipath_kernel.h.

#define IPATH_8BIT_IN_HT0   0x10

Definition at line 964 of file ipath_kernel.h.

#define IPATH_8BIT_IN_HT1   0x20

Definition at line 967 of file ipath_kernel.h.

#define ipath_cdbg (   which,
)    __IPATH_DBG_WHICH(__IPATH_##which##DBG,fmt,##__VA_ARGS__)

Definition at line 1352 of file ipath_kernel.h.


Definition at line 63 of file ipath_kernel.h.


Definition at line 55 of file ipath_kernel.h.


Definition at line 58 of file ipath_kernel.h.

#define ipath_dbg (   fmt,

Definition at line 1350 of file ipath_kernel.h.

#define ipath_dev_err (   dd,
do { \
const struct ipath_devdata *__dd = (dd); \
if (__dd->pcidev) \
dev_err(&__dd->pcidev->dev, "%s: " fmt, \
##__VA_ARGS__); \
##__VA_ARGS__); \
} while (0)

Definition at line 1328 of file ipath_kernel.h.


Definition at line 1082 of file ipath_kernel.h.


Definition at line 1325 of file ipath_kernel.h.


Definition at line 1324 of file ipath_kernel.h.

#define IPATH_DISABLED   0x80000 /* administratively disabled */

Definition at line 995 of file ipath_kernel.h.

#define IPATH_DRV_NAME   "ib_ipath"

Definition at line 1321 of file ipath_kernel.h.

#define IPATH_EEP_LOG_CNT   (4)

Definition at line 77 of file ipath_kernel.h.

#define ipath_flush_wc ( )    wmb()

Definition at line 1313 of file ipath_kernel.h.


Definition at line 1018 of file ipath_kernel.h.

#define IPATH_GPIO_ERRINTRS   0x100000

Definition at line 997 of file ipath_kernel.h.

#define IPATH_GPIO_INTR   0x8000

Definition at line 986 of file ipath_kernel.h.

#define IPATH_GPIO_LLI_BIT   5

Definition at line 1017 of file ipath_kernel.h.


Definition at line 1016 of file ipath_kernel.h.

#define IPATH_GPIO_PORT0_BIT   2

Definition at line 1014 of file ipath_kernel.h.


Definition at line 1015 of file ipath_kernel.h.


Definition at line 955 of file ipath_kernel.h.

#define IPATH_HAS_MULT_IB_SPEED   0x8000000

Definition at line 1006 of file ipath_kernel.h.

#define IPATH_HAS_PBC_CNT   0x800000

Definition at line 1002 of file ipath_kernel.h.

#define IPATH_HAS_SEND_DMA   0x400000

Definition at line 1000 of file ipath_kernel.h.

#define IPATH_HAS_THRESH_UPDATE   0x4000000

Definition at line 1005 of file ipath_kernel.h.

#define IPATH_HOL_DOWN   1

Definition at line 835 of file ipath_kernel.h.


Definition at line 838 of file ipath_kernel.h.


Definition at line 837 of file ipath_kernel.h.

#define IPATH_HOL_UP   0

Definition at line 834 of file ipath_kernel.h.

#define IPATH_IB_AUTONEG_FAILED   0x20000000

Definition at line 1008 of file ipath_kernel.h.

#define IPATH_IB_AUTONEG_INPROG   0x10000000

Definition at line 1007 of file ipath_kernel.h.

#define IPATH_IB_CFG_HRTBT   1 /* Get/set Heartbeat off/enable/auto */

Definition at line 247 of file ipath_kernel.h.

#define IPATH_IB_CFG_LIDLMC   0 /* Get/set LID (LS16b) and Mask (MS16b) */

Definition at line 246 of file ipath_kernel.h.

#define IPATH_IB_CFG_LINKLATENCY   8 /* Get Auto-Lane-reversal enable */

Definition at line 256 of file ipath_kernel.h.

#define IPATH_IB_CFG_LREV_ENB   7 /* Get/set Auto-Lane-reversal enable */

Definition at line 255 of file ipath_kernel.h.

#define IPATH_IB_CFG_LWID   3 /* Get currently active Link-width */

Definition at line 251 of file ipath_kernel.h.

#define IPATH_IB_CFG_LWID_ENB   2 /* Get/set allowed Link-width */

Definition at line 250 of file ipath_kernel.h.

#define IPATH_IB_CFG_RXPOL_ENB   6 /* Get/set Auto-RX-polarity enable */

Definition at line 254 of file ipath_kernel.h.

#define IPATH_IB_CFG_SPD   5 /* Get current Link spd */

Definition at line 253 of file ipath_kernel.h.

#define IPATH_IB_CFG_SPD_ENB   4 /* Get/set allowed Link speeds */

Definition at line 252 of file ipath_kernel.h.

#define IPATH_IB_FORCE_NOTIFY   0x80000000 /* force notify on next ib change */

Definition at line 1011 of file ipath_kernel.h.

#define IPATH_IB_HRTBT_OFF   0 /* Heartbeat off */

Definition at line 249 of file ipath_kernel.h.

#define IPATH_IB_HRTBT_ON   3 /* Heartbeat enabled, sent every 100msec */

Definition at line 248 of file ipath_kernel.h.

#define IPATH_IB_LINK_DISABLED   0x40000000

Definition at line 1010 of file ipath_kernel.h.

#define IPATH_INITTED   0x2

Definition at line 957 of file ipath_kernel.h.

#define IPATH_INTREG_64   0x40000

Definition at line 993 of file ipath_kernel.h.

#define IPATH_LED_LOG   2 /* Logical (link) YELLOW LED */

Definition at line 1048 of file ipath_kernel.h.

#define IPATH_LED_PHYS   1 /* Physical (linktraining) GREEN LED */

Definition at line 1047 of file ipath_kernel.h.

#define IPATH_LINKACTIVE   0x200

Definition at line 975 of file ipath_kernel.h.

#define IPATH_LINKARMED   0x100

Definition at line 973 of file ipath_kernel.h.

#define IPATH_LINKDOWN   0x40

Definition at line 969 of file ipath_kernel.h.

#define IPATH_LINKINIT   0x80

Definition at line 971 of file ipath_kernel.h.

#define IPATH_LINKUNK   0x400

Definition at line 977 of file ipath_kernel.h.

#define IPATH_MAJOR   233

Definition at line 1322 of file ipath_kernel.h.

#define IPATH_NMINORS   255

Definition at line 1326 of file ipath_kernel.h.

#define IPATH_NO_HRTBT   0x1000000

Definition at line 1004 of file ipath_kernel.h.

#define IPATH_NOCABLE   0x4000

Definition at line 983 of file ipath_kernel.h.

#define IPATH_NODMA_RTAIL   0x2000

Definition at line 981 of file ipath_kernel.h.

#define IPATH_PIO_FLUSH_WC   0x1000

Definition at line 979 of file ipath_kernel.h.


Definition at line 1024 of file ipath_kernel.h.


Definition at line 1022 of file ipath_kernel.h.


Definition at line 1026 of file ipath_kernel.h.

#define IPATH_PRESENT   0x8

Definition at line 961 of file ipath_kernel.h.

#define IPATH_RCVHDRSZ_SET   0x4

Definition at line 959 of file ipath_kernel.h.


Definition at line 855 of file ipath_kernel.h.


Definition at line 850 of file ipath_kernel.h.


Definition at line 853 of file ipath_kernel.h.


Definition at line 851 of file ipath_kernel.h.


Definition at line 857 of file ipath_kernel.h.


Definition at line 849 of file ipath_kernel.h.


Definition at line 841 of file ipath_kernel.h.


Definition at line 861 of file ipath_kernel.h.


Definition at line 860 of file ipath_kernel.h.


Definition at line 843 of file ipath_kernel.h.


Definition at line 842 of file ipath_kernel.h.


Definition at line 844 of file ipath_kernel.h.


Definition at line 845 of file ipath_kernel.h.


Definition at line 846 of file ipath_kernel.h.

#define IPATH_SDMA_STATUS_ABORT_IN_PROG   (1ull << 62)

Definition at line 236 of file ipath_kernel.h.


Definition at line 237 of file ipath_kernel.h.

#define IPATH_SDMA_STATUS_SCB_EMPTY   (1ull << 30)

Definition at line 238 of file ipath_kernel.h.


Definition at line 235 of file ipath_kernel.h.


Definition at line 226 of file ipath_kernel.h.


Definition at line 227 of file ipath_kernel.h.


Definition at line 224 of file ipath_kernel.h.


Definition at line 225 of file ipath_kernel.h.


Definition at line 223 of file ipath_kernel.h.

#define IPATH_SDMA_TXREQ_F_VL15   0x20

Definition at line 228 of file ipath_kernel.h.


Definition at line 232 of file ipath_kernel.h.


Definition at line 230 of file ipath_kernel.h.


Definition at line 231 of file ipath_kernel.h.


Definition at line 233 of file ipath_kernel.h.

#define IPATH_SMALLBUF_DWORDS   (dd->ipath_piosize2k >> 2)

Definition at line 241 of file ipath_kernel.h.

#define IPATH_SWAP_PIOBUFS   0x200000

Definition at line 998 of file ipath_kernel.h.


Definition at line 70 of file ipath_kernel.h.


Definition at line 1323 of file ipath_kernel.h.

#define port_fp (   fp)    ((struct ipath_filedata *)(fp)->private_data)->pd

Definition at line 943 of file ipath_kernel.h.

#define subport_fp (   fp)    ((struct ipath_filedata *)(fp)->private_data)->subport

Definition at line 944 of file ipath_kernel.h.

#define tidcursor_fp (   fp)    ((struct ipath_filedata *)(fp)->private_data)->tidcursor

Definition at line 946 of file ipath_kernel.h.

#define user_sdma_queue_fp (   fp)    ((struct ipath_filedata *)(fp)->private_data)->pq

Definition at line 948 of file ipath_kernel.h.

Function Documentation

struct sk_buff* ipath_alloc_skb ( struct ipath_devdata dd,
gfp_t  gfp_mask 

ipath_alloc_skb - allocate an skb and buffer with possible constraints : the infinipath device : the sk_buff SFP mask

Definition at line 1066 of file ipath_driver.c.

void ipath_cancel_sends ( struct ipath_devdata ,

Definition at line 1856 of file ipath_driver.c.

void ipath_cdev_cleanup ( struct cdev **  cdevp,
struct device **  devp 

Definition at line 2511 of file ipath_file_ops.c.

int ipath_cdev_init ( int  minor,
char name,
const struct file_operations fops,
struct cdev **  cdevp,
struct device **  devp 

Definition at line 2489 of file ipath_file_ops.c.

void ipath_chg_pioavailkernel ( struct ipath_devdata dd,
unsigned  start,
unsigned  len,
int  avail 

ipath_chg_pioavailkernel - change which send buffers are available for kernel : the infinipath device : the starting send buffer number : the number of send buffers : true if the buffers are available for kernel use, false otherwise

Definition at line 1671 of file ipath_driver.c.

void ipath_chip_cleanup ( struct ipath_devdata )
void ipath_chip_done ( void  )
void ipath_clear_freeze ( struct ipath_devdata )

Definition at line 887 of file ipath_intr.c.

int ipath_count_units ( int npresentp,
int nupp,
int maxportsp 

Definition at line 250 of file ipath_driver.c.

int ipath_create_rcvhdrq ( struct ipath_devdata dd,
struct ipath_portdata pd 

ipath_create_rcvhdrq - create a receive header queue : the infinipath device : the port 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 1767 of file ipath_driver.c.

int ipath_decode_err ( struct ipath_devdata dd,
char buf,
size_t  blen,
ipath_err_t  err 

Definition at line 918 of file ipath_driver.c.

int ipath_device_create_group ( struct device ,
struct ipath_devdata  

Definition at line 1186 of file ipath_sysfs.c.

void ipath_device_remove_group ( struct device ,
struct ipath_devdata  

Definition at line 1225 of file ipath_sysfs.c.

int ipath_diag_add ( struct ipath_devdata )

Definition at line 87 of file ipath_diag.c.

void ipath_diag_remove ( struct ipath_devdata )

Definition at line 117 of file ipath_diag.c.

void ipath_disable_armlaunch ( struct ipath_devdata )

Definition at line 2779 of file ipath_driver.c.

void ipath_disable_wc ( struct ipath_devdata dd)

ipath_disable_wc - disable write combining for MMIO writes to the device : infinipath device

Definition at line 155 of file ipath_wc_x86_64.c.

void ipath_disarm_piobufs ( struct ipath_devdata dd,
unsigned  first,
unsigned  cnt 

ipath_disarm_piobufs - cancel a range of PIO buffers : the infinipath device : the first PIO buffer to cancel : the number of PIO buffers to cancel

cancel a range of PIO buffers, used when they might be armed, but not triggered. Used at init to ensure buffer state, and also user process close, in case it died while writing to a PIO buffer Also after errors.

Definition at line 815 of file ipath_driver.c.

void ipath_disarm_senderrbufs ( struct ipath_devdata )

Definition at line 47 of file ipath_intr.c.

int ipath_eeprom_read ( struct ipath_devdata dd,
u8  eeprom_offset,
void buff,
int  len 

ipath_eeprom_read - receives bytes from the eeprom via I2C : the infinipath device : address to read from : where to store result : number of bytes to receive

Definition at line 641 of file ipath_eeprom.c.

int ipath_eeprom_write ( struct ipath_devdata dd,
u8  eeprom_offset,
const void buff,
int  len 

ipath_eeprom_write - writes data to the eeprom via I2C : the infinipath device : where to place data : data to write : number of bytes to write

Definition at line 662 of file ipath_eeprom.c.

void ipath_enable_armlaunch ( struct ipath_devdata )

Definition at line 2769 of file ipath_driver.c.

int ipath_enable_wc ( struct ipath_devdata dd)

ipath_enable_wc - enable write combining for MMIO writes to the device : infinipath device

Nothing to do on PowerPC, so just return without error.

ipath_enable_wc - enable write combining for MMIO writes to the device : infinipath device

This routine is x86_64-specific; it twiddles the CPU's MTRRs to enable write combining.

Definition at line 46 of file ipath_wc_ppc64.c.

void ipath_exit_ipathfs ( void  )

Definition at line 419 of file ipath_fs.c.

int ipath_expose_reset ( struct device dev)

ipath_expose_reset - create a device reset file : the device structure

Only expose a file that lets us reset the device after someone enters diag mode. A device reset is quite likely to crash the machine entirely, so we don't want to normally make it available.

Called with ipath_mutex held.

Definition at line 1171 of file ipath_sysfs.c.

void ipath_force_pio_avail_update ( struct ipath_devdata )

Definition at line 1945 of file ipath_driver.c.

void ipath_format_hwerrors ( u64  hwerrs,
const struct ipath_hwerror_msgs hwerrmsgs,
size_t  nhwerrmsgs,
char msg,
size_t  msgl 

ipath_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 205 of file ipath_intr.c.

void ipath_free_data ( struct ipath_portdata dd)
void ipath_free_pddata ( struct ipath_devdata dd,
struct ipath_portdata pd 

ipath_free_pddata - free a port's allocated data : the infinipath device : the portdata structure

free up any allocated data for a port This should not touch anything that would affect a simultaneous re-allocation of port data, because it is called after ipath_mutex is released (and can be called from reinit as well). It should never change any chip state, or global driver state. (The only exception to global state is freeing the port0 port0_skbs.)

Definition at line 2434 of file ipath_driver.c.

void ipath_get_eeprom_info ( struct ipath_devdata dd)

ipath_get_guid - get the GUID from the i2c device : the infinipath device

We have the capability to use the ipath_nguid field, and get the guid from the first chip's flash, to use for all of them.

Definition at line 706 of file ipath_eeprom.c.

void ipath_get_faststats ( unsigned long  opaque)

ipath_get_faststats - get word counters from chip before they overflow - contains a pointer to the infinipath device ipath_devdata

called from add_timer

Definition at line 248 of file ipath_stats.c.

const char* ipath_get_unit_name ( int  unit)

Definition at line 51 of file ipath_driver.c.

int ipath_get_user_pages ( unsigned long  start_page,
size_t  num_pages,
struct page **  p 

ipath_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 161 of file ipath_user_pages.c.

u32 __iomem* ipath_getpiobuf ( struct ipath_devdata dd,
u32  plen,
u32 pbufnum 

ipath_getpiobuf - find an available pio buffer : the infinipath device : the size of the PIO buffer needed in 32-bit words : the buffer number is placed here

Definition at line 1626 of file ipath_driver.c.

void ipath_hol_down ( struct ipath_devdata )

Definition at line 2691 of file ipath_driver.c.

void ipath_hol_event ( unsigned  long)

Definition at line 2718 of file ipath_driver.c.

void ipath_hol_up ( struct ipath_devdata )

Definition at line 2706 of file ipath_driver.c.

void ipath_inc_eeprom_err ( struct ipath_devdata dd,
u32  eidx,
u32  incr 

ipath_inc_eeprom_err - increment one of the four error counters that are logged to EEPROM. : the infinipath 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 ipath_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 1015 of file ipath_eeprom.c.

int ipath_init_chip ( struct ipath_devdata dd,
int  reinit 

ipath_init_chip - do the actual initialization sequence on the chip : the infinipath 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 708 of file ipath_init_chip.c.

void ipath_init_iba6110_funcs ( struct ipath_devdata dd)

ipath_init_iba6110_funcs - set up the chip-specific function pointers : the infinipath device

This is global, and is called directly at init to set up the chip-specific function pointers for later use.

Definition at line 1908 of file ipath_iba6110.c.

int ipath_init_ipathfs ( void  )

Definition at line 414 of file ipath_fs.c.

irqreturn_t ipath_intr ( int  irq,
void devid 

Definition at line 1065 of file ipath_intr.c.

void ipath_kreceive ( struct ipath_portdata )

Definition at line 1150 of file ipath_driver.c.

struct ipath_devdata* ipath_lookup ( int  unit)

Definition at line 238 of file ipath_driver.c.

dma_addr_t ipath_map_page ( struct pci_dev hwdev,
struct page page,
unsigned long  offset,
size_t  size,
int  direction 

ipath_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 106 of file ipath_user_pages.c.

dma_addr_t ipath_map_single ( struct pci_dev hwdev,
void ptr,
size_t  size,
int  direction 

ipath_map_single - a safety wrapper around pci_map_single()

Same idea as ipath_map_page().

Definition at line 130 of file ipath_user_pages.c.

int ipath_parse_ushort ( const char str,
unsigned short valp 

ipath_parse_ushort - parse an unsigned short value in an arbitrary base : the string containing the number : where to put the result

returns the number of bytes consumed, or negative value on error

Definition at line 48 of file ipath_sysfs.c.

void ipath_release_user_pages ( struct page **  ,

Definition at line 175 of file ipath_user_pages.c.

void ipath_release_user_pages_on_close ( struct page **  ,

Definition at line 204 of file ipath_user_pages.c.

int ipath_reset_device ( int  unit)

ipath_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 ports are open that use chip resources

Definition at line 2559 of file ipath_driver.c.

void ipath_restart_sdma ( struct ipath_devdata )

Definition at line 591 of file ipath_sdma.c.

void ipath_sd7220_clr_ibpar ( struct ipath_devdata )
void ipath_sdma_intr ( struct ipath_devdata )

Definition at line 364 of file ipath_sdma.c.

int ipath_sdma_make_progress ( struct ipath_devdata dd)

Definition at line 95 of file ipath_sdma.c.

int ipath_sdma_verbs_send ( struct ipath_devdata ,
struct ipath_sge_state ,
u32  ,
struct ipath_verbs_txreq  

Definition at line 664 of file ipath_sdma.c.

void ipath_set_led_override ( struct ipath_devdata dd,
unsigned int  val 

Definition at line 2279 of file ipath_driver.c.

int ipath_set_lid ( struct ipath_devdata ,
u32  ,

Definition at line 2201 of file ipath_driver.c.

int ipath_set_linkstate ( struct ipath_devdata ,

Definition at line 2005 of file ipath_driver.c.

int ipath_set_mtu ( struct ipath_devdata dd,
u16  arg 

ipath_set_mtu - set the MTU : the infinipath device

  • : the new MTU

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 2134 of file ipath_driver.c.

void ipath_set_relock_poll ( struct ipath_devdata ,
int ipath_set_rx_pol_inv ( struct ipath_devdata dd,
u8  new_pol_inv 

Definition at line 2742 of file ipath_driver.c.

int ipath_setrcvhdrsize ( struct ipath_devdata dd,
unsigned  rhdrsize 

ipath_setrcvhdrsize - set the receive header size : the infinipath device : the receive header size

called from user init code, and also layered driver init

Definition at line 1452 of file ipath_driver.c.

void ipath_shutdown_device ( struct ipath_devdata dd)

ipath_shutdown_device - shut down a device : the infinipath device

This is called to make the device quiet when we are about to unload the driver, and also when the device is administratively disabled. It does not free any data structures. Everything it does has to be setup again by ipath_init_chip(dd,1)

Definition at line 2327 of file ipath_driver.c.

void ipath_shutdown_relock_poll ( struct ipath_devdata )
u64 ipath_snap_cntr ( struct ipath_devdata dd,
ipath_creg  creg 

ipath_snap_cntr - snapshot a chip counter : the infinipath device : the counter to snapshot

called from add_timer and user counter read calls, to deal with counters that wrap in "human time". The words sent and received, and the packets sent and received are all that we worry about. For now, at least, we don't worry about error counters, because if they wrap that quickly, we probably don't care. We may eventually just make this handle all the counters. word counters can wrap in about 20 seconds of full bandwidth traffic, packet counters in a few hours.

Definition at line 52 of file ipath_stats.c.

int ipath_tempsense_read ( struct ipath_devdata dd,
u8  regnum 

ipath_tempsense_read - read register of temp sensor via I2C : the infinipath device : register to read from

returns reg contents (0..255) or < 0 for error

Definition at line 1085 of file ipath_eeprom.c.

int ipath_tempsense_write ( struct ipath_devdata dd,
u8  regnum,
u8  data 

ipath_tempsense_write - write register of temp sensor via I2C : the infinipath device : register to write : data to write

returns 0 for success or < 0 for error

Definition at line 1163 of file ipath_eeprom.c.

void ipath_toggle_rclkrls ( struct ipath_devdata )
int ipath_unordered_wc ( void  )

ipath_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.

ipath_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 ipath_wc_ppc64.c.

int ipath_update_eeprom_log ( struct ipath_devdata dd)

ipath_update_eeprom_log - copy active-time and error counters to eeprom : the infinipath device

Although the time is kept as seconds in the ipath_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 ipath_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 865 of file ipath_eeprom.c.

int ipath_user_add ( struct ipath_devdata dd)

Definition at line 2562 of file ipath_file_ops.c.

void ipath_user_remove ( struct ipath_devdata dd)

Definition at line 2601 of file ipath_file_ops.c.

int ipath_wait_linkstate ( struct ipath_devdata dd,
u32  state,
int  msecs 

ipath_wait_linkstate - wait for an IB link state change to occur : the infinipath 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 ipath_set_linkstate. Returns 0 if state reached, otherwise -ETIMEDOUT state can have multiple states set, for any of several transitions.

Definition at line 852 of file ipath_driver.c.

void ipath_write_kreg_port ( const struct ipath_devdata dd,
ipath_kreg  regno,
unsigned  port,
u64  value 

ipath_write_kreg_port - write a device's per-port 64-bit kernel register : the infinipath device : the register number to write : the port containing the register : the value to write

Registers that vary with the chip implementation constants (port) use this routine.

Definition at line 2225 of file ipath_driver.c.

int ipathfs_add_device ( struct ipath_devdata )

Definition at line 377 of file ipath_fs.c.

int ipathfs_remove_device ( struct ipath_devdata )

Definition at line 392 of file ipath_fs.c.

int setup_sdma ( struct ipath_devdata )

Definition at line 419 of file ipath_sdma.c.

void signal_ib_event ( struct ipath_devdata dd,
enum ib_event_type  ev 

Definition at line 246 of file ipath_intr.c.

void teardown_sdma ( struct ipath_devdata )

Definition at line 508 of file ipath_sdma.c.

Variable Documentation

const char ib_ipath_version[]

Definition at line 65 of file ipath_driver.c.

unsigned ipath_debug

Definition at line 73 of file ipath_driver.c.

struct list_head ipath_dev_list
spinlock_t ipath_devs_lock
int ipath_diag_inuse

Definition at line 54 of file ipath_diag.c.

struct attribute_group* ipath_driver_attr_groups[]

Definition at line 1074 of file ipath_sysfs.c.

const char* ipath_ibcstatus_str[]

Definition at line 100 of file ipath_driver.c.

unsigned ipath_linkrecovery

Definition at line 88 of file ipath_driver.c.

unsigned ipath_mtu4096

Definition at line 79 of file ipath_driver.c.

struct mutex ipath_mutex
wait_queue_head_t ipath_state_wait

Definition at line 71 of file ipath_driver.c.

struct infinipath_stats ipath_stats

Definition at line 36 of file ipath_stats.c.