Lines Matching full:hdr
61 nmreq_register_from_legacy(struct nmreq *nmr, struct nmreq_header *hdr, in nmreq_register_from_legacy() argument
97 if (strlen(hdr->nr_name) + strlen(suffix) in nmreq_register_from_legacy()
98 >= sizeof(hdr->nr_name)) { in nmreq_register_from_legacy()
102 strlcat(hdr->nr_name, suffix, sizeof(hdr->nr_name)); in nmreq_register_from_legacy()
124 struct nmreq_header *hdr = nm_os_malloc(sizeof(*hdr)); in nmreq_from_legacy() local
126 if (hdr == NULL) { in nmreq_from_legacy()
136 hdr->nr_version = NETMAP_API; /* new API */ in nmreq_from_legacy()
137 strlcpy(hdr->nr_name, nmr->nr_name, sizeof(nmr->nr_name)); in nmreq_from_legacy()
138 hdr->nr_options = (uintptr_t)NULL; in nmreq_from_legacy()
139 hdr->nr_body = (uintptr_t)NULL; in nmreq_from_legacy()
148 hdr->nr_body = (uintptr_t)req; in nmreq_from_legacy()
149 hdr->nr_reqtype = NETMAP_REQ_REGISTER; in nmreq_from_legacy()
150 if (nmreq_register_from_legacy(nmr, hdr, req)) { in nmreq_from_legacy()
158 hdr->nr_body = (uintptr_t)req; in nmreq_from_legacy()
159 hdr->nr_reqtype = NETMAP_REQ_VALE_ATTACH; in nmreq_from_legacy()
160 if (nmreq_register_from_legacy(nmr, hdr, &req->reg)) { in nmreq_from_legacy()
172 hdr->nr_reqtype = NETMAP_REQ_VALE_DETACH; in nmreq_from_legacy()
173 hdr->nr_body = (uintptr_t)nm_os_malloc(sizeof(struct nmreq_vale_detach)); in nmreq_from_legacy()
180 hdr->nr_body = (uintptr_t)req; in nmreq_from_legacy()
181 hdr->nr_reqtype = (nmr->nr_cmd == NETMAP_BDG_VNET_HDR) ? in nmreq_from_legacy()
189 hdr->nr_body = (uintptr_t)req; in nmreq_from_legacy()
190 hdr->nr_reqtype = NETMAP_REQ_VALE_NEWIF; in nmreq_from_legacy()
199 hdr->nr_reqtype = NETMAP_REQ_VALE_DELIF; in nmreq_from_legacy()
206 hdr->nr_body = (uintptr_t)req; in nmreq_from_legacy()
207 hdr->nr_reqtype = (nmr->nr_cmd == NETMAP_BDG_POLLING_ON) ? in nmreq_from_legacy()
238 hdr->nr_body = (uintptr_t)req; in nmreq_from_legacy()
239 hdr->nr_reqtype = NETMAP_REQ_VALE_LIST; in nmreq_from_legacy()
246 hdr->nr_body = (uintptr_t)req; in nmreq_from_legacy()
247 hdr->nr_reqtype = NETMAP_REQ_PORT_INFO_GET; in nmreq_from_legacy()
261 return hdr; in nmreq_from_legacy()
263 if (hdr) { in nmreq_from_legacy()
264 if (hdr->nr_body) { in nmreq_from_legacy()
265 nm_os_free((void *)(uintptr_t)hdr->nr_body); in nmreq_from_legacy()
267 nm_os_free(hdr); in nmreq_from_legacy()
291 nmreq_to_legacy(struct nmreq_header *hdr, struct nmreq *nmr) in nmreq_to_legacy() argument
297 switch (hdr->nr_reqtype) { in nmreq_to_legacy()
300 (struct nmreq_register *)(uintptr_t)hdr->nr_body; in nmreq_to_legacy()
306 (struct nmreq_port_info_get *)(uintptr_t)hdr->nr_body; in nmreq_to_legacy()
317 (struct nmreq_vale_attach *)(uintptr_t)hdr->nr_body; in nmreq_to_legacy()
326 (struct nmreq_vale_list *)(uintptr_t)hdr->nr_body; in nmreq_to_legacy()
327 strlcpy(nmr->nr_name, hdr->nr_name, sizeof(nmr->nr_name)); in nmreq_to_legacy()
335 (struct nmreq_port_hdr *)(uintptr_t)hdr->nr_body; in nmreq_to_legacy()
341 (struct nmreq_vale_newif *)(uintptr_t)hdr->nr_body; in nmreq_to_legacy()
371 struct nmreq_header *hdr; in netmap_ioctl_legacy() local
378 hdr = nmreq_from_legacy(nmr, cmd); in netmap_ioctl_legacy()
379 if (hdr == NULL) { /* out of memory */ in netmap_ioctl_legacy()
382 error = netmap_ioctl(priv, NIOCCTRL, (caddr_t)hdr, td, in netmap_ioctl_legacy()
385 nmreq_to_legacy(hdr, nmr); in netmap_ioctl_legacy()
387 if (hdr->nr_body) { in netmap_ioctl_legacy()
388 nm_os_free((void *)(uintptr_t)hdr->nr_body); in netmap_ioctl_legacy()
390 nm_os_free(hdr); in netmap_ioctl_legacy()