mad.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. /*
  2. * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. #include <rdma/ib_mad.h>
  33. #include <rdma/ib_smi.h>
  34. #include <linux/mlx4/cmd.h>
  35. #include <linux/gfp.h>
  36. #include <rdma/ib_pma.h>
  37. #include "mlx4_ib.h"
  38. enum {
  39. MLX4_IB_VENDOR_CLASS1 = 0x9,
  40. MLX4_IB_VENDOR_CLASS2 = 0xa
  41. };
  42. int mlx4_MAD_IFC(struct mlx4_ib_dev *dev, int ignore_mkey, int ignore_bkey,
  43. int port, struct ib_wc *in_wc, struct ib_grh *in_grh,
  44. void *in_mad, void *response_mad)
  45. {
  46. struct mlx4_cmd_mailbox *inmailbox, *outmailbox;
  47. void *inbox;
  48. int err;
  49. u32 in_modifier = port;
  50. u8 op_modifier = 0;
  51. inmailbox = mlx4_alloc_cmd_mailbox(dev->dev);
  52. if (IS_ERR(inmailbox))
  53. return PTR_ERR(inmailbox);
  54. inbox = inmailbox->buf;
  55. outmailbox = mlx4_alloc_cmd_mailbox(dev->dev);
  56. if (IS_ERR(outmailbox)) {
  57. mlx4_free_cmd_mailbox(dev->dev, inmailbox);
  58. return PTR_ERR(outmailbox);
  59. }
  60. memcpy(inbox, in_mad, 256);
  61. /*
  62. * Key check traps can't be generated unless we have in_wc to
  63. * tell us where to send the trap.
  64. */
  65. if (ignore_mkey || !in_wc)
  66. op_modifier |= 0x1;
  67. if (ignore_bkey || !in_wc)
  68. op_modifier |= 0x2;
  69. if (in_wc) {
  70. struct {
  71. __be32 my_qpn;
  72. u32 reserved1;
  73. __be32 rqpn;
  74. u8 sl;
  75. u8 g_path;
  76. u16 reserved2[2];
  77. __be16 pkey;
  78. u32 reserved3[11];
  79. u8 grh[40];
  80. } *ext_info;
  81. memset(inbox + 256, 0, 256);
  82. ext_info = inbox + 256;
  83. ext_info->my_qpn = cpu_to_be32(in_wc->qp->qp_num);
  84. ext_info->rqpn = cpu_to_be32(in_wc->src_qp);
  85. ext_info->sl = in_wc->sl << 4;
  86. ext_info->g_path = in_wc->dlid_path_bits |
  87. (in_wc->wc_flags & IB_WC_GRH ? 0x80 : 0);
  88. ext_info->pkey = cpu_to_be16(in_wc->pkey_index);
  89. if (in_grh)
  90. memcpy(ext_info->grh, in_grh, 40);
  91. op_modifier |= 0x4;
  92. in_modifier |= in_wc->slid << 16;
  93. }
  94. err = mlx4_cmd_box(dev->dev, inmailbox->dma, outmailbox->dma,
  95. in_modifier, op_modifier,
  96. MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C,
  97. MLX4_CMD_NATIVE);
  98. if (!err)
  99. memcpy(response_mad, outmailbox->buf, 256);
  100. mlx4_free_cmd_mailbox(dev->dev, inmailbox);
  101. mlx4_free_cmd_mailbox(dev->dev, outmailbox);
  102. return err;
  103. }
  104. static void update_sm_ah(struct mlx4_ib_dev *dev, u8 port_num, u16 lid, u8 sl)
  105. {
  106. struct ib_ah *new_ah;
  107. struct ib_ah_attr ah_attr;
  108. if (!dev->send_agent[port_num - 1][0])
  109. return;
  110. memset(&ah_attr, 0, sizeof ah_attr);
  111. ah_attr.dlid = lid;
  112. ah_attr.sl = sl;
  113. ah_attr.port_num = port_num;
  114. new_ah = ib_create_ah(dev->send_agent[port_num - 1][0]->qp->pd,
  115. &ah_attr);
  116. if (IS_ERR(new_ah))
  117. return;
  118. spin_lock(&dev->sm_lock);
  119. if (dev->sm_ah[port_num - 1])
  120. ib_destroy_ah(dev->sm_ah[port_num - 1]);
  121. dev->sm_ah[port_num - 1] = new_ah;
  122. spin_unlock(&dev->sm_lock);
  123. }
  124. /*
  125. * Snoop SM MADs for port info, GUID info, and P_Key table sets, so we can
  126. * synthesize LID change, Client-Rereg, GID change, and P_Key change events.
  127. */
  128. static void smp_snoop(struct ib_device *ibdev, u8 port_num, struct ib_mad *mad,
  129. u16 prev_lid)
  130. {
  131. struct ib_port_info *pinfo;
  132. u16 lid;
  133. struct mlx4_ib_dev *dev = to_mdev(ibdev);
  134. if ((mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
  135. mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
  136. mad->mad_hdr.method == IB_MGMT_METHOD_SET)
  137. switch (mad->mad_hdr.attr_id) {
  138. case IB_SMP_ATTR_PORT_INFO:
  139. pinfo = (struct ib_port_info *) ((struct ib_smp *) mad)->data;
  140. lid = be16_to_cpu(pinfo->lid);
  141. update_sm_ah(dev, port_num,
  142. be16_to_cpu(pinfo->sm_lid),
  143. pinfo->neighbormtu_mastersmsl & 0xf);
  144. if (pinfo->clientrereg_resv_subnetto & 0x80)
  145. mlx4_ib_dispatch_event(dev, port_num,
  146. IB_EVENT_CLIENT_REREGISTER);
  147. if (prev_lid != lid)
  148. mlx4_ib_dispatch_event(dev, port_num,
  149. IB_EVENT_LID_CHANGE);
  150. break;
  151. case IB_SMP_ATTR_PKEY_TABLE:
  152. mlx4_ib_dispatch_event(dev, port_num,
  153. IB_EVENT_PKEY_CHANGE);
  154. break;
  155. case IB_SMP_ATTR_GUID_INFO:
  156. mlx4_ib_dispatch_event(dev, port_num,
  157. IB_EVENT_GID_CHANGE);
  158. break;
  159. default:
  160. break;
  161. }
  162. }
  163. static void node_desc_override(struct ib_device *dev,
  164. struct ib_mad *mad)
  165. {
  166. if ((mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
  167. mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
  168. mad->mad_hdr.method == IB_MGMT_METHOD_GET_RESP &&
  169. mad->mad_hdr.attr_id == IB_SMP_ATTR_NODE_DESC) {
  170. spin_lock(&to_mdev(dev)->sm_lock);
  171. memcpy(((struct ib_smp *) mad)->data, dev->node_desc, 64);
  172. spin_unlock(&to_mdev(dev)->sm_lock);
  173. }
  174. }
  175. static void forward_trap(struct mlx4_ib_dev *dev, u8 port_num, struct ib_mad *mad)
  176. {
  177. int qpn = mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_SUBN_LID_ROUTED;
  178. struct ib_mad_send_buf *send_buf;
  179. struct ib_mad_agent *agent = dev->send_agent[port_num - 1][qpn];
  180. int ret;
  181. if (agent) {
  182. send_buf = ib_create_send_mad(agent, qpn, 0, 0, IB_MGMT_MAD_HDR,
  183. IB_MGMT_MAD_DATA, GFP_ATOMIC);
  184. if (IS_ERR(send_buf))
  185. return;
  186. /*
  187. * We rely here on the fact that MLX QPs don't use the
  188. * address handle after the send is posted (this is
  189. * wrong following the IB spec strictly, but we know
  190. * it's OK for our devices).
  191. */
  192. spin_lock(&dev->sm_lock);
  193. memcpy(send_buf->mad, mad, sizeof *mad);
  194. if ((send_buf->ah = dev->sm_ah[port_num - 1]))
  195. ret = ib_post_send_mad(send_buf, NULL);
  196. else
  197. ret = -EINVAL;
  198. spin_unlock(&dev->sm_lock);
  199. if (ret)
  200. ib_free_send_mad(send_buf);
  201. }
  202. }
  203. static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
  204. struct ib_wc *in_wc, struct ib_grh *in_grh,
  205. struct ib_mad *in_mad, struct ib_mad *out_mad)
  206. {
  207. u16 slid, prev_lid = 0;
  208. int err;
  209. struct ib_port_attr pattr;
  210. if (in_wc && in_wc->qp->qp_num) {
  211. pr_debug("received MAD: slid:%d sqpn:%d "
  212. "dlid_bits:%d dqpn:%d wc_flags:0x%x, cls %x, mtd %x, atr %x\n",
  213. in_wc->slid, in_wc->src_qp,
  214. in_wc->dlid_path_bits,
  215. in_wc->qp->qp_num,
  216. in_wc->wc_flags,
  217. in_mad->mad_hdr.mgmt_class, in_mad->mad_hdr.method,
  218. be16_to_cpu(in_mad->mad_hdr.attr_id));
  219. if (in_wc->wc_flags & IB_WC_GRH) {
  220. pr_debug("sgid_hi:0x%016llx sgid_lo:0x%016llx\n",
  221. be64_to_cpu(in_grh->sgid.global.subnet_prefix),
  222. be64_to_cpu(in_grh->sgid.global.interface_id));
  223. pr_debug("dgid_hi:0x%016llx dgid_lo:0x%016llx\n",
  224. be64_to_cpu(in_grh->dgid.global.subnet_prefix),
  225. be64_to_cpu(in_grh->dgid.global.interface_id));
  226. }
  227. }
  228. slid = in_wc ? in_wc->slid : be16_to_cpu(IB_LID_PERMISSIVE);
  229. if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP && slid == 0) {
  230. forward_trap(to_mdev(ibdev), port_num, in_mad);
  231. return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
  232. }
  233. if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
  234. in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
  235. if (in_mad->mad_hdr.method != IB_MGMT_METHOD_GET &&
  236. in_mad->mad_hdr.method != IB_MGMT_METHOD_SET &&
  237. in_mad->mad_hdr.method != IB_MGMT_METHOD_TRAP_REPRESS)
  238. return IB_MAD_RESULT_SUCCESS;
  239. /*
  240. * Don't process SMInfo queries -- the SMA can't handle them.
  241. */
  242. if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO)
  243. return IB_MAD_RESULT_SUCCESS;
  244. } else if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_PERF_MGMT ||
  245. in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS1 ||
  246. in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS2 ||
  247. in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_CONG_MGMT) {
  248. if (in_mad->mad_hdr.method != IB_MGMT_METHOD_GET &&
  249. in_mad->mad_hdr.method != IB_MGMT_METHOD_SET)
  250. return IB_MAD_RESULT_SUCCESS;
  251. } else
  252. return IB_MAD_RESULT_SUCCESS;
  253. if ((in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
  254. in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
  255. in_mad->mad_hdr.method == IB_MGMT_METHOD_SET &&
  256. in_mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO &&
  257. !ib_query_port(ibdev, port_num, &pattr))
  258. prev_lid = pattr.lid;
  259. err = mlx4_MAD_IFC(to_mdev(ibdev),
  260. mad_flags & IB_MAD_IGNORE_MKEY,
  261. mad_flags & IB_MAD_IGNORE_BKEY,
  262. port_num, in_wc, in_grh, in_mad, out_mad);
  263. if (err)
  264. return IB_MAD_RESULT_FAILURE;
  265. if (!out_mad->mad_hdr.status) {
  266. if (!(to_mdev(ibdev)->dev->caps.flags & MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV))
  267. smp_snoop(ibdev, port_num, in_mad, prev_lid);
  268. node_desc_override(ibdev, out_mad);
  269. }
  270. /* set return bit in status of directed route responses */
  271. if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE)
  272. out_mad->mad_hdr.status |= cpu_to_be16(1 << 15);
  273. if (in_mad->mad_hdr.method == IB_MGMT_METHOD_TRAP_REPRESS)
  274. /* no response for trap repress */
  275. return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
  276. return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
  277. }
  278. static void edit_counter(struct mlx4_counter *cnt,
  279. struct ib_pma_portcounters *pma_cnt)
  280. {
  281. pma_cnt->port_xmit_data = cpu_to_be32((be64_to_cpu(cnt->tx_bytes)>>2));
  282. pma_cnt->port_rcv_data = cpu_to_be32((be64_to_cpu(cnt->rx_bytes)>>2));
  283. pma_cnt->port_xmit_packets = cpu_to_be32(be64_to_cpu(cnt->tx_frames));
  284. pma_cnt->port_rcv_packets = cpu_to_be32(be64_to_cpu(cnt->rx_frames));
  285. }
  286. static int iboe_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
  287. struct ib_wc *in_wc, struct ib_grh *in_grh,
  288. struct ib_mad *in_mad, struct ib_mad *out_mad)
  289. {
  290. struct mlx4_cmd_mailbox *mailbox;
  291. struct mlx4_ib_dev *dev = to_mdev(ibdev);
  292. int err;
  293. u32 inmod = dev->counters[port_num - 1] & 0xffff;
  294. u8 mode;
  295. if (in_mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_PERF_MGMT)
  296. return -EINVAL;
  297. mailbox = mlx4_alloc_cmd_mailbox(dev->dev);
  298. if (IS_ERR(mailbox))
  299. return IB_MAD_RESULT_FAILURE;
  300. err = mlx4_cmd_box(dev->dev, 0, mailbox->dma, inmod, 0,
  301. MLX4_CMD_QUERY_IF_STAT, MLX4_CMD_TIME_CLASS_C,
  302. MLX4_CMD_WRAPPED);
  303. if (err)
  304. err = IB_MAD_RESULT_FAILURE;
  305. else {
  306. memset(out_mad->data, 0, sizeof out_mad->data);
  307. mode = ((struct mlx4_counter *)mailbox->buf)->counter_mode;
  308. switch (mode & 0xf) {
  309. case 0:
  310. edit_counter(mailbox->buf,
  311. (void *)(out_mad->data + 40));
  312. err = IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
  313. break;
  314. default:
  315. err = IB_MAD_RESULT_FAILURE;
  316. }
  317. }
  318. mlx4_free_cmd_mailbox(dev->dev, mailbox);
  319. return err;
  320. }
  321. int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
  322. struct ib_wc *in_wc, struct ib_grh *in_grh,
  323. struct ib_mad *in_mad, struct ib_mad *out_mad)
  324. {
  325. switch (rdma_port_get_link_layer(ibdev, port_num)) {
  326. case IB_LINK_LAYER_INFINIBAND:
  327. return ib_process_mad(ibdev, mad_flags, port_num, in_wc,
  328. in_grh, in_mad, out_mad);
  329. case IB_LINK_LAYER_ETHERNET:
  330. return iboe_process_mad(ibdev, mad_flags, port_num, in_wc,
  331. in_grh, in_mad, out_mad);
  332. default:
  333. return -EINVAL;
  334. }
  335. }
  336. static void send_handler(struct ib_mad_agent *agent,
  337. struct ib_mad_send_wc *mad_send_wc)
  338. {
  339. ib_free_send_mad(mad_send_wc->send_buf);
  340. }
  341. int mlx4_ib_mad_init(struct mlx4_ib_dev *dev)
  342. {
  343. struct ib_mad_agent *agent;
  344. int p, q;
  345. int ret;
  346. enum rdma_link_layer ll;
  347. for (p = 0; p < dev->num_ports; ++p) {
  348. ll = rdma_port_get_link_layer(&dev->ib_dev, p + 1);
  349. for (q = 0; q <= 1; ++q) {
  350. if (ll == IB_LINK_LAYER_INFINIBAND) {
  351. agent = ib_register_mad_agent(&dev->ib_dev, p + 1,
  352. q ? IB_QPT_GSI : IB_QPT_SMI,
  353. NULL, 0, send_handler,
  354. NULL, NULL);
  355. if (IS_ERR(agent)) {
  356. ret = PTR_ERR(agent);
  357. goto err;
  358. }
  359. dev->send_agent[p][q] = agent;
  360. } else
  361. dev->send_agent[p][q] = NULL;
  362. }
  363. }
  364. return 0;
  365. err:
  366. for (p = 0; p < dev->num_ports; ++p)
  367. for (q = 0; q <= 1; ++q)
  368. if (dev->send_agent[p][q])
  369. ib_unregister_mad_agent(dev->send_agent[p][q]);
  370. return ret;
  371. }
  372. void mlx4_ib_mad_cleanup(struct mlx4_ib_dev *dev)
  373. {
  374. struct ib_mad_agent *agent;
  375. int p, q;
  376. for (p = 0; p < dev->num_ports; ++p) {
  377. for (q = 0; q <= 1; ++q) {
  378. agent = dev->send_agent[p][q];
  379. if (agent) {
  380. dev->send_agent[p][q] = NULL;
  381. ib_unregister_mad_agent(agent);
  382. }
  383. }
  384. if (dev->sm_ah[p])
  385. ib_destroy_ah(dev->sm_ah[p]);
  386. }
  387. }
  388. void handle_port_mgmt_change_event(struct work_struct *work)
  389. {
  390. struct ib_event_work *ew = container_of(work, struct ib_event_work, work);
  391. struct mlx4_ib_dev *dev = ew->ib_dev;
  392. struct mlx4_eqe *eqe = &(ew->ib_eqe);
  393. u8 port = eqe->event.port_mgmt_change.port;
  394. u32 changed_attr;
  395. switch (eqe->subtype) {
  396. case MLX4_DEV_PMC_SUBTYPE_PORT_INFO:
  397. changed_attr = be32_to_cpu(eqe->event.port_mgmt_change.params.port_info.changed_attr);
  398. /* Update the SM ah - This should be done before handling
  399. the other changed attributes so that MADs can be sent to the SM */
  400. if (changed_attr & MSTR_SM_CHANGE_MASK) {
  401. u16 lid = be16_to_cpu(eqe->event.port_mgmt_change.params.port_info.mstr_sm_lid);
  402. u8 sl = eqe->event.port_mgmt_change.params.port_info.mstr_sm_sl & 0xf;
  403. update_sm_ah(dev, port, lid, sl);
  404. }
  405. /* Check if it is a lid change event */
  406. if (changed_attr & MLX4_EQ_PORT_INFO_LID_CHANGE_MASK)
  407. mlx4_ib_dispatch_event(dev, port, IB_EVENT_LID_CHANGE);
  408. /* Generate GUID changed event */
  409. if (changed_attr & MLX4_EQ_PORT_INFO_GID_PFX_CHANGE_MASK)
  410. mlx4_ib_dispatch_event(dev, port, IB_EVENT_GID_CHANGE);
  411. if (changed_attr & MLX4_EQ_PORT_INFO_CLIENT_REREG_MASK)
  412. mlx4_ib_dispatch_event(dev, port,
  413. IB_EVENT_CLIENT_REREGISTER);
  414. break;
  415. case MLX4_DEV_PMC_SUBTYPE_PKEY_TABLE:
  416. mlx4_ib_dispatch_event(dev, port, IB_EVENT_PKEY_CHANGE);
  417. break;
  418. case MLX4_DEV_PMC_SUBTYPE_GUID_INFO:
  419. mlx4_ib_dispatch_event(dev, port, IB_EVENT_GID_CHANGE);
  420. break;
  421. default:
  422. pr_warn("Unsupported subtype 0x%x for "
  423. "Port Management Change event\n", eqe->subtype);
  424. }
  425. kfree(ew);
  426. }
  427. void mlx4_ib_dispatch_event(struct mlx4_ib_dev *dev, u8 port_num,
  428. enum ib_event_type type)
  429. {
  430. struct ib_event event;
  431. event.device = &dev->ib_dev;
  432. event.element.port_num = port_num;
  433. event.event = type;
  434. ib_dispatch_event(&event);
  435. }