mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 21:19:04 -04:00
Merge libata branch 'chs-support' to latest upstream kernel.
This commit is contained in:
commit
76b2bf9b4d
241 changed files with 13868 additions and 6715 deletions
21
include/asm-arm/arch-sa1100/mcp.h
Normal file
21
include/asm-arm/arch-sa1100/mcp.h
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* linux/include/asm-arm/arch-sa1100/mcp.h
|
||||
*
|
||||
* Copyright (C) 2005 Russell King.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __ASM_ARM_ARCH_MCP_H
|
||||
#define __ASM_ARM_ARCH_MCP_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
struct mcp_plat_data {
|
||||
u32 mccr0;
|
||||
u32 mccr1;
|
||||
unsigned int sclk_rate;
|
||||
};
|
||||
|
||||
#endif
|
||||
41
include/asm-arm/hardware/gic.h
Normal file
41
include/asm-arm/hardware/gic.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* linux/include/asm-arm/hardware/gic.h
|
||||
*
|
||||
* Copyright (C) 2002 ARM Limited, All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
#ifndef __ASM_ARM_HARDWARE_GIC_H
|
||||
#define __ASM_ARM_HARDWARE_GIC_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#define GIC_CPU_CTRL 0x00
|
||||
#define GIC_CPU_PRIMASK 0x04
|
||||
#define GIC_CPU_BINPOINT 0x08
|
||||
#define GIC_CPU_INTACK 0x0c
|
||||
#define GIC_CPU_EOI 0x10
|
||||
#define GIC_CPU_RUNNINGPRI 0x14
|
||||
#define GIC_CPU_HIGHPRI 0x18
|
||||
|
||||
#define GIC_DIST_CTRL 0x000
|
||||
#define GIC_DIST_CTR 0x004
|
||||
#define GIC_DIST_ENABLE_SET 0x100
|
||||
#define GIC_DIST_ENABLE_CLEAR 0x180
|
||||
#define GIC_DIST_PENDING_SET 0x200
|
||||
#define GIC_DIST_PENDING_CLEAR 0x280
|
||||
#define GIC_DIST_ACTIVE_BIT 0x300
|
||||
#define GIC_DIST_PRI 0x400
|
||||
#define GIC_DIST_TARGET 0x800
|
||||
#define GIC_DIST_CONFIG 0xc00
|
||||
#define GIC_DIST_SOFTINT 0xf00
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
void gic_dist_init(void __iomem *base);
|
||||
void gic_cpu_init(void __iomem *base);
|
||||
void gic_raise_softirq(cpumask_t cpumask, unsigned int irq);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -19,7 +19,6 @@
|
|||
#include <asm/ptrace.h>
|
||||
#include <asm/head.h>
|
||||
#include <asm/signal.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/btfixup.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef __SPARC_SEGMENT_H
|
||||
#define __SPARC_SEGMENT_H
|
||||
|
||||
/* Only here because we have some old header files that expect it.. */
|
||||
|
||||
#endif
|
||||
|
|
@ -9,7 +9,6 @@
|
|||
#include <linux/threads.h> /* NR_CPUS */
|
||||
#include <linux/thread_info.h>
|
||||
|
||||
#include <asm/segment.h>
|
||||
#include <asm/page.h>
|
||||
#include <asm/psr.h>
|
||||
#include <asm/ptrace.h>
|
||||
|
|
|
|||
|
|
@ -72,10 +72,10 @@ extern int atomic64_sub_ret(int, atomic64_t *);
|
|||
|
||||
/* Atomic operations are already serializing */
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb__before_atomic_dec() membar("#StoreLoad | #LoadLoad")
|
||||
#define smp_mb__after_atomic_dec() membar("#StoreLoad | #StoreStore")
|
||||
#define smp_mb__before_atomic_inc() membar("#StoreLoad | #LoadLoad")
|
||||
#define smp_mb__after_atomic_inc() membar("#StoreLoad | #StoreStore")
|
||||
#define smp_mb__before_atomic_dec() membar_storeload_loadload();
|
||||
#define smp_mb__after_atomic_dec() membar_storeload_storestore();
|
||||
#define smp_mb__before_atomic_inc() membar_storeload_loadload();
|
||||
#define smp_mb__after_atomic_inc() membar_storeload_storestore();
|
||||
#else
|
||||
#define smp_mb__before_atomic_dec() barrier()
|
||||
#define smp_mb__after_atomic_dec() barrier()
|
||||
|
|
|
|||
|
|
@ -72,8 +72,8 @@ static inline int __test_and_change_bit(int nr, volatile unsigned long *addr)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb__before_clear_bit() membar("#StoreLoad | #LoadLoad")
|
||||
#define smp_mb__after_clear_bit() membar("#StoreLoad | #StoreStore")
|
||||
#define smp_mb__before_clear_bit() membar_storeload_loadload()
|
||||
#define smp_mb__after_clear_bit() membar_storeload_storestore()
|
||||
#else
|
||||
#define smp_mb__before_clear_bit() barrier()
|
||||
#define smp_mb__after_clear_bit() barrier()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include <asm/a.out.h>
|
||||
#include <asm/pstate.h>
|
||||
#include <asm/ptrace.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
/* The sparc has no problems with write protection */
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef __SPARC64_SEGMENT_H
|
||||
#define __SPARC64_SEGMENT_H
|
||||
|
||||
/* Only here because we have some old header files that expect it.. */
|
||||
|
||||
#endif
|
||||
82
include/asm-sparc64/sfafsr.h
Normal file
82
include/asm-sparc64/sfafsr.h
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
#ifndef _SPARC64_SFAFSR_H
|
||||
#define _SPARC64_SFAFSR_H
|
||||
|
||||
#include <asm/const.h>
|
||||
|
||||
/* Spitfire Asynchronous Fault Status register, ASI=0x4C VA<63:0>=0x0 */
|
||||
|
||||
#define SFAFSR_ME (_AC(1,UL) << SFAFSR_ME_SHIFT)
|
||||
#define SFAFSR_ME_SHIFT 32
|
||||
#define SFAFSR_PRIV (_AC(1,UL) << SFAFSR_PRIV_SHIFT)
|
||||
#define SFAFSR_PRIV_SHIFT 31
|
||||
#define SFAFSR_ISAP (_AC(1,UL) << SFAFSR_ISAP_SHIFT)
|
||||
#define SFAFSR_ISAP_SHIFT 30
|
||||
#define SFAFSR_ETP (_AC(1,UL) << SFAFSR_ETP_SHIFT)
|
||||
#define SFAFSR_ETP_SHIFT 29
|
||||
#define SFAFSR_IVUE (_AC(1,UL) << SFAFSR_IVUE_SHIFT)
|
||||
#define SFAFSR_IVUE_SHIFT 28
|
||||
#define SFAFSR_TO (_AC(1,UL) << SFAFSR_TO_SHIFT)
|
||||
#define SFAFSR_TO_SHIFT 27
|
||||
#define SFAFSR_BERR (_AC(1,UL) << SFAFSR_BERR_SHIFT)
|
||||
#define SFAFSR_BERR_SHIFT 26
|
||||
#define SFAFSR_LDP (_AC(1,UL) << SFAFSR_LDP_SHIFT)
|
||||
#define SFAFSR_LDP_SHIFT 25
|
||||
#define SFAFSR_CP (_AC(1,UL) << SFAFSR_CP_SHIFT)
|
||||
#define SFAFSR_CP_SHIFT 24
|
||||
#define SFAFSR_WP (_AC(1,UL) << SFAFSR_WP_SHIFT)
|
||||
#define SFAFSR_WP_SHIFT 23
|
||||
#define SFAFSR_EDP (_AC(1,UL) << SFAFSR_EDP_SHIFT)
|
||||
#define SFAFSR_EDP_SHIFT 22
|
||||
#define SFAFSR_UE (_AC(1,UL) << SFAFSR_UE_SHIFT)
|
||||
#define SFAFSR_UE_SHIFT 21
|
||||
#define SFAFSR_CE (_AC(1,UL) << SFAFSR_CE_SHIFT)
|
||||
#define SFAFSR_CE_SHIFT 20
|
||||
#define SFAFSR_ETS (_AC(0xf,UL) << SFAFSR_ETS_SHIFT)
|
||||
#define SFAFSR_ETS_SHIFT 16
|
||||
#define SFAFSR_PSYND (_AC(0xffff,UL) << SFAFSR_PSYND_SHIFT)
|
||||
#define SFAFSR_PSYND_SHIFT 0
|
||||
|
||||
/* UDB Error Register, ASI=0x7f VA<63:0>=0x0(High),0x18(Low) for read
|
||||
* ASI=0x77 VA<63:0>=0x0(High),0x18(Low) for write
|
||||
*/
|
||||
|
||||
#define UDBE_UE (_AC(1,UL) << 9)
|
||||
#define UDBE_CE (_AC(1,UL) << 8)
|
||||
#define UDBE_E_SYNDR (_AC(0xff,UL) << 0)
|
||||
|
||||
/* The trap handlers for asynchronous errors encode the AFSR and
|
||||
* other pieces of information into a 64-bit argument for C code
|
||||
* encoded as follows:
|
||||
*
|
||||
* -----------------------------------------------
|
||||
* | UDB_H | UDB_L | TL>1 | TT | AFSR |
|
||||
* -----------------------------------------------
|
||||
* 63 54 53 44 42 41 33 32 0
|
||||
*
|
||||
* The AFAR is passed in unchanged.
|
||||
*/
|
||||
#define SFSTAT_UDBH_MASK (_AC(0x3ff,UL) << SFSTAT_UDBH_SHIFT)
|
||||
#define SFSTAT_UDBH_SHIFT 54
|
||||
#define SFSTAT_UDBL_MASK (_AC(0x3ff,UL) << SFSTAT_UDBH_SHIFT)
|
||||
#define SFSTAT_UDBL_SHIFT 44
|
||||
#define SFSTAT_TL_GT_ONE (_AC(1,UL) << SFSTAT_TL_GT_ONE_SHIFT)
|
||||
#define SFSTAT_TL_GT_ONE_SHIFT 42
|
||||
#define SFSTAT_TRAP_TYPE (_AC(0x1FF,UL) << SFSTAT_TRAP_TYPE_SHIFT)
|
||||
#define SFSTAT_TRAP_TYPE_SHIFT 33
|
||||
#define SFSTAT_AFSR_MASK (_AC(0x1ffffffff,UL) << SFSTAT_AFSR_SHIFT)
|
||||
#define SFSTAT_AFSR_SHIFT 0
|
||||
|
||||
/* ESTATE Error Enable Register, ASI=0x4b VA<63:0>=0x0 */
|
||||
#define ESTATE_ERR_CE 0x1 /* Correctable errors */
|
||||
#define ESTATE_ERR_NCE 0x2 /* TO, BERR, LDP, ETP, EDP, WP, UE, IVUE */
|
||||
#define ESTATE_ERR_ISAP 0x4 /* System address parity error */
|
||||
#define ESTATE_ERR_ALL (ESTATE_ERR_CE | \
|
||||
ESTATE_ERR_NCE | \
|
||||
ESTATE_ERR_ISAP)
|
||||
|
||||
/* The various trap types that report using the above state. */
|
||||
#define TRAP_TYPE_IAE 0x09 /* Instruction Access Error */
|
||||
#define TRAP_TYPE_DAE 0x32 /* Data Access Error */
|
||||
#define TRAP_TYPE_CEE 0x63 /* Correctable ECC Error */
|
||||
|
||||
#endif /* _SPARC64_SFAFSR_H */
|
||||
|
|
@ -43,7 +43,7 @@ typedef struct {
|
|||
#define spin_is_locked(lp) ((lp)->lock != 0)
|
||||
|
||||
#define spin_unlock_wait(lp) \
|
||||
do { membar("#LoadLoad"); \
|
||||
do { rmb(); \
|
||||
} while((lp)->lock)
|
||||
|
||||
static inline void _raw_spin_lock(spinlock_t *lock)
|
||||
|
|
@ -129,15 +129,18 @@ typedef struct {
|
|||
#define spin_is_locked(__lock) ((__lock)->lock != 0)
|
||||
#define spin_unlock_wait(__lock) \
|
||||
do { \
|
||||
membar("#LoadLoad"); \
|
||||
rmb(); \
|
||||
} while((__lock)->lock)
|
||||
|
||||
extern void _do_spin_lock (spinlock_t *lock, char *str);
|
||||
extern void _do_spin_unlock (spinlock_t *lock);
|
||||
extern int _do_spin_trylock (spinlock_t *lock);
|
||||
extern void _do_spin_lock(spinlock_t *lock, char *str, unsigned long caller);
|
||||
extern void _do_spin_unlock(spinlock_t *lock);
|
||||
extern int _do_spin_trylock(spinlock_t *lock, unsigned long caller);
|
||||
|
||||
#define _raw_spin_trylock(lp) _do_spin_trylock(lp)
|
||||
#define _raw_spin_lock(lock) _do_spin_lock(lock, "spin_lock")
|
||||
#define _raw_spin_trylock(lp) \
|
||||
_do_spin_trylock(lp, (unsigned long) __builtin_return_address(0))
|
||||
#define _raw_spin_lock(lock) \
|
||||
_do_spin_lock(lock, "spin_lock", \
|
||||
(unsigned long) __builtin_return_address(0))
|
||||
#define _raw_spin_unlock(lock) _do_spin_unlock(lock)
|
||||
#define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
|
||||
|
||||
|
|
@ -279,37 +282,41 @@ typedef struct {
|
|||
#define RW_LOCK_UNLOCKED (rwlock_t) { 0, 0, 0xff, { } }
|
||||
#define rwlock_init(lp) do { *(lp) = RW_LOCK_UNLOCKED; } while(0)
|
||||
|
||||
extern void _do_read_lock(rwlock_t *rw, char *str);
|
||||
extern void _do_read_unlock(rwlock_t *rw, char *str);
|
||||
extern void _do_write_lock(rwlock_t *rw, char *str);
|
||||
extern void _do_write_unlock(rwlock_t *rw);
|
||||
extern int _do_write_trylock(rwlock_t *rw, char *str);
|
||||
extern void _do_read_lock(rwlock_t *rw, char *str, unsigned long caller);
|
||||
extern void _do_read_unlock(rwlock_t *rw, char *str, unsigned long caller);
|
||||
extern void _do_write_lock(rwlock_t *rw, char *str, unsigned long caller);
|
||||
extern void _do_write_unlock(rwlock_t *rw, unsigned long caller);
|
||||
extern int _do_write_trylock(rwlock_t *rw, char *str, unsigned long caller);
|
||||
|
||||
#define _raw_read_lock(lock) \
|
||||
do { unsigned long flags; \
|
||||
local_irq_save(flags); \
|
||||
_do_read_lock(lock, "read_lock"); \
|
||||
_do_read_lock(lock, "read_lock", \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
} while(0)
|
||||
|
||||
#define _raw_read_unlock(lock) \
|
||||
do { unsigned long flags; \
|
||||
local_irq_save(flags); \
|
||||
_do_read_unlock(lock, "read_unlock"); \
|
||||
_do_read_unlock(lock, "read_unlock", \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
} while(0)
|
||||
|
||||
#define _raw_write_lock(lock) \
|
||||
do { unsigned long flags; \
|
||||
local_irq_save(flags); \
|
||||
_do_write_lock(lock, "write_lock"); \
|
||||
_do_write_lock(lock, "write_lock", \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
} while(0)
|
||||
|
||||
#define _raw_write_unlock(lock) \
|
||||
do { unsigned long flags; \
|
||||
local_irq_save(flags); \
|
||||
_do_write_unlock(lock); \
|
||||
_do_write_unlock(lock, \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
} while(0)
|
||||
|
||||
|
|
@ -317,7 +324,8 @@ do { unsigned long flags; \
|
|||
({ unsigned long flags; \
|
||||
int val; \
|
||||
local_irq_save(flags); \
|
||||
val = _do_write_trylock(lock, "write_trylock"); \
|
||||
val = _do_write_trylock(lock, "write_trylock", \
|
||||
(unsigned long) __builtin_return_address(0)); \
|
||||
local_irq_restore(flags); \
|
||||
val; \
|
||||
})
|
||||
|
|
|
|||
|
|
@ -28,6 +28,14 @@ enum sparc_cpu {
|
|||
#define ARCH_SUN4C_SUN4 0
|
||||
#define ARCH_SUN4 0
|
||||
|
||||
extern void mb(void);
|
||||
extern void rmb(void);
|
||||
extern void wmb(void);
|
||||
extern void membar_storeload(void);
|
||||
extern void membar_storeload_storestore(void);
|
||||
extern void membar_storeload_loadload(void);
|
||||
extern void membar_storestore_loadstore(void);
|
||||
|
||||
#endif
|
||||
|
||||
#define setipl(__new_ipl) \
|
||||
|
|
@ -78,16 +86,11 @@ enum sparc_cpu {
|
|||
|
||||
#define nop() __asm__ __volatile__ ("nop")
|
||||
|
||||
#define membar(type) __asm__ __volatile__ ("membar " type : : : "memory")
|
||||
#define mb() \
|
||||
membar("#LoadLoad | #LoadStore | #StoreStore | #StoreLoad")
|
||||
#define rmb() membar("#LoadLoad")
|
||||
#define wmb() membar("#StoreStore")
|
||||
#define read_barrier_depends() do { } while(0)
|
||||
#define set_mb(__var, __value) \
|
||||
do { __var = __value; membar("#StoreLoad | #StoreStore"); } while(0)
|
||||
do { __var = __value; membar_storeload_storestore(); } while(0)
|
||||
#define set_wmb(__var, __value) \
|
||||
do { __var = __value; membar("#StoreStore"); } while(0)
|
||||
do { __var = __value; wmb(); } while(0)
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
#define smp_mb() mb()
|
||||
|
|
|
|||
|
|
@ -1,2 +1,37 @@
|
|||
int pci_siig10x_fn(struct pci_dev *dev, int enable);
|
||||
int pci_siig20x_fn(struct pci_dev *dev, int enable);
|
||||
/*
|
||||
* Definitions for PCI support.
|
||||
*/
|
||||
#define FL_BASE_MASK 0x0007
|
||||
#define FL_BASE0 0x0000
|
||||
#define FL_BASE1 0x0001
|
||||
#define FL_BASE2 0x0002
|
||||
#define FL_BASE3 0x0003
|
||||
#define FL_BASE4 0x0004
|
||||
#define FL_GET_BASE(x) (x & FL_BASE_MASK)
|
||||
|
||||
/* Use successive BARs (PCI base address registers),
|
||||
else use offset into some specified BAR */
|
||||
#define FL_BASE_BARS 0x0008
|
||||
|
||||
/* do not assign an irq */
|
||||
#define FL_NOIRQ 0x0080
|
||||
|
||||
/* Use the Base address register size to cap number of ports */
|
||||
#define FL_REGION_SZ_CAP 0x0100
|
||||
|
||||
struct pciserial_board {
|
||||
unsigned int flags;
|
||||
unsigned int num_ports;
|
||||
unsigned int base_baud;
|
||||
unsigned int uart_offset;
|
||||
unsigned int reg_shift;
|
||||
unsigned int first_offset;
|
||||
};
|
||||
|
||||
struct serial_private;
|
||||
|
||||
struct serial_private *
|
||||
pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board);
|
||||
void pciserial_remove_ports(struct serial_private *priv);
|
||||
void pciserial_suspend_ports(struct serial_private *priv);
|
||||
void pciserial_resume_ports(struct serial_private *priv);
|
||||
|
|
|
|||
|
|
@ -1,24 +1,29 @@
|
|||
|
||||
/*
|
||||
Copyright 2003-2004 Red Hat, Inc. All rights reserved.
|
||||
Copyright 2003-2004 Jeff Garzik
|
||||
|
||||
The contents of this file are subject to the Open
|
||||
Software License version 1.1 that can be found at
|
||||
http://www.opensource.org/licenses/osl-1.1.txt and is included herein
|
||||
by reference.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License version 2 (the "GPL") as distributed
|
||||
in the kernel source COPYING file, in which case the provisions of
|
||||
the GPL are applicable instead of the above. If you wish to allow
|
||||
the use of your version of this file only under the terms of the
|
||||
GPL and not to allow others to use your version of this file under
|
||||
the OSL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the GPL.
|
||||
If you do not delete the provisions above, a recipient may use your
|
||||
version of this file under either the OSL or the GPL.
|
||||
|
||||
* Copyright 2003-2004 Red Hat, Inc. All rights reserved.
|
||||
* Copyright 2003-2004 Jeff Garzik
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
* libata documentation is available via 'make {ps|pdf}docs',
|
||||
* as Documentation/DocBook/libata.*
|
||||
*
|
||||
* Hardware documentation available from http://www.t13.org/
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_ATA_H__
|
||||
|
|
@ -108,6 +113,8 @@ enum {
|
|||
|
||||
/* ATA device commands */
|
||||
ATA_CMD_CHK_POWER = 0xE5, /* check power mode */
|
||||
ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */
|
||||
ATA_CMD_IDLE = 0xE3, /* place in idle power mode */
|
||||
ATA_CMD_EDD = 0x90, /* execute device diagnostic */
|
||||
ATA_CMD_FLUSH = 0xE7,
|
||||
ATA_CMD_FLUSH_EXT = 0xEA,
|
||||
|
|
|
|||
|
|
@ -408,6 +408,8 @@ struct ethtool_ops {
|
|||
#define SUPPORTED_FIBRE (1 << 10)
|
||||
#define SUPPORTED_BNC (1 << 11)
|
||||
#define SUPPORTED_10000baseT_Full (1 << 12)
|
||||
#define SUPPORTED_Pause (1 << 13)
|
||||
#define SUPPORTED_Asym_Pause (1 << 14)
|
||||
|
||||
/* Indicates what features are advertised by the interface. */
|
||||
#define ADVERTISED_10baseT_Half (1 << 0)
|
||||
|
|
@ -423,6 +425,8 @@ struct ethtool_ops {
|
|||
#define ADVERTISED_FIBRE (1 << 10)
|
||||
#define ADVERTISED_BNC (1 << 11)
|
||||
#define ADVERTISED_10000baseT_Full (1 << 12)
|
||||
#define ADVERTISED_Pause (1 << 13)
|
||||
#define ADVERTISED_Asym_Pause (1 << 14)
|
||||
|
||||
/* The following are all involved in forcing a particular link
|
||||
* mode for the device for setting things. When getting the
|
||||
|
|
|
|||
|
|
@ -1,23 +1,26 @@
|
|||
/*
|
||||
Copyright 2003-2004 Red Hat, Inc. All rights reserved.
|
||||
Copyright 2003-2004 Jeff Garzik
|
||||
|
||||
The contents of this file are subject to the Open
|
||||
Software License version 1.1 that can be found at
|
||||
http://www.opensource.org/licenses/osl-1.1.txt and is included herein
|
||||
by reference.
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License version 2 (the "GPL") as distributed
|
||||
in the kernel source COPYING file, in which case the provisions of
|
||||
the GPL are applicable instead of the above. If you wish to allow
|
||||
the use of your version of this file only under the terms of the
|
||||
GPL and not to allow others to use your version of this file under
|
||||
the OSL, indicate your decision by deleting the provisions above and
|
||||
replace them with the notice and other provisions required by the GPL.
|
||||
If you do not delete the provisions above, a recipient may use your
|
||||
version of this file under either the OSL or the GPL.
|
||||
|
||||
* Copyright 2003-2005 Red Hat, Inc. All rights reserved.
|
||||
* Copyright 2003-2005 Jeff Garzik
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*
|
||||
*
|
||||
* libata documentation is available via 'make {ps|pdf}docs',
|
||||
* as Documentation/DocBook/libata.*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_LIBATA_H__
|
||||
|
|
@ -114,6 +117,8 @@ enum {
|
|||
ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */
|
||||
ATA_FLAG_SATA_RESET = (1 << 7), /* use COMRESET */
|
||||
ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */
|
||||
ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once
|
||||
* proper HSM is in place. */
|
||||
|
||||
ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */
|
||||
ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */
|
||||
|
|
@ -369,7 +374,7 @@ struct ata_port_operations {
|
|||
|
||||
void (*host_stop) (struct ata_host_set *host_set);
|
||||
|
||||
void (*bmdma_stop) (struct ata_port *ap);
|
||||
void (*bmdma_stop) (struct ata_queued_cmd *qc);
|
||||
u8 (*bmdma_status) (struct ata_port *ap);
|
||||
};
|
||||
|
||||
|
|
@ -430,7 +435,7 @@ extern void ata_dev_id_string(u16 *id, unsigned char *s,
|
|||
extern void ata_dev_config(struct ata_port *ap, unsigned int i);
|
||||
extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
|
||||
extern void ata_bmdma_start (struct ata_queued_cmd *qc);
|
||||
extern void ata_bmdma_stop(struct ata_port *ap);
|
||||
extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
|
||||
extern u8 ata_bmdma_status(struct ata_port *ap);
|
||||
extern void ata_bmdma_irq_clear(struct ata_port *ap);
|
||||
extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat);
|
||||
|
|
@ -650,7 +655,7 @@ static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val)
|
|||
ap->ops->scr_write(ap, reg, val);
|
||||
}
|
||||
|
||||
static inline void scr_write_flush(struct ata_port *ap, unsigned int reg,
|
||||
static inline void scr_write_flush(struct ata_port *ap, unsigned int reg,
|
||||
u32 val)
|
||||
{
|
||||
ap->ops->scr_write(ap, reg, val);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#define MII_EXPANSION 0x06 /* Expansion register */
|
||||
#define MII_CTRL1000 0x09 /* 1000BASE-T control */
|
||||
#define MII_STAT1000 0x0a /* 1000BASE-T status */
|
||||
#define MII_ESTATUS 0x0f /* Extended Status */
|
||||
#define MII_DCOUNTER 0x12 /* Disconnect counter */
|
||||
#define MII_FCSCOUNTER 0x13 /* False carrier counter */
|
||||
#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
|
||||
|
|
@ -54,7 +55,10 @@
|
|||
#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
|
||||
#define BMSR_RFAULT 0x0010 /* Remote fault detected */
|
||||
#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
|
||||
#define BMSR_RESV 0x07c0 /* Unused... */
|
||||
#define BMSR_RESV 0x00c0 /* Unused... */
|
||||
#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
|
||||
#define BMSR_100FULL2 0x0200 /* Can do 100BASE-T2 HDX */
|
||||
#define BMSR_100HALF2 0x0400 /* Can do 100BASE-T2 FDX */
|
||||
#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
|
||||
#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
|
||||
#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
|
||||
|
|
@ -114,6 +118,9 @@
|
|||
#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
|
||||
#define EXPANSION_RESV 0xffe0 /* Unused... */
|
||||
|
||||
#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
|
||||
#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
|
||||
|
||||
/* N-way test register. */
|
||||
#define NWAYTEST_RESV1 0x00ff /* Unused... */
|
||||
#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
|
||||
|
|
|
|||
|
|
@ -63,11 +63,12 @@ struct device;
|
|||
|
||||
struct mmc_host {
|
||||
struct device *dev;
|
||||
struct class_device class_dev;
|
||||
int index;
|
||||
struct mmc_host_ops *ops;
|
||||
unsigned int f_min;
|
||||
unsigned int f_max;
|
||||
u32 ocr_avail;
|
||||
char host_name[8];
|
||||
|
||||
/* host specific block data */
|
||||
unsigned int max_seg_size; /* see blk_queue_max_segment_size */
|
||||
|
|
@ -97,6 +98,7 @@ extern void mmc_free_host(struct mmc_host *);
|
|||
|
||||
#define mmc_priv(x) ((void *)((x) + 1))
|
||||
#define mmc_dev(x) ((x)->dev)
|
||||
#define mmc_hostname(x) ((x)->class_dev.class_id)
|
||||
|
||||
extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
|
||||
extern int mmc_resume_host(struct mmc_host *);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ struct ieee1394_device_id {
|
|||
__u32 model_id;
|
||||
__u32 specifier_id;
|
||||
__u32 version;
|
||||
kernel_ulong_t driver_data;
|
||||
kernel_ulong_t driver_data
|
||||
__attribute__((aligned(sizeof(kernel_ulong_t))));
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -182,7 +183,11 @@ struct of_device_id
|
|||
char name[32];
|
||||
char type[32];
|
||||
char compatible[128];
|
||||
#if __KERNEL__
|
||||
void *data;
|
||||
#else
|
||||
kernel_ulong_t data;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -208,7 +213,8 @@ struct pcmcia_device_id {
|
|||
#ifdef __KERNEL__
|
||||
const char * prod_id[4];
|
||||
#else
|
||||
kernel_ulong_t prod_id[4];
|
||||
kernel_ulong_t prod_id[4]
|
||||
__attribute__((aligned(sizeof(kernel_ulong_t))));
|
||||
#endif
|
||||
|
||||
/* not matched against */
|
||||
|
|
|
|||
|
|
@ -1249,6 +1249,7 @@
|
|||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E
|
||||
#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x036F
|
||||
#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
|
||||
#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
|
||||
#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B
|
||||
|
|
|
|||
377
include/linux/phy.h
Normal file
377
include/linux/phy.h
Normal file
|
|
@ -0,0 +1,377 @@
|
|||
/*
|
||||
* include/linux/phy.h
|
||||
*
|
||||
* Framework and drivers for configuring and reading different PHYs
|
||||
* Based on code in sungem_phy.c and gianfar_phy.c
|
||||
*
|
||||
* Author: Andy Fleming
|
||||
*
|
||||
* Copyright (c) 2004 Freescale Semiconductor, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __PHY_H
|
||||
#define __PHY_H
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/device.h>
|
||||
|
||||
#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
|
||||
SUPPORTED_10baseT_Full | \
|
||||
SUPPORTED_100baseT_Half | \
|
||||
SUPPORTED_100baseT_Full | \
|
||||
SUPPORTED_Autoneg | \
|
||||
SUPPORTED_TP | \
|
||||
SUPPORTED_MII)
|
||||
|
||||
#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \
|
||||
SUPPORTED_1000baseT_Half | \
|
||||
SUPPORTED_1000baseT_Full)
|
||||
|
||||
/* Set phydev->irq to PHY_POLL if interrupts are not supported,
|
||||
* or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
|
||||
* the attached driver handles the interrupt
|
||||
*/
|
||||
#define PHY_POLL -1
|
||||
#define PHY_IGNORE_INTERRUPT -2
|
||||
|
||||
#define PHY_HAS_INTERRUPT 0x00000001
|
||||
#define PHY_HAS_MAGICANEG 0x00000002
|
||||
|
||||
#define MII_BUS_MAX 4
|
||||
|
||||
|
||||
#define PHY_INIT_TIMEOUT 100000
|
||||
#define PHY_STATE_TIME 1
|
||||
#define PHY_FORCE_TIMEOUT 10
|
||||
#define PHY_AN_TIMEOUT 10
|
||||
|
||||
#define PHY_MAX_ADDR 32
|
||||
|
||||
/* The Bus class for PHYs. Devices which provide access to
|
||||
* PHYs should register using this structure */
|
||||
struct mii_bus {
|
||||
const char *name;
|
||||
int id;
|
||||
void *priv;
|
||||
int (*read)(struct mii_bus *bus, int phy_id, int regnum);
|
||||
int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);
|
||||
int (*reset)(struct mii_bus *bus);
|
||||
|
||||
/* A lock to ensure that only one thing can read/write
|
||||
* the MDIO bus at a time */
|
||||
spinlock_t mdio_lock;
|
||||
|
||||
struct device *dev;
|
||||
|
||||
/* list of all PHYs on bus */
|
||||
struct phy_device *phy_map[PHY_MAX_ADDR];
|
||||
|
||||
/* Pointer to an array of interrupts, each PHY's
|
||||
* interrupt at the index matching its address */
|
||||
int *irq;
|
||||
};
|
||||
|
||||
#define PHY_INTERRUPT_DISABLED 0x0
|
||||
#define PHY_INTERRUPT_ENABLED 0x80000000
|
||||
|
||||
/* PHY state machine states:
|
||||
*
|
||||
* DOWN: PHY device and driver are not ready for anything. probe
|
||||
* should be called if and only if the PHY is in this state,
|
||||
* given that the PHY device exists.
|
||||
* - PHY driver probe function will, depending on the PHY, set
|
||||
* the state to STARTING or READY
|
||||
*
|
||||
* STARTING: PHY device is coming up, and the ethernet driver is
|
||||
* not ready. PHY drivers may set this in the probe function.
|
||||
* If they do, they are responsible for making sure the state is
|
||||
* eventually set to indicate whether the PHY is UP or READY,
|
||||
* depending on the state when the PHY is done starting up.
|
||||
* - PHY driver will set the state to READY
|
||||
* - start will set the state to PENDING
|
||||
*
|
||||
* READY: PHY is ready to send and receive packets, but the
|
||||
* controller is not. By default, PHYs which do not implement
|
||||
* probe will be set to this state by phy_probe(). If the PHY
|
||||
* driver knows the PHY is ready, and the PHY state is STARTING,
|
||||
* then it sets this STATE.
|
||||
* - start will set the state to UP
|
||||
*
|
||||
* PENDING: PHY device is coming up, but the ethernet driver is
|
||||
* ready. phy_start will set this state if the PHY state is
|
||||
* STARTING.
|
||||
* - PHY driver will set the state to UP when the PHY is ready
|
||||
*
|
||||
* UP: The PHY and attached device are ready to do work.
|
||||
* Interrupts should be started here.
|
||||
* - timer moves to AN
|
||||
*
|
||||
* AN: The PHY is currently negotiating the link state. Link is
|
||||
* therefore down for now. phy_timer will set this state when it
|
||||
* detects the state is UP. config_aneg will set this state
|
||||
* whenever called with phydev->autoneg set to AUTONEG_ENABLE.
|
||||
* - If autonegotiation finishes, but there's no link, it sets
|
||||
* the state to NOLINK.
|
||||
* - If aneg finishes with link, it sets the state to RUNNING,
|
||||
* and calls adjust_link
|
||||
* - If autonegotiation did not finish after an arbitrary amount
|
||||
* of time, autonegotiation should be tried again if the PHY
|
||||
* supports "magic" autonegotiation (back to AN)
|
||||
* - If it didn't finish, and no magic_aneg, move to FORCING.
|
||||
*
|
||||
* NOLINK: PHY is up, but not currently plugged in.
|
||||
* - If the timer notes that the link comes back, we move to RUNNING
|
||||
* - config_aneg moves to AN
|
||||
* - phy_stop moves to HALTED
|
||||
*
|
||||
* FORCING: PHY is being configured with forced settings
|
||||
* - if link is up, move to RUNNING
|
||||
* - If link is down, we drop to the next highest setting, and
|
||||
* retry (FORCING) after a timeout
|
||||
* - phy_stop moves to HALTED
|
||||
*
|
||||
* RUNNING: PHY is currently up, running, and possibly sending
|
||||
* and/or receiving packets
|
||||
* - timer will set CHANGELINK if we're polling (this ensures the
|
||||
* link state is polled every other cycle of this state machine,
|
||||
* which makes it every other second)
|
||||
* - irq will set CHANGELINK
|
||||
* - config_aneg will set AN
|
||||
* - phy_stop moves to HALTED
|
||||
*
|
||||
* CHANGELINK: PHY experienced a change in link state
|
||||
* - timer moves to RUNNING if link
|
||||
* - timer moves to NOLINK if the link is down
|
||||
* - phy_stop moves to HALTED
|
||||
*
|
||||
* HALTED: PHY is up, but no polling or interrupts are done. Or
|
||||
* PHY is in an error state.
|
||||
*
|
||||
* - phy_start moves to RESUMING
|
||||
*
|
||||
* RESUMING: PHY was halted, but now wants to run again.
|
||||
* - If we are forcing, or aneg is done, timer moves to RUNNING
|
||||
* - If aneg is not done, timer moves to AN
|
||||
* - phy_stop moves to HALTED
|
||||
*/
|
||||
enum phy_state {
|
||||
PHY_DOWN=0,
|
||||
PHY_STARTING,
|
||||
PHY_READY,
|
||||
PHY_PENDING,
|
||||
PHY_UP,
|
||||
PHY_AN,
|
||||
PHY_RUNNING,
|
||||
PHY_NOLINK,
|
||||
PHY_FORCING,
|
||||
PHY_CHANGELINK,
|
||||
PHY_HALTED,
|
||||
PHY_RESUMING
|
||||
};
|
||||
|
||||
/* phy_device: An instance of a PHY
|
||||
*
|
||||
* drv: Pointer to the driver for this PHY instance
|
||||
* bus: Pointer to the bus this PHY is on
|
||||
* dev: driver model device structure for this PHY
|
||||
* phy_id: UID for this device found during discovery
|
||||
* state: state of the PHY for management purposes
|
||||
* dev_flags: Device-specific flags used by the PHY driver.
|
||||
* addr: Bus address of PHY
|
||||
* link_timeout: The number of timer firings to wait before the
|
||||
* giving up on the current attempt at acquiring a link
|
||||
* irq: IRQ number of the PHY's interrupt (-1 if none)
|
||||
* phy_timer: The timer for handling the state machine
|
||||
* phy_queue: A work_queue for the interrupt
|
||||
* attached_dev: The attached enet driver's device instance ptr
|
||||
* adjust_link: Callback for the enet controller to respond to
|
||||
* changes in the link state.
|
||||
* adjust_state: Callback for the enet driver to respond to
|
||||
* changes in the state machine.
|
||||
*
|
||||
* speed, duplex, pause, supported, advertising, and
|
||||
* autoneg are used like in mii_if_info
|
||||
*
|
||||
* interrupts currently only supports enabled or disabled,
|
||||
* but could be changed in the future to support enabling
|
||||
* and disabling specific interrupts
|
||||
*
|
||||
* Contains some infrastructure for polling and interrupt
|
||||
* handling, as well as handling shifts in PHY hardware state
|
||||
*/
|
||||
struct phy_device {
|
||||
/* Information about the PHY type */
|
||||
/* And management functions */
|
||||
struct phy_driver *drv;
|
||||
|
||||
struct mii_bus *bus;
|
||||
|
||||
struct device dev;
|
||||
|
||||
u32 phy_id;
|
||||
|
||||
enum phy_state state;
|
||||
|
||||
u32 dev_flags;
|
||||
|
||||
/* Bus address of the PHY (0-32) */
|
||||
int addr;
|
||||
|
||||
/* forced speed & duplex (no autoneg)
|
||||
* partner speed & duplex & pause (autoneg)
|
||||
*/
|
||||
int speed;
|
||||
int duplex;
|
||||
int pause;
|
||||
int asym_pause;
|
||||
|
||||
/* The most recently read link state */
|
||||
int link;
|
||||
|
||||
/* Enabled Interrupts */
|
||||
u32 interrupts;
|
||||
|
||||
/* Union of PHY and Attached devices' supported modes */
|
||||
/* See mii.h for more info */
|
||||
u32 supported;
|
||||
u32 advertising;
|
||||
|
||||
int autoneg;
|
||||
|
||||
int link_timeout;
|
||||
|
||||
/* Interrupt number for this PHY
|
||||
* -1 means no interrupt */
|
||||
int irq;
|
||||
|
||||
/* private data pointer */
|
||||
/* For use by PHYs to maintain extra state */
|
||||
void *priv;
|
||||
|
||||
/* Interrupt and Polling infrastructure */
|
||||
struct work_struct phy_queue;
|
||||
struct timer_list phy_timer;
|
||||
|
||||
spinlock_t lock;
|
||||
|
||||
struct net_device *attached_dev;
|
||||
|
||||
void (*adjust_link)(struct net_device *dev);
|
||||
|
||||
void (*adjust_state)(struct net_device *dev);
|
||||
};
|
||||
#define to_phy_device(d) container_of(d, struct phy_device, dev)
|
||||
|
||||
/* struct phy_driver: Driver structure for a particular PHY type
|
||||
*
|
||||
* phy_id: The result of reading the UID registers of this PHY
|
||||
* type, and ANDing them with the phy_id_mask. This driver
|
||||
* only works for PHYs with IDs which match this field
|
||||
* name: The friendly name of this PHY type
|
||||
* phy_id_mask: Defines the important bits of the phy_id
|
||||
* features: A list of features (speed, duplex, etc) supported
|
||||
* by this PHY
|
||||
* flags: A bitfield defining certain other features this PHY
|
||||
* supports (like interrupts)
|
||||
*
|
||||
* The drivers must implement config_aneg and read_status. All
|
||||
* other functions are optional. Note that none of these
|
||||
* functions should be called from interrupt time. The goal is
|
||||
* for the bus read/write functions to be able to block when the
|
||||
* bus transaction is happening, and be freed up by an interrupt
|
||||
* (The MPC85xx has this ability, though it is not currently
|
||||
* supported in the driver).
|
||||
*/
|
||||
struct phy_driver {
|
||||
u32 phy_id;
|
||||
char *name;
|
||||
unsigned int phy_id_mask;
|
||||
u32 features;
|
||||
u32 flags;
|
||||
|
||||
/* Called to initialize the PHY,
|
||||
* including after a reset */
|
||||
int (*config_init)(struct phy_device *phydev);
|
||||
|
||||
/* Called during discovery. Used to set
|
||||
* up device-specific structures, if any */
|
||||
int (*probe)(struct phy_device *phydev);
|
||||
|
||||
/* PHY Power Management */
|
||||
int (*suspend)(struct phy_device *phydev);
|
||||
int (*resume)(struct phy_device *phydev);
|
||||
|
||||
/* Configures the advertisement and resets
|
||||
* autonegotiation if phydev->autoneg is on,
|
||||
* forces the speed to the current settings in phydev
|
||||
* if phydev->autoneg is off */
|
||||
int (*config_aneg)(struct phy_device *phydev);
|
||||
|
||||
/* Determines the negotiated speed and duplex */
|
||||
int (*read_status)(struct phy_device *phydev);
|
||||
|
||||
/* Clears any pending interrupts */
|
||||
int (*ack_interrupt)(struct phy_device *phydev);
|
||||
|
||||
/* Enables or disables interrupts */
|
||||
int (*config_intr)(struct phy_device *phydev);
|
||||
|
||||
/* Clears up any memory if needed */
|
||||
void (*remove)(struct phy_device *phydev);
|
||||
|
||||
struct device_driver driver;
|
||||
};
|
||||
#define to_phy_driver(d) container_of(d, struct phy_driver, driver)
|
||||
|
||||
int phy_read(struct phy_device *phydev, u16 regnum);
|
||||
int phy_write(struct phy_device *phydev, u16 regnum, u16 val);
|
||||
struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
|
||||
int phy_clear_interrupt(struct phy_device *phydev);
|
||||
int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
|
||||
struct phy_device * phy_attach(struct net_device *dev,
|
||||
const char *phy_id, u32 flags);
|
||||
struct phy_device * phy_connect(struct net_device *dev, const char *phy_id,
|
||||
void (*handler)(struct net_device *), u32 flags);
|
||||
void phy_disconnect(struct phy_device *phydev);
|
||||
void phy_detach(struct phy_device *phydev);
|
||||
void phy_start(struct phy_device *phydev);
|
||||
void phy_stop(struct phy_device *phydev);
|
||||
int phy_start_aneg(struct phy_device *phydev);
|
||||
|
||||
int mdiobus_register(struct mii_bus *bus);
|
||||
void mdiobus_unregister(struct mii_bus *bus);
|
||||
void phy_sanitize_settings(struct phy_device *phydev);
|
||||
int phy_stop_interrupts(struct phy_device *phydev);
|
||||
|
||||
static inline int phy_read_status(struct phy_device *phydev) {
|
||||
return phydev->drv->read_status(phydev);
|
||||
}
|
||||
|
||||
int genphy_config_advert(struct phy_device *phydev);
|
||||
int genphy_setup_forced(struct phy_device *phydev);
|
||||
int genphy_restart_aneg(struct phy_device *phydev);
|
||||
int genphy_config_aneg(struct phy_device *phydev);
|
||||
int genphy_update_link(struct phy_device *phydev);
|
||||
int genphy_read_status(struct phy_device *phydev);
|
||||
void phy_driver_unregister(struct phy_driver *drv);
|
||||
int phy_driver_register(struct phy_driver *new_driver);
|
||||
void phy_prepare_link(struct phy_device *phydev,
|
||||
void (*adjust_link)(struct net_device *));
|
||||
void phy_start_machine(struct phy_device *phydev,
|
||||
void (*handler)(struct net_device *));
|
||||
void phy_stop_machine(struct phy_device *phydev);
|
||||
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
|
||||
int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
|
||||
int phy_mii_ioctl(struct phy_device *phydev,
|
||||
struct mii_ioctl_data *mii_data, int cmd);
|
||||
int phy_start_interrupts(struct phy_device *phydev);
|
||||
void phy_print_status(struct phy_device *phydev);
|
||||
|
||||
extern struct bus_type mdio_bus_type;
|
||||
#endif /* __PHY_H */
|
||||
|
|
@ -140,44 +140,4 @@ struct rs_multiport_struct {
|
|||
#define ALPHA_KLUDGE_MCR 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Definitions for PCI support.
|
||||
*/
|
||||
#define SPCI_FL_BASE_MASK 0x0007
|
||||
#define SPCI_FL_BASE0 0x0000
|
||||
#define SPCI_FL_BASE1 0x0001
|
||||
#define SPCI_FL_BASE2 0x0002
|
||||
#define SPCI_FL_BASE3 0x0003
|
||||
#define SPCI_FL_BASE4 0x0004
|
||||
#define SPCI_FL_GET_BASE(x) (x & SPCI_FL_BASE_MASK)
|
||||
|
||||
#define SPCI_FL_IRQ_MASK (0x0007 << 4)
|
||||
#define SPCI_FL_IRQBASE0 (0x0000 << 4)
|
||||
#define SPCI_FL_IRQBASE1 (0x0001 << 4)
|
||||
#define SPCI_FL_IRQBASE2 (0x0002 << 4)
|
||||
#define SPCI_FL_IRQBASE3 (0x0003 << 4)
|
||||
#define SPCI_FL_IRQBASE4 (0x0004 << 4)
|
||||
#define SPCI_FL_GET_IRQBASE(x) ((x & SPCI_FL_IRQ_MASK) >> 4)
|
||||
|
||||
/* Use successive BARs (PCI base address registers),
|
||||
else use offset into some specified BAR */
|
||||
#define SPCI_FL_BASE_TABLE 0x0100
|
||||
|
||||
/* Use successive entries in the irq resource table */
|
||||
#define SPCI_FL_IRQ_TABLE 0x0200
|
||||
|
||||
/* Use the irq resource table instead of dev->irq */
|
||||
#define SPCI_FL_IRQRESOURCE 0x0400
|
||||
|
||||
/* Use the Base address register size to cap number of ports */
|
||||
#define SPCI_FL_REGION_SZ_CAP 0x0800
|
||||
|
||||
/* Do not use irq sharing for this device */
|
||||
#define SPCI_FL_NO_SHIRQ 0x1000
|
||||
|
||||
/* This is a PNP device */
|
||||
#define SPCI_FL_ISPNP 0x2000
|
||||
|
||||
#define SPCI_FL_PNPDEFAULT (SPCI_FL_IRQRESOURCE|SPCI_FL_ISPNP)
|
||||
|
||||
#endif /* _LINUX_SERIAL_H */
|
||||
|
|
|
|||
105
include/rdma/ib_cache.h
Normal file
105
include/rdma/ib_cache.h
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005 Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_cache.h 1349 2004-12-16 21:09:43Z roland $
|
||||
*/
|
||||
|
||||
#ifndef _IB_CACHE_H
|
||||
#define _IB_CACHE_H
|
||||
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
/**
|
||||
* ib_get_cached_gid - Returns a cached GID table entry
|
||||
* @device: The device to query.
|
||||
* @port_num: The port number of the device to query.
|
||||
* @index: The index into the cached GID table to query.
|
||||
* @gid: The GID value found at the specified index.
|
||||
*
|
||||
* ib_get_cached_gid() fetches the specified GID table entry stored in
|
||||
* the local software cache.
|
||||
*/
|
||||
int ib_get_cached_gid(struct ib_device *device,
|
||||
u8 port_num,
|
||||
int index,
|
||||
union ib_gid *gid);
|
||||
|
||||
/**
|
||||
* ib_find_cached_gid - Returns the port number and GID table index where
|
||||
* a specified GID value occurs.
|
||||
* @device: The device to query.
|
||||
* @gid: The GID value to search for.
|
||||
* @port_num: The port number of the device where the GID value was found.
|
||||
* @index: The index into the cached GID table where the GID was found. This
|
||||
* parameter may be NULL.
|
||||
*
|
||||
* ib_find_cached_gid() searches for the specified GID value in
|
||||
* the local software cache.
|
||||
*/
|
||||
int ib_find_cached_gid(struct ib_device *device,
|
||||
union ib_gid *gid,
|
||||
u8 *port_num,
|
||||
u16 *index);
|
||||
|
||||
/**
|
||||
* ib_get_cached_pkey - Returns a cached PKey table entry
|
||||
* @device: The device to query.
|
||||
* @port_num: The port number of the device to query.
|
||||
* @index: The index into the cached PKey table to query.
|
||||
* @pkey: The PKey value found at the specified index.
|
||||
*
|
||||
* ib_get_cached_pkey() fetches the specified PKey table entry stored in
|
||||
* the local software cache.
|
||||
*/
|
||||
int ib_get_cached_pkey(struct ib_device *device_handle,
|
||||
u8 port_num,
|
||||
int index,
|
||||
u16 *pkey);
|
||||
|
||||
/**
|
||||
* ib_find_cached_pkey - Returns the PKey table index where a specified
|
||||
* PKey value occurs.
|
||||
* @device: The device to query.
|
||||
* @port_num: The port number of the device to search for the PKey.
|
||||
* @pkey: The PKey value to search for.
|
||||
* @index: The index into the cached PKey table where the PKey was found.
|
||||
*
|
||||
* ib_find_cached_pkey() searches the specified PKey table in
|
||||
* the local software cache.
|
||||
*/
|
||||
int ib_find_cached_pkey(struct ib_device *device,
|
||||
u8 port_num,
|
||||
u16 pkey,
|
||||
u16 *index);
|
||||
|
||||
#endif /* _IB_CACHE_H */
|
||||
568
include/rdma/ib_cm.h
Normal file
568
include/rdma/ib_cm.h
Normal file
|
|
@ -0,0 +1,568 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 Topspin Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 Voltaire Corporation. All rights reserved.
|
||||
* Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_cm.h 2730 2005-06-28 16:43:03Z sean.hefty $
|
||||
*/
|
||||
#if !defined(IB_CM_H)
|
||||
#define IB_CM_H
|
||||
|
||||
#include <rdma/ib_mad.h>
|
||||
#include <rdma/ib_sa.h>
|
||||
|
||||
enum ib_cm_state {
|
||||
IB_CM_IDLE,
|
||||
IB_CM_LISTEN,
|
||||
IB_CM_REQ_SENT,
|
||||
IB_CM_REQ_RCVD,
|
||||
IB_CM_MRA_REQ_SENT,
|
||||
IB_CM_MRA_REQ_RCVD,
|
||||
IB_CM_REP_SENT,
|
||||
IB_CM_REP_RCVD,
|
||||
IB_CM_MRA_REP_SENT,
|
||||
IB_CM_MRA_REP_RCVD,
|
||||
IB_CM_ESTABLISHED,
|
||||
IB_CM_DREQ_SENT,
|
||||
IB_CM_DREQ_RCVD,
|
||||
IB_CM_TIMEWAIT,
|
||||
IB_CM_SIDR_REQ_SENT,
|
||||
IB_CM_SIDR_REQ_RCVD
|
||||
};
|
||||
|
||||
enum ib_cm_lap_state {
|
||||
IB_CM_LAP_IDLE,
|
||||
IB_CM_LAP_SENT,
|
||||
IB_CM_LAP_RCVD,
|
||||
IB_CM_MRA_LAP_SENT,
|
||||
IB_CM_MRA_LAP_RCVD,
|
||||
};
|
||||
|
||||
enum ib_cm_event_type {
|
||||
IB_CM_REQ_ERROR,
|
||||
IB_CM_REQ_RECEIVED,
|
||||
IB_CM_REP_ERROR,
|
||||
IB_CM_REP_RECEIVED,
|
||||
IB_CM_RTU_RECEIVED,
|
||||
IB_CM_USER_ESTABLISHED,
|
||||
IB_CM_DREQ_ERROR,
|
||||
IB_CM_DREQ_RECEIVED,
|
||||
IB_CM_DREP_RECEIVED,
|
||||
IB_CM_TIMEWAIT_EXIT,
|
||||
IB_CM_MRA_RECEIVED,
|
||||
IB_CM_REJ_RECEIVED,
|
||||
IB_CM_LAP_ERROR,
|
||||
IB_CM_LAP_RECEIVED,
|
||||
IB_CM_APR_RECEIVED,
|
||||
IB_CM_SIDR_REQ_ERROR,
|
||||
IB_CM_SIDR_REQ_RECEIVED,
|
||||
IB_CM_SIDR_REP_RECEIVED
|
||||
};
|
||||
|
||||
enum ib_cm_data_size {
|
||||
IB_CM_REQ_PRIVATE_DATA_SIZE = 92,
|
||||
IB_CM_MRA_PRIVATE_DATA_SIZE = 222,
|
||||
IB_CM_REJ_PRIVATE_DATA_SIZE = 148,
|
||||
IB_CM_REP_PRIVATE_DATA_SIZE = 196,
|
||||
IB_CM_RTU_PRIVATE_DATA_SIZE = 224,
|
||||
IB_CM_DREQ_PRIVATE_DATA_SIZE = 220,
|
||||
IB_CM_DREP_PRIVATE_DATA_SIZE = 224,
|
||||
IB_CM_REJ_ARI_LENGTH = 72,
|
||||
IB_CM_LAP_PRIVATE_DATA_SIZE = 168,
|
||||
IB_CM_APR_PRIVATE_DATA_SIZE = 148,
|
||||
IB_CM_APR_INFO_LENGTH = 72,
|
||||
IB_CM_SIDR_REQ_PRIVATE_DATA_SIZE = 216,
|
||||
IB_CM_SIDR_REP_PRIVATE_DATA_SIZE = 136,
|
||||
IB_CM_SIDR_REP_INFO_LENGTH = 72
|
||||
};
|
||||
|
||||
struct ib_cm_id;
|
||||
|
||||
struct ib_cm_req_event_param {
|
||||
struct ib_cm_id *listen_id;
|
||||
struct ib_device *device;
|
||||
u8 port;
|
||||
|
||||
struct ib_sa_path_rec *primary_path;
|
||||
struct ib_sa_path_rec *alternate_path;
|
||||
|
||||
__be64 remote_ca_guid;
|
||||
u32 remote_qkey;
|
||||
u32 remote_qpn;
|
||||
enum ib_qp_type qp_type;
|
||||
|
||||
u32 starting_psn;
|
||||
u8 responder_resources;
|
||||
u8 initiator_depth;
|
||||
unsigned int local_cm_response_timeout:5;
|
||||
unsigned int flow_control:1;
|
||||
unsigned int remote_cm_response_timeout:5;
|
||||
unsigned int retry_count:3;
|
||||
unsigned int rnr_retry_count:3;
|
||||
unsigned int srq:1;
|
||||
};
|
||||
|
||||
struct ib_cm_rep_event_param {
|
||||
__be64 remote_ca_guid;
|
||||
u32 remote_qkey;
|
||||
u32 remote_qpn;
|
||||
u32 starting_psn;
|
||||
u8 responder_resources;
|
||||
u8 initiator_depth;
|
||||
unsigned int target_ack_delay:5;
|
||||
unsigned int failover_accepted:2;
|
||||
unsigned int flow_control:1;
|
||||
unsigned int rnr_retry_count:3;
|
||||
unsigned int srq:1;
|
||||
};
|
||||
|
||||
enum ib_cm_rej_reason {
|
||||
IB_CM_REJ_NO_QP = 1,
|
||||
IB_CM_REJ_NO_EEC = 2,
|
||||
IB_CM_REJ_NO_RESOURCES = 3,
|
||||
IB_CM_REJ_TIMEOUT = 4,
|
||||
IB_CM_REJ_UNSUPPORTED = 5,
|
||||
IB_CM_REJ_INVALID_COMM_ID = 6,
|
||||
IB_CM_REJ_INVALID_COMM_INSTANCE = 7,
|
||||
IB_CM_REJ_INVALID_SERVICE_ID = 8,
|
||||
IB_CM_REJ_INVALID_TRANSPORT_TYPE = 9,
|
||||
IB_CM_REJ_STALE_CONN = 10,
|
||||
IB_CM_REJ_RDC_NOT_EXIST = 11,
|
||||
IB_CM_REJ_INVALID_GID = 12,
|
||||
IB_CM_REJ_INVALID_LID = 13,
|
||||
IB_CM_REJ_INVALID_SL = 14,
|
||||
IB_CM_REJ_INVALID_TRAFFIC_CLASS = 15,
|
||||
IB_CM_REJ_INVALID_HOP_LIMIT = 16,
|
||||
IB_CM_REJ_INVALID_PACKET_RATE = 17,
|
||||
IB_CM_REJ_INVALID_ALT_GID = 18,
|
||||
IB_CM_REJ_INVALID_ALT_LID = 19,
|
||||
IB_CM_REJ_INVALID_ALT_SL = 20,
|
||||
IB_CM_REJ_INVALID_ALT_TRAFFIC_CLASS = 21,
|
||||
IB_CM_REJ_INVALID_ALT_HOP_LIMIT = 22,
|
||||
IB_CM_REJ_INVALID_ALT_PACKET_RATE = 23,
|
||||
IB_CM_REJ_PORT_CM_REDIRECT = 24,
|
||||
IB_CM_REJ_PORT_REDIRECT = 25,
|
||||
IB_CM_REJ_INVALID_MTU = 26,
|
||||
IB_CM_REJ_INSUFFICIENT_RESP_RESOURCES = 27,
|
||||
IB_CM_REJ_CONSUMER_DEFINED = 28,
|
||||
IB_CM_REJ_INVALID_RNR_RETRY = 29,
|
||||
IB_CM_REJ_DUPLICATE_LOCAL_COMM_ID = 30,
|
||||
IB_CM_REJ_INVALID_CLASS_VERSION = 31,
|
||||
IB_CM_REJ_INVALID_FLOW_LABEL = 32,
|
||||
IB_CM_REJ_INVALID_ALT_FLOW_LABEL = 33
|
||||
};
|
||||
|
||||
struct ib_cm_rej_event_param {
|
||||
enum ib_cm_rej_reason reason;
|
||||
void *ari;
|
||||
u8 ari_length;
|
||||
};
|
||||
|
||||
struct ib_cm_mra_event_param {
|
||||
u8 service_timeout;
|
||||
};
|
||||
|
||||
struct ib_cm_lap_event_param {
|
||||
struct ib_sa_path_rec *alternate_path;
|
||||
};
|
||||
|
||||
enum ib_cm_apr_status {
|
||||
IB_CM_APR_SUCCESS,
|
||||
IB_CM_APR_INVALID_COMM_ID,
|
||||
IB_CM_APR_UNSUPPORTED,
|
||||
IB_CM_APR_REJECT,
|
||||
IB_CM_APR_REDIRECT,
|
||||
IB_CM_APR_IS_CURRENT,
|
||||
IB_CM_APR_INVALID_QPN_EECN,
|
||||
IB_CM_APR_INVALID_LID,
|
||||
IB_CM_APR_INVALID_GID,
|
||||
IB_CM_APR_INVALID_FLOW_LABEL,
|
||||
IB_CM_APR_INVALID_TCLASS,
|
||||
IB_CM_APR_INVALID_HOP_LIMIT,
|
||||
IB_CM_APR_INVALID_PACKET_RATE,
|
||||
IB_CM_APR_INVALID_SL
|
||||
};
|
||||
|
||||
struct ib_cm_apr_event_param {
|
||||
enum ib_cm_apr_status ap_status;
|
||||
void *apr_info;
|
||||
u8 info_len;
|
||||
};
|
||||
|
||||
struct ib_cm_sidr_req_event_param {
|
||||
struct ib_cm_id *listen_id;
|
||||
struct ib_device *device;
|
||||
u8 port;
|
||||
u16 pkey;
|
||||
};
|
||||
|
||||
enum ib_cm_sidr_status {
|
||||
IB_SIDR_SUCCESS,
|
||||
IB_SIDR_UNSUPPORTED,
|
||||
IB_SIDR_REJECT,
|
||||
IB_SIDR_NO_QP,
|
||||
IB_SIDR_REDIRECT,
|
||||
IB_SIDR_UNSUPPORTED_VERSION
|
||||
};
|
||||
|
||||
struct ib_cm_sidr_rep_event_param {
|
||||
enum ib_cm_sidr_status status;
|
||||
u32 qkey;
|
||||
u32 qpn;
|
||||
void *info;
|
||||
u8 info_len;
|
||||
|
||||
};
|
||||
|
||||
struct ib_cm_event {
|
||||
enum ib_cm_event_type event;
|
||||
union {
|
||||
struct ib_cm_req_event_param req_rcvd;
|
||||
struct ib_cm_rep_event_param rep_rcvd;
|
||||
/* No data for RTU received events. */
|
||||
struct ib_cm_rej_event_param rej_rcvd;
|
||||
struct ib_cm_mra_event_param mra_rcvd;
|
||||
struct ib_cm_lap_event_param lap_rcvd;
|
||||
struct ib_cm_apr_event_param apr_rcvd;
|
||||
/* No data for DREQ/DREP received events. */
|
||||
struct ib_cm_sidr_req_event_param sidr_req_rcvd;
|
||||
struct ib_cm_sidr_rep_event_param sidr_rep_rcvd;
|
||||
enum ib_wc_status send_status;
|
||||
} param;
|
||||
|
||||
void *private_data;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_cm_handler - User-defined callback to process communication events.
|
||||
* @cm_id: Communication identifier associated with the reported event.
|
||||
* @event: Information about the communication event.
|
||||
*
|
||||
* IB_CM_REQ_RECEIVED and IB_CM_SIDR_REQ_RECEIVED communication events
|
||||
* generated as a result of listen requests result in the allocation of a
|
||||
* new @cm_id. The new @cm_id is returned to the user through this callback.
|
||||
* Clients are responsible for destroying the new @cm_id. For peer-to-peer
|
||||
* IB_CM_REQ_RECEIVED and all other events, the returned @cm_id corresponds
|
||||
* to a user's existing communication identifier.
|
||||
*
|
||||
* Users may not call ib_destroy_cm_id while in the context of this callback;
|
||||
* however, returning a non-zero value instructs the communication manager to
|
||||
* destroy the @cm_id after the callback completes.
|
||||
*/
|
||||
typedef int (*ib_cm_handler)(struct ib_cm_id *cm_id,
|
||||
struct ib_cm_event *event);
|
||||
|
||||
struct ib_cm_id {
|
||||
ib_cm_handler cm_handler;
|
||||
void *context;
|
||||
__be64 service_id;
|
||||
__be64 service_mask;
|
||||
enum ib_cm_state state; /* internal CM/debug use */
|
||||
enum ib_cm_lap_state lap_state; /* internal CM/debug use */
|
||||
__be32 local_id;
|
||||
__be32 remote_id;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_create_cm_id - Allocate a communication identifier.
|
||||
* @cm_handler: Callback invoked to notify the user of CM events.
|
||||
* @context: User specified context associated with the communication
|
||||
* identifier.
|
||||
*
|
||||
* Communication identifiers are used to track connection states, service
|
||||
* ID resolution requests, and listen requests.
|
||||
*/
|
||||
struct ib_cm_id *ib_create_cm_id(ib_cm_handler cm_handler,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* ib_destroy_cm_id - Destroy a connection identifier.
|
||||
* @cm_id: Connection identifier to destroy.
|
||||
*
|
||||
* This call blocks until the connection identifier is destroyed.
|
||||
*/
|
||||
void ib_destroy_cm_id(struct ib_cm_id *cm_id);
|
||||
|
||||
#define IB_SERVICE_ID_AGN_MASK __constant_cpu_to_be64(0xFF00000000000000ULL)
|
||||
#define IB_CM_ASSIGN_SERVICE_ID __constant_cpu_to_be64(0x0200000000000000ULL)
|
||||
|
||||
/**
|
||||
* ib_cm_listen - Initiates listening on the specified service ID for
|
||||
* connection and service ID resolution requests.
|
||||
* @cm_id: Connection identifier associated with the listen request.
|
||||
* @service_id: Service identifier matched against incoming connection
|
||||
* and service ID resolution requests. The service ID should be specified
|
||||
* network-byte order. If set to IB_CM_ASSIGN_SERVICE_ID, the CM will
|
||||
* assign a service ID to the caller.
|
||||
* @service_mask: Mask applied to service ID used to listen across a
|
||||
* range of service IDs. If set to 0, the service ID is matched
|
||||
* exactly. This parameter is ignored if %service_id is set to
|
||||
* IB_CM_ASSIGN_SERVICE_ID.
|
||||
*/
|
||||
int ib_cm_listen(struct ib_cm_id *cm_id,
|
||||
__be64 service_id,
|
||||
__be64 service_mask);
|
||||
|
||||
struct ib_cm_req_param {
|
||||
struct ib_sa_path_rec *primary_path;
|
||||
struct ib_sa_path_rec *alternate_path;
|
||||
__be64 service_id;
|
||||
u32 qp_num;
|
||||
enum ib_qp_type qp_type;
|
||||
u32 starting_psn;
|
||||
const void *private_data;
|
||||
u8 private_data_len;
|
||||
u8 peer_to_peer;
|
||||
u8 responder_resources;
|
||||
u8 initiator_depth;
|
||||
u8 remote_cm_response_timeout;
|
||||
u8 flow_control;
|
||||
u8 local_cm_response_timeout;
|
||||
u8 retry_count;
|
||||
u8 rnr_retry_count;
|
||||
u8 max_cm_retries;
|
||||
u8 srq;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_send_cm_req - Sends a connection request to the remote node.
|
||||
* @cm_id: Connection identifier that will be associated with the
|
||||
* connection request.
|
||||
* @param: Connection request information needed to establish the
|
||||
* connection.
|
||||
*/
|
||||
int ib_send_cm_req(struct ib_cm_id *cm_id,
|
||||
struct ib_cm_req_param *param);
|
||||
|
||||
struct ib_cm_rep_param {
|
||||
u32 qp_num;
|
||||
u32 starting_psn;
|
||||
const void *private_data;
|
||||
u8 private_data_len;
|
||||
u8 responder_resources;
|
||||
u8 initiator_depth;
|
||||
u8 target_ack_delay;
|
||||
u8 failover_accepted;
|
||||
u8 flow_control;
|
||||
u8 rnr_retry_count;
|
||||
u8 srq;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_send_cm_rep - Sends a connection reply in response to a connection
|
||||
* request.
|
||||
* @cm_id: Connection identifier that will be associated with the
|
||||
* connection request.
|
||||
* @param: Connection reply information needed to establish the
|
||||
* connection.
|
||||
*/
|
||||
int ib_send_cm_rep(struct ib_cm_id *cm_id,
|
||||
struct ib_cm_rep_param *param);
|
||||
|
||||
/**
|
||||
* ib_send_cm_rtu - Sends a connection ready to use message in response
|
||||
* to a connection reply message.
|
||||
* @cm_id: Connection identifier associated with the connection request.
|
||||
* @private_data: Optional user-defined private data sent with the
|
||||
* ready to use message.
|
||||
* @private_data_len: Size of the private data buffer, in bytes.
|
||||
*/
|
||||
int ib_send_cm_rtu(struct ib_cm_id *cm_id,
|
||||
const void *private_data,
|
||||
u8 private_data_len);
|
||||
|
||||
/**
|
||||
* ib_send_cm_dreq - Sends a disconnection request for an existing
|
||||
* connection.
|
||||
* @cm_id: Connection identifier associated with the connection being
|
||||
* released.
|
||||
* @private_data: Optional user-defined private data sent with the
|
||||
* disconnection request message.
|
||||
* @private_data_len: Size of the private data buffer, in bytes.
|
||||
*/
|
||||
int ib_send_cm_dreq(struct ib_cm_id *cm_id,
|
||||
const void *private_data,
|
||||
u8 private_data_len);
|
||||
|
||||
/**
|
||||
* ib_send_cm_drep - Sends a disconnection reply to a disconnection request.
|
||||
* @cm_id: Connection identifier associated with the connection being
|
||||
* released.
|
||||
* @private_data: Optional user-defined private data sent with the
|
||||
* disconnection reply message.
|
||||
* @private_data_len: Size of the private data buffer, in bytes.
|
||||
*
|
||||
* If the cm_id is in the correct state, the CM will transition the connection
|
||||
* to the timewait state, even if an error occurs sending the DREP message.
|
||||
*/
|
||||
int ib_send_cm_drep(struct ib_cm_id *cm_id,
|
||||
const void *private_data,
|
||||
u8 private_data_len);
|
||||
|
||||
/**
|
||||
* ib_cm_establish - Forces a connection state to established.
|
||||
* @cm_id: Connection identifier to transition to established.
|
||||
*
|
||||
* This routine should be invoked by users who receive messages on a
|
||||
* connected QP before an RTU has been received.
|
||||
*/
|
||||
int ib_cm_establish(struct ib_cm_id *cm_id);
|
||||
|
||||
/**
|
||||
* ib_send_cm_rej - Sends a connection rejection message to the
|
||||
* remote node.
|
||||
* @cm_id: Connection identifier associated with the connection being
|
||||
* rejected.
|
||||
* @reason: Reason for the connection request rejection.
|
||||
* @ari: Optional additional rejection information.
|
||||
* @ari_length: Size of the additional rejection information, in bytes.
|
||||
* @private_data: Optional user-defined private data sent with the
|
||||
* rejection message.
|
||||
* @private_data_len: Size of the private data buffer, in bytes.
|
||||
*/
|
||||
int ib_send_cm_rej(struct ib_cm_id *cm_id,
|
||||
enum ib_cm_rej_reason reason,
|
||||
void *ari,
|
||||
u8 ari_length,
|
||||
const void *private_data,
|
||||
u8 private_data_len);
|
||||
|
||||
/**
|
||||
* ib_send_cm_mra - Sends a message receipt acknowledgement to a connection
|
||||
* message.
|
||||
* @cm_id: Connection identifier associated with the connection message.
|
||||
* @service_timeout: The maximum time required for the sender to reply to
|
||||
* to the connection message.
|
||||
* @private_data: Optional user-defined private data sent with the
|
||||
* message receipt acknowledgement.
|
||||
* @private_data_len: Size of the private data buffer, in bytes.
|
||||
*/
|
||||
int ib_send_cm_mra(struct ib_cm_id *cm_id,
|
||||
u8 service_timeout,
|
||||
const void *private_data,
|
||||
u8 private_data_len);
|
||||
|
||||
/**
|
||||
* ib_send_cm_lap - Sends a load alternate path request.
|
||||
* @cm_id: Connection identifier associated with the load alternate path
|
||||
* message.
|
||||
* @alternate_path: A path record that identifies the alternate path to
|
||||
* load.
|
||||
* @private_data: Optional user-defined private data sent with the
|
||||
* load alternate path message.
|
||||
* @private_data_len: Size of the private data buffer, in bytes.
|
||||
*/
|
||||
int ib_send_cm_lap(struct ib_cm_id *cm_id,
|
||||
struct ib_sa_path_rec *alternate_path,
|
||||
const void *private_data,
|
||||
u8 private_data_len);
|
||||
|
||||
/**
|
||||
* ib_cm_init_qp_attr - Initializes the QP attributes for use in transitioning
|
||||
* to a specified QP state.
|
||||
* @cm_id: Communication identifier associated with the QP attributes to
|
||||
* initialize.
|
||||
* @qp_attr: On input, specifies the desired QP state. On output, the
|
||||
* mandatory and desired optional attributes will be set in order to
|
||||
* modify the QP to the specified state.
|
||||
* @qp_attr_mask: The QP attribute mask that may be used to transition the
|
||||
* QP to the specified state.
|
||||
*
|
||||
* Users must set the @qp_attr->qp_state to the desired QP state. This call
|
||||
* will set all required attributes for the given transition, along with
|
||||
* known optional attributes. Users may override the attributes returned from
|
||||
* this call before calling ib_modify_qp.
|
||||
*/
|
||||
int ib_cm_init_qp_attr(struct ib_cm_id *cm_id,
|
||||
struct ib_qp_attr *qp_attr,
|
||||
int *qp_attr_mask);
|
||||
|
||||
/**
|
||||
* ib_send_cm_apr - Sends an alternate path response message in response to
|
||||
* a load alternate path request.
|
||||
* @cm_id: Connection identifier associated with the alternate path response.
|
||||
* @status: Reply status sent with the alternate path response.
|
||||
* @info: Optional additional information sent with the alternate path
|
||||
* response.
|
||||
* @info_length: Size of the additional information, in bytes.
|
||||
* @private_data: Optional user-defined private data sent with the
|
||||
* alternate path response message.
|
||||
* @private_data_len: Size of the private data buffer, in bytes.
|
||||
*/
|
||||
int ib_send_cm_apr(struct ib_cm_id *cm_id,
|
||||
enum ib_cm_apr_status status,
|
||||
void *info,
|
||||
u8 info_length,
|
||||
const void *private_data,
|
||||
u8 private_data_len);
|
||||
|
||||
struct ib_cm_sidr_req_param {
|
||||
struct ib_sa_path_rec *path;
|
||||
__be64 service_id;
|
||||
int timeout_ms;
|
||||
const void *private_data;
|
||||
u8 private_data_len;
|
||||
u8 max_cm_retries;
|
||||
u16 pkey;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_send_cm_sidr_req - Sends a service ID resolution request to the
|
||||
* remote node.
|
||||
* @cm_id: Communication identifier that will be associated with the
|
||||
* service ID resolution request.
|
||||
* @param: Service ID resolution request information.
|
||||
*/
|
||||
int ib_send_cm_sidr_req(struct ib_cm_id *cm_id,
|
||||
struct ib_cm_sidr_req_param *param);
|
||||
|
||||
struct ib_cm_sidr_rep_param {
|
||||
u32 qp_num;
|
||||
u32 qkey;
|
||||
enum ib_cm_sidr_status status;
|
||||
const void *info;
|
||||
u8 info_length;
|
||||
const void *private_data;
|
||||
u8 private_data_len;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_send_cm_sidr_rep - Sends a service ID resolution request to the
|
||||
* remote node.
|
||||
* @cm_id: Communication identifier associated with the received service ID
|
||||
* resolution request.
|
||||
* @param: Service ID resolution reply information.
|
||||
*/
|
||||
int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id,
|
||||
struct ib_cm_sidr_rep_param *param);
|
||||
|
||||
#endif /* IB_CM_H */
|
||||
93
include/rdma/ib_fmr_pool.h
Normal file
93
include/rdma/ib_fmr_pool.h
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Topspin Corporation. All rights reserved.
|
||||
* Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_fmr_pool.h 2730 2005-06-28 16:43:03Z sean.hefty $
|
||||
*/
|
||||
|
||||
#if !defined(IB_FMR_POOL_H)
|
||||
#define IB_FMR_POOL_H
|
||||
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
struct ib_fmr_pool;
|
||||
|
||||
/**
|
||||
* struct ib_fmr_pool_param - Parameters for creating FMR pool
|
||||
* @max_pages_per_fmr:Maximum number of pages per map request.
|
||||
* @access:Access flags for FMRs in pool.
|
||||
* @pool_size:Number of FMRs to allocate for pool.
|
||||
* @dirty_watermark:Flush is triggered when @dirty_watermark dirty
|
||||
* FMRs are present.
|
||||
* @flush_function:Callback called when unmapped FMRs are flushed and
|
||||
* more FMRs are possibly available for mapping
|
||||
* @flush_arg:Context passed to user's flush function.
|
||||
* @cache:If set, FMRs may be reused after unmapping for identical map
|
||||
* requests.
|
||||
*/
|
||||
struct ib_fmr_pool_param {
|
||||
int max_pages_per_fmr;
|
||||
enum ib_access_flags access;
|
||||
int pool_size;
|
||||
int dirty_watermark;
|
||||
void (*flush_function)(struct ib_fmr_pool *pool,
|
||||
void * arg);
|
||||
void *flush_arg;
|
||||
unsigned cache:1;
|
||||
};
|
||||
|
||||
struct ib_pool_fmr {
|
||||
struct ib_fmr *fmr;
|
||||
struct ib_fmr_pool *pool;
|
||||
struct list_head list;
|
||||
struct hlist_node cache_node;
|
||||
int ref_count;
|
||||
int remap_count;
|
||||
u64 io_virtual_address;
|
||||
int page_list_len;
|
||||
u64 page_list[0];
|
||||
};
|
||||
|
||||
struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
|
||||
struct ib_fmr_pool_param *params);
|
||||
|
||||
void ib_destroy_fmr_pool(struct ib_fmr_pool *pool);
|
||||
|
||||
int ib_flush_fmr_pool(struct ib_fmr_pool *pool);
|
||||
|
||||
struct ib_pool_fmr *ib_fmr_pool_map_phys(struct ib_fmr_pool *pool_handle,
|
||||
u64 *page_list,
|
||||
int list_len,
|
||||
u64 *io_virtual_address);
|
||||
|
||||
int ib_fmr_pool_unmap(struct ib_pool_fmr *fmr);
|
||||
|
||||
#endif /* IB_FMR_POOL_H */
|
||||
579
include/rdma/ib_mad.h
Normal file
579
include/rdma/ib_mad.h
Normal file
|
|
@ -0,0 +1,579 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved.
|
||||
* Copyright (c) 2004 Infinicon Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 Topspin Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 Voltaire Corporation. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_mad.h 2775 2005-07-02 13:42:12Z halr $
|
||||
*/
|
||||
|
||||
#if !defined( IB_MAD_H )
|
||||
#define IB_MAD_H
|
||||
|
||||
#include <linux/pci.h>
|
||||
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
/* Management base version */
|
||||
#define IB_MGMT_BASE_VERSION 1
|
||||
|
||||
/* Management classes */
|
||||
#define IB_MGMT_CLASS_SUBN_LID_ROUTED 0x01
|
||||
#define IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE 0x81
|
||||
#define IB_MGMT_CLASS_SUBN_ADM 0x03
|
||||
#define IB_MGMT_CLASS_PERF_MGMT 0x04
|
||||
#define IB_MGMT_CLASS_BM 0x05
|
||||
#define IB_MGMT_CLASS_DEVICE_MGMT 0x06
|
||||
#define IB_MGMT_CLASS_CM 0x07
|
||||
#define IB_MGMT_CLASS_SNMP 0x08
|
||||
#define IB_MGMT_CLASS_VENDOR_RANGE2_START 0x30
|
||||
#define IB_MGMT_CLASS_VENDOR_RANGE2_END 0x4F
|
||||
|
||||
#define IB_OPENIB_OUI (0x001405)
|
||||
|
||||
/* Management methods */
|
||||
#define IB_MGMT_METHOD_GET 0x01
|
||||
#define IB_MGMT_METHOD_SET 0x02
|
||||
#define IB_MGMT_METHOD_GET_RESP 0x81
|
||||
#define IB_MGMT_METHOD_SEND 0x03
|
||||
#define IB_MGMT_METHOD_TRAP 0x05
|
||||
#define IB_MGMT_METHOD_REPORT 0x06
|
||||
#define IB_MGMT_METHOD_REPORT_RESP 0x86
|
||||
#define IB_MGMT_METHOD_TRAP_REPRESS 0x07
|
||||
|
||||
#define IB_MGMT_METHOD_RESP 0x80
|
||||
|
||||
#define IB_MGMT_MAX_METHODS 128
|
||||
|
||||
/* RMPP information */
|
||||
#define IB_MGMT_RMPP_VERSION 1
|
||||
|
||||
#define IB_MGMT_RMPP_TYPE_DATA 1
|
||||
#define IB_MGMT_RMPP_TYPE_ACK 2
|
||||
#define IB_MGMT_RMPP_TYPE_STOP 3
|
||||
#define IB_MGMT_RMPP_TYPE_ABORT 4
|
||||
|
||||
#define IB_MGMT_RMPP_FLAG_ACTIVE 1
|
||||
#define IB_MGMT_RMPP_FLAG_FIRST (1<<1)
|
||||
#define IB_MGMT_RMPP_FLAG_LAST (1<<2)
|
||||
|
||||
#define IB_MGMT_RMPP_NO_RESPTIME 0x1F
|
||||
|
||||
#define IB_MGMT_RMPP_STATUS_SUCCESS 0
|
||||
#define IB_MGMT_RMPP_STATUS_RESX 1
|
||||
#define IB_MGMT_RMPP_STATUS_ABORT_MIN 118
|
||||
#define IB_MGMT_RMPP_STATUS_T2L 118
|
||||
#define IB_MGMT_RMPP_STATUS_BAD_LEN 119
|
||||
#define IB_MGMT_RMPP_STATUS_BAD_SEG 120
|
||||
#define IB_MGMT_RMPP_STATUS_BADT 121
|
||||
#define IB_MGMT_RMPP_STATUS_W2S 122
|
||||
#define IB_MGMT_RMPP_STATUS_S2B 123
|
||||
#define IB_MGMT_RMPP_STATUS_BAD_STATUS 124
|
||||
#define IB_MGMT_RMPP_STATUS_UNV 125
|
||||
#define IB_MGMT_RMPP_STATUS_TMR 126
|
||||
#define IB_MGMT_RMPP_STATUS_UNSPEC 127
|
||||
#define IB_MGMT_RMPP_STATUS_ABORT_MAX 127
|
||||
|
||||
#define IB_QP0 0
|
||||
#define IB_QP1 __constant_htonl(1)
|
||||
#define IB_QP1_QKEY 0x80010000
|
||||
#define IB_QP_SET_QKEY 0x80000000
|
||||
|
||||
struct ib_mad_hdr {
|
||||
u8 base_version;
|
||||
u8 mgmt_class;
|
||||
u8 class_version;
|
||||
u8 method;
|
||||
__be16 status;
|
||||
__be16 class_specific;
|
||||
__be64 tid;
|
||||
__be16 attr_id;
|
||||
__be16 resv;
|
||||
__be32 attr_mod;
|
||||
};
|
||||
|
||||
struct ib_rmpp_hdr {
|
||||
u8 rmpp_version;
|
||||
u8 rmpp_type;
|
||||
u8 rmpp_rtime_flags;
|
||||
u8 rmpp_status;
|
||||
__be32 seg_num;
|
||||
__be32 paylen_newwin;
|
||||
};
|
||||
|
||||
typedef u64 __bitwise ib_sa_comp_mask;
|
||||
|
||||
#define IB_SA_COMP_MASK(n) ((__force ib_sa_comp_mask) cpu_to_be64(1ull << n))
|
||||
|
||||
/*
|
||||
* ib_sa_hdr and ib_sa_mad structures must be packed because they have
|
||||
* 64-bit fields that are only 32-bit aligned. 64-bit architectures will
|
||||
* lay them out wrong otherwise. (And unfortunately they are sent on
|
||||
* the wire so we can't change the layout)
|
||||
*/
|
||||
struct ib_sa_hdr {
|
||||
__be64 sm_key;
|
||||
__be16 attr_offset;
|
||||
__be16 reserved;
|
||||
ib_sa_comp_mask comp_mask;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct ib_mad {
|
||||
struct ib_mad_hdr mad_hdr;
|
||||
u8 data[232];
|
||||
};
|
||||
|
||||
struct ib_rmpp_mad {
|
||||
struct ib_mad_hdr mad_hdr;
|
||||
struct ib_rmpp_hdr rmpp_hdr;
|
||||
u8 data[220];
|
||||
};
|
||||
|
||||
struct ib_sa_mad {
|
||||
struct ib_mad_hdr mad_hdr;
|
||||
struct ib_rmpp_hdr rmpp_hdr;
|
||||
struct ib_sa_hdr sa_hdr;
|
||||
u8 data[200];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct ib_vendor_mad {
|
||||
struct ib_mad_hdr mad_hdr;
|
||||
struct ib_rmpp_hdr rmpp_hdr;
|
||||
u8 reserved;
|
||||
u8 oui[3];
|
||||
u8 data[216];
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_mad_send_buf - MAD data buffer and work request for sends.
|
||||
* @mad: References an allocated MAD data buffer. The size of the data
|
||||
* buffer is specified in the @send_wr.length field.
|
||||
* @mapping: DMA mapping information.
|
||||
* @mad_agent: MAD agent that allocated the buffer.
|
||||
* @context: User-controlled context fields.
|
||||
* @send_wr: An initialized work request structure used when sending the MAD.
|
||||
* The wr_id field of the work request is initialized to reference this
|
||||
* data structure.
|
||||
* @sge: A scatter-gather list referenced by the work request.
|
||||
*
|
||||
* Users are responsible for initializing the MAD buffer itself, with the
|
||||
* exception of specifying the payload length field in any RMPP MAD.
|
||||
*/
|
||||
struct ib_mad_send_buf {
|
||||
struct ib_mad *mad;
|
||||
DECLARE_PCI_UNMAP_ADDR(mapping)
|
||||
struct ib_mad_agent *mad_agent;
|
||||
void *context[2];
|
||||
struct ib_send_wr send_wr;
|
||||
struct ib_sge sge;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_get_rmpp_resptime - Returns the RMPP response time.
|
||||
* @rmpp_hdr: An RMPP header.
|
||||
*/
|
||||
static inline u8 ib_get_rmpp_resptime(struct ib_rmpp_hdr *rmpp_hdr)
|
||||
{
|
||||
return rmpp_hdr->rmpp_rtime_flags >> 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* ib_get_rmpp_flags - Returns the RMPP flags.
|
||||
* @rmpp_hdr: An RMPP header.
|
||||
*/
|
||||
static inline u8 ib_get_rmpp_flags(struct ib_rmpp_hdr *rmpp_hdr)
|
||||
{
|
||||
return rmpp_hdr->rmpp_rtime_flags & 0x7;
|
||||
}
|
||||
|
||||
/**
|
||||
* ib_set_rmpp_resptime - Sets the response time in an RMPP header.
|
||||
* @rmpp_hdr: An RMPP header.
|
||||
* @rtime: The response time to set.
|
||||
*/
|
||||
static inline void ib_set_rmpp_resptime(struct ib_rmpp_hdr *rmpp_hdr, u8 rtime)
|
||||
{
|
||||
rmpp_hdr->rmpp_rtime_flags = ib_get_rmpp_flags(rmpp_hdr) | (rtime << 3);
|
||||
}
|
||||
|
||||
/**
|
||||
* ib_set_rmpp_flags - Sets the flags in an RMPP header.
|
||||
* @rmpp_hdr: An RMPP header.
|
||||
* @flags: The flags to set.
|
||||
*/
|
||||
static inline void ib_set_rmpp_flags(struct ib_rmpp_hdr *rmpp_hdr, u8 flags)
|
||||
{
|
||||
rmpp_hdr->rmpp_rtime_flags = (rmpp_hdr->rmpp_rtime_flags & 0xF1) |
|
||||
(flags & 0x7);
|
||||
}
|
||||
|
||||
struct ib_mad_agent;
|
||||
struct ib_mad_send_wc;
|
||||
struct ib_mad_recv_wc;
|
||||
|
||||
/**
|
||||
* ib_mad_send_handler - callback handler for a sent MAD.
|
||||
* @mad_agent: MAD agent that sent the MAD.
|
||||
* @mad_send_wc: Send work completion information on the sent MAD.
|
||||
*/
|
||||
typedef void (*ib_mad_send_handler)(struct ib_mad_agent *mad_agent,
|
||||
struct ib_mad_send_wc *mad_send_wc);
|
||||
|
||||
/**
|
||||
* ib_mad_snoop_handler - Callback handler for snooping sent MADs.
|
||||
* @mad_agent: MAD agent that snooped the MAD.
|
||||
* @send_wr: Work request information on the sent MAD.
|
||||
* @mad_send_wc: Work completion information on the sent MAD. Valid
|
||||
* only for snooping that occurs on a send completion.
|
||||
*
|
||||
* Clients snooping MADs should not modify data referenced by the @send_wr
|
||||
* or @mad_send_wc.
|
||||
*/
|
||||
typedef void (*ib_mad_snoop_handler)(struct ib_mad_agent *mad_agent,
|
||||
struct ib_send_wr *send_wr,
|
||||
struct ib_mad_send_wc *mad_send_wc);
|
||||
|
||||
/**
|
||||
* ib_mad_recv_handler - callback handler for a received MAD.
|
||||
* @mad_agent: MAD agent requesting the received MAD.
|
||||
* @mad_recv_wc: Received work completion information on the received MAD.
|
||||
*
|
||||
* MADs received in response to a send request operation will be handed to
|
||||
* the user after the send operation completes. All data buffers given
|
||||
* to registered agents through this routine are owned by the receiving
|
||||
* client, except for snooping agents. Clients snooping MADs should not
|
||||
* modify the data referenced by @mad_recv_wc.
|
||||
*/
|
||||
typedef void (*ib_mad_recv_handler)(struct ib_mad_agent *mad_agent,
|
||||
struct ib_mad_recv_wc *mad_recv_wc);
|
||||
|
||||
/**
|
||||
* ib_mad_agent - Used to track MAD registration with the access layer.
|
||||
* @device: Reference to device registration is on.
|
||||
* @qp: Reference to QP used for sending and receiving MADs.
|
||||
* @mr: Memory region for system memory usable for DMA.
|
||||
* @recv_handler: Callback handler for a received MAD.
|
||||
* @send_handler: Callback handler for a sent MAD.
|
||||
* @snoop_handler: Callback handler for snooped sent MADs.
|
||||
* @context: User-specified context associated with this registration.
|
||||
* @hi_tid: Access layer assigned transaction ID for this client.
|
||||
* Unsolicited MADs sent by this client will have the upper 32-bits
|
||||
* of their TID set to this value.
|
||||
* @port_num: Port number on which QP is registered
|
||||
* @rmpp_version: If set, indicates the RMPP version used by this agent.
|
||||
*/
|
||||
struct ib_mad_agent {
|
||||
struct ib_device *device;
|
||||
struct ib_qp *qp;
|
||||
struct ib_mr *mr;
|
||||
ib_mad_recv_handler recv_handler;
|
||||
ib_mad_send_handler send_handler;
|
||||
ib_mad_snoop_handler snoop_handler;
|
||||
void *context;
|
||||
u32 hi_tid;
|
||||
u8 port_num;
|
||||
u8 rmpp_version;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_mad_send_wc - MAD send completion information.
|
||||
* @wr_id: Work request identifier associated with the send MAD request.
|
||||
* @status: Completion status.
|
||||
* @vendor_err: Optional vendor error information returned with a failed
|
||||
* request.
|
||||
*/
|
||||
struct ib_mad_send_wc {
|
||||
u64 wr_id;
|
||||
enum ib_wc_status status;
|
||||
u32 vendor_err;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_mad_recv_buf - received MAD buffer information.
|
||||
* @list: Reference to next data buffer for a received RMPP MAD.
|
||||
* @grh: References a data buffer containing the global route header.
|
||||
* The data refereced by this buffer is only valid if the GRH is
|
||||
* valid.
|
||||
* @mad: References the start of the received MAD.
|
||||
*/
|
||||
struct ib_mad_recv_buf {
|
||||
struct list_head list;
|
||||
struct ib_grh *grh;
|
||||
struct ib_mad *mad;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_mad_recv_wc - received MAD information.
|
||||
* @wc: Completion information for the received data.
|
||||
* @recv_buf: Specifies the location of the received data buffer(s).
|
||||
* @rmpp_list: Specifies a list of RMPP reassembled received MAD buffers.
|
||||
* @mad_len: The length of the received MAD, without duplicated headers.
|
||||
*
|
||||
* For received response, the wr_id field of the wc is set to the wr_id
|
||||
* for the corresponding send request.
|
||||
*/
|
||||
struct ib_mad_recv_wc {
|
||||
struct ib_wc *wc;
|
||||
struct ib_mad_recv_buf recv_buf;
|
||||
struct list_head rmpp_list;
|
||||
int mad_len;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_mad_reg_req - MAD registration request
|
||||
* @mgmt_class: Indicates which management class of MADs should be receive
|
||||
* by the caller. This field is only required if the user wishes to
|
||||
* receive unsolicited MADs, otherwise it should be 0.
|
||||
* @mgmt_class_version: Indicates which version of MADs for the given
|
||||
* management class to receive.
|
||||
* @oui: Indicates IEEE OUI when mgmt_class is a vendor class
|
||||
* in the range from 0x30 to 0x4f. Otherwise not used.
|
||||
* @method_mask: The caller will receive unsolicited MADs for any method
|
||||
* where @method_mask = 1.
|
||||
*/
|
||||
struct ib_mad_reg_req {
|
||||
u8 mgmt_class;
|
||||
u8 mgmt_class_version;
|
||||
u8 oui[3];
|
||||
DECLARE_BITMAP(method_mask, IB_MGMT_MAX_METHODS);
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_register_mad_agent - Register to send/receive MADs.
|
||||
* @device: The device to register with.
|
||||
* @port_num: The port on the specified device to use.
|
||||
* @qp_type: Specifies which QP to access. Must be either
|
||||
* IB_QPT_SMI or IB_QPT_GSI.
|
||||
* @mad_reg_req: Specifies which unsolicited MADs should be received
|
||||
* by the caller. This parameter may be NULL if the caller only
|
||||
* wishes to receive solicited responses.
|
||||
* @rmpp_version: If set, indicates that the client will send
|
||||
* and receive MADs that contain the RMPP header for the given version.
|
||||
* If set to 0, indicates that RMPP is not used by this client.
|
||||
* @send_handler: The completion callback routine invoked after a send
|
||||
* request has completed.
|
||||
* @recv_handler: The completion callback routine invoked for a received
|
||||
* MAD.
|
||||
* @context: User specified context associated with the registration.
|
||||
*/
|
||||
struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device,
|
||||
u8 port_num,
|
||||
enum ib_qp_type qp_type,
|
||||
struct ib_mad_reg_req *mad_reg_req,
|
||||
u8 rmpp_version,
|
||||
ib_mad_send_handler send_handler,
|
||||
ib_mad_recv_handler recv_handler,
|
||||
void *context);
|
||||
|
||||
enum ib_mad_snoop_flags {
|
||||
/*IB_MAD_SNOOP_POSTED_SENDS = 1,*/
|
||||
/*IB_MAD_SNOOP_RMPP_SENDS = (1<<1),*/
|
||||
IB_MAD_SNOOP_SEND_COMPLETIONS = (1<<2),
|
||||
/*IB_MAD_SNOOP_RMPP_SEND_COMPLETIONS = (1<<3),*/
|
||||
IB_MAD_SNOOP_RECVS = (1<<4)
|
||||
/*IB_MAD_SNOOP_RMPP_RECVS = (1<<5),*/
|
||||
/*IB_MAD_SNOOP_REDIRECTED_QPS = (1<<6)*/
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_register_mad_snoop - Register to snoop sent and received MADs.
|
||||
* @device: The device to register with.
|
||||
* @port_num: The port on the specified device to use.
|
||||
* @qp_type: Specifies which QP traffic to snoop. Must be either
|
||||
* IB_QPT_SMI or IB_QPT_GSI.
|
||||
* @mad_snoop_flags: Specifies information where snooping occurs.
|
||||
* @send_handler: The callback routine invoked for a snooped send.
|
||||
* @recv_handler: The callback routine invoked for a snooped receive.
|
||||
* @context: User specified context associated with the registration.
|
||||
*/
|
||||
struct ib_mad_agent *ib_register_mad_snoop(struct ib_device *device,
|
||||
u8 port_num,
|
||||
enum ib_qp_type qp_type,
|
||||
int mad_snoop_flags,
|
||||
ib_mad_snoop_handler snoop_handler,
|
||||
ib_mad_recv_handler recv_handler,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* ib_unregister_mad_agent - Unregisters a client from using MAD services.
|
||||
* @mad_agent: Corresponding MAD registration request to deregister.
|
||||
*
|
||||
* After invoking this routine, MAD services are no longer usable by the
|
||||
* client on the associated QP.
|
||||
*/
|
||||
int ib_unregister_mad_agent(struct ib_mad_agent *mad_agent);
|
||||
|
||||
/**
|
||||
* ib_post_send_mad - Posts MAD(s) to the send queue of the QP associated
|
||||
* with the registered client.
|
||||
* @mad_agent: Specifies the associated registration to post the send to.
|
||||
* @send_wr: Specifies the information needed to send the MAD(s).
|
||||
* @bad_send_wr: Specifies the MAD on which an error was encountered.
|
||||
*
|
||||
* Sent MADs are not guaranteed to complete in the order that they were posted.
|
||||
*
|
||||
* If the MAD requires RMPP, the data buffer should contain a single copy
|
||||
* of the common MAD, RMPP, and class specific headers, followed by the class
|
||||
* defined data. If the class defined data would not divide evenly into
|
||||
* RMPP segments, then space must be allocated at the end of the referenced
|
||||
* buffer for any required padding. To indicate the amount of class defined
|
||||
* data being transferred, the paylen_newwin field in the RMPP header should
|
||||
* be set to the size of the class specific header plus the amount of class
|
||||
* defined data being transferred. The paylen_newwin field should be
|
||||
* specified in network-byte order.
|
||||
*/
|
||||
int ib_post_send_mad(struct ib_mad_agent *mad_agent,
|
||||
struct ib_send_wr *send_wr,
|
||||
struct ib_send_wr **bad_send_wr);
|
||||
|
||||
/**
|
||||
* ib_coalesce_recv_mad - Coalesces received MAD data into a single buffer.
|
||||
* @mad_recv_wc: Work completion information for a received MAD.
|
||||
* @buf: User-provided data buffer to receive the coalesced buffers. The
|
||||
* referenced buffer should be at least the size of the mad_len specified
|
||||
* by @mad_recv_wc.
|
||||
*
|
||||
* This call copies a chain of received MAD segments into a single data buffer,
|
||||
* removing duplicated headers.
|
||||
*/
|
||||
void ib_coalesce_recv_mad(struct ib_mad_recv_wc *mad_recv_wc, void *buf);
|
||||
|
||||
/**
|
||||
* ib_free_recv_mad - Returns data buffers used to receive a MAD.
|
||||
* @mad_recv_wc: Work completion information for a received MAD.
|
||||
*
|
||||
* Clients receiving MADs through their ib_mad_recv_handler must call this
|
||||
* routine to return the work completion buffers to the access layer.
|
||||
*/
|
||||
void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc);
|
||||
|
||||
/**
|
||||
* ib_cancel_mad - Cancels an outstanding send MAD operation.
|
||||
* @mad_agent: Specifies the registration associated with sent MAD.
|
||||
* @wr_id: Indicates the work request identifier of the MAD to cancel.
|
||||
*
|
||||
* MADs will be returned to the user through the corresponding
|
||||
* ib_mad_send_handler.
|
||||
*/
|
||||
void ib_cancel_mad(struct ib_mad_agent *mad_agent, u64 wr_id);
|
||||
|
||||
/**
|
||||
* ib_modify_mad - Modifies an outstanding send MAD operation.
|
||||
* @mad_agent: Specifies the registration associated with sent MAD.
|
||||
* @wr_id: Indicates the work request identifier of the MAD to modify.
|
||||
* @timeout_ms: New timeout value for sent MAD.
|
||||
*
|
||||
* This call will reset the timeout value for a sent MAD to the specified
|
||||
* value.
|
||||
*/
|
||||
int ib_modify_mad(struct ib_mad_agent *mad_agent, u64 wr_id, u32 timeout_ms);
|
||||
|
||||
/**
|
||||
* ib_redirect_mad_qp - Registers a QP for MAD services.
|
||||
* @qp: Reference to a QP that requires MAD services.
|
||||
* @rmpp_version: If set, indicates that the client will send
|
||||
* and receive MADs that contain the RMPP header for the given version.
|
||||
* If set to 0, indicates that RMPP is not used by this client.
|
||||
* @send_handler: The completion callback routine invoked after a send
|
||||
* request has completed.
|
||||
* @recv_handler: The completion callback routine invoked for a received
|
||||
* MAD.
|
||||
* @context: User specified context associated with the registration.
|
||||
*
|
||||
* Use of this call allows clients to use MAD services, such as RMPP,
|
||||
* on user-owned QPs. After calling this routine, users may send
|
||||
* MADs on the specified QP by calling ib_mad_post_send.
|
||||
*/
|
||||
struct ib_mad_agent *ib_redirect_mad_qp(struct ib_qp *qp,
|
||||
u8 rmpp_version,
|
||||
ib_mad_send_handler send_handler,
|
||||
ib_mad_recv_handler recv_handler,
|
||||
void *context);
|
||||
|
||||
/**
|
||||
* ib_process_mad_wc - Processes a work completion associated with a
|
||||
* MAD sent or received on a redirected QP.
|
||||
* @mad_agent: Specifies the registered MAD service using the redirected QP.
|
||||
* @wc: References a work completion associated with a sent or received
|
||||
* MAD segment.
|
||||
*
|
||||
* This routine is used to complete or continue processing on a MAD request.
|
||||
* If the work completion is associated with a send operation, calling
|
||||
* this routine is required to continue an RMPP transfer or to wait for a
|
||||
* corresponding response, if it is a request. If the work completion is
|
||||
* associated with a receive operation, calling this routine is required to
|
||||
* process an inbound or outbound RMPP transfer, or to match a response MAD
|
||||
* with its corresponding request.
|
||||
*/
|
||||
int ib_process_mad_wc(struct ib_mad_agent *mad_agent,
|
||||
struct ib_wc *wc);
|
||||
|
||||
/**
|
||||
* ib_create_send_mad - Allocate and initialize a data buffer and work request
|
||||
* for sending a MAD.
|
||||
* @mad_agent: Specifies the registered MAD service to associate with the MAD.
|
||||
* @remote_qpn: Specifies the QPN of the receiving node.
|
||||
* @pkey_index: Specifies which PKey the MAD will be sent using. This field
|
||||
* is valid only if the remote_qpn is QP 1.
|
||||
* @ah: References the address handle used to transfer to the remote node.
|
||||
* @rmpp_active: Indicates if the send will enable RMPP.
|
||||
* @hdr_len: Indicates the size of the data header of the MAD. This length
|
||||
* should include the common MAD header, RMPP header, plus any class
|
||||
* specific header.
|
||||
* @data_len: Indicates the size of any user-transferred data. The call will
|
||||
* automatically adjust the allocated buffer size to account for any
|
||||
* additional padding that may be necessary.
|
||||
* @gfp_mask: GFP mask used for the memory allocation.
|
||||
*
|
||||
* This is a helper routine that may be used to allocate a MAD. Users are
|
||||
* not required to allocate outbound MADs using this call. The returned
|
||||
* MAD send buffer will reference a data buffer usable for sending a MAD, along
|
||||
* with an initialized work request structure. Users may modify the returned
|
||||
* MAD data buffer or work request before posting the send.
|
||||
*
|
||||
* The returned data buffer will be cleared. Users are responsible for
|
||||
* initializing the common MAD and any class specific headers. If @rmpp_active
|
||||
* is set, the RMPP header will be initialized for sending.
|
||||
*/
|
||||
struct ib_mad_send_buf * ib_create_send_mad(struct ib_mad_agent *mad_agent,
|
||||
u32 remote_qpn, u16 pkey_index,
|
||||
struct ib_ah *ah, int rmpp_active,
|
||||
int hdr_len, int data_len,
|
||||
unsigned int __nocast gfp_mask);
|
||||
|
||||
/**
|
||||
* ib_free_send_mad - Returns data buffers used to send a MAD.
|
||||
* @send_buf: Previously allocated send data buffer.
|
||||
*/
|
||||
void ib_free_send_mad(struct ib_mad_send_buf *send_buf);
|
||||
|
||||
#endif /* IB_MAD_H */
|
||||
245
include/rdma/ib_pack.h
Normal file
245
include/rdma/ib_pack.h
Normal file
|
|
@ -0,0 +1,245 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Topspin Corporation. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_pack.h 1349 2004-12-16 21:09:43Z roland $
|
||||
*/
|
||||
|
||||
#ifndef IB_PACK_H
|
||||
#define IB_PACK_H
|
||||
|
||||
#include <rdma/ib_verbs.h>
|
||||
|
||||
enum {
|
||||
IB_LRH_BYTES = 8,
|
||||
IB_GRH_BYTES = 40,
|
||||
IB_BTH_BYTES = 12,
|
||||
IB_DETH_BYTES = 8
|
||||
};
|
||||
|
||||
struct ib_field {
|
||||
size_t struct_offset_bytes;
|
||||
size_t struct_size_bytes;
|
||||
int offset_words;
|
||||
int offset_bits;
|
||||
int size_bits;
|
||||
char *field_name;
|
||||
};
|
||||
|
||||
#define RESERVED \
|
||||
.field_name = "reserved"
|
||||
|
||||
/*
|
||||
* This macro cleans up the definitions of constants for BTH opcodes.
|
||||
* It is used to define constants such as IB_OPCODE_UD_SEND_ONLY,
|
||||
* which becomes IB_OPCODE_UD + IB_OPCODE_SEND_ONLY, and this gives
|
||||
* the correct value.
|
||||
*
|
||||
* In short, user code should use the constants defined using the
|
||||
* macro rather than worrying about adding together other constants.
|
||||
*/
|
||||
#define IB_OPCODE(transport, op) \
|
||||
IB_OPCODE_ ## transport ## _ ## op = \
|
||||
IB_OPCODE_ ## transport + IB_OPCODE_ ## op
|
||||
|
||||
enum {
|
||||
/* transport types -- just used to define real constants */
|
||||
IB_OPCODE_RC = 0x00,
|
||||
IB_OPCODE_UC = 0x20,
|
||||
IB_OPCODE_RD = 0x40,
|
||||
IB_OPCODE_UD = 0x60,
|
||||
|
||||
/* operations -- just used to define real constants */
|
||||
IB_OPCODE_SEND_FIRST = 0x00,
|
||||
IB_OPCODE_SEND_MIDDLE = 0x01,
|
||||
IB_OPCODE_SEND_LAST = 0x02,
|
||||
IB_OPCODE_SEND_LAST_WITH_IMMEDIATE = 0x03,
|
||||
IB_OPCODE_SEND_ONLY = 0x04,
|
||||
IB_OPCODE_SEND_ONLY_WITH_IMMEDIATE = 0x05,
|
||||
IB_OPCODE_RDMA_WRITE_FIRST = 0x06,
|
||||
IB_OPCODE_RDMA_WRITE_MIDDLE = 0x07,
|
||||
IB_OPCODE_RDMA_WRITE_LAST = 0x08,
|
||||
IB_OPCODE_RDMA_WRITE_LAST_WITH_IMMEDIATE = 0x09,
|
||||
IB_OPCODE_RDMA_WRITE_ONLY = 0x0a,
|
||||
IB_OPCODE_RDMA_WRITE_ONLY_WITH_IMMEDIATE = 0x0b,
|
||||
IB_OPCODE_RDMA_READ_REQUEST = 0x0c,
|
||||
IB_OPCODE_RDMA_READ_RESPONSE_FIRST = 0x0d,
|
||||
IB_OPCODE_RDMA_READ_RESPONSE_MIDDLE = 0x0e,
|
||||
IB_OPCODE_RDMA_READ_RESPONSE_LAST = 0x0f,
|
||||
IB_OPCODE_RDMA_READ_RESPONSE_ONLY = 0x10,
|
||||
IB_OPCODE_ACKNOWLEDGE = 0x11,
|
||||
IB_OPCODE_ATOMIC_ACKNOWLEDGE = 0x12,
|
||||
IB_OPCODE_COMPARE_SWAP = 0x13,
|
||||
IB_OPCODE_FETCH_ADD = 0x14,
|
||||
|
||||
/* real constants follow -- see comment about above IB_OPCODE()
|
||||
macro for more details */
|
||||
|
||||
/* RC */
|
||||
IB_OPCODE(RC, SEND_FIRST),
|
||||
IB_OPCODE(RC, SEND_MIDDLE),
|
||||
IB_OPCODE(RC, SEND_LAST),
|
||||
IB_OPCODE(RC, SEND_LAST_WITH_IMMEDIATE),
|
||||
IB_OPCODE(RC, SEND_ONLY),
|
||||
IB_OPCODE(RC, SEND_ONLY_WITH_IMMEDIATE),
|
||||
IB_OPCODE(RC, RDMA_WRITE_FIRST),
|
||||
IB_OPCODE(RC, RDMA_WRITE_MIDDLE),
|
||||
IB_OPCODE(RC, RDMA_WRITE_LAST),
|
||||
IB_OPCODE(RC, RDMA_WRITE_LAST_WITH_IMMEDIATE),
|
||||
IB_OPCODE(RC, RDMA_WRITE_ONLY),
|
||||
IB_OPCODE(RC, RDMA_WRITE_ONLY_WITH_IMMEDIATE),
|
||||
IB_OPCODE(RC, RDMA_READ_REQUEST),
|
||||
IB_OPCODE(RC, RDMA_READ_RESPONSE_FIRST),
|
||||
IB_OPCODE(RC, RDMA_READ_RESPONSE_MIDDLE),
|
||||
IB_OPCODE(RC, RDMA_READ_RESPONSE_LAST),
|
||||
IB_OPCODE(RC, RDMA_READ_RESPONSE_ONLY),
|
||||
IB_OPCODE(RC, ACKNOWLEDGE),
|
||||
IB_OPCODE(RC, ATOMIC_ACKNOWLEDGE),
|
||||
IB_OPCODE(RC, COMPARE_SWAP),
|
||||
IB_OPCODE(RC, FETCH_ADD),
|
||||
|
||||
/* UC */
|
||||
IB_OPCODE(UC, SEND_FIRST),
|
||||
IB_OPCODE(UC, SEND_MIDDLE),
|
||||
IB_OPCODE(UC, SEND_LAST),
|
||||
IB_OPCODE(UC, SEND_LAST_WITH_IMMEDIATE),
|
||||
IB_OPCODE(UC, SEND_ONLY),
|
||||
IB_OPCODE(UC, SEND_ONLY_WITH_IMMEDIATE),
|
||||
IB_OPCODE(UC, RDMA_WRITE_FIRST),
|
||||
IB_OPCODE(UC, RDMA_WRITE_MIDDLE),
|
||||
IB_OPCODE(UC, RDMA_WRITE_LAST),
|
||||
IB_OPCODE(UC, RDMA_WRITE_LAST_WITH_IMMEDIATE),
|
||||
IB_OPCODE(UC, RDMA_WRITE_ONLY),
|
||||
IB_OPCODE(UC, RDMA_WRITE_ONLY_WITH_IMMEDIATE),
|
||||
|
||||
/* RD */
|
||||
IB_OPCODE(RD, SEND_FIRST),
|
||||
IB_OPCODE(RD, SEND_MIDDLE),
|
||||
IB_OPCODE(RD, SEND_LAST),
|
||||
IB_OPCODE(RD, SEND_LAST_WITH_IMMEDIATE),
|
||||
IB_OPCODE(RD, SEND_ONLY),
|
||||
IB_OPCODE(RD, SEND_ONLY_WITH_IMMEDIATE),
|
||||
IB_OPCODE(RD, RDMA_WRITE_FIRST),
|
||||
IB_OPCODE(RD, RDMA_WRITE_MIDDLE),
|
||||
IB_OPCODE(RD, RDMA_WRITE_LAST),
|
||||
IB_OPCODE(RD, RDMA_WRITE_LAST_WITH_IMMEDIATE),
|
||||
IB_OPCODE(RD, RDMA_WRITE_ONLY),
|
||||
IB_OPCODE(RD, RDMA_WRITE_ONLY_WITH_IMMEDIATE),
|
||||
IB_OPCODE(RD, RDMA_READ_REQUEST),
|
||||
IB_OPCODE(RD, RDMA_READ_RESPONSE_FIRST),
|
||||
IB_OPCODE(RD, RDMA_READ_RESPONSE_MIDDLE),
|
||||
IB_OPCODE(RD, RDMA_READ_RESPONSE_LAST),
|
||||
IB_OPCODE(RD, RDMA_READ_RESPONSE_ONLY),
|
||||
IB_OPCODE(RD, ACKNOWLEDGE),
|
||||
IB_OPCODE(RD, ATOMIC_ACKNOWLEDGE),
|
||||
IB_OPCODE(RD, COMPARE_SWAP),
|
||||
IB_OPCODE(RD, FETCH_ADD),
|
||||
|
||||
/* UD */
|
||||
IB_OPCODE(UD, SEND_ONLY),
|
||||
IB_OPCODE(UD, SEND_ONLY_WITH_IMMEDIATE)
|
||||
};
|
||||
|
||||
enum {
|
||||
IB_LNH_RAW = 0,
|
||||
IB_LNH_IP = 1,
|
||||
IB_LNH_IBA_LOCAL = 2,
|
||||
IB_LNH_IBA_GLOBAL = 3
|
||||
};
|
||||
|
||||
struct ib_unpacked_lrh {
|
||||
u8 virtual_lane;
|
||||
u8 link_version;
|
||||
u8 service_level;
|
||||
u8 link_next_header;
|
||||
__be16 destination_lid;
|
||||
__be16 packet_length;
|
||||
__be16 source_lid;
|
||||
};
|
||||
|
||||
struct ib_unpacked_grh {
|
||||
u8 ip_version;
|
||||
u8 traffic_class;
|
||||
__be32 flow_label;
|
||||
__be16 payload_length;
|
||||
u8 next_header;
|
||||
u8 hop_limit;
|
||||
union ib_gid source_gid;
|
||||
union ib_gid destination_gid;
|
||||
};
|
||||
|
||||
struct ib_unpacked_bth {
|
||||
u8 opcode;
|
||||
u8 solicited_event;
|
||||
u8 mig_req;
|
||||
u8 pad_count;
|
||||
u8 transport_header_version;
|
||||
__be16 pkey;
|
||||
__be32 destination_qpn;
|
||||
u8 ack_req;
|
||||
__be32 psn;
|
||||
};
|
||||
|
||||
struct ib_unpacked_deth {
|
||||
__be32 qkey;
|
||||
__be32 source_qpn;
|
||||
};
|
||||
|
||||
struct ib_ud_header {
|
||||
struct ib_unpacked_lrh lrh;
|
||||
int grh_present;
|
||||
struct ib_unpacked_grh grh;
|
||||
struct ib_unpacked_bth bth;
|
||||
struct ib_unpacked_deth deth;
|
||||
int immediate_present;
|
||||
__be32 immediate_data;
|
||||
};
|
||||
|
||||
void ib_pack(const struct ib_field *desc,
|
||||
int desc_len,
|
||||
void *structure,
|
||||
void *buf);
|
||||
|
||||
void ib_unpack(const struct ib_field *desc,
|
||||
int desc_len,
|
||||
void *buf,
|
||||
void *structure);
|
||||
|
||||
void ib_ud_header_init(int payload_bytes,
|
||||
int grh_present,
|
||||
struct ib_ud_header *header);
|
||||
|
||||
int ib_ud_header_pack(struct ib_ud_header *header,
|
||||
void *buf);
|
||||
|
||||
int ib_ud_header_unpack(void *buf,
|
||||
struct ib_ud_header *header);
|
||||
|
||||
#endif /* IB_PACK_H */
|
||||
373
include/rdma/ib_sa.h
Normal file
373
include/rdma/ib_sa.h
Normal file
|
|
@ -0,0 +1,373 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005 Voltaire, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_sa.h 2811 2005-07-06 18:11:43Z halr $
|
||||
*/
|
||||
|
||||
#ifndef IB_SA_H
|
||||
#define IB_SA_H
|
||||
|
||||
#include <linux/compiler.h>
|
||||
|
||||
#include <rdma/ib_verbs.h>
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
enum {
|
||||
IB_SA_CLASS_VERSION = 2, /* IB spec version 1.1/1.2 */
|
||||
|
||||
IB_SA_METHOD_GET_TABLE = 0x12,
|
||||
IB_SA_METHOD_GET_TABLE_RESP = 0x92,
|
||||
IB_SA_METHOD_DELETE = 0x15
|
||||
};
|
||||
|
||||
enum ib_sa_selector {
|
||||
IB_SA_GTE = 0,
|
||||
IB_SA_LTE = 1,
|
||||
IB_SA_EQ = 2,
|
||||
/*
|
||||
* The meaning of "best" depends on the attribute: for
|
||||
* example, for MTU best will return the largest available
|
||||
* MTU, while for packet life time, best will return the
|
||||
* smallest available life time.
|
||||
*/
|
||||
IB_SA_BEST = 3
|
||||
};
|
||||
|
||||
enum ib_sa_rate {
|
||||
IB_SA_RATE_2_5_GBPS = 2,
|
||||
IB_SA_RATE_5_GBPS = 5,
|
||||
IB_SA_RATE_10_GBPS = 3,
|
||||
IB_SA_RATE_20_GBPS = 6,
|
||||
IB_SA_RATE_30_GBPS = 4,
|
||||
IB_SA_RATE_40_GBPS = 7,
|
||||
IB_SA_RATE_60_GBPS = 8,
|
||||
IB_SA_RATE_80_GBPS = 9,
|
||||
IB_SA_RATE_120_GBPS = 10
|
||||
};
|
||||
|
||||
static inline int ib_sa_rate_enum_to_int(enum ib_sa_rate rate)
|
||||
{
|
||||
switch (rate) {
|
||||
case IB_SA_RATE_2_5_GBPS: return 1;
|
||||
case IB_SA_RATE_5_GBPS: return 2;
|
||||
case IB_SA_RATE_10_GBPS: return 4;
|
||||
case IB_SA_RATE_20_GBPS: return 8;
|
||||
case IB_SA_RATE_30_GBPS: return 12;
|
||||
case IB_SA_RATE_40_GBPS: return 16;
|
||||
case IB_SA_RATE_60_GBPS: return 24;
|
||||
case IB_SA_RATE_80_GBPS: return 32;
|
||||
case IB_SA_RATE_120_GBPS: return 48;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Structures for SA records are named "struct ib_sa_xxx_rec." No
|
||||
* attempt is made to pack structures to match the physical layout of
|
||||
* SA records in SA MADs; all packing and unpacking is handled by the
|
||||
* SA query code.
|
||||
*
|
||||
* For a record with structure ib_sa_xxx_rec, the naming convention
|
||||
* for the component mask value for field yyy is IB_SA_XXX_REC_YYY (we
|
||||
* never use different abbreviations or otherwise change the spelling
|
||||
* of xxx/yyy between ib_sa_xxx_rec.yyy and IB_SA_XXX_REC_YYY).
|
||||
*
|
||||
* Reserved rows are indicated with comments to help maintainability.
|
||||
*/
|
||||
|
||||
/* reserved: 0 */
|
||||
/* reserved: 1 */
|
||||
#define IB_SA_PATH_REC_DGID IB_SA_COMP_MASK( 2)
|
||||
#define IB_SA_PATH_REC_SGID IB_SA_COMP_MASK( 3)
|
||||
#define IB_SA_PATH_REC_DLID IB_SA_COMP_MASK( 4)
|
||||
#define IB_SA_PATH_REC_SLID IB_SA_COMP_MASK( 5)
|
||||
#define IB_SA_PATH_REC_RAW_TRAFFIC IB_SA_COMP_MASK( 6)
|
||||
/* reserved: 7 */
|
||||
#define IB_SA_PATH_REC_FLOW_LABEL IB_SA_COMP_MASK( 8)
|
||||
#define IB_SA_PATH_REC_HOP_LIMIT IB_SA_COMP_MASK( 9)
|
||||
#define IB_SA_PATH_REC_TRAFFIC_CLASS IB_SA_COMP_MASK(10)
|
||||
#define IB_SA_PATH_REC_REVERSIBLE IB_SA_COMP_MASK(11)
|
||||
#define IB_SA_PATH_REC_NUMB_PATH IB_SA_COMP_MASK(12)
|
||||
#define IB_SA_PATH_REC_PKEY IB_SA_COMP_MASK(13)
|
||||
/* reserved: 14 */
|
||||
#define IB_SA_PATH_REC_SL IB_SA_COMP_MASK(15)
|
||||
#define IB_SA_PATH_REC_MTU_SELECTOR IB_SA_COMP_MASK(16)
|
||||
#define IB_SA_PATH_REC_MTU IB_SA_COMP_MASK(17)
|
||||
#define IB_SA_PATH_REC_RATE_SELECTOR IB_SA_COMP_MASK(18)
|
||||
#define IB_SA_PATH_REC_RATE IB_SA_COMP_MASK(19)
|
||||
#define IB_SA_PATH_REC_PACKET_LIFE_TIME_SELECTOR IB_SA_COMP_MASK(20)
|
||||
#define IB_SA_PATH_REC_PACKET_LIFE_TIME IB_SA_COMP_MASK(21)
|
||||
#define IB_SA_PATH_REC_PREFERENCE IB_SA_COMP_MASK(22)
|
||||
|
||||
struct ib_sa_path_rec {
|
||||
/* reserved */
|
||||
/* reserved */
|
||||
union ib_gid dgid;
|
||||
union ib_gid sgid;
|
||||
__be16 dlid;
|
||||
__be16 slid;
|
||||
int raw_traffic;
|
||||
/* reserved */
|
||||
__be32 flow_label;
|
||||
u8 hop_limit;
|
||||
u8 traffic_class;
|
||||
int reversible;
|
||||
u8 numb_path;
|
||||
__be16 pkey;
|
||||
/* reserved */
|
||||
u8 sl;
|
||||
u8 mtu_selector;
|
||||
u8 mtu;
|
||||
u8 rate_selector;
|
||||
u8 rate;
|
||||
u8 packet_life_time_selector;
|
||||
u8 packet_life_time;
|
||||
u8 preference;
|
||||
};
|
||||
|
||||
#define IB_SA_MCMEMBER_REC_MGID IB_SA_COMP_MASK( 0)
|
||||
#define IB_SA_MCMEMBER_REC_PORT_GID IB_SA_COMP_MASK( 1)
|
||||
#define IB_SA_MCMEMBER_REC_QKEY IB_SA_COMP_MASK( 2)
|
||||
#define IB_SA_MCMEMBER_REC_MLID IB_SA_COMP_MASK( 3)
|
||||
#define IB_SA_MCMEMBER_REC_MTU_SELECTOR IB_SA_COMP_MASK( 4)
|
||||
#define IB_SA_MCMEMBER_REC_MTU IB_SA_COMP_MASK( 5)
|
||||
#define IB_SA_MCMEMBER_REC_TRAFFIC_CLASS IB_SA_COMP_MASK( 6)
|
||||
#define IB_SA_MCMEMBER_REC_PKEY IB_SA_COMP_MASK( 7)
|
||||
#define IB_SA_MCMEMBER_REC_RATE_SELECTOR IB_SA_COMP_MASK( 8)
|
||||
#define IB_SA_MCMEMBER_REC_RATE IB_SA_COMP_MASK( 9)
|
||||
#define IB_SA_MCMEMBER_REC_PACKET_LIFE_TIME_SELECTOR IB_SA_COMP_MASK(10)
|
||||
#define IB_SA_MCMEMBER_REC_PACKET_LIFE_TIME IB_SA_COMP_MASK(11)
|
||||
#define IB_SA_MCMEMBER_REC_SL IB_SA_COMP_MASK(12)
|
||||
#define IB_SA_MCMEMBER_REC_FLOW_LABEL IB_SA_COMP_MASK(13)
|
||||
#define IB_SA_MCMEMBER_REC_HOP_LIMIT IB_SA_COMP_MASK(14)
|
||||
#define IB_SA_MCMEMBER_REC_SCOPE IB_SA_COMP_MASK(15)
|
||||
#define IB_SA_MCMEMBER_REC_JOIN_STATE IB_SA_COMP_MASK(16)
|
||||
#define IB_SA_MCMEMBER_REC_PROXY_JOIN IB_SA_COMP_MASK(17)
|
||||
|
||||
struct ib_sa_mcmember_rec {
|
||||
union ib_gid mgid;
|
||||
union ib_gid port_gid;
|
||||
__be32 qkey;
|
||||
__be16 mlid;
|
||||
u8 mtu_selector;
|
||||
u8 mtu;
|
||||
u8 traffic_class;
|
||||
__be16 pkey;
|
||||
u8 rate_selector;
|
||||
u8 rate;
|
||||
u8 packet_life_time_selector;
|
||||
u8 packet_life_time;
|
||||
u8 sl;
|
||||
__be32 flow_label;
|
||||
u8 hop_limit;
|
||||
u8 scope;
|
||||
u8 join_state;
|
||||
int proxy_join;
|
||||
};
|
||||
|
||||
/* Service Record Component Mask Sec 15.2.5.14 Ver 1.1 */
|
||||
#define IB_SA_SERVICE_REC_SERVICE_ID IB_SA_COMP_MASK( 0)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_GID IB_SA_COMP_MASK( 1)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_PKEY IB_SA_COMP_MASK( 2)
|
||||
/* reserved: 3 */
|
||||
#define IB_SA_SERVICE_REC_SERVICE_LEASE IB_SA_COMP_MASK( 4)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_KEY IB_SA_COMP_MASK( 5)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_NAME IB_SA_COMP_MASK( 6)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_0 IB_SA_COMP_MASK( 7)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_1 IB_SA_COMP_MASK( 8)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_2 IB_SA_COMP_MASK( 9)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_3 IB_SA_COMP_MASK(10)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_4 IB_SA_COMP_MASK(11)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_5 IB_SA_COMP_MASK(12)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_6 IB_SA_COMP_MASK(13)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_7 IB_SA_COMP_MASK(14)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_8 IB_SA_COMP_MASK(15)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_9 IB_SA_COMP_MASK(16)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_10 IB_SA_COMP_MASK(17)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_11 IB_SA_COMP_MASK(18)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_12 IB_SA_COMP_MASK(19)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_13 IB_SA_COMP_MASK(20)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_14 IB_SA_COMP_MASK(21)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA8_15 IB_SA_COMP_MASK(22)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA16_0 IB_SA_COMP_MASK(23)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA16_1 IB_SA_COMP_MASK(24)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA16_2 IB_SA_COMP_MASK(25)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA16_3 IB_SA_COMP_MASK(26)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA16_4 IB_SA_COMP_MASK(27)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA16_5 IB_SA_COMP_MASK(28)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA16_6 IB_SA_COMP_MASK(29)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA16_7 IB_SA_COMP_MASK(30)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA32_0 IB_SA_COMP_MASK(31)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA32_1 IB_SA_COMP_MASK(32)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA32_2 IB_SA_COMP_MASK(33)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA32_3 IB_SA_COMP_MASK(34)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA64_0 IB_SA_COMP_MASK(35)
|
||||
#define IB_SA_SERVICE_REC_SERVICE_DATA64_1 IB_SA_COMP_MASK(36)
|
||||
|
||||
#define IB_DEFAULT_SERVICE_LEASE 0xFFFFFFFF
|
||||
|
||||
struct ib_sa_service_rec {
|
||||
u64 id;
|
||||
union ib_gid gid;
|
||||
__be16 pkey;
|
||||
/* reserved */
|
||||
u32 lease;
|
||||
u8 key[16];
|
||||
u8 name[64];
|
||||
u8 data8[16];
|
||||
u16 data16[8];
|
||||
u32 data32[4];
|
||||
u64 data64[2];
|
||||
};
|
||||
|
||||
struct ib_sa_query;
|
||||
|
||||
void ib_sa_cancel_query(int id, struct ib_sa_query *query);
|
||||
|
||||
int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,
|
||||
struct ib_sa_path_rec *rec,
|
||||
ib_sa_comp_mask comp_mask,
|
||||
int timeout_ms, unsigned int __nocast gfp_mask,
|
||||
void (*callback)(int status,
|
||||
struct ib_sa_path_rec *resp,
|
||||
void *context),
|
||||
void *context,
|
||||
struct ib_sa_query **query);
|
||||
|
||||
int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,
|
||||
u8 method,
|
||||
struct ib_sa_mcmember_rec *rec,
|
||||
ib_sa_comp_mask comp_mask,
|
||||
int timeout_ms, unsigned int __nocast gfp_mask,
|
||||
void (*callback)(int status,
|
||||
struct ib_sa_mcmember_rec *resp,
|
||||
void *context),
|
||||
void *context,
|
||||
struct ib_sa_query **query);
|
||||
|
||||
int ib_sa_service_rec_query(struct ib_device *device, u8 port_num,
|
||||
u8 method,
|
||||
struct ib_sa_service_rec *rec,
|
||||
ib_sa_comp_mask comp_mask,
|
||||
int timeout_ms, unsigned int __nocast gfp_mask,
|
||||
void (*callback)(int status,
|
||||
struct ib_sa_service_rec *resp,
|
||||
void *context),
|
||||
void *context,
|
||||
struct ib_sa_query **sa_query);
|
||||
|
||||
/**
|
||||
* ib_sa_mcmember_rec_set - Start an MCMember set query
|
||||
* @device:device to send query on
|
||||
* @port_num: port number to send query on
|
||||
* @rec:MCMember Record to send in query
|
||||
* @comp_mask:component mask to send in query
|
||||
* @timeout_ms:time to wait for response
|
||||
* @gfp_mask:GFP mask to use for internal allocations
|
||||
* @callback:function called when query completes, times out or is
|
||||
* canceled
|
||||
* @context:opaque user context passed to callback
|
||||
* @sa_query:query context, used to cancel query
|
||||
*
|
||||
* Send an MCMember Set query to the SA (eg to join a multicast
|
||||
* group). The callback function will be called when the query
|
||||
* completes (or fails); status is 0 for a successful response, -EINTR
|
||||
* if the query is canceled, -ETIMEDOUT is the query timed out, or
|
||||
* -EIO if an error occurred sending the query. The resp parameter of
|
||||
* the callback is only valid if status is 0.
|
||||
*
|
||||
* If the return value of ib_sa_mcmember_rec_set() is negative, it is
|
||||
* an error code. Otherwise it is a query ID that can be used to
|
||||
* cancel the query.
|
||||
*/
|
||||
static inline int
|
||||
ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num,
|
||||
struct ib_sa_mcmember_rec *rec,
|
||||
ib_sa_comp_mask comp_mask,
|
||||
int timeout_ms, unsigned int __nocast gfp_mask,
|
||||
void (*callback)(int status,
|
||||
struct ib_sa_mcmember_rec *resp,
|
||||
void *context),
|
||||
void *context,
|
||||
struct ib_sa_query **query)
|
||||
{
|
||||
return ib_sa_mcmember_rec_query(device, port_num,
|
||||
IB_MGMT_METHOD_SET,
|
||||
rec, comp_mask,
|
||||
timeout_ms, gfp_mask, callback,
|
||||
context, query);
|
||||
}
|
||||
|
||||
/**
|
||||
* ib_sa_mcmember_rec_delete - Start an MCMember delete query
|
||||
* @device:device to send query on
|
||||
* @port_num: port number to send query on
|
||||
* @rec:MCMember Record to send in query
|
||||
* @comp_mask:component mask to send in query
|
||||
* @timeout_ms:time to wait for response
|
||||
* @gfp_mask:GFP mask to use for internal allocations
|
||||
* @callback:function called when query completes, times out or is
|
||||
* canceled
|
||||
* @context:opaque user context passed to callback
|
||||
* @sa_query:query context, used to cancel query
|
||||
*
|
||||
* Send an MCMember Delete query to the SA (eg to leave a multicast
|
||||
* group). The callback function will be called when the query
|
||||
* completes (or fails); status is 0 for a successful response, -EINTR
|
||||
* if the query is canceled, -ETIMEDOUT is the query timed out, or
|
||||
* -EIO if an error occurred sending the query. The resp parameter of
|
||||
* the callback is only valid if status is 0.
|
||||
*
|
||||
* If the return value of ib_sa_mcmember_rec_delete() is negative, it
|
||||
* is an error code. Otherwise it is a query ID that can be used to
|
||||
* cancel the query.
|
||||
*/
|
||||
static inline int
|
||||
ib_sa_mcmember_rec_delete(struct ib_device *device, u8 port_num,
|
||||
struct ib_sa_mcmember_rec *rec,
|
||||
ib_sa_comp_mask comp_mask,
|
||||
int timeout_ms, unsigned int __nocast gfp_mask,
|
||||
void (*callback)(int status,
|
||||
struct ib_sa_mcmember_rec *resp,
|
||||
void *context),
|
||||
void *context,
|
||||
struct ib_sa_query **query)
|
||||
{
|
||||
return ib_sa_mcmember_rec_query(device, port_num,
|
||||
IB_SA_METHOD_DELETE,
|
||||
rec, comp_mask,
|
||||
timeout_ms, gfp_mask, callback,
|
||||
context, query);
|
||||
}
|
||||
|
||||
|
||||
#endif /* IB_SA_H */
|
||||
94
include/rdma/ib_smi.h
Normal file
94
include/rdma/ib_smi.h
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Mellanox Technologies Ltd. All rights reserved.
|
||||
* Copyright (c) 2004 Infinicon Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 Intel Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 Topspin Corporation. All rights reserved.
|
||||
* Copyright (c) 2004 Voltaire Corporation. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_smi.h 1389 2004-12-27 22:56:47Z roland $
|
||||
*/
|
||||
|
||||
#if !defined( IB_SMI_H )
|
||||
#define IB_SMI_H
|
||||
|
||||
#include <rdma/ib_mad.h>
|
||||
|
||||
#define IB_SMP_DATA_SIZE 64
|
||||
#define IB_SMP_MAX_PATH_HOPS 64
|
||||
|
||||
struct ib_smp {
|
||||
u8 base_version;
|
||||
u8 mgmt_class;
|
||||
u8 class_version;
|
||||
u8 method;
|
||||
__be16 status;
|
||||
u8 hop_ptr;
|
||||
u8 hop_cnt;
|
||||
__be64 tid;
|
||||
__be16 attr_id;
|
||||
__be16 resv;
|
||||
__be32 attr_mod;
|
||||
__be64 mkey;
|
||||
__be16 dr_slid;
|
||||
__be16 dr_dlid;
|
||||
u8 reserved[28];
|
||||
u8 data[IB_SMP_DATA_SIZE];
|
||||
u8 initial_path[IB_SMP_MAX_PATH_HOPS];
|
||||
u8 return_path[IB_SMP_MAX_PATH_HOPS];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define IB_SMP_DIRECTION __constant_htons(0x8000)
|
||||
|
||||
/* Subnet management attributes */
|
||||
#define IB_SMP_ATTR_NOTICE __constant_htons(0x0002)
|
||||
#define IB_SMP_ATTR_NODE_DESC __constant_htons(0x0010)
|
||||
#define IB_SMP_ATTR_NODE_INFO __constant_htons(0x0011)
|
||||
#define IB_SMP_ATTR_SWITCH_INFO __constant_htons(0x0012)
|
||||
#define IB_SMP_ATTR_GUID_INFO __constant_htons(0x0014)
|
||||
#define IB_SMP_ATTR_PORT_INFO __constant_htons(0x0015)
|
||||
#define IB_SMP_ATTR_PKEY_TABLE __constant_htons(0x0016)
|
||||
#define IB_SMP_ATTR_SL_TO_VL_TABLE __constant_htons(0x0017)
|
||||
#define IB_SMP_ATTR_VL_ARB_TABLE __constant_htons(0x0018)
|
||||
#define IB_SMP_ATTR_LINEAR_FORWARD_TABLE __constant_htons(0x0019)
|
||||
#define IB_SMP_ATTR_RANDOM_FORWARD_TABLE __constant_htons(0x001A)
|
||||
#define IB_SMP_ATTR_MCAST_FORWARD_TABLE __constant_htons(0x001B)
|
||||
#define IB_SMP_ATTR_SM_INFO __constant_htons(0x0020)
|
||||
#define IB_SMP_ATTR_VENDOR_DIAG __constant_htons(0x0030)
|
||||
#define IB_SMP_ATTR_LED_INFO __constant_htons(0x0031)
|
||||
#define IB_SMP_ATTR_VENDOR_MASK __constant_htons(0xFF00)
|
||||
|
||||
static inline u8
|
||||
ib_get_smp_direction(struct ib_smp *smp)
|
||||
{
|
||||
return ((smp->status & IB_SMP_DIRECTION) == IB_SMP_DIRECTION);
|
||||
}
|
||||
|
||||
#endif /* IB_SMI_H */
|
||||
328
include/rdma/ib_user_cm.h
Normal file
328
include/rdma/ib_user_cm.h
Normal file
|
|
@ -0,0 +1,328 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_user_cm.h 2576 2005-06-09 17:00:30Z libor $
|
||||
*/
|
||||
|
||||
#ifndef IB_USER_CM_H
|
||||
#define IB_USER_CM_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#define IB_USER_CM_ABI_VERSION 1
|
||||
|
||||
enum {
|
||||
IB_USER_CM_CMD_CREATE_ID,
|
||||
IB_USER_CM_CMD_DESTROY_ID,
|
||||
IB_USER_CM_CMD_ATTR_ID,
|
||||
|
||||
IB_USER_CM_CMD_LISTEN,
|
||||
IB_USER_CM_CMD_ESTABLISH,
|
||||
|
||||
IB_USER_CM_CMD_SEND_REQ,
|
||||
IB_USER_CM_CMD_SEND_REP,
|
||||
IB_USER_CM_CMD_SEND_RTU,
|
||||
IB_USER_CM_CMD_SEND_DREQ,
|
||||
IB_USER_CM_CMD_SEND_DREP,
|
||||
IB_USER_CM_CMD_SEND_REJ,
|
||||
IB_USER_CM_CMD_SEND_MRA,
|
||||
IB_USER_CM_CMD_SEND_LAP,
|
||||
IB_USER_CM_CMD_SEND_APR,
|
||||
IB_USER_CM_CMD_SEND_SIDR_REQ,
|
||||
IB_USER_CM_CMD_SEND_SIDR_REP,
|
||||
|
||||
IB_USER_CM_CMD_EVENT,
|
||||
};
|
||||
/*
|
||||
* command ABI structures.
|
||||
*/
|
||||
struct ib_ucm_cmd_hdr {
|
||||
__u32 cmd;
|
||||
__u16 in;
|
||||
__u16 out;
|
||||
};
|
||||
|
||||
struct ib_ucm_create_id {
|
||||
__u64 response;
|
||||
};
|
||||
|
||||
struct ib_ucm_create_id_resp {
|
||||
__u32 id;
|
||||
};
|
||||
|
||||
struct ib_ucm_destroy_id {
|
||||
__u32 id;
|
||||
};
|
||||
|
||||
struct ib_ucm_attr_id {
|
||||
__u64 response;
|
||||
__u32 id;
|
||||
};
|
||||
|
||||
struct ib_ucm_attr_id_resp {
|
||||
__be64 service_id;
|
||||
__be64 service_mask;
|
||||
__be32 local_id;
|
||||
__be32 remote_id;
|
||||
};
|
||||
|
||||
struct ib_ucm_listen {
|
||||
__be64 service_id;
|
||||
__be64 service_mask;
|
||||
__u32 id;
|
||||
};
|
||||
|
||||
struct ib_ucm_establish {
|
||||
__u32 id;
|
||||
};
|
||||
|
||||
struct ib_ucm_private_data {
|
||||
__u64 data;
|
||||
__u32 id;
|
||||
__u8 len;
|
||||
__u8 reserved[3];
|
||||
};
|
||||
|
||||
struct ib_ucm_path_rec {
|
||||
__u8 dgid[16];
|
||||
__u8 sgid[16];
|
||||
__be16 dlid;
|
||||
__be16 slid;
|
||||
__u32 raw_traffic;
|
||||
__be32 flow_label;
|
||||
__u32 reversible;
|
||||
__u32 mtu;
|
||||
__be16 pkey;
|
||||
__u8 hop_limit;
|
||||
__u8 traffic_class;
|
||||
__u8 numb_path;
|
||||
__u8 sl;
|
||||
__u8 mtu_selector;
|
||||
__u8 rate_selector;
|
||||
__u8 rate;
|
||||
__u8 packet_life_time_selector;
|
||||
__u8 packet_life_time;
|
||||
__u8 preference;
|
||||
};
|
||||
|
||||
struct ib_ucm_req {
|
||||
__u32 id;
|
||||
__u32 qpn;
|
||||
__u32 qp_type;
|
||||
__u32 psn;
|
||||
__be64 sid;
|
||||
__u64 data;
|
||||
__u64 primary_path;
|
||||
__u64 alternate_path;
|
||||
__u8 len;
|
||||
__u8 peer_to_peer;
|
||||
__u8 responder_resources;
|
||||
__u8 initiator_depth;
|
||||
__u8 remote_cm_response_timeout;
|
||||
__u8 flow_control;
|
||||
__u8 local_cm_response_timeout;
|
||||
__u8 retry_count;
|
||||
__u8 rnr_retry_count;
|
||||
__u8 max_cm_retries;
|
||||
__u8 srq;
|
||||
__u8 reserved[1];
|
||||
};
|
||||
|
||||
struct ib_ucm_rep {
|
||||
__u64 data;
|
||||
__u32 id;
|
||||
__u32 qpn;
|
||||
__u32 psn;
|
||||
__u8 len;
|
||||
__u8 responder_resources;
|
||||
__u8 initiator_depth;
|
||||
__u8 target_ack_delay;
|
||||
__u8 failover_accepted;
|
||||
__u8 flow_control;
|
||||
__u8 rnr_retry_count;
|
||||
__u8 srq;
|
||||
};
|
||||
|
||||
struct ib_ucm_info {
|
||||
__u32 id;
|
||||
__u32 status;
|
||||
__u64 info;
|
||||
__u64 data;
|
||||
__u8 info_len;
|
||||
__u8 data_len;
|
||||
__u8 reserved[2];
|
||||
};
|
||||
|
||||
struct ib_ucm_mra {
|
||||
__u64 data;
|
||||
__u32 id;
|
||||
__u8 len;
|
||||
__u8 timeout;
|
||||
__u8 reserved[2];
|
||||
};
|
||||
|
||||
struct ib_ucm_lap {
|
||||
__u64 path;
|
||||
__u64 data;
|
||||
__u32 id;
|
||||
__u8 len;
|
||||
__u8 reserved[3];
|
||||
};
|
||||
|
||||
struct ib_ucm_sidr_req {
|
||||
__u32 id;
|
||||
__u32 timeout;
|
||||
__be64 sid;
|
||||
__u64 data;
|
||||
__u64 path;
|
||||
__u16 pkey;
|
||||
__u8 len;
|
||||
__u8 max_cm_retries;
|
||||
};
|
||||
|
||||
struct ib_ucm_sidr_rep {
|
||||
__u32 id;
|
||||
__u32 qpn;
|
||||
__u32 qkey;
|
||||
__u32 status;
|
||||
__u64 info;
|
||||
__u64 data;
|
||||
__u8 info_len;
|
||||
__u8 data_len;
|
||||
__u8 reserved[2];
|
||||
};
|
||||
/*
|
||||
* event notification ABI structures.
|
||||
*/
|
||||
struct ib_ucm_event_get {
|
||||
__u64 response;
|
||||
__u64 data;
|
||||
__u64 info;
|
||||
__u8 data_len;
|
||||
__u8 info_len;
|
||||
__u8 reserved[2];
|
||||
};
|
||||
|
||||
struct ib_ucm_req_event_resp {
|
||||
__u32 listen_id;
|
||||
/* device */
|
||||
/* port */
|
||||
struct ib_ucm_path_rec primary_path;
|
||||
struct ib_ucm_path_rec alternate_path;
|
||||
__be64 remote_ca_guid;
|
||||
__u32 remote_qkey;
|
||||
__u32 remote_qpn;
|
||||
__u32 qp_type;
|
||||
__u32 starting_psn;
|
||||
__u8 responder_resources;
|
||||
__u8 initiator_depth;
|
||||
__u8 local_cm_response_timeout;
|
||||
__u8 flow_control;
|
||||
__u8 remote_cm_response_timeout;
|
||||
__u8 retry_count;
|
||||
__u8 rnr_retry_count;
|
||||
__u8 srq;
|
||||
};
|
||||
|
||||
struct ib_ucm_rep_event_resp {
|
||||
__be64 remote_ca_guid;
|
||||
__u32 remote_qkey;
|
||||
__u32 remote_qpn;
|
||||
__u32 starting_psn;
|
||||
__u8 responder_resources;
|
||||
__u8 initiator_depth;
|
||||
__u8 target_ack_delay;
|
||||
__u8 failover_accepted;
|
||||
__u8 flow_control;
|
||||
__u8 rnr_retry_count;
|
||||
__u8 srq;
|
||||
__u8 reserved[1];
|
||||
};
|
||||
|
||||
struct ib_ucm_rej_event_resp {
|
||||
__u32 reason;
|
||||
/* ari in ib_ucm_event_get info field. */
|
||||
};
|
||||
|
||||
struct ib_ucm_mra_event_resp {
|
||||
__u8 timeout;
|
||||
__u8 reserved[3];
|
||||
};
|
||||
|
||||
struct ib_ucm_lap_event_resp {
|
||||
struct ib_ucm_path_rec path;
|
||||
};
|
||||
|
||||
struct ib_ucm_apr_event_resp {
|
||||
__u32 status;
|
||||
/* apr info in ib_ucm_event_get info field. */
|
||||
};
|
||||
|
||||
struct ib_ucm_sidr_req_event_resp {
|
||||
__u32 listen_id;
|
||||
/* device */
|
||||
/* port */
|
||||
__u16 pkey;
|
||||
__u8 reserved[2];
|
||||
};
|
||||
|
||||
struct ib_ucm_sidr_rep_event_resp {
|
||||
__u32 status;
|
||||
__u32 qkey;
|
||||
__u32 qpn;
|
||||
/* info in ib_ucm_event_get info field. */
|
||||
};
|
||||
|
||||
#define IB_UCM_PRES_DATA 0x01
|
||||
#define IB_UCM_PRES_INFO 0x02
|
||||
#define IB_UCM_PRES_PRIMARY 0x04
|
||||
#define IB_UCM_PRES_ALTERNATE 0x08
|
||||
|
||||
struct ib_ucm_event_resp {
|
||||
__u32 id;
|
||||
__u32 event;
|
||||
__u32 present;
|
||||
union {
|
||||
struct ib_ucm_req_event_resp req_resp;
|
||||
struct ib_ucm_rep_event_resp rep_resp;
|
||||
struct ib_ucm_rej_event_resp rej_resp;
|
||||
struct ib_ucm_mra_event_resp mra_resp;
|
||||
struct ib_ucm_lap_event_resp lap_resp;
|
||||
struct ib_ucm_apr_event_resp apr_resp;
|
||||
|
||||
struct ib_ucm_sidr_req_event_resp sidr_req_resp;
|
||||
struct ib_ucm_sidr_rep_event_resp sidr_rep_resp;
|
||||
|
||||
__u32 send_status;
|
||||
} u;
|
||||
};
|
||||
|
||||
#endif /* IB_USER_CM_H */
|
||||
137
include/rdma/ib_user_mad.h
Normal file
137
include/rdma/ib_user_mad.h
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
/*
|
||||
* Copyright (c) 2004 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005 Voltaire, Inc. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_user_mad.h 2814 2005-07-06 19:14:09Z halr $
|
||||
*/
|
||||
|
||||
#ifndef IB_USER_MAD_H
|
||||
#define IB_USER_MAD_H
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/ioctl.h>
|
||||
|
||||
/*
|
||||
* Increment this value if any changes that break userspace ABI
|
||||
* compatibility are made.
|
||||
*/
|
||||
#define IB_USER_MAD_ABI_VERSION 5
|
||||
|
||||
/*
|
||||
* Make sure that all structs defined in this file remain laid out so
|
||||
* that they pack the same way on 32-bit and 64-bit architectures (to
|
||||
* avoid incompatibility between 32-bit userspace and 64-bit kernels).
|
||||
*/
|
||||
|
||||
/**
|
||||
* ib_user_mad_hdr - MAD packet header
|
||||
* @id - ID of agent MAD received with/to be sent with
|
||||
* @status - 0 on successful receive, ETIMEDOUT if no response
|
||||
* received (transaction ID in data[] will be set to TID of original
|
||||
* request) (ignored on send)
|
||||
* @timeout_ms - Milliseconds to wait for response (unset on receive)
|
||||
* @retries - Number of automatic retries to attempt
|
||||
* @qpn - Remote QP number received from/to be sent to
|
||||
* @qkey - Remote Q_Key to be sent with (unset on receive)
|
||||
* @lid - Remote lid received from/to be sent to
|
||||
* @sl - Service level received with/to be sent with
|
||||
* @path_bits - Local path bits received with/to be sent with
|
||||
* @grh_present - If set, GRH was received/should be sent
|
||||
* @gid_index - Local GID index to send with (unset on receive)
|
||||
* @hop_limit - Hop limit in GRH
|
||||
* @traffic_class - Traffic class in GRH
|
||||
* @gid - Remote GID in GRH
|
||||
* @flow_label - Flow label in GRH
|
||||
*/
|
||||
struct ib_user_mad_hdr {
|
||||
__u32 id;
|
||||
__u32 status;
|
||||
__u32 timeout_ms;
|
||||
__u32 retries;
|
||||
__u32 length;
|
||||
__be32 qpn;
|
||||
__be32 qkey;
|
||||
__be16 lid;
|
||||
__u8 sl;
|
||||
__u8 path_bits;
|
||||
__u8 grh_present;
|
||||
__u8 gid_index;
|
||||
__u8 hop_limit;
|
||||
__u8 traffic_class;
|
||||
__u8 gid[16];
|
||||
__be32 flow_label;
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_user_mad - MAD packet
|
||||
* @hdr - MAD packet header
|
||||
* @data - Contents of MAD
|
||||
*
|
||||
*/
|
||||
struct ib_user_mad {
|
||||
struct ib_user_mad_hdr hdr;
|
||||
__u8 data[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* ib_user_mad_reg_req - MAD registration request
|
||||
* @id - Set by the kernel; used to identify agent in future requests.
|
||||
* @qpn - Queue pair number; must be 0 or 1.
|
||||
* @method_mask - The caller will receive unsolicited MADs for any method
|
||||
* where @method_mask = 1.
|
||||
* @mgmt_class - Indicates which management class of MADs should be receive
|
||||
* by the caller. This field is only required if the user wishes to
|
||||
* receive unsolicited MADs, otherwise it should be 0.
|
||||
* @mgmt_class_version - Indicates which version of MADs for the given
|
||||
* management class to receive.
|
||||
* @oui: Indicates IEEE OUI when mgmt_class is a vendor class
|
||||
* in the range from 0x30 to 0x4f. Otherwise not used.
|
||||
* @rmpp_version: If set, indicates the RMPP version used.
|
||||
*
|
||||
*/
|
||||
struct ib_user_mad_reg_req {
|
||||
__u32 id;
|
||||
__u32 method_mask[4];
|
||||
__u8 qpn;
|
||||
__u8 mgmt_class;
|
||||
__u8 mgmt_class_version;
|
||||
__u8 oui[3];
|
||||
__u8 rmpp_version;
|
||||
};
|
||||
|
||||
#define IB_IOCTL_MAGIC 0x1b
|
||||
|
||||
#define IB_USER_MAD_REGISTER_AGENT _IOWR(IB_IOCTL_MAGIC, 1, \
|
||||
struct ib_user_mad_reg_req)
|
||||
|
||||
#define IB_USER_MAD_UNREGISTER_AGENT _IOW(IB_IOCTL_MAGIC, 2, __u32)
|
||||
|
||||
#endif /* IB_USER_MAD_H */
|
||||
422
include/rdma/ib_user_verbs.h
Normal file
422
include/rdma/ib_user_verbs.h
Normal file
|
|
@ -0,0 +1,422 @@
|
|||
/*
|
||||
* Copyright (c) 2005 Topspin Communications. All rights reserved.
|
||||
* Copyright (c) 2005 Cisco Systems. All rights reserved.
|
||||
*
|
||||
* This software is available to you under a choice of one of two
|
||||
* licenses. You may choose to be licensed under the terms of the GNU
|
||||
* General Public License (GPL) Version 2, available from the file
|
||||
* COPYING in the main directory of this source tree, or the
|
||||
* OpenIB.org BSD license below:
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following
|
||||
* conditions are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* $Id: ib_user_verbs.h 2708 2005-06-24 17:27:21Z roland $
|
||||
*/
|
||||
|
||||
#ifndef IB_USER_VERBS_H
|
||||
#define IB_USER_VERBS_H
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
/*
|
||||
* Increment this value if any changes that break userspace ABI
|
||||
* compatibility are made.
|
||||
*/
|
||||
#define IB_USER_VERBS_ABI_VERSION 1
|
||||
|
||||
enum {
|
||||
IB_USER_VERBS_CMD_QUERY_PARAMS,
|
||||
IB_USER_VERBS_CMD_GET_CONTEXT,
|
||||
IB_USER_VERBS_CMD_QUERY_DEVICE,
|
||||
IB_USER_VERBS_CMD_QUERY_PORT,
|
||||
IB_USER_VERBS_CMD_QUERY_GID,
|
||||
IB_USER_VERBS_CMD_QUERY_PKEY,
|
||||
IB_USER_VERBS_CMD_ALLOC_PD,
|
||||
IB_USER_VERBS_CMD_DEALLOC_PD,
|
||||
IB_USER_VERBS_CMD_CREATE_AH,
|
||||
IB_USER_VERBS_CMD_MODIFY_AH,
|
||||
IB_USER_VERBS_CMD_QUERY_AH,
|
||||
IB_USER_VERBS_CMD_DESTROY_AH,
|
||||
IB_USER_VERBS_CMD_REG_MR,
|
||||
IB_USER_VERBS_CMD_REG_SMR,
|
||||
IB_USER_VERBS_CMD_REREG_MR,
|
||||
IB_USER_VERBS_CMD_QUERY_MR,
|
||||
IB_USER_VERBS_CMD_DEREG_MR,
|
||||
IB_USER_VERBS_CMD_ALLOC_MW,
|
||||
IB_USER_VERBS_CMD_BIND_MW,
|
||||
IB_USER_VERBS_CMD_DEALLOC_MW,
|
||||
IB_USER_VERBS_CMD_CREATE_CQ,
|
||||
IB_USER_VERBS_CMD_RESIZE_CQ,
|
||||
IB_USER_VERBS_CMD_DESTROY_CQ,
|
||||
IB_USER_VERBS_CMD_POLL_CQ,
|
||||
IB_USER_VERBS_CMD_PEEK_CQ,
|
||||
IB_USER_VERBS_CMD_REQ_NOTIFY_CQ,
|
||||
IB_USER_VERBS_CMD_CREATE_QP,
|
||||
IB_USER_VERBS_CMD_QUERY_QP,
|
||||
IB_USER_VERBS_CMD_MODIFY_QP,
|
||||
IB_USER_VERBS_CMD_DESTROY_QP,
|
||||
IB_USER_VERBS_CMD_POST_SEND,
|
||||
IB_USER_VERBS_CMD_POST_RECV,
|
||||
IB_USER_VERBS_CMD_ATTACH_MCAST,
|
||||
IB_USER_VERBS_CMD_DETACH_MCAST,
|
||||
IB_USER_VERBS_CMD_CREATE_SRQ,
|
||||
IB_USER_VERBS_CMD_MODIFY_SRQ,
|
||||
IB_USER_VERBS_CMD_QUERY_SRQ,
|
||||
IB_USER_VERBS_CMD_DESTROY_SRQ,
|
||||
IB_USER_VERBS_CMD_POST_SRQ_RECV
|
||||
};
|
||||
|
||||
/*
|
||||
* Make sure that all structs defined in this file remain laid out so
|
||||
* that they pack the same way on 32-bit and 64-bit architectures (to
|
||||
* avoid incompatibility between 32-bit userspace and 64-bit kernels).
|
||||
* In particular do not use pointer types -- pass pointers in __u64
|
||||
* instead.
|
||||
*/
|
||||
|
||||
struct ib_uverbs_async_event_desc {
|
||||
__u64 element;
|
||||
__u32 event_type; /* enum ib_event_type */
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct ib_uverbs_comp_event_desc {
|
||||
__u64 cq_handle;
|
||||
};
|
||||
|
||||
/*
|
||||
* All commands from userspace should start with a __u32 command field
|
||||
* followed by __u16 in_words and out_words fields (which give the
|
||||
* length of the command block and response buffer if any in 32-bit
|
||||
* words). The kernel driver will read these fields first and read
|
||||
* the rest of the command struct based on these value.
|
||||
*/
|
||||
|
||||
struct ib_uverbs_cmd_hdr {
|
||||
__u32 command;
|
||||
__u16 in_words;
|
||||
__u16 out_words;
|
||||
};
|
||||
|
||||
/*
|
||||
* No driver_data for "query params" command, since this is intended
|
||||
* to be a core function with no possible device dependence.
|
||||
*/
|
||||
struct ib_uverbs_query_params {
|
||||
__u64 response;
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_params_resp {
|
||||
__u32 num_cq_events;
|
||||
};
|
||||
|
||||
struct ib_uverbs_get_context {
|
||||
__u64 response;
|
||||
__u64 cq_fd_tab;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_get_context_resp {
|
||||
__u32 async_fd;
|
||||
__u32 reserved;
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_device {
|
||||
__u64 response;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_device_resp {
|
||||
__u64 fw_ver;
|
||||
__be64 node_guid;
|
||||
__be64 sys_image_guid;
|
||||
__u64 max_mr_size;
|
||||
__u64 page_size_cap;
|
||||
__u32 vendor_id;
|
||||
__u32 vendor_part_id;
|
||||
__u32 hw_ver;
|
||||
__u32 max_qp;
|
||||
__u32 max_qp_wr;
|
||||
__u32 device_cap_flags;
|
||||
__u32 max_sge;
|
||||
__u32 max_sge_rd;
|
||||
__u32 max_cq;
|
||||
__u32 max_cqe;
|
||||
__u32 max_mr;
|
||||
__u32 max_pd;
|
||||
__u32 max_qp_rd_atom;
|
||||
__u32 max_ee_rd_atom;
|
||||
__u32 max_res_rd_atom;
|
||||
__u32 max_qp_init_rd_atom;
|
||||
__u32 max_ee_init_rd_atom;
|
||||
__u32 atomic_cap;
|
||||
__u32 max_ee;
|
||||
__u32 max_rdd;
|
||||
__u32 max_mw;
|
||||
__u32 max_raw_ipv6_qp;
|
||||
__u32 max_raw_ethy_qp;
|
||||
__u32 max_mcast_grp;
|
||||
__u32 max_mcast_qp_attach;
|
||||
__u32 max_total_mcast_qp_attach;
|
||||
__u32 max_ah;
|
||||
__u32 max_fmr;
|
||||
__u32 max_map_per_fmr;
|
||||
__u32 max_srq;
|
||||
__u32 max_srq_wr;
|
||||
__u32 max_srq_sge;
|
||||
__u16 max_pkeys;
|
||||
__u8 local_ca_ack_delay;
|
||||
__u8 phys_port_cnt;
|
||||
__u8 reserved[4];
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_port {
|
||||
__u64 response;
|
||||
__u8 port_num;
|
||||
__u8 reserved[7];
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_port_resp {
|
||||
__u32 port_cap_flags;
|
||||
__u32 max_msg_sz;
|
||||
__u32 bad_pkey_cntr;
|
||||
__u32 qkey_viol_cntr;
|
||||
__u32 gid_tbl_len;
|
||||
__u16 pkey_tbl_len;
|
||||
__u16 lid;
|
||||
__u16 sm_lid;
|
||||
__u8 state;
|
||||
__u8 max_mtu;
|
||||
__u8 active_mtu;
|
||||
__u8 lmc;
|
||||
__u8 max_vl_num;
|
||||
__u8 sm_sl;
|
||||
__u8 subnet_timeout;
|
||||
__u8 init_type_reply;
|
||||
__u8 active_width;
|
||||
__u8 active_speed;
|
||||
__u8 phys_state;
|
||||
__u8 reserved[3];
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_gid {
|
||||
__u64 response;
|
||||
__u8 port_num;
|
||||
__u8 index;
|
||||
__u8 reserved[6];
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_gid_resp {
|
||||
__u8 gid[16];
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_pkey {
|
||||
__u64 response;
|
||||
__u8 port_num;
|
||||
__u8 index;
|
||||
__u8 reserved[6];
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_query_pkey_resp {
|
||||
__u16 pkey;
|
||||
__u16 reserved;
|
||||
};
|
||||
|
||||
struct ib_uverbs_alloc_pd {
|
||||
__u64 response;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_alloc_pd_resp {
|
||||
__u32 pd_handle;
|
||||
};
|
||||
|
||||
struct ib_uverbs_dealloc_pd {
|
||||
__u32 pd_handle;
|
||||
};
|
||||
|
||||
struct ib_uverbs_reg_mr {
|
||||
__u64 response;
|
||||
__u64 start;
|
||||
__u64 length;
|
||||
__u64 hca_va;
|
||||
__u32 pd_handle;
|
||||
__u32 access_flags;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_reg_mr_resp {
|
||||
__u32 mr_handle;
|
||||
__u32 lkey;
|
||||
__u32 rkey;
|
||||
};
|
||||
|
||||
struct ib_uverbs_dereg_mr {
|
||||
__u32 mr_handle;
|
||||
};
|
||||
|
||||
struct ib_uverbs_create_cq {
|
||||
__u64 response;
|
||||
__u64 user_handle;
|
||||
__u32 cqe;
|
||||
__u32 event_handler;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_create_cq_resp {
|
||||
__u32 cq_handle;
|
||||
__u32 cqe;
|
||||
};
|
||||
|
||||
struct ib_uverbs_destroy_cq {
|
||||
__u32 cq_handle;
|
||||
};
|
||||
|
||||
struct ib_uverbs_create_qp {
|
||||
__u64 response;
|
||||
__u64 user_handle;
|
||||
__u32 pd_handle;
|
||||
__u32 send_cq_handle;
|
||||
__u32 recv_cq_handle;
|
||||
__u32 srq_handle;
|
||||
__u32 max_send_wr;
|
||||
__u32 max_recv_wr;
|
||||
__u32 max_send_sge;
|
||||
__u32 max_recv_sge;
|
||||
__u32 max_inline_data;
|
||||
__u8 sq_sig_all;
|
||||
__u8 qp_type;
|
||||
__u8 is_srq;
|
||||
__u8 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_create_qp_resp {
|
||||
__u32 qp_handle;
|
||||
__u32 qpn;
|
||||
};
|
||||
|
||||
/*
|
||||
* This struct needs to remain a multiple of 8 bytes to keep the
|
||||
* alignment of the modify QP parameters.
|
||||
*/
|
||||
struct ib_uverbs_qp_dest {
|
||||
__u8 dgid[16];
|
||||
__u32 flow_label;
|
||||
__u16 dlid;
|
||||
__u16 reserved;
|
||||
__u8 sgid_index;
|
||||
__u8 hop_limit;
|
||||
__u8 traffic_class;
|
||||
__u8 sl;
|
||||
__u8 src_path_bits;
|
||||
__u8 static_rate;
|
||||
__u8 is_global;
|
||||
__u8 port_num;
|
||||
};
|
||||
|
||||
struct ib_uverbs_modify_qp {
|
||||
struct ib_uverbs_qp_dest dest;
|
||||
struct ib_uverbs_qp_dest alt_dest;
|
||||
__u32 qp_handle;
|
||||
__u32 attr_mask;
|
||||
__u32 qkey;
|
||||
__u32 rq_psn;
|
||||
__u32 sq_psn;
|
||||
__u32 dest_qp_num;
|
||||
__u32 qp_access_flags;
|
||||
__u16 pkey_index;
|
||||
__u16 alt_pkey_index;
|
||||
__u8 qp_state;
|
||||
__u8 cur_qp_state;
|
||||
__u8 path_mtu;
|
||||
__u8 path_mig_state;
|
||||
__u8 en_sqd_async_notify;
|
||||
__u8 max_rd_atomic;
|
||||
__u8 max_dest_rd_atomic;
|
||||
__u8 min_rnr_timer;
|
||||
__u8 port_num;
|
||||
__u8 timeout;
|
||||
__u8 retry_cnt;
|
||||
__u8 rnr_retry;
|
||||
__u8 alt_port_num;
|
||||
__u8 alt_timeout;
|
||||
__u8 reserved[2];
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_modify_qp_resp {
|
||||
};
|
||||
|
||||
struct ib_uverbs_destroy_qp {
|
||||
__u32 qp_handle;
|
||||
};
|
||||
|
||||
struct ib_uverbs_attach_mcast {
|
||||
__u8 gid[16];
|
||||
__u32 qp_handle;
|
||||
__u16 mlid;
|
||||
__u16 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_detach_mcast {
|
||||
__u8 gid[16];
|
||||
__u32 qp_handle;
|
||||
__u16 mlid;
|
||||
__u16 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_create_srq {
|
||||
__u64 response;
|
||||
__u64 user_handle;
|
||||
__u32 pd_handle;
|
||||
__u32 max_wr;
|
||||
__u32 max_sge;
|
||||
__u32 srq_limit;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_create_srq_resp {
|
||||
__u32 srq_handle;
|
||||
};
|
||||
|
||||
struct ib_uverbs_modify_srq {
|
||||
__u32 srq_handle;
|
||||
__u32 attr_mask;
|
||||
__u32 max_wr;
|
||||
__u32 max_sge;
|
||||
__u32 srq_limit;
|
||||
__u32 reserved;
|
||||
__u64 driver_data[0];
|
||||
};
|
||||
|
||||
struct ib_uverbs_destroy_srq {
|
||||
__u32 srq_handle;
|
||||
};
|
||||
|
||||
#endif /* IB_USER_VERBS_H */
|
||||
1461
include/rdma/ib_verbs.h
Normal file
1461
include/rdma/ib_verbs.h
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue