Lines Matching +full:data +full:- +full:path
2 * Copyright (c) 2004-2009 Voltaire Inc. All rights reserved.
14 * - Redistributions of source code must retain the above
18 * - Redistributions in binary form must reproduce the above
57 char path[64]; member
77 uint8_t data[64]; member
82 void drsmp_get_init(void *umad, DRPath * path, int attr, int mod) in drsmp_get_init() argument
88 smp->base_version = 1; in drsmp_get_init()
89 smp->mgmt_class = IB_SMI_DIRECT_CLASS; in drsmp_get_init()
90 smp->class_version = 1; in drsmp_get_init()
92 smp->method = 1; in drsmp_get_init()
93 smp->attr_id = (uint16_t) htons((uint16_t) attr); in drsmp_get_init()
94 smp->attr_mod = htonl(mod); in drsmp_get_init()
95 smp->tid = htonll(drmad_tid++); in drsmp_get_init()
96 smp->dr_slid = 0xffff; in drsmp_get_init()
97 smp->dr_dlid = 0xffff; in drsmp_get_init()
101 if (path) in drsmp_get_init()
102 memcpy(smp->initial_path, path->path, path->hop_cnt + 1); in drsmp_get_init()
104 smp->hop_cnt = (uint8_t) path->hop_cnt; in drsmp_get_init()
113 smp->base_version = 1; in smp_get_init()
114 smp->mgmt_class = IB_SMI_CLASS; in smp_get_init()
115 smp->class_version = 1; in smp_get_init()
117 smp->method = 1; in smp_get_init()
118 smp->attr_id = (uint16_t) htons((uint16_t) attr); in smp_get_init()
119 smp->attr_mod = htonl(mod); in smp_get_init()
120 smp->tid = htonll(drmad_tid++); in smp_get_init()
125 void drsmp_set_init(void *umad, DRPath * path, int attr, int mod, void *data) in drsmp_set_init() argument
131 smp->method = 2; /* SET */ in drsmp_set_init()
132 smp->attr_id = (uint16_t) htons((uint16_t) attr); in drsmp_set_init()
133 smp->attr_mod = htonl(mod); in drsmp_set_init()
134 smp->tid = htonll(drmad_tid++); in drsmp_set_init()
135 smp->dr_slid = 0xffff; in drsmp_set_init()
136 smp->dr_dlid = 0xffff; in drsmp_set_init()
140 if (path) in drsmp_set_init()
141 memcpy(smp->initial_path, path->path, path->hop_cnt + 1); in drsmp_set_init()
143 if (data) in drsmp_set_init()
144 memcpy(smp->data, data, sizeof smp->data); in drsmp_set_init()
146 smp->hop_cnt = (uint8_t) path->hop_cnt; in drsmp_set_init()
151 switch (drsmp->status) { in drmad_status_str()
160 int str2DRPath(char *str, DRPath * path) in str2DRPath() argument
164 path->hop_cnt = -1; in str2DRPath()
170 path->path[++path->hop_cnt] = (char)atoi(str); in str2DRPath()
177 if (path->path[0] != 0 || in str2DRPath()
178 (path->hop_cnt > 0 && dev_port && path->path[1] != dev_port)) { in str2DRPath()
180 return -1; in str2DRPath()
184 return path->hop_cnt; in str2DRPath()
202 return -1; in process_opt()
227 DRPath path; in main() local
237 " -- DR routed examples:", in main()
238 "-D 0,1,2,3,5 16 # NODE DESC", in main()
239 "-D 0,1,2 0x15 2 # PORT INFO, port 2", in main()
240 " -- LID routed examples:", in main()
251 argc -= optind; in main()
258 str2DRPath(strdupa(argv[0]), &path) < 0) in main()
259 IBPANIC("bad path str '%s'", argv[0]); in main()
283 drsmp_get_init(umad, &path, attr, mod); in main()
294 if (umad_recv(portid, umad, &length, -1) != mad_agent) in main()
298 xdump(stdout, 0, smp->data, 64); in main()
299 if (smp->status) in main()
301 ntohs(smp->status)); in main()
305 desc = smp->data; in main()
312 if (smp->status) in main()
313 fprintf(stdout, "SMP status: 0x%x\n", ntohs(smp->status)); in main()