nes.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. /*
  2. * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
  3. * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
  4. *
  5. * This software is available to you under a choice of one of two
  6. * licenses. You may choose to be licensed under the terms of the GNU
  7. * General Public License (GPL) Version 2, available from the file
  8. * COPYING in the main directory of this source tree, or the
  9. * OpenIB.org BSD license below:
  10. *
  11. * Redistribution and use in source and binary forms, with or
  12. * without modification, are permitted provided that the following
  13. * conditions are met:
  14. *
  15. * - Redistributions of source code must retain the above
  16. * copyright notice, this list of conditions and the following
  17. * disclaimer.
  18. *
  19. * - Redistributions in binary form must reproduce the above
  20. * copyright notice, this list of conditions and the following
  21. * disclaimer in the documentation and/or other materials
  22. * provided with the distribution.
  23. *
  24. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  28. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  29. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  30. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  31. * SOFTWARE.
  32. */
  33. #ifndef __NES_H
  34. #define __NES_H
  35. #include <linux/netdevice.h>
  36. #include <linux/inetdevice.h>
  37. #include <linux/interrupt.h>
  38. #include <linux/spinlock.h>
  39. #include <linux/kernel.h>
  40. #include <linux/delay.h>
  41. #include <linux/pci.h>
  42. #include <linux/dma-mapping.h>
  43. #include <linux/workqueue.h>
  44. #include <linux/slab.h>
  45. #include <asm/io.h>
  46. #include <linux/crc32c.h>
  47. #include <rdma/ib_smi.h>
  48. #include <rdma/ib_verbs.h>
  49. #include <rdma/ib_pack.h>
  50. #include <rdma/rdma_cm.h>
  51. #include <rdma/iw_cm.h>
  52. #include <rdma/rdma_netlink.h>
  53. #include <rdma/iw_portmap.h>
  54. #define NES_SEND_FIRST_WRITE
  55. #define QUEUE_DISCONNECTS
  56. #define DRV_NAME "iw_nes"
  57. #define DRV_VERSION "1.5.0.1"
  58. #define PFX DRV_NAME ": "
  59. /*
  60. * NetEffect PCI vendor id and NE010 PCI device id.
  61. */
  62. #ifndef PCI_VENDOR_ID_NETEFFECT /* not in pci.ids yet */
  63. #define PCI_VENDOR_ID_NETEFFECT 0x1678
  64. #define PCI_DEVICE_ID_NETEFFECT_NE020 0x0100
  65. #define PCI_DEVICE_ID_NETEFFECT_NE020_KR 0x0110
  66. #endif
  67. #define NE020_REV 4
  68. #define NE020_REV1 5
  69. #define BAR_0 0
  70. #define BAR_1 2
  71. #define RX_BUF_SIZE (1536 + 8)
  72. #define NES_REG0_SIZE (4 * 1024)
  73. #define NES_TX_TIMEOUT (6*HZ)
  74. #define NES_FIRST_QPN 64
  75. #define NES_SW_CONTEXT_ALIGN 1024
  76. #define NES_MAX_MTU 9000
  77. #define NES_NIC_MAX_NICS 16
  78. #define NES_MAX_ARP_TABLE_SIZE 4096
  79. #define NES_NIC_CEQ_SIZE 8
  80. /* NICs will be on a separate CQ */
  81. #define NES_CCEQ_SIZE ((nesadapter->max_cq / nesadapter->port_count) - 32)
  82. #define NES_MAX_PORT_COUNT 4
  83. #define MAX_DPC_ITERATIONS 128
  84. #define NES_DRV_OPT_ENABLE_MPA_VER_0 0x00000001
  85. #define NES_DRV_OPT_DISABLE_MPA_CRC 0x00000002
  86. #define NES_DRV_OPT_DISABLE_FIRST_WRITE 0x00000004
  87. #define NES_DRV_OPT_DISABLE_INTF 0x00000008
  88. #define NES_DRV_OPT_ENABLE_MSI 0x00000010
  89. #define NES_DRV_OPT_DUAL_LOGICAL_PORT 0x00000020
  90. #define NES_DRV_OPT_SUPRESS_OPTION_BC 0x00000040
  91. #define NES_DRV_OPT_NO_INLINE_DATA 0x00000080
  92. #define NES_DRV_OPT_DISABLE_INT_MOD 0x00000100
  93. #define NES_DRV_OPT_DISABLE_VIRT_WQ 0x00000200
  94. #define NES_DRV_OPT_ENABLE_PAU 0x00000400
  95. #define NES_AEQ_EVENT_TIMEOUT 2500
  96. #define NES_DISCONNECT_EVENT_TIMEOUT 2000
  97. /* debug levels */
  98. /* must match userspace */
  99. #define NES_DBG_HW 0x00000001
  100. #define NES_DBG_INIT 0x00000002
  101. #define NES_DBG_ISR 0x00000004
  102. #define NES_DBG_PHY 0x00000008
  103. #define NES_DBG_NETDEV 0x00000010
  104. #define NES_DBG_CM 0x00000020
  105. #define NES_DBG_CM1 0x00000040
  106. #define NES_DBG_NIC_RX 0x00000080
  107. #define NES_DBG_NIC_TX 0x00000100
  108. #define NES_DBG_CQP 0x00000200
  109. #define NES_DBG_MMAP 0x00000400
  110. #define NES_DBG_MR 0x00000800
  111. #define NES_DBG_PD 0x00001000
  112. #define NES_DBG_CQ 0x00002000
  113. #define NES_DBG_QP 0x00004000
  114. #define NES_DBG_MOD_QP 0x00008000
  115. #define NES_DBG_AEQ 0x00010000
  116. #define NES_DBG_IW_RX 0x00020000
  117. #define NES_DBG_IW_TX 0x00040000
  118. #define NES_DBG_SHUTDOWN 0x00080000
  119. #define NES_DBG_PAU 0x00100000
  120. #define NES_DBG_NLMSG 0x00200000
  121. #define NES_DBG_RSVD1 0x10000000
  122. #define NES_DBG_RSVD2 0x20000000
  123. #define NES_DBG_RSVD3 0x40000000
  124. #define NES_DBG_RSVD4 0x80000000
  125. #define NES_DBG_ALL 0xffffffff
  126. #ifdef CONFIG_INFINIBAND_NES_DEBUG
  127. #define nes_debug(level, fmt, args...) \
  128. do { \
  129. if (level & nes_debug_level) \
  130. printk(KERN_ERR PFX "%s[%u]: " fmt, __func__, __LINE__, ##args); \
  131. } while (0)
  132. #define assert(expr) \
  133. do { \
  134. if (!(expr)) { \
  135. printk(KERN_ERR PFX "Assertion failed! %s, %s, %s, line %d\n", \
  136. #expr, __FILE__, __func__, __LINE__); \
  137. } \
  138. } while (0)
  139. #define NES_EVENT_TIMEOUT 1200000
  140. #else
  141. #define nes_debug(level, fmt, args...) no_printk(fmt, ##args)
  142. #define assert(expr) do {} while (0)
  143. #define NES_EVENT_TIMEOUT 100000
  144. #endif
  145. #include "nes_hw.h"
  146. #include "nes_verbs.h"
  147. #include "nes_context.h"
  148. #include <rdma/nes-abi.h>
  149. #include "nes_cm.h"
  150. #include "nes_mgt.h"
  151. extern int interrupt_mod_interval;
  152. extern int nes_if_count;
  153. extern int mpa_version;
  154. extern int disable_mpa_crc;
  155. extern unsigned int nes_drv_opt;
  156. extern unsigned int nes_debug_level;
  157. extern unsigned int wqm_quanta;
  158. extern struct list_head nes_adapter_list;
  159. extern atomic_t cm_connects;
  160. extern atomic_t cm_accepts;
  161. extern atomic_t cm_disconnects;
  162. extern atomic_t cm_closes;
  163. extern atomic_t cm_connecteds;
  164. extern atomic_t cm_connect_reqs;
  165. extern atomic_t cm_rejects;
  166. extern atomic_t mod_qp_timouts;
  167. extern atomic_t qps_created;
  168. extern atomic_t qps_destroyed;
  169. extern atomic_t sw_qps_destroyed;
  170. extern u32 mh_detected;
  171. extern u32 mh_pauses_sent;
  172. extern u32 cm_packets_sent;
  173. extern u32 cm_packets_bounced;
  174. extern u32 cm_packets_created;
  175. extern u32 cm_packets_received;
  176. extern u32 cm_packets_dropped;
  177. extern u32 cm_packets_retrans;
  178. extern atomic_t cm_listens_created;
  179. extern atomic_t cm_listens_destroyed;
  180. extern u32 cm_backlog_drops;
  181. extern atomic_t cm_loopbacks;
  182. extern atomic_t cm_nodes_created;
  183. extern atomic_t cm_nodes_destroyed;
  184. extern atomic_t cm_accel_dropped_pkts;
  185. extern atomic_t cm_resets_recvd;
  186. extern atomic_t pau_qps_created;
  187. extern atomic_t pau_qps_destroyed;
  188. extern u32 int_mod_timer_init;
  189. extern u32 int_mod_cq_depth_256;
  190. extern u32 int_mod_cq_depth_128;
  191. extern u32 int_mod_cq_depth_32;
  192. extern u32 int_mod_cq_depth_24;
  193. extern u32 int_mod_cq_depth_16;
  194. extern u32 int_mod_cq_depth_4;
  195. extern u32 int_mod_cq_depth_1;
  196. struct nes_device {
  197. struct nes_adapter *nesadapter;
  198. void __iomem *regs;
  199. void __iomem *index_reg;
  200. struct pci_dev *pcidev;
  201. struct net_device *netdev[NES_NIC_MAX_NICS];
  202. u64 link_status_interrupts;
  203. struct tasklet_struct dpc_tasklet;
  204. spinlock_t indexed_regs_lock;
  205. unsigned long csr_start;
  206. unsigned long doorbell_region;
  207. unsigned long doorbell_start;
  208. unsigned long mac_tx_errors;
  209. unsigned long mac_pause_frames_sent;
  210. unsigned long mac_pause_frames_received;
  211. unsigned long mac_rx_errors;
  212. unsigned long mac_rx_crc_errors;
  213. unsigned long mac_rx_symbol_err_frames;
  214. unsigned long mac_rx_jabber_frames;
  215. unsigned long mac_rx_oversized_frames;
  216. unsigned long mac_rx_short_frames;
  217. unsigned long port_rx_discards;
  218. unsigned long port_tx_discards;
  219. unsigned int mac_index;
  220. unsigned int nes_stack_start;
  221. /* Control Structures */
  222. void *cqp_vbase;
  223. dma_addr_t cqp_pbase;
  224. u32 cqp_mem_size;
  225. u8 ceq_index;
  226. u8 nic_ceq_index;
  227. struct nes_hw_cqp cqp;
  228. struct nes_hw_cq ccq;
  229. struct list_head cqp_avail_reqs;
  230. struct list_head cqp_pending_reqs;
  231. struct nes_cqp_request *nes_cqp_requests;
  232. u32 int_req;
  233. u32 int_stat;
  234. u32 timer_int_req;
  235. u32 timer_only_int_count;
  236. u32 intf_int_req;
  237. u32 last_mac_tx_pauses;
  238. u32 last_used_chunks_tx;
  239. struct list_head list;
  240. u16 base_doorbell_index;
  241. u16 currcq_count;
  242. u16 deepcq_count;
  243. u8 iw_status;
  244. u8 msi_enabled;
  245. u8 netdev_count;
  246. u8 napi_isr_ran;
  247. u8 disable_rx_flow_control;
  248. u8 disable_tx_flow_control;
  249. struct delayed_work work;
  250. u8 link_recheck;
  251. };
  252. /* Receive skb private area - must fit in skb->cb area */
  253. struct nes_rskb_cb {
  254. u64 busaddr;
  255. u32 maplen;
  256. u32 seqnum;
  257. u8 *data_start;
  258. struct nes_qp *nesqp;
  259. };
  260. static inline __le32 get_crc_value(struct nes_v4_quad *nes_quad)
  261. {
  262. u32 crc_value;
  263. crc_value = crc32c(~0, (void *)nes_quad, sizeof (struct nes_v4_quad));
  264. /*
  265. * With commit ef19454b ("[LIB] crc32c: Keep intermediate crc
  266. * state in cpu order"), behavior of crc32c changes on
  267. * big-endian platforms. Our algorithm expects the previous
  268. * behavior; otherwise we have RDMA connection establishment
  269. * issue on big-endian.
  270. */
  271. return cpu_to_le32(crc_value);
  272. }
  273. static inline void
  274. set_wqe_64bit_value(__le32 *wqe_words, u32 index, u64 value)
  275. {
  276. wqe_words[index] = cpu_to_le32((u32) value);
  277. wqe_words[index + 1] = cpu_to_le32(upper_32_bits(value));
  278. }
  279. static inline void
  280. set_wqe_32bit_value(__le32 *wqe_words, u32 index, u32 value)
  281. {
  282. wqe_words[index] = cpu_to_le32(value);
  283. }
  284. static inline void
  285. nes_fill_init_cqp_wqe(struct nes_hw_cqp_wqe *cqp_wqe, struct nes_device *nesdev)
  286. {
  287. cqp_wqe->wqe_words[NES_CQP_WQE_COMP_CTX_LOW_IDX] = 0;
  288. cqp_wqe->wqe_words[NES_CQP_WQE_COMP_CTX_HIGH_IDX] = 0;
  289. cqp_wqe->wqe_words[NES_CQP_WQE_COMP_SCRATCH_LOW_IDX] = 0;
  290. cqp_wqe->wqe_words[NES_CQP_WQE_COMP_SCRATCH_HIGH_IDX] = 0;
  291. cqp_wqe->wqe_words[NES_CQP_STAG_WQE_PBL_BLK_COUNT_IDX] = 0;
  292. cqp_wqe->wqe_words[NES_CQP_STAG_WQE_PBL_LEN_IDX] = 0;
  293. cqp_wqe->wqe_words[NES_CQP_STAG_WQE_LEN_LOW_IDX] = 0;
  294. cqp_wqe->wqe_words[NES_CQP_STAG_WQE_PA_LOW_IDX] = 0;
  295. cqp_wqe->wqe_words[NES_CQP_STAG_WQE_PA_HIGH_IDX] = 0;
  296. }
  297. static inline void
  298. nes_fill_init_qp_wqe(struct nes_hw_qp_wqe *wqe, struct nes_qp *nesqp, u32 head)
  299. {
  300. u32 value;
  301. value = ((u32)((unsigned long) nesqp)) | head;
  302. set_wqe_32bit_value(wqe->wqe_words, NES_IWARP_SQ_WQE_COMP_CTX_HIGH_IDX,
  303. (u32)(upper_32_bits((unsigned long)(nesqp))));
  304. set_wqe_32bit_value(wqe->wqe_words, NES_IWARP_SQ_WQE_COMP_CTX_LOW_IDX, value);
  305. }
  306. /* Read from memory-mapped device */
  307. static inline u32 nes_read_indexed(struct nes_device *nesdev, u32 reg_index)
  308. {
  309. unsigned long flags;
  310. void __iomem *addr = nesdev->index_reg;
  311. u32 value;
  312. spin_lock_irqsave(&nesdev->indexed_regs_lock, flags);
  313. writel(reg_index, addr);
  314. value = readl((void __iomem *)addr + 4);
  315. spin_unlock_irqrestore(&nesdev->indexed_regs_lock, flags);
  316. return value;
  317. }
  318. static inline u32 nes_read32(const void __iomem *addr)
  319. {
  320. return readl(addr);
  321. }
  322. static inline u16 nes_read16(const void __iomem *addr)
  323. {
  324. return readw(addr);
  325. }
  326. static inline u8 nes_read8(const void __iomem *addr)
  327. {
  328. return readb(addr);
  329. }
  330. /* Write to memory-mapped device */
  331. static inline void nes_write_indexed(struct nes_device *nesdev, u32 reg_index, u32 val)
  332. {
  333. unsigned long flags;
  334. void __iomem *addr = nesdev->index_reg;
  335. spin_lock_irqsave(&nesdev->indexed_regs_lock, flags);
  336. writel(reg_index, addr);
  337. writel(val, (void __iomem *)addr + 4);
  338. spin_unlock_irqrestore(&nesdev->indexed_regs_lock, flags);
  339. }
  340. static inline void nes_write32(void __iomem *addr, u32 val)
  341. {
  342. writel(val, addr);
  343. }
  344. static inline void nes_write16(void __iomem *addr, u16 val)
  345. {
  346. writew(val, addr);
  347. }
  348. static inline void nes_write8(void __iomem *addr, u8 val)
  349. {
  350. writeb(val, addr);
  351. }
  352. enum nes_resource {
  353. NES_RESOURCE_MW = 1,
  354. NES_RESOURCE_FAST_MR,
  355. NES_RESOURCE_PHYS_MR,
  356. NES_RESOURCE_USER_MR,
  357. NES_RESOURCE_PD,
  358. NES_RESOURCE_QP,
  359. NES_RESOURCE_CQ,
  360. NES_RESOURCE_ARP
  361. };
  362. static inline int nes_alloc_resource(struct nes_adapter *nesadapter,
  363. unsigned long *resource_array, u32 max_resources,
  364. u32 *req_resource_num, u32 *next, enum nes_resource resource_type)
  365. {
  366. unsigned long flags;
  367. u32 resource_num;
  368. spin_lock_irqsave(&nesadapter->resource_lock, flags);
  369. resource_num = find_next_zero_bit(resource_array, max_resources, *next);
  370. if (resource_num >= max_resources) {
  371. resource_num = find_first_zero_bit(resource_array, max_resources);
  372. if (resource_num >= max_resources) {
  373. printk(KERN_ERR PFX "%s: No available resources [type=%u].\n", __func__, resource_type);
  374. spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
  375. return -EMFILE;
  376. }
  377. }
  378. set_bit(resource_num, resource_array);
  379. *next = resource_num+1;
  380. if (*next == max_resources) {
  381. *next = 0;
  382. }
  383. spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
  384. *req_resource_num = resource_num;
  385. return 0;
  386. }
  387. static inline int nes_is_resource_allocated(struct nes_adapter *nesadapter,
  388. unsigned long *resource_array, u32 resource_num)
  389. {
  390. unsigned long flags;
  391. int bit_is_set;
  392. spin_lock_irqsave(&nesadapter->resource_lock, flags);
  393. bit_is_set = test_bit(resource_num, resource_array);
  394. nes_debug(NES_DBG_HW, "resource_num %u is%s allocated.\n",
  395. resource_num, (bit_is_set ? "": " not"));
  396. spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
  397. return bit_is_set;
  398. }
  399. static inline void nes_free_resource(struct nes_adapter *nesadapter,
  400. unsigned long *resource_array, u32 resource_num)
  401. {
  402. unsigned long flags;
  403. spin_lock_irqsave(&nesadapter->resource_lock, flags);
  404. clear_bit(resource_num, resource_array);
  405. spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
  406. }
  407. static inline struct nes_vnic *to_nesvnic(struct ib_device *ibdev)
  408. {
  409. return container_of(ibdev, struct nes_ib_device, ibdev)->nesvnic;
  410. }
  411. static inline struct nes_pd *to_nespd(struct ib_pd *ibpd)
  412. {
  413. return container_of(ibpd, struct nes_pd, ibpd);
  414. }
  415. static inline struct nes_ucontext *to_nesucontext(struct ib_ucontext *ibucontext)
  416. {
  417. return container_of(ibucontext, struct nes_ucontext, ibucontext);
  418. }
  419. static inline struct nes_mr *to_nesmr(struct ib_mr *ibmr)
  420. {
  421. return container_of(ibmr, struct nes_mr, ibmr);
  422. }
  423. static inline struct nes_mr *to_nesmr_from_ibfmr(struct ib_fmr *ibfmr)
  424. {
  425. return container_of(ibfmr, struct nes_mr, ibfmr);
  426. }
  427. static inline struct nes_mr *to_nesmw(struct ib_mw *ibmw)
  428. {
  429. return container_of(ibmw, struct nes_mr, ibmw);
  430. }
  431. static inline struct nes_fmr *to_nesfmr(struct nes_mr *nesmr)
  432. {
  433. return container_of(nesmr, struct nes_fmr, nesmr);
  434. }
  435. static inline struct nes_cq *to_nescq(struct ib_cq *ibcq)
  436. {
  437. return container_of(ibcq, struct nes_cq, ibcq);
  438. }
  439. static inline struct nes_qp *to_nesqp(struct ib_qp *ibqp)
  440. {
  441. return container_of(ibqp, struct nes_qp, ibqp);
  442. }
  443. /* nes.c */
  444. void nes_add_ref(struct ib_qp *);
  445. void nes_rem_ref(struct ib_qp *);
  446. struct ib_qp *nes_get_qp(struct ib_device *, int);
  447. /* nes_hw.c */
  448. struct nes_adapter *nes_init_adapter(struct nes_device *, u8);
  449. void nes_nic_init_timer_defaults(struct nes_device *, u8);
  450. void nes_destroy_adapter(struct nes_adapter *);
  451. int nes_init_cqp(struct nes_device *);
  452. int nes_init_phy(struct nes_device *);
  453. int nes_init_nic_qp(struct nes_device *, struct net_device *);
  454. void nes_destroy_nic_qp(struct nes_vnic *);
  455. int nes_napi_isr(struct nes_device *);
  456. void nes_dpc(unsigned long);
  457. void nes_nic_ce_handler(struct nes_device *, struct nes_hw_nic_cq *);
  458. void nes_iwarp_ce_handler(struct nes_device *, struct nes_hw_cq *);
  459. int nes_destroy_cqp(struct nes_device *);
  460. int nes_nic_cm_xmit(struct sk_buff *, struct net_device *);
  461. void nes_recheck_link_status(struct work_struct *work);
  462. void nes_terminate_timeout(struct timer_list *t);
  463. /* nes_nic.c */
  464. struct net_device *nes_netdev_init(struct nes_device *, void __iomem *);
  465. void nes_netdev_destroy(struct net_device *);
  466. int nes_nic_cm_xmit(struct sk_buff *, struct net_device *);
  467. /* nes_cm.c */
  468. void *nes_cm_create(struct net_device *);
  469. int nes_cm_recv(struct sk_buff *, struct net_device *);
  470. void nes_update_arp(unsigned char *, u32, u32, u16, u16);
  471. void nes_manage_arp_cache(struct net_device *, unsigned char *, u32, u32);
  472. void nes_sock_release(struct nes_qp *, unsigned long *);
  473. void flush_wqes(struct nes_device *nesdev, struct nes_qp *, u32, u32);
  474. int nes_manage_apbvt(struct nes_vnic *, u32, u32, u32);
  475. int nes_cm_disconn(struct nes_qp *);
  476. void nes_cm_disconn_worker(void *);
  477. /* nes_verbs.c */
  478. int nes_hw_modify_qp(struct nes_device *, struct nes_qp *, u32, u32, u32);
  479. int nes_modify_qp(struct ib_qp *, struct ib_qp_attr *, int, struct ib_udata *);
  480. struct nes_ib_device *nes_init_ofa_device(struct net_device *);
  481. void nes_port_ibevent(struct nes_vnic *nesvnic);
  482. void nes_destroy_ofa_device(struct nes_ib_device *);
  483. int nes_register_ofa_device(struct nes_ib_device *);
  484. /* nes_util.c */
  485. int nes_read_eeprom_values(struct nes_device *, struct nes_adapter *);
  486. void nes_write_1G_phy_reg(struct nes_device *, u8, u8, u16);
  487. void nes_read_1G_phy_reg(struct nes_device *, u8, u8, u16 *);
  488. void nes_write_10G_phy_reg(struct nes_device *, u16, u8, u16, u16);
  489. void nes_read_10G_phy_reg(struct nes_device *, u8, u8, u16);
  490. struct nes_cqp_request *nes_get_cqp_request(struct nes_device *);
  491. void nes_free_cqp_request(struct nes_device *nesdev,
  492. struct nes_cqp_request *cqp_request);
  493. void nes_put_cqp_request(struct nes_device *nesdev,
  494. struct nes_cqp_request *cqp_request);
  495. void nes_post_cqp_request(struct nes_device *, struct nes_cqp_request *);
  496. int nes_arp_table(struct nes_device *, u32, u8 *, u32);
  497. void nes_mh_fix(struct timer_list *t);
  498. void nes_clc(struct timer_list *t);
  499. void nes_dump_mem(unsigned int, void *, int);
  500. u32 nes_crc32(u32, u32, u32, u32, u8 *, u32, u32, u32);
  501. #endif /* __NES_H */